尊敬的各位用户,很抱歉通知您!
蜂特网将于2024年12月31日停止运营!

服务您是我们的荣幸

   发布新贴

板块公告

1、禁止发布与板块不相关内容。
2、提交作业务必注明课程名称及第几节课程作业并且提交到课程作业区!

评论学员

暂无数据

iLogic - 一键关闭所有工作面

吴艺君 发布于 10-22 15:14
查看:5750|回复:2

Turn On/Off all Workfeatures with iLogic

Issue:
You have other members of your design team that do not remember to turn off work features at the part level or sub-assembly level when they are done working with those files. As a result file previews and view representations get messed up. You'd like to have a quick way to toggle all of the work features off. Can this be done with iLogic?

psb.png

 




Solution:
You can use this example iLogic rule to toggle all work features on or off.


'catch and skip errors

On Error Resume Next

'define the active assembly

Dim oAssyDoc As AssemblyDocument

oAssyDoc ThisApplication.ActiveDocument 

 

'get user input as True or False

wfBoolean InputRadioBox("Turn all Work Features On/Off""On""Off", False, "iLogic")

 

'Check all referenced docs

Dim oDoc As Inventor.Document

For Each oDoc In oAssyDoc.AllReferencedDocuments

    'set work plane visibility

    For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes

    oWorkPlane.Visible wfBoolean

    Next

    'set work axis visibility

    For Each oWorkAxis In oDoc.ComponentDefinition.WorkAxes

    oWorkAxis.Visible wfBoolean

    Next

    'set work point visibility

    For Each oWorkPoint In oDoc.ComponentDefinition.WorkPoints

    oWorkPoint.Visible wfBoolean

    Next

Next

'update the files

InventorVb.DocumentUpdate()



评分

评分人 积分 理由
吴艺君于 2014-10-27 19:49 重新编辑过该贴

共有2条评论

本贴暂还没有回复,赶紧来抢占沙发吧~

在线咨询 蜂特网,融汇知识之力,分享科技未来!

联系客服
加蜂特网为微信好友