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.
Hi, I have found how to do what I needed. I used the ReferenceProduct property of the product to acess the CATDocument.Product of the object. From there I used the .parent property from that ReferenceProduct to work with that object as if it were the Root Document in the CATIA Session.
My problem was more about accessing a specific CATPart than actually searching for it, sorry if I was unclear.