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.
How to automatically choose a configured assembly?
troy_ostrander
Member Posts: 31 ✭✭
An example would be with drawers in cabinetry. The drawer slide hardware have specific depths from 250 to 700mm. The drawer assembly including slide is easy to configure. How do you make an automation for the input of the inside depth of cabinet to choose the best fitting drawer assembly? The goal being change the cabinet depth and the drawer assembly updates to the best fitting drawer assembly.
0
Comments
The way we do this is in part studios is through nested if statements, checking the input of the cabinet depth against the minimum size allowed for a specific slide, if true, return the correct slide/box size, if false, check the next smaller size. So that would look something like this.
#Depth >= 25.*in ? 24.*in : ( #Depth >= 24*in ? 23*in : (#Depth >= 23*in ? 22*in : 0*in ) )
So, if you setup this logic in your drawer and slide part studios, then you can pass in the depth variable through the assembly configuration and have the part studios calculate the size they need to be.
I think. I haven't worked too much with assemblies.
Thanks @Matthew_Curran for your reply. I'm familiar with nested if and statement. But rather than changing a dimension I'd want the true/false statement result be the actual configuration name. I know this is possible in SW.
BTW I'm just starting with Onshape so I am lacking the Onshape terminology.
@troy_ostrander Could you describe how you would do it in SW? Because @Matthew_Curran solution was not quite what your after, I'm, not positive what your after. I generally use the nested if route but in a configured variable studio. I like keeping that big messy nested logic out of my main assembly and in a place that is made for designing logic variables. If I knew what you were doing in SW, I think it would be more clear to me what you want. I have not found too many things in SW I could not accomplish in Onshape in terms of logic programming. Of course, we still cannot dynamically control suppression or booleans in assemblies yet but, I feeling like its just around the corner.