Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Internal Validation from TimelineObject.entity after Presspull

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
390 Views, 2 Replies

Internal Validation from TimelineObject.entity after Presspull

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. 

2 REPLIES 2
Message 2 of 3
marshaltu
in reply to: Anonymous

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

 

 



Marshal Tu
Fusion 360 Developer
Autodesk, Inc.

Message 3 of 3
Anonymous
in reply to: marshaltu

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. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report