Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

CATIA V5 Macro : CATPart search 1

Status
Not open for further replies.

Viltry

New member
Mar 19, 2015
6
US
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!
 
Replies continue below

Recommended for you

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.
 
That works perfectly, thank you very much! I learned something very usefull today!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top