Detecting invalid modeling operations

Detecting invalid modeling operations

gel19
Explorer Explorer
376 Views
1 Reply
Message 1 of 2

Detecting invalid modeling operations

gel19
Explorer
Explorer

I am curious whether there is a way to know whether a modeling operation in Python code will be valid or not. E.g. for sweeping. I'm wondering whether it's possible to iterate through a range of parameters and identify those that will produce e.g. a valid sweep. Do we have any information available to us in the API to help with this?

0 Likes
Accepted solutions (1)
377 Views
1 Reply
Reply (1)
Message 2 of 2

BrianEkins
Mentor
Mentor
Accepted solution

The only way to verify if a modeling operation will be successful is to try creating and then check the result. The creation may completely fail, or it might complete with an error, which you can check for by using the Feature.healthState and Feature.errorOrWarningMessage properties. That's effectively what the command is doing, although it can execute the creation at a lower level, so it's a bit more efficient, but it is still attempting to create the feature and verify if the creation was successful or not.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com