jzecha
Aerospace
- Jan 20, 2016
- 236
Ok so a little background on the need for this macro.
My company uses Catia on the shop floor to build tools with.
When a Customer sends us a NX model, we run it though a conversion software that creates great Catia Files.
The only issue is due to the way the layers might have been saved in NX, some of the features come in hidden.
For instance the PMI comes in a GeoSet called "PMI" in ever part/product that has PMI.
This folder is usually hidden, and sometimes contains Sub GeoSets inside it that are also hidden.
I want to find the PMI GeoSets and unhide them and all of their sub Geosets, Lines, and Points.
Can someone give me some advice how to do this on a big product?
I build this macro that unhides the "PMI" GeoSet but nothing underneath:
My company uses Catia on the shop floor to build tools with.
When a Customer sends us a NX model, we run it though a conversion software that creates great Catia Files.
The only issue is due to the way the layers might have been saved in NX, some of the features come in hidden.
For instance the PMI comes in a GeoSet called "PMI" in ever part/product that has PMI.
This folder is usually hidden, and sometimes contains Sub GeoSets inside it that are also hidden.
I want to find the PMI GeoSets and unhide them and all of their sub Geosets, Lines, and Points.
Can someone give me some advice how to do this on a big product?
I build this macro that unhides the "PMI" GeoSet but nothing underneath:
Code:
Language="CATSCRIPT"
Sub CATMain()
CATIA.RefreshDisplay = False
Set ProductDocument1 = CATIA.ActiveDocument
Set Product1 = ProductDocument1. Product
Dim ProductDoc1_As_Document
Set ProductDoc1 = Catia.ActiveDocument
Dim Selection1_As_Selection
Set Selection1 = ProductDoc1.Selection
selection1.Search "Name=*PMI*,All"
'selection1.Search "(Name=*PMI* & CATPrtSearch.OpenBodyFeature),all"
Set visPropertySet1 = Selection1.visProperties
VisPropertySet1.SetShow 0
Selection1.Clear
Dim specsAndGeomWindow1 As Window
Set specsAndGeomWindow1 = CATIA.ActiveWindow
Dim viewer3D1 As Viewer
Set viewer3D1 = specsAndGeomWindow1.ActiveViewer
Dim viewpoint3D1 As Viewpoint3D
Set viewpoint3D1 = viewer3D1.Viewpoint3D
viewer3D1.Reframe
Set viewpoint3D1 = viewer3D1.Viewpoint3D
CATIA.RefreshDisplay = True
End Sub