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: 

How to determine object is an assembly or part?

2 REPLIES 2
Reply
Message 1 of 3
ruban2
257 Views, 2 Replies

How to determine object is an assembly or part?

I execute script but got error like this.

Failed:
Traceback (most recent call last):
File "C:/Users/admin/Documents/ExportStep/ExportStep.py", line 154, in run
'material': comp.material.name,
AttributeError: 'NoneType' object has no attribute 'name'

 

it is to because comp is assembly.

so I am going to determine assembly in fusion360.

 

2 REPLIES 2
Message 2 of 3
kandennti
in reply to: ruban2

Hi @ruban2 .

 

Without the code you are running and the f3d/f3z files I don't know anything.

I try to provide as much as I can that I can try right away, but you have not provided any.

Message 3 of 3
BrianEkins
in reply to: ruban2

Fusion is a bit strange in that it doesn't differentiate between parts and assemblies and you can even create something that acts as both, that's not recommended. 

Fusion has components and you can assume a component is a part or assembly based on its contents. A component can contain bodies and it can contain references to other components. When it just contains bodies it can logically be considered a part. When it just contains references to other components (occurrences) it can be considered an assembly. It's possible to have a component that has both. I would consider this a bad component. If you have a component that has neither you don't know if it's represents an empty assembly or part.

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report