How to suppress a feature using a variable value?
I have defined global variable (e.g. A=0 or A=1) in the equationsection. Now I want to drive state of one of my features usingvalue of A. i.e. when A=0 I want to suppress it and when it is 1 Iwant to unsuppress it.
How can I embed this rule into a Solidworks partfile?
I am not looking for a solution from design table point of view.
Thanks
Raghawendra
SolidworksGeneral

I have defined global variable (e.g. A=0 or A=1) in the equationsection. Now I want to drive state of one of my features usingvalue of A. i.e. when A=0 I want to suppress it and when it is 1 Iwant to unsuppress it.
How can I embed this rule into a Solidworks partfile?
I am not looking for a solution from design table point of view.
Thanks
Raghawendra
SolidworksGeneral

How can I refer the global variable in a DT? What syntax to use?
e.g. variable name is A, then how to refer this in DT?
"$VAR:A" does not work :-(
Adding to that, if this variable is from some other partfile loadedin the session, then how to refer it? (adding @partname.SLDPRT)does not work either.
Thanks
Raghawendra
Any comments on how robust is this if I define multi-hundredvariables.
Is this robust enough if I have linkage between these variables,DT, features and assemblies and dimensions.?
Thanks
Raghawendra
I can see the column that you have entered the variable into, but Idon't understand the syntax - could you write it here to explain?
What does the $PRP refer to and the zxyz? If you have more than oneequation/variable, how do I which I am refering to?
Thanks.
Thanks again for the help.
I'm using 2009 SP1.0
The workaround (which worked for me) is update design table (I justopen and close it) and then rebuid/update.
Thanks
Raghawendra
I expected the design table to update automatically as dimensionsare changed. Is this not the case or is there an option somewhereto conrtol this?
Thanks again for your replies.
It works most of the time when I do that, although it doesn'talways update the property ($PRP). I suppose I just expected it toupdate the table in the background and rerun the equations. I guessI could make a macro or something to make it all a bit quicker -rebuild and update design table in one button.
One thing I try to do if I have some kind of calculation like thatin a DT is to highlight the affected cells (usually the wholecolumn) in a suitable color. Then I add a note in nice big redletters at the bottom to advise that "light blue cells areautomatically calculated" or whatever. That way attention is drawnto how the DT is constructed so that somebody else coming to itmight understand how it works and not be disappointed if it doesn'twork as expected.
Hi All,
Can I do the same thing using Visual Basic Script.
In the same way have a variable, and set it to 0, to make the feature suppressed.
If so, how do I go abt that.
I am a newbee to API. I would like to ask for your help with this.
Thanks in advance.
Ashwin.
Hi! I have lamented about this issue for some time now (almost 2 years). I have found that using GV/DT/Assemblies/Configurations, all together, can works, but not consistently, and never when your boss is watching
Why doesn't this work consistently, I have theories. I have spent many hours (too many!) understanding SW and its rebuild functionality and contacting SW and my reseller. Their conclusion is what I quote below:
"I've received an update from SolidWorks ... The functionality you are looking for is a limitation of SolidWorks.
...
You cannot (consistently) drive configured Global Variables in the top level assembly down to configurations of its components. The method you were using did seem to work when we forced the update by editing the subassembly, but it was inherently unstable as the method is backwards from the intended use of equations in assemblies (as you received the syntax errors).
I'd recommend not using configurations if you need a master model to update. If you just use Default configurations, it will all update properly. The issue is when you have multiple configured values of Global Variables in the top level." (Sent: 08/14/2015)
As you can read, its not the best news, but it offers certainty. That is to say, you are using the software as you should, the back end however, isn't keeping up to pace. Now that we know this 'limitation', we can work around it!
Recently, I found that SW release in 2014-SP2 Beta SPR that addressed the issue:
256735 ability to control global variable on configuration level to drive equations
In theory it works. In practice its very messy.
My conclusions:
- If using global variables, avoid configurations in the assembly and in parts below it!!!! (this is the over cautious approach). The key is to avoid lower parts using the assemblies variable. The way it was explained to me is that the GV is an array (the size equal to the number of configurations) and when parts link to the GV, it references a specific position in that array. Awesome. The problem is when the GV changes, it updates in the assembly, but it fails to push the value down to the part. Why? It seams that the part is linked to a specific cell of that GV, and not the one that was most recently changed. I know my explanation isn't the best, but its regrettably true.
- Use variables and feature suppression to create "configuration like parts". See forums for more detail. (This is what I am doing, it works super!)
- Don't use global variables. Use design table and drive equations directly. (from what I gather, this is the original design intent of DT)
- If you want to create products with many driving parameters, you will be guided driveworks as a solution. Looks impressive, but i have a small budget
Hope this helps,
Arpad