A script to find "Loose" Bodies

A script to find "Loose" Bodies

tookemtoni
Collaborator Collaborator
346 Views
4 Replies
Message 1 of 5

A script to find "Loose" Bodies

tookemtoni
Collaborator
Collaborator

Hello there,

 

In the process of working with sub-components in Fusion 360, bodies once part of a component can lose their hierarchy and become a body isn't part of a component or just a "body".... Which I am calling a "loose body" here.

 

This can happen when moving components to other components in the browser or creating new components in an active sub-component which bumps the existing body into a "loose body" See GIF for the latter example.

 

I would like to find them quickly in larger assemblies, Is it possible to make a script that would find these loose bodies and create a components from those bodies?

 

LooseBody.gif

0 Likes
347 Views
4 Replies
Replies (4)
Message 2 of 5

BrianEkins
Mentor
Mentor

All bodies are owned by a component. When you create a design there is a root component which is what your initial body is owned by. You then created a new component that's independent of the existing body. You can move the body from the root component to the new component, if you want. You would use the BRepBody.moveToComponent method.

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

tookemtoni
Collaborator
Collaborator

@BrianEkins Thanks, The issue of having these loose bodies is that the Arrange feature will not work with them. I think I'm describing the condition of these bodies in the wrong way. It has something to do with "leafs"????

0 Likes
Message 4 of 5

BrianEkins
Mentor
Mentor

I think you need to become more familiar with how Fusion groups its data. Here are a few resources.

 

https://help.autodesk.com/view/fusion360/ENU/?guid=ASM-COMPONENTS

 

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-88A4DB43-CFDD-4CFF-B124-7EE67915A07A

 

https://www.autodesk.com/autodesk-university/class/Components-Components-Components-Depth-Look-Inter...

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

tookemtoni
Collaborator
Collaborator

Thanks Brian, 

 

For clarification for this thread.  This is the warning one gets when you are using the Arrange Feature:

 

"Not all selected objects will be arranged. Only "leaf" components can be arranged. (A leaf has no child components.)"

 

My GIF above is used to illustrate how component body of "leaf" changes to what? I think I am just missing the terminology.

0 Likes