This topic contains 2 replies, has 2 voices, and was last updated by  Viltry 2 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #1577



    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!


    Emmett Ross

    Hi. Are you trying to search for just the CATParts or search just within CATparts?

    Selection1.Search “CATPrtSearch.Surface, All”



    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.

    Thank you for your answer.

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘CATIA Macro Programming’ is closed to new topics and replies.