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.

Determine which options were selected when previously using a feature to create a part?

ENG_1ENG_1 Member Posts: 4
Is there a way to access a piece of information that was input by selecting an enum value to create a feature, the next time that feature is used?

For instance, if I made a feature to create cube with an enum option for filleted edges, would it be possible to then use featurescript to query that cube and determine whether or not the user chose to have filleted edges?

Best Answers

Answers

  • lemon1324lemon1324 Member, Developers Posts: 223 EDU
    In this application, I think the attributes would suit you better, as they are associated to geometry and not global.

    Say, for instance, you make two cube features, one of which has the fillet option and one which doesn't.  Using attributes lets you respond to both of these in later features independently, rather than overwriting the Variable (which is necessarily a global variable).
    Arul Suresh
    PhD, Mechanical Engineering, Stanford University
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    @lemon1324 from this point of view you are right
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,310
    Or do you just want the next feature created to use the same inputs selected last time? In that case just use "UIHint" : "REMEMBER_PREVIOUS_VALUE"
    Senior Director, Technical Services, EMEAI
  • ENG_1ENG_1 Member Posts: 4
    Thank you @lemon1324 and @konstantin_shiriazdanov, I believe these are exactly what I was looking for. I think that there might actually be a use for both global variables and attributes in my specific case.
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    I agree that Attributes are the tool for the job: One custom feature can set attributes that another can read. Here's a feature with examples as getting and setting attributes (which simply gets the attribute value and prints it to the console):
    https://cad.onshape.com/documents/5de745b789701c60bf75fd19/w/3d4893fbd20b641cfbce25c9/e/71100f5de8e6955281228275

Sign In or Register to comment.