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: 

Error when getting appearance.name

1 REPLY 1
Reply
Message 1 of 2
grakoczy
155 Views, 1 Reply

Error when getting appearance.name

Hi,

 

I've found strange case in one design.

It's crashing when I try to access body or face appearance.name property.

This is the error message:

Zrzut ekranu z 2017-01-04 11-06-54.png

 

In this example it's crashing at line: 

print("body.appearance.name: ", body.appearance.name)

but one line before I have:

print("body.appearance: ", body.appearance)

and it works fine and returns the appearance.

 

This is very weird because I can do exactly the same thing in Spyder console and I got the name.

It seems to be related with component as Spyder console returns default Steel Satin material while component has assigned wood material in the whole assembly design so it should return wood, not the steel material from the source file.

Is there any way to fix this in the code instead of assigning appearance to the component in the source file?

1 REPLY 1
Message 2 of 2
ekinsb
in reply to: grakoczy

We've just discovered a problem with getting materials and appearances using the API and have just started investigating.  The problem we've seen is case specific and limited to a certain design.  Is what you're seeing also limited to certain designs or does it happen all the time.  Can you post a simple design and some code that reproduces the problem?  We can use that to verify that it is the same problem and if not we can work on fixing this too.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog

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