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.
Setting the Name Property on a Composite Part
ethan_keller924
Member, csevp Posts: 44 PRO
Perhaps this has come up before, but is there any fundamental reason I shouldn't be able to call setProperty for the name on a composite part? In other words, should I submit an IR to do so?
Tagged:
0
Comments
-
Do you have a sample of your code to share? I've been able to do it before without issues.Applications Developer at Premier Custom Built
chadstoltzfus@premiercb.com0 -
Was it set in the UI, perhaps? Edit: works for me.0
-
I think I figured out my mistake. I mistakenly assumed that `qCreatedBy(compositeId)->qBodyType(BodyType.COMPOSITE)` would result in a query that only returns bodies, but the resolved query included a vertex... So when I called `setProperty` on that query the error was thrown due to the vertex included. Changing to `qCreatedBy(compositeId, EntityType.BODY)->qBodyType(BodyType.COMPOSITE)` did the trick. Should have read the documentation for qBodyType better! Thanks for setting me straight

0 -
Ach, yeah, a composite part does contain a vertex (implementation detail), which we should probably filter out of queries. Sorry about the non-obviousness.0
-
Yeah - filtering that out is a good idea. To conclude, that should be the resulting IR from this
As always, thanks Anton!
1


