×
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 V5 Macro : CATPart search

CATIA V5 Macro : CATPart search

CATIA V5 Macro : CATPart search

(OP)
Hello everyone,

I am currently trying to write a macro to change the color of all the annotations in specific Products of a large assembly in order to take screens shots with a white backround. So far, I have managed to go through all the Products of the assembly and identify the lowest ones on the tree that contain only one part. I have also found out how to change the color of annotations from the Part object.

The problem I am having right now is accessing the right Part object. I can find out the part name through Product.Name but I can't seem to figure out how to search for CATParts only. So far, I've only been able to differenciate between CATProducts and CATParts, but without gaining access to the Part object, whose properties/methods I need.

I hope I was clear enough, I'm quite new to CATIA programming and have not yet wrapped my head around all the correct terms.

Thank you very much!

RE: CATIA V5 Macro : CATPart search

When you determine a 'Product' from the product structure you can think of this as accessing the instance object which points to the Reference object (the CATPart/CATproduct level which contains the design data). The Product object has a property ReferenceProduct which will access the CATDocument.Product object which is available on both CATParts and CATProducts.

Retrieving the .Parent property from the ReferenceProduct will return the Document associated with that Geometry that will allow you to work with that object as if it were the Root Document in the CATIA Session.

RE: CATIA V5 Macro : CATPart search

(OP)
That works perfectly, thank you very much! I learned something very usefull today!

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