Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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_keller924ethan_keller924 Member, csevp Posts: 42 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?

Comments

  • chadstoltzfuschadstoltzfus Member, Developers, csevp Posts: 139 PRO
    edited March 19
    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.com
  • _anton_anton Member, Onshape Employees Posts: 381
    edited March 19
    Was it set in the UI, perhaps? Edit: works for me.
  • ethan_keller924ethan_keller924 Member, csevp Posts: 42 PRO
    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 :blush:
  • _anton_anton Member, Onshape Employees Posts: 381
    Ach, yeah, a composite part does contain a vertex (implementation detail), which we should probably filter out of queries. Sorry about the non-obviousness.
  • ethan_keller924ethan_keller924 Member, csevp Posts: 42 PRO
    Yeah - filtering that out is a good idea. To conclude, that should be the resulting IR from this :smile: As always, thanks Anton!
Sign In or Register to comment.