How to be notified that a special part has been redrawn?
I'm working on a project where I need to know when a part or an assembly has been redrawn. I'm using the notification PRO_MDL_DISPLAY_PRE so when someone Hide or Show a part or an assembly I receive a notification and I print the name and the type of the model by the notification:
the problem is that I always get the name of the root parent of my model and the type is always PRO_MDL_ASSEMBLY. Is it possible to receive the precise information that a part has been displayed?
Thank you very much!
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
I tested similar code myself, it seems like that notification doesn't run recursively (aka, it doesn't run a component in a model). It only runs on the top-level model, regardless of which model or sub-component is changed.
From what I can tell, your best bet would be to build an array of the current state of every component in the model, save that array into memory, and then do a comparison of the current-state to the previous-state on every new model display change (using the notification). Problem is, that check could impact model performance depending on how large your models are.