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.

Is there a reverse qCreatedBy? like qCreator?

joshtargojoshtargo Member Posts: 299 EDU

Is there a reverse qCreatedBy? like qCreator?

I want to try to get the name of the feature that created a selected mate connector, then make a copy and give it the same name.

Comments

  • lanalana Onshape Employees Posts: 716

    Feature names are not exposed to Feature Script ( we don't want to regenerate everything on a name change). There is lastModifyingOperationId, but it will give you Id, not the name. Sorry, this does not work for your use case.

  • Chris_D_Mentes_001Chris_D_Mentes_001 Member, csevp Posts: 105 PRO
    edited December 2024

    When you know the "Type" you want a function to return (which in this case is "Id") you can search the standard library to see if any functions there return that Type using the input you want by pressing CTRL+F to bring up the word search bar and typing "returns TheTypeImLookingFor":

    You can the cycle through what it finds and see if anything suits your fancy, I happened to find what I think you're looking for:

    I'd also like to point out that a "Query" is just a map of maps of maps etc, and each layer is a subquery with a "queryType" key. If the queryType is correct then that map may also hold the Id of the entity that query refers too. I don't actually know much about how a query map is structured but you can always use "println(query)" in your code, open up a tab that uses that feautre, open up the notices and see how that specific query map is structured to see if it's something you can use. Good Luck

Sign In or Register to comment.