Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
Featurescript Lookup Table in UI
Hugh_Goodbody
Member Posts: 40 PRO
I have a lookup table in a UI, I would like to poplulate the following UI field with data selected from the first field.
For example, user selects Pin diameter = 20mm, in the data table (I have this done), there are two entries for 20mm with two different OD options (35mm, 40mm), I would now like the next field in the UI to only display those two entries from the table - is this possible?
0
Comments
Just to clarify, sounds like you're saying there are cases where you don't want OD to show. Are there cases where you do want it to show?
One possibility is changing "OD" from being part of the lookup table to being its own enum dropdown. That would allow it to show conditionally based on previous parameters, or could allow future parameters to show conditionally based on it (including showing different lookup tables). Though I'm not sure if this solves your problem, or if I fully understand yet.
If you explain what you're doing in more detail, including how you want to calculate your OD, myself and others may be able to give you a better idea of how you can proceed.
The second way you can do it is using what I like to call the boomerang technique. It's a relatively new idea I came up with a month or so ago. The basic idea is to use a combination of hidden parameters and editing logic to control the visibility of one or more parameters in your annotation. In your case, this would probably work by creating a hidden Bore enum at the top of your precondition, then using that enum to drive the visibility of the corresponding look up tables. You would then need to select the appropriate enum option inside the editing logic based on whatever logic you want. You can see an advanced example of this in the Updated Spur Gear FeatureScript I posted yesterday; I can also provide simpler examples if you're struggling to understand what's going on. This would be by far the most user friendly solution, but I can understand why you might be hesitant to go down this path. Ultimately, the choice is up to you.