Jeoy
Automotive
- Jan 3, 2019
- 3
Hi Guys,
Is someone know how to searching the color of the selected face?
I write one as below, but it always shows mistake at last two line. Could someone please help? Many thanks.
Sub CATmain ()
Dim objSel As Object
Dim varFilter(0) As Variant
Dim strReturn As String
Dim strMsg As String
strMsg = "After clicking OK, select what color you want to changing"
MsgBox strMsg, 64, "Instructions"
Set objSel = CATIA.ActiveDocument.Selection
objSel.Clear
varFilter(0) = "AnyObject"
strReturn = objSel.SelectElement2(varFilter, "Select any object in the active document…", False)
CATIA.DisplayFileAlerts = False
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
Dim r, g, b
r = CLng(0)
g = CLng(0)
b = CLng(0)
visProperties1.GetRealColor r, g, b
Set productDocument1 = CATIA.ActiveDocument
Set selection1 = productDocument1.Selection
selection1.Search "(Topology.CGMFace & Color=visProperties1.GetRealColor r, g, b),all"
End Sub
Is someone know how to searching the color of the selected face?
I write one as below, but it always shows mistake at last two line. Could someone please help? Many thanks.
Sub CATmain ()
Dim objSel As Object
Dim varFilter(0) As Variant
Dim strReturn As String
Dim strMsg As String
strMsg = "After clicking OK, select what color you want to changing"
MsgBox strMsg, 64, "Instructions"
Set objSel = CATIA.ActiveDocument.Selection
objSel.Clear
varFilter(0) = "AnyObject"
strReturn = objSel.SelectElement2(varFilter, "Select any object in the active document…", False)
CATIA.DisplayFileAlerts = False
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
Dim r, g, b
r = CLng(0)
g = CLng(0)
b = CLng(0)
visProperties1.GetRealColor r, g, b
Set productDocument1 = CATIA.ActiveDocument
Set selection1 = productDocument1.Selection
selection1.Search "(Topology.CGMFace & Color=visProperties1.GetRealColor r, g, b),all"
End Sub