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 assign a variable to control number of sides of a polygon?
dhiraj_patil
Member Posts: 3 ✭
Best Answers
-
Alex_Kempen Member Posts: 248 EDUSketch patterns and polygons cannot unfortunately be controlled with variables. This is due to the way Onshape handles creating new sketch entities internally; new entities aren’t processed deterministically, so increasing the number of sides on a polygon and then changing it back will cause things which reference the sides of the polygon to behave unexpectedly and inconsistently.
One alternative to configuring polygons directly is to make multiple polygon sketches and to use configurations to switch between them.
Also, note that variables are called in Onshape using a # - this also activates the variable autocomplete menu.CS Student at UT DallasAlex.Kempen@utdallas.eduCheck out my FeatureScripts here:1 -
EvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭This limitation bugs me semi-frequently, and if the Onshape team finds a way to make it work in the background, that would be great. Until then, I'll get around it like this. Start by making a surface that's a single section of the poligon, using the circular pattern feature to make the whole shape, and extruding the face (or lofting or whatever). Here's an example.
Evan Reese5
Answers
One alternative to configuring polygons directly is to make multiple polygon sketches and to use configurations to switch between them.
Also, note that variables are called in Onshape using a # - this also activates the variable autocomplete menu.