Daniel Popa
Automotive
- Sep 23, 2016
- 19
Hello everyone
I am trying to create a macro that would show/hide all the features inside a Body. I have managed to get to a point where it is working nicely but I can not figure out how to make it check all the bodies and not just the ones with the name "Part Body".
Does anyone have any suggestions?
Thank you.
I am trying to create a macro that would show/hide all the features inside a Body. I have managed to get to a point where it is working nicely but I can not figure out how to make it check all the bodies and not just the ones with the name "Part Body".
Does anyone have any suggestions?
Thank you.
Code:
Language="VBSCRIPT"
Sub CATMain()
Set productDocument1 = CATIA.ActiveDocument
Set productDocument1 = CATIA.ActiveDocument
Set productDocument1 = CATIA.ActiveDocument
Set selection1 = productDocument1.Selection
selection1.Search "(CATPrtSearch.BodyFeature.Visibility=Visible),all"
Set selection1 = productDocument1.Selection
selection1.Search "CATPrtSearch.MechanicalFeature,sel"
Set selection1 = productDocument1.Selection
Set visPropertySet1 = selection1.VisProperties
Set visPropertySet1 = visPropertySet1.Parent
visPropertySet1.SetShow catVisPropertyShowAttr
selection1.Clear
selection1.Search "((((CATStFreeStyleSearch.BodyFeature + CATPrtSearch.BodyFeature) + CATGmoSearch.BodyFeature) + CATSpdSearch.SpdBodyRef) + CATSpdSearch.BodyFeature),all"
Set selection1 = productDocument1.Selection
Set visPropertySet1 = selection1.VisProperties
Set visPropertySet1 = visPropertySet1.Parent
visPropertySet1.SetShow catVisPropertyShowAttr
selection1.Clear
End Sub