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.
For Loop For Dummies
I'm trying to create a feature that will make a hole pattern like this ubiquitous one from Dieter Rams. I've got the intent represented with standard features and an equation to calc the number of holes for each ring. I've also made some good progress fumbling through writing the code with help from a friend that does some other kinds of coding, but doesn't know featurescript or CAD. Together, we were able to get a cylinder extruded and patterned linearly using a for loop, which is the first step. Separately, I've also got a circular pattern working with a for loop, but I don't know how to combine them. I'm hung up on addressing each iteration of the first loop individually to also do a circular pattern. Do I need a nested for loop? Or should I somehow evaluate each instance after my first for loop and do a second for loop after my first one? I think I accidentally created an infinite loop trying this. You can check out my model and code here. I'm looking for hints more than answers since this is mostly a learning exercise and I want it to stick. My coding skill level is "beginner", so don't be afraid to say something that seems obvious. Any helpful nudges are very appreciated!
Evan Reese / Principal and Industrial Designer with Ovyl