How to have ACT object respond to geometry update

Nick Ramseyer
Nick Ramseyer Member Posts: 18
First Comment

I am currently working on an ACT extension where I would like my custom tree object to update after the geometry is updated in Mechanical. Amongst the options in the xml guide there doesn't appear to be an explicit callback to respond to a geometry update in mechanical.

I can get the object to update using the "Isvalid" check on the object, as this is called whenever the tree is updated. However this is a problem because this means my object is now updated every time the tree is refreshed (which happens whenever any other object is added or removed in mechanical).

Is there a way to have the object only respond to a geometry update? and not to the tree itself refreshing? (For context the object creates graphics and takes considerable time to update whenever it refreshes)



  • Nick Ramseyer
    Nick Ramseyer Member Posts: 18
    First Comment

    There may be a way to intercept the actual signal... but a "cheap" way of doing this is to just track the global number of edges in a variable and if it's changed then that means the geometry changed. So basically use the "isvalid" check on the object to check if the global geometry changed.

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 794
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member

    Some ACT objects seem to offer an callaback but it seems not all of them do.... Python Code objects do offer a After Geometry Changed callback. One way out could be to replace the ACT object by a Python Code one ...