How to tell if TimeLineObject should have an entity?

How to tell if TimeLineObject should have an entity?

marcosscriven
Enthusiast Enthusiast
617 Views
2 Replies
Message 1 of 3

How to tell if TimeLineObject should have an entity?

marcosscriven
Enthusiast
Enthusiast

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.

Accepted solutions (1)
618 Views
2 Replies
Replies (2)
Message 2 of 3

BrianEkins
Mentor
Mentor
Accepted solution

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
Enthusiast
Enthusiast

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.

0 Likes