×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

CATIA MACRO QUESTION-How to define partnumber

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.


RE: CATIA MACRO QUESTION-How to define partnumber

(OP)


RE: CATIA MACRO QUESTION-How to define partnumber

i have some problem to understand your question/problem

Eric N.
indocti discant et ament meminisse periti

RE: CATIA MACRO QUESTION-How to define partnumber

(OP)
So,

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

ok so what is your code so far and what is the problems?

Eric N.
indocti discant et ament meminisse periti

RE: CATIA MACRO QUESTION-How to define partnumber

(OP)
I dont know method all of "En-xxx".

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

I guess you want to look into the functions INSTR, LEFT... to process your string names.

regards,
LWolf

RE: CATIA MACRO QUESTION-How to define partnumber

(OP)
Okay, Guys

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

check visporprties in the chm file...

Eric N.
indocti discant et ament meminisse periti

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close