ethan22
Industrial
- May 24, 2012
- 3
Hello Everyone,
Ok so im trying to wright a Macro for Catia that reads in user in put from a multi-selection, the problem is how do you wright a comand prompt for multi selection for vba code in catia.
This is what i have so far.
Private Sub Black_Click()
Dim productDocument1 As Document
Set productDocument1 = CATIA.ActiveDocument
Dim selection1 As Selection
Set selection1 = productDocument1.Selection
selection1.Search "CATPrtSearch.MechanicalFeature,all"
Set visPropertySet1 = selection1.VisProperties
visPropertySet1.SetRealColor 51, 51, 51, 1
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
visProperties1.SetRealOpacity 255, 1
selection1.Clear
selection1.Search "CATAsmSearch.Part,all"
Set visPropertySet1 = selection1.VisProperties
visPropertySet1.SetRealColor 51, 51, 51, 1
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
visProperties1.SetRealOpacity 255, 1
selection1.Clear
Dim specsAndGeomWindow1 As Window
Set specsAndGeomWindow1 = CATIA.ActiveWindow
Dim viewer3D1 As Viewer
Set viewer3D1 = specsAndGeomWindow1.ActiveViewer
viewer3D1.Reframe
Dim viewpoint3D1 As Viewpoint3D
Set viewpoint3D1 = viewer3D1.Viewpoint3D
End Sub
This coad is linked to GUI interface for each color there is a buton this one happens to be black.
What i want to do, is before the program runs have the user select the part bodie's that they want the color to be changed and then for the program to read that input and only change thoes bodies, right now this program changes every body in the part. I also want the user to beable to slect more than just one body hence Multi-Select.
Thanks
Ethan
Ok so im trying to wright a Macro for Catia that reads in user in put from a multi-selection, the problem is how do you wright a comand prompt for multi selection for vba code in catia.
This is what i have so far.
Private Sub Black_Click()
Dim productDocument1 As Document
Set productDocument1 = CATIA.ActiveDocument
Dim selection1 As Selection
Set selection1 = productDocument1.Selection
selection1.Search "CATPrtSearch.MechanicalFeature,all"
Set visPropertySet1 = selection1.VisProperties
visPropertySet1.SetRealColor 51, 51, 51, 1
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
visProperties1.SetRealOpacity 255, 1
selection1.Clear
selection1.Search "CATAsmSearch.Part,all"
Set visPropertySet1 = selection1.VisProperties
visPropertySet1.SetRealColor 51, 51, 51, 1
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
visProperties1.SetRealOpacity 255, 1
selection1.Clear
Dim specsAndGeomWindow1 As Window
Set specsAndGeomWindow1 = CATIA.ActiveWindow
Dim viewer3D1 As Viewer
Set viewer3D1 = specsAndGeomWindow1.ActiveViewer
viewer3D1.Reframe
Dim viewpoint3D1 As Viewpoint3D
Set viewpoint3D1 = viewer3D1.Viewpoint3D
End Sub
This coad is linked to GUI interface for each color there is a buton this one happens to be black.
What i want to do, is before the program runs have the user select the part bodie's that they want the color to be changed and then for the program to read that input and only change thoes bodies, right now this program changes every body in the part. I also want the user to beable to slect more than just one body hence Multi-Select.
Thanks
Ethan