Error when getting appearance.name

Error when getting appearance.name

grakoczy
Contributor Contributor
361 Views
1 Reply
Message 1 of 2

Error when getting appearance.name

grakoczy
Contributor
Contributor

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?

0 Likes
362 Views
1 Reply
Reply (1)
Message 2 of 2

ekinsb
Alumni
Alumni

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
0 Likes