Determine if object is part of base class

Determine if object is part of base class

SeanKane88
Contributor Contributor
466 Views
2 Replies
Message 1 of 3

Determine if object is part of base class

SeanKane88
Contributor
Contributor

Is it possible to determine if an object is part of a base / parent class? I.e. I would to do the following check:

 

if (ObjectType == ObjectParentType):

    my code here

 

Object is a sketchLine or a sketchArc. From the reference manual I know that these are both inherited from sketchCurve. However, I can't figure out how to get the parent type from the sketchLine / Arc etc. so every test I have been able to do ends up failing because the equality ends up being something like sketchLine == sketchCurve, which fails.

0 Likes
Accepted solutions (1)
467 Views
2 Replies
Replies (2)
Message 2 of 3

ekinsb
Alumni
Alumni
Accepted solution

This is discussed in the "Python Specific Issues" topic in the API help.  Here's a direct link that shows you can use the Python isInstance function.

 

http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-743C88FB-CA3F-44B0-B0B9-FCC378D0D782#Object Types

 

 


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 3 of 3

SeanKane88
Contributor
Contributor

Thanks - works fine. Sorry about the slow response but have been away from my computer a week.

0 Likes