qayamraza83
Aerospace
Hello
I am new in Catia macro
I am working in a Macro that an hide geometric set and set layer
I have created but it is only working to set Layer
Sub CATMain()
Dim objSelection1 As Selection
Set objSelection1 = CATIA.ActiveDocument.Selection
Dim objSelection2 As Selection
Set objSelection2 = CATIA.ActiveDocument.Selection
'---------------------Inform the User when nothing is selected ---------------------'
If objSelection1.Count = 0 Then
MsgBox " Nothing is selected. Please select Multibranchable and Run Macro Again"
Exit Sub
End If
'------------------------------------------------------------------------------------'
'---------------For Changing The Layer---------------'
objSelection1.Search "CATPrtSearch.Rib,sel"
Dim VisProperty1 As VisPropertySet
Set VisProperty1 = objSelection1.VisProperties
Dim LayValue As Long
LayValue = InputBox("Please Enter the Layer Value", "Change of Layer", 180)
VisProperty1.SetLayer catVisLayerBasic, LayValue
'----------------------------------------------------'
objSelection1.Clear
'--------------For Hidding GeometriSet-------------------'
objSelection2.Search "CATPrtSearch.OpenBodyFeature,sel"
Dim Property2 As VisPropertySet
Set Property2 = objSelection2.VisProperties
Property2.SetShow catVisPropertyNoShowAttr
'----------------------------------------------------'
objSelection2.Clear
End Sub
I am new in Catia macro
I am working in a Macro that an hide geometric set and set layer
I have created but it is only working to set Layer
Sub CATMain()
Dim objSelection1 As Selection
Set objSelection1 = CATIA.ActiveDocument.Selection
Dim objSelection2 As Selection
Set objSelection2 = CATIA.ActiveDocument.Selection
'---------------------Inform the User when nothing is selected ---------------------'
If objSelection1.Count = 0 Then
MsgBox " Nothing is selected. Please select Multibranchable and Run Macro Again"
Exit Sub
End If
'------------------------------------------------------------------------------------'
'---------------For Changing The Layer---------------'
objSelection1.Search "CATPrtSearch.Rib,sel"
Dim VisProperty1 As VisPropertySet
Set VisProperty1 = objSelection1.VisProperties
Dim LayValue As Long
LayValue = InputBox("Please Enter the Layer Value", "Change of Layer", 180)
VisProperty1.SetLayer catVisLayerBasic, LayValue
'----------------------------------------------------'
objSelection1.Clear
'--------------For Hidding GeometriSet-------------------'
objSelection2.Search "CATPrtSearch.OpenBodyFeature,sel"
Dim Property2 As VisPropertySet
Set Property2 = objSelection2.VisProperties
Property2.SetShow catVisPropertyNoShowAttr
'----------------------------------------------------'
objSelection2.Clear
End Sub