How do you reference a global variable in a design table equation?
Does anyone know the correct syntax? Cannot find it anywhere
This is what I would like to do:
How do you reference a global variable in a design table equation?
Does anyone know the correct syntax? Cannot find it anywhere
This is what I would like to do:
You cannot access the global variable within the value. You can access the global variable in the design table (in the 2nd row) and then have the variable drive the equations within SOLIDWORKS. Here is the syntax for the global variable, "$VALUE@"Global Variable Name Here"@equations".
Do not use any quotes when entering in the design table.
Jeff
Hi Chris
Unfortunately if you write global variable in the design table, it doesnt work properly . I advice you to follow bellow steps :
1- Create global variable
2- Create 2 configurations and make an equation in new config.
3- Make a design table
4- Make desired equation in your design table .
Good luck .
Hi Adel Taheri Aval, thank you so much. Your advice was completely correct, and extremely helpful.
By creating the global variable and equations first, in the normal equation editor, and then creating the design table, it automatically put the correct equations syntax into the design table.
Attaching images of the good results.
You can use an if statement right in the design table to get values of 0 for suppressed or 1 for unsuppressed. I did this in a column, then referenced the resulting cell in my column for the suppression. If this is to be a driven value and not one meant to be entered directly by the user, then it must be driven in the table by an equation tied to the values set by the user.
So either you use that driven value from the design table to actually drive the model if you can start out intending to do so, or modify the already created geometry to do so. Otherwise, you must create an equation that gives the same results reflected in the model. It could get to be a difficult equation and you will have to remember to modify the equation if you change something in the model that altars how the program is calculating that value.
For example if it is a length of a line driven by where the intersection falls on another line line, and you change the constraint to where it falls on an arc instead, the equation will have to be changed and that is where the equation could get really ugly really fast.
You could create a sketch using the output of a simplified equation that doesn't track to the exact geometry if it doesn't need to be that precise.
Seems like it would be a fairly easy programming task to give the design table direct access to global variables for values. But software like this is so complex that there no longer is any easy programming task.
In my case I am modeling a cylinder that can be anything from a roll of paper towels, plastic wrap or rolls of trash bags, etc. for use in my cabinet product designs. The trash bag rolls don't have a carboard tube in the middle so I want to omit the hole from those, which I did as a delete face operation. I decided to make the various rolls on a tube as ten inches or longer, and the ones without at 9 inches or less. I control that length in the design table. An if then statement for suppression evaluates that length from the design table and assigs either 0 or 1 to suppress the hole or not.
If it was tied to say arc length of a given circle when the controlled values are the diameter and the angle of the arc, then what I could do is create a sketch with a line and a length dimension, I could then set that length in the design table and use an equation for calculating the arc length as pi*D*A/360 where D is the diameter and A is the angle. Then that calculated arc length value is accessible to an if statement in the design table for a column controlling suppression. The equation should render the same value as if you measured the arc length in the sketch with the diameter and angle. So even though for the model you didn't need to do the math and just let the solver do it, you still have to create the same equation anyhow in a dummy sketch to access it in logic expressions in the design table.
Hi Chris
Unfortunately if you write global variable in the design table, it doesnt work properly . I advice you to follow bellow steps :
1- Create global variable
2- Create 2 configurations and make an equation in new config.
3- Make a design table
4- Make desired equation in your design table .
Good luck .