I'm trying to build a command Termination Event that will keep track of the changes a user makes to space (and how those changes effect geometry my plugin creates).
Right now I'm just trying to access the most recently created/edited geometry from from the timeline marker. This seems to work for most actions, but if I use Press/Pull on something like a cylinder face, I get a weird interanl validation Error:
Here is sample Code:
timeline = design.timeline marker = timeline.markerPosition if marker >0: curTimeLineItem = timeline.item(marker-1) assert curTimeLineItem is not None try: entity = curTimeLineItem.entity except: if Globals.debug: Globals.ui.messageBox('Entity not there for '+curTimeLineItem.classType()+'.'+curTimeLineItem.name+':\n{}'.format(traceback.format_exc())) return if entity is None: Globals.ui.messageBox("not entity for "+curTimeLineItem.name) elif "Feature" in entity.classType(): Globals.ui.messageBox("Feature of type "+entity.classType()) bodies = entity.bodies for body in bodies: Globals.ui.messageBox("body: "+body.parentComponent.name+"."+body.name)
And the error code from entity = curTimeLIneITem.entity is RuntimeErrorr: 2: InternalValidationError: res.
What is this error? What can I do?
More generally what is the best way to detect a users changes to the design after each action.
Solved! Go to Solution.
Solved by marshaltu. Go to Solution.
Hello,
Unfortunately it was because no API object was corresponding to the entity created by Press/Pull. We was lack of such API. I will log a requirement in our internal system for tracking.
Also it seemed that there was no smart way to detect design changes users made currently. Your solution would only work for parametric design, not direct-modeling design. It would be great if you can explain a little bit about your scenario why you want to track users's changes. I would also like to recommend you log the requirement in our idea station.
http://forums.autodesk.com/t5/ideastation-request-a-feature-or/idb-p/125
Thanks,
Marshal
I want to track a users actions because I'm working on a plugin that tests some basic expectations of the modeler (will this fit in that, will it 3D print?, etc.) While I could ask the user to periodically check those expectations, kind of like going into the simulation workspace, I think that's really cumbersome. So instead I would like to continually run checks as they make changes, I would also like to know as much about those changes as possible so that the checks can be more efficient.