JV03
Aerospace
- Feb 5, 2015
- 8
In need of some programming help.
I'm trying to create a macro to hide all hardware from an assembly. (i.e. NAS*, SL*, etc.) The problem I am having is that if a sketch within a sub-assy has the hole feature name SLXXX the macro recognizes that as an instance and hides the sketch, therefore hiding the entire sub-assy. Is there any way around this?
Below is the code I have so far.
Sub HideHardware()
'Finding and hiding all hardware
MsgBox ("This Macro will hide all common hardware: SL*, NAS*, MS*, TYE*, AN*, CCR*"), vbOKOnly
Set productDocument1 = CATIA.ActiveDocument
Set Selection1 = productDocument1.Selection
Selection1.Search "Name = NAS*+AN*+MS*+TYE*+SL*+CCR*, sel"
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
visProperties1.SetShow catVisPropertyNoShowAttr
End Sub
Any help would be much appreciated.
I'm trying to create a macro to hide all hardware from an assembly. (i.e. NAS*, SL*, etc.) The problem I am having is that if a sketch within a sub-assy has the hole feature name SLXXX the macro recognizes that as an instance and hides the sketch, therefore hiding the entire sub-assy. Is there any way around this?
Below is the code I have so far.
Sub HideHardware()
'Finding and hiding all hardware
MsgBox ("This Macro will hide all common hardware: SL*, NAS*, MS*, TYE*, AN*, CCR*"), vbOKOnly
Set productDocument1 = CATIA.ActiveDocument
Set Selection1 = productDocument1.Selection
Selection1.Search "Name = NAS*+AN*+MS*+TYE*+SL*+CCR*, sel"
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
visProperties1.SetShow catVisPropertyNoShowAttr
End Sub
Any help would be much appreciated.