CATIA MACRO QUESTION-How to define partnumber
CATIA MACRO QUESTION-How to define partnumber
(OP)
hello guys
I have a question about catia macro code.
How to define partnumber partly?
For example, My partnumber is "engine"
then I define partnumber begine with "en"
So, "eng","end"..etc.. also included
I don't know this macro code.
Thank you.
p.s - I can't english well.
I have a question about catia macro code.
How to define partnumber partly?
For example, My partnumber is "engine"
then I define partnumber begine with "en"
So, "eng","end"..etc.. also included
I don't know this macro code.
Thank you.
p.s - I can't english well.





RE: CATIA MACRO QUESTION-How to define partnumber
RE: CATIA MACRO QUESTION-How to define partnumber
indocti discant et ament meminisse periti
RE: CATIA MACRO QUESTION-How to define partnumber
For example, I have 'Product1'
'Product1' is configuration many part.
That partnumber is "eng" , "end", "sus"
If Partnumber start "en", color is red
If Partnumber start "su", color is blue
As a result "eng" and "end" color is red, "sus" color is blue
Thanks
RE: CATIA MACRO QUESTION-How to define partnumber
indocti discant et ament meminisse periti
RE: CATIA MACRO QUESTION-How to define partnumber
So, I try to test.
This code is activated only "En".
also, This code is wrong.
I want to know method and correct code.
Sub CATMain()
Dim i as Integer
Dim partDocument1 As PartDocument
Set partDocument1 = CATIA.ActiveDocument
Dim part1 As Part
Set part1 = partDocument1.Part
Set Bodies1 = Part1.Bodies
Set body1 = Bodies1.Item("PartBody")
Part1.InWorkObject = Body1
Dim visProperties1 As VisProperty
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
Dim r, g, b
r= CLng(0)
g= CLng(0)
b= CLng(0)
For i = 1 To part1.Count
If part1.Item(i).PartNumber = "En" then
part1.PartBodyVisProperty.SetRealColor 255,0,255
End If
End Sub
RE: CATIA MACRO QUESTION-How to define partnumber
regards,
LWolf
RE: CATIA MACRO QUESTION-How to define partnumber
I want to Know that code.
Product1
-part1
-PartBody <- I want to change this color.
help me please
Thanks
RE: CATIA MACRO QUESTION-How to define partnumber
indocti discant et ament meminisse periti