Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching the color of the selected face

Status
Not open for further replies.

Jeoy

Automotive
Joined
Jan 3, 2019
Messages
3
Location
CN
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top