How to determine object is an assembly or part?

How to determine object is an assembly or part?

ruban2
Participant Participant
470 Views
2 Replies
Message 1 of 3

How to determine object is an assembly or part?

ruban2
Participant
Participant

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.

 

0 Likes
471 Views
2 Replies
Replies (2)
Message 2 of 3

kandennti
Mentor
Mentor

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.

0 Likes
Message 3 of 3

BrianEkins
Mentor
Mentor

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