Move bodies to root part and delete empty components #2194
Unanswered
Indrajeetrt
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi @Indrajeetrt! I don't think we have a "transfer" or "move component/bodies" API currently (please confirm if possible @jacobrkerstetter @jonahrb @b-matteo) However, we do have a # Copy body_a under comp_b
body_a.copy(parent=comp_b)
# Delete body_a from comp_a
comp_a.delete_body(body_a)
# Or if you want to delete comp_a from the design directly
design.delete_component(comp_a) Hope this helps! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello There,
Good day!!!
I am facing some problems with moving all the bodies to root components from subcomponents.
I usually do it with space claim scripting, below are lines of code I use:
"
selections = Selection.Create(GetRootPart().GetAllBodies())
component = PartSelection.Create(GetRootPart())
result = ComponentHelper.MoveBodiesToComponent(selections, component, False)
selection = PartSelection.Create(GetRootPart())
ComponentHelper.DeleteEmptyComponents(selection, None)
"
this I want using pygeometry and I don't want to run discovery script as it is taking more time.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions