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

Best ways to create a 1:1 relationship between a set of queries and some other settings?

Evan_ReeseEvan_Reese Member Posts: 2,066 PRO
I'm working on a feature that generates a list of parts, which should have some values associated with them by the feature. Later (in the same feature), when I query one of those parts, I want to be able to get a list of the settings for it. I thought I might be able to use the query itself as the key to a map, which would have all of the settings in it, but that didn't seem to work. I think I could use attributes, but I don't need to access this info in a downstream feature, so it doesn't feel quite right. Maybe that doesn't matter though. Any ideas on how to approach this?
Evan Reese / Principal and Industrial Designer with Ovyl
Website: ovyl.io
Tagged:

Best Answer

  • Options
    ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,178
    Answer ✓
    Attributes sounds right -- it doesn't matter if it's the same feature.  If you like, you can clear them at the end of your feature.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc

Answers

  • Options
    ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,178
    Answer ✓
    Attributes sounds right -- it doesn't matter if it's the same feature.  If you like, you can clear them at the end of your feature.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • Options
    Evan_ReeseEvan_Reese Member Posts: 2,066 PRO
    Great, I'll go that route. thanks!
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • Options
    Konst_ShKonst_Sh Member Posts: 42 PRO
    The transient query of the part should be pretty persistent in the scope of the feature as long as you don't use some non trivial body identity changing operations. Also if you decide to go with named attribute you can remove it in the end of feature by setting it to `undefined`
Sign In or Register to comment.