import hw
import hw.hv as hv
ses = hw.Session()
win=ses.get(hw.Window)
##新建collection 包含所有pid
allpid = hv.Collection(hv.Part)
##使用列表表达式修改所有pid为透明显示
[p.setAttributes(meshMode='transparent',color(245,245,245)) for p in allpid.getEntities()]
#修改需要突出显示的零件为红色
model = ses.get(hv.Model)
singlepart = model.get(hv.Part,2)
singlepart.meshMode="shaded"
singlepart.color="red"
win.draw()

更多笔记 欢迎关注 公众号 CAE仿真记

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐