Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
How can I make a composite part of all of the bodies I create in a feature?
monroe_weber_shirk
Member Posts: 96 EDU
I'm writing a feature script to create a ruler or a scale that includes tick marks and numbers. I want to combine all of the ticks and numbers into a single composite part at the end of the feature script.
I first tried
opCreateCompositePart(context, id, { "bodies" : qAllModifiableSolidBodies(), "closed" : false });
but that put all of the bodies in the part studio into the composite and I only want the parts created in this feature to be in the composite.
I tried creating an array of all of the bodies as I create them.
tickbodies[i] = qCreatedBy(currentID + "tick", EntityType.BODY);
and then used
opCreateCompositePart(context, id, {and then used
"bodies" : tickbodies,
"closed" : true
});
That fails because "bodies" is not expecting an array.
What is the elegant way of putting all of these ticks and numbers into a composite part?
0
Best Answer
-
NeilCooke Moderator, Onshape Employees Posts: 5,714Just use qCreatedBy(id) for all bodies created in the current feature.
Senior Director, Technical Services, EMEAI1
Answers