Catia MACRO: Show/Hide Mechanical Features in Body
Catia MACRO: Show/Hide Mechanical Features in Body
(OP)
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 --> VBSCRIPT
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





RE: Catia MACRO: Show/Hide Mechanical Features in Body
Daniel, your code is working fine, no matter the name of the body but you can clean it a little bit.
CODE --> CATScript
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Catia MACRO: Show/Hide Mechanical Features in Body
Thank you. It was not working on some of the projects and i have found the problem. It was just the way the parts were hidden.