Hello Ferdo and Others
I have tried so hard to write a VBA macro to get Catia Part Body's color from a part document, change part color to white color and change it back to previous color. I have got to a point below and the error "type mis-match" appeared and I do not know how to fix it since I am novice to Catia macro programming, even I have read lots of online forums and tips.
--------------------------------------
Option Explicit
Sub CATMain()
Dim oDoc As PartDocument
Set oDoc = CATIA.ActiveDocument.Selection
Dim visProperties1 As VisPropertySet
Dim r, g, b
r = CLng(0)
g = CLng(0)
b = CLng(0)
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
visProperties1.GetRealColor r, g, b 'Type mismatch error
MsgBox "r = " & r & " g = " & g & " b = " & b
End Sub
I would really love Ferdo and others to help me out to achieve my objectives above. As well, if you are able to show me how to print out the image of the part in white color and other 3D annotation captures in a Catia part document, then I am so grateful for your help. Please correct the above program in VBA, not CATScript or VB Script.
Thank you All and have a nice weekend.
Quin
I have tried so hard to write a VBA macro to get Catia Part Body's color from a part document, change part color to white color and change it back to previous color. I have got to a point below and the error "type mis-match" appeared and I do not know how to fix it since I am novice to Catia macro programming, even I have read lots of online forums and tips.
--------------------------------------
Option Explicit
Sub CATMain()
Dim oDoc As PartDocument
Set oDoc = CATIA.ActiveDocument.Selection
Dim visProperties1 As VisPropertySet
Dim r, g, b
r = CLng(0)
g = CLng(0)
b = CLng(0)
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
visProperties1.GetRealColor r, g, b 'Type mismatch error
MsgBox "r = " & r & " g = " & g & " b = " & b
End Sub
I would really love Ferdo and others to help me out to achieve my objectives above. As well, if you are able to show me how to print out the image of the part in white color and other 3D annotation captures in a Catia part document, then I am so grateful for your help. Please correct the above program in VBA, not CATScript or VB Script.
Thank you All and have a nice weekend.
Quin