Hi,
Are there any TUI commands that add all SOLIDS and COMPOUNDS to a list to enable boolean operations on them? Writing a loop to create the text below is not a useful method.
An example;
Fuse_1_objects_1 = [model.selection(“SOLID”, “solids_A_1”),
model.selection(“SOLID”, “solids_A_2”),
model.selection(“SOLID”, “solids_A_3”),
.
.
.
model.selection(“COMPOUND”, “Comp_A_1”),
model.selection(“COMPOUND”, “Comp_A_2”),
model.selection(“COMPOUND”, “Comp_A_3”),
.
.
.
model.selection(“SOLID”, “solids_B_1”),
model.selection(“SOLID”, “solids_B_2”),
model.selection(“SOLID”, “solids_B_3”),
.
.
.
model.selection(“COMPOUND”, “Comp_B_1”),
model.selection(“COMPOUND”, “Comp_B_2”),
model.selection(“COMPOUND”, “Comp_B_3”), … )]
Fuse_1 = model.addFuse(Part_1_doc, Fuse_1_objects_1, keepSubResults = False)
To;
Fuse_1_objects_1 = [model.selection(“SOLID”, “list_of_solids”),
model.selection(“COMPOUND”, “list_of_comp”)]
Fuse_1 = model.addFuse(Part_1_doc, Fuse_1_objects_1, keepSubResults = False)
I use the method down below.
object_names_1 = [f"obj_1_{i}" for i in range(counter1)]
object_names_2 = [f"obj_2_{i}" for i in range(counter2)]
fuse_objects1 = [model.selection(“SOLID”, name) for name in object_names_1]
Fuse_1 = model.addFuse(Part_1_doc, fuse_objects1, removeEdges = True, keepSubResults = True)
Fuse_1.result().setName(“Fuse1”)
fuse_objects2 = [model.selection(“COMPOUND”, name) for name in object_names_2]
Fuse_2 = model.addFuse(Part_1_doc, fuse_objects2, removeEdges = True, keepSubResults = True)
Fuse_2.result().setName(“Fuse2”)
Fuse_101 = model.addFuse(Part_1_doc, [model.selection(“SOLID”, “Fuse1”),model.selection(“COMPOUND”, “Fuse2”)], keepSubResults = True)
Fuse_101.result().setName(“FuseAll”)
Regards,
Said