How can i move 2parts in a new component in spaceclaim using for loop when multipleparts are there?

selection = Selection.Create(result.CreatedBodies)
component = ComponentHelper.MoveBodiesToComponent(selection, Info5)
selection = BodySelection.Create(GetRootPart().GetBodies("Bolt"))
result = ComponentHelper.MoveBodiesToComponent(selection, component.CreatedComponents[0], False, Info6)

Answers

  • Chris Harrold
    Chris Harrold Member, Administrator, Employee Posts: 183
    100 Comments 5 Answers First Anniversary Ansys Employee
    admin

    @Rajesh Meena - can you assist?

  • Rajesh Meena
    Rajesh Meena Moderator, Employee Posts: 128
    100 Comments 25 Likes Second Anniversary 5 Answers
    ✭✭✭✭

    @AmrishKulkarni ,

    Below code can help me achieve component movement shown in image below:

    comp_sel = Selection.Create((GetRootPart().Components))
    ComponentHelper.MoveBodiesToComponent(comp_sel)

    I am moving all component but you can filter based on name or index.