HyperView Python 二次开发之突显某零件在模型全局位置(附完整源码)
·

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仿真记
更多推荐


所有评论(0)