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.
Is it possible to have driven variables?
carl_malagodi
Member Posts: 18 EDU
Is it possible to have a variable that is only driven by a dimension, for example in the polygon sketch entity it doesnt appear to be possible to make the number of sides driven by a variable, is there a way to make a variable be driven by the number of sides instead? This isn't a use case I'm considering, more of a way to try to communicate what I'm trying to find out.
Tagged:
0
Best Answers
-
S1mon Member Posts: 2,901 PROIt seems like you are correct about the polygon sketch entity. Interestingly, sketch pattern counts can be set with a variable. Both are show as "5x", so it seems like someone just assumed that driving the polygon tool with a variable wasn't as common, and didn't get to it. If it was an important use case to you (and it sounds like it isn't), then I would file an improvement request.
Similarly, I don't know an easy way to extract the count of either polygon sides or sketch patterns without using some FeatureScript to create the entities in the first place.
You can extract general measurements (including areas and perimeters) into variables, which can be very useful. Look at Measure value. There's also a "sensor" FeatureScript for clearances and other measurements, which can generate warnings if something is out of a predefined range.
0 -
eric_pesty Member Posts: 1,836 PRONote that you could use a "measure" feature on the angle between the first two sides and do the math to get the number of sides in a variable for use in a downstream feature...
But if you can't drive the number of sides it might not be that useful...
Depending what you are trying to do you might be able to achieve what you want with a circular feature pattern instead of the polygon tool...1 -
eric_pesty Member Posts: 1,836 PROI missed the end of your statement.
As a general rule you should be able to make a driven variable out of pretty much anything using the measure custom feature.
The only limitation is that you have to create it after what is driving it.
For example there is no way to have a driven variable within a sketch that you can also use in the same sketch.1
Answers
Similarly, I don't know an easy way to extract the count of either polygon sides or sketch patterns without using some FeatureScript to create the entities in the first place.
You can extract general measurements (including areas and perimeters) into variables, which can be very useful. Look at Measure value. There's also a "sensor" FeatureScript for clearances and other measurements, which can generate warnings if something is out of a predefined range.
But if you can't drive the number of sides it might not be that useful...
Depending what you are trying to do you might be able to achieve what you want with a circular feature pattern instead of the polygon tool...
As a general rule you should be able to make a driven variable out of pretty much anything using the measure custom feature.
The only limitation is that you have to create it after what is driving it.
For example there is no way to have a driven variable within a sketch that you can also use in the same sketch.