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.

Options

Can't figure out how to "retrieve" bodies created by instantiator...

eric_pestyeric_pesty Member Posts: 1,514 PRO
edited May 2023 in FeatureScript
I don't think I can use "qCreatedBy" and I can't use the "instantiator" variable directly...

For context I am adding instances within a loop and I would like to apply a transform to all the bodies at the end.

I had created a query that worked fine in my test case but it also moves everything else that's already in the part studio (which makes sense) so that was an epic failure.

I'm sure there's got to be a way to do this but I haven't worked with the instantiator before and it's a bit of a different animal from what I'm used to...
Tagged:

Best Answer

  • Options
    eric_pestyeric_pesty Member Posts: 1,514 PRO
    Answer ✓
    Nevermind, I figured it out!
    I re-read through the "addInstance" documentation and found the hint in the optional "name" part.

    For anyone reading this, it is done with qCreatedBy(id + "name of newInstanciator", entityType.XXXX). I was missing the "entityType" when I first tried it.

Answers

  • Options
    eric_pestyeric_pesty Member Posts: 1,514 PRO
    Answer ✓
    Nevermind, I figured it out!
    I re-read through the "addInstance" documentation and found the hint in the optional "name" part.

    For anyone reading this, it is done with qCreatedBy(id + "name of newInstanciator", entityType.XXXX). I was missing the "entityType" when I first tried it.
Sign In or Register to comment.