hello
I need to change the tangent surfaces only selecting only one surface, I wrote this macro but doesn't work fine, it shows me all surfaces selected but doesen't change the color on the screen!!
someone can help me?
Thanks
Sub CATMain()
Dim InputObjectType(0)
Set Document = CATIA.ActiveDocument
Set Selection = Document.Selection
Dim prtPart As Part
Set prtPart = CATIA.ActiveDocument.Part
Dim oHSF As HybridShapeFactory
Set oHSF = prtPart.HybridShapeFactory
InputObjectType(0) = "Face"
Status = Selection.SelectElement2(InputObjectType, "Select a face", True)
If (Status = "cancel") Then Exit Sub
Set FirstFace = Selection.Item(1).Value
Selection.Clear
Dim newelement1 As HybridShapeExtract
Set newelement1 = oHSF.AddNewExtract(FirstFace)
newelement1.PropagationType = 2
newelement1.ComplementaryExtract = False
newelement1.IsFederated = False
prtPart.UpdateObject newelement1
Selection.Add newelement1
Set visPropertySet1 = Selection.VisProperties
visPropertySet1.SetRealColor 255, 0, 0, 0
Selection3 = Clear
End Sub
I need to change the tangent surfaces only selecting only one surface, I wrote this macro but doesn't work fine, it shows me all surfaces selected but doesen't change the color on the screen!!
someone can help me?
Thanks
Sub CATMain()
Dim InputObjectType(0)
Set Document = CATIA.ActiveDocument
Set Selection = Document.Selection
Dim prtPart As Part
Set prtPart = CATIA.ActiveDocument.Part
Dim oHSF As HybridShapeFactory
Set oHSF = prtPart.HybridShapeFactory
InputObjectType(0) = "Face"
Status = Selection.SelectElement2(InputObjectType, "Select a face", True)
If (Status = "cancel") Then Exit Sub
Set FirstFace = Selection.Item(1).Value
Selection.Clear
Dim newelement1 As HybridShapeExtract
Set newelement1 = oHSF.AddNewExtract(FirstFace)
newelement1.PropagationType = 2
newelement1.ComplementaryExtract = False
newelement1.IsFederated = False
prtPart.UpdateObject newelement1
Selection.Add newelement1
Set visPropertySet1 = Selection.VisProperties
visPropertySet1.SetRealColor 255, 0, 0, 0
Selection3 = Clear
End Sub