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: 

How to tell if TimeLineObject should have an entity?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
marcosscriven
161 Views, 2 Replies

How to tell if TimeLineObject should have an entity?

I was traversing the timeline to get each entity, and found that in some cases I got this error:

 

 

return _fusion.TimelineObject__get_entity(self)
RuntimeError: 2 : InternalValidationError : res

 

 

Googling around I see that that's some known gaps in the API. I'm seeing it on:

 

  • CopyPasteBody
  • Align
  • Move

In each case a reasonable entity I think would be the occurrence affected?

It's easy enough to wrap this method myself, but is there a supported way to know first if the entity should be there, before attempting to get it?

I just don't really like wrapping APIs to work around things like this to suppress errors in case it changes in the future,  and I end up suppressing a valid error.

2 REPLIES 2
Message 2 of 3
BrianEkins
in reply to: marcosscriven

All of the items in the timeline should have an associated entity and it's a mistake in the API if there isn't.  This typically happens when a new feature is added to Fusion and the API isn't updated to support it or an existing feature is modified in such a way that the existing API wrapper for it no longer functions as expected.  Both cases are bad.  The only current solution until it's fixed in the API is to do what you suggested and wrap it with a try except.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 3
marcosscriven
in reply to: BrianEkins

I have some sympathy for it blowing up on new features.

It's pretty damning IMO (as a software engineer) for the entity on existing features to be blowing up like this for such a long time. There should be some integration tests for this, and it should not be released unless they're passing.

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