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.
Control Flow Features (while loop, if/else, etc...)
ethan_keller924
Member, csevp Posts: 42 PRO
Over the last couple of weeks, I realized that I need better Control Flow for feature execution, so I have started to hack away at a while loop feature. Have control-flow type features already been implemented? And if so, where can I find it?
I have started by incorporating 'while loop' type behavior into the std linear pattern. My goal is to be able to recreate geometry a number of times until some condition is satisfied (ultimately using FS eval as a means to optimize some geometry.) In this contrived example, I am deriving a star, and continue to derive a larger and larger star until the star's volume would falsify a while loop guard. I got that working fine. But since each time I have to delete the previous star attempt, at the end I'm left with the star that just so happens to be the last one before the while loop exited. Is there any way to assign this star the same id as the first one created such that subsequent features 'recognize' it? How would I do that? https://cad.onshape.com/documents/9b79414e1e0f4657737c60a1/w/7a7ca4a3e5bbfe2a831c16b5/e/d1a090a875d0434a34c6cebb (This is for a student team I'll be working with tomorrow) Also any other feedback about my overall approach/what to do instead of having a 'delete If' custom feature - is there a way I could make a generic feature execution conditional that doesn't involve writing a new conditional-type feature?
I have started by incorporating 'while loop' type behavior into the std linear pattern. My goal is to be able to recreate geometry a number of times until some condition is satisfied (ultimately using FS eval as a means to optimize some geometry.) In this contrived example, I am deriving a star, and continue to derive a larger and larger star until the star's volume would falsify a while loop guard. I got that working fine. But since each time I have to delete the previous star attempt, at the end I'm left with the star that just so happens to be the last one before the while loop exited. Is there any way to assign this star the same id as the first one created such that subsequent features 'recognize' it? How would I do that? https://cad.onshape.com/documents/9b79414e1e0f4657737c60a1/w/7a7ca4a3e5bbfe2a831c16b5/e/d1a090a875d0434a34c6cebb (This is for a student team I'll be working with tomorrow) Also any other feedback about my overall approach/what to do instead of having a 'delete If' custom feature - is there a way I could make a generic feature execution conditional that doesn't involve writing a new conditional-type feature?
Tagged:
0