5 Replies Latest reply on Apr 30, 2012 1:54 PM by Jerry Steiger

# Using variable (global or local) in equation driven curves

Hi all,

I'm trying to draw an equation driven curve that would use global or local variable. SW 12 documentation clearly state :

"You cannot use global variables directly for equation driven curves. However, you can create a global variable and associate it with a dimension, then use the dimension in the equation for the curve."

This is a serious limitation. Variables can be either positive or negative but dimensions in general can't (?). Variable can be really small like 1e-9. Dimensions can't.

So my question is : Is there a work around ?

If not, how do I complain to Solidworks so they fix that problem ?

Finally, I found that, in the equation driven curve editor, number likes 1.2E-6 is not understood correctly by solidworks. One must write 1.2*10^(-6).

Anyone ever noted that ?

How do I report that ?

Thanks

Philippe

P.S. Below, an example of the kind of equation I want to drive with variables. This is for the sag of an asphere lens. I want to replace numbers like -8.5995732*10^(-9) by a variable. So when the design of the lens changes, I don't have to dig the number. I will just need to edit the table of global variables.D3@ESQUISSE1 is the radius of curvature of the lens which is a big number and is a readily available dimension so I can use it.

-1*(((1/"D3@ESQUISSE1")*(x^2))/(1+sqrt(1-x^2/("D3@ESQUISSE1"^2)))-8.5995732*10^(-9)*x^4+7.8575671*10^(-14)*x^6-8.3052033*10^(-19)*x^8)

• ###### Re: Using variable (global or local) in equation driven curves

to report enhacements that you want to the software, you go to the customer portal and enter an enhancement request (sometimes called an ER)

a work around for the negative values is to use an offset.

say that the value in the equation is -1 to 1, make the global variable -1 to 1, make a dim equal to the variable+2, and in the equation, use the dim-2.

• ###### Re: Using variable (global or local) in equation driven curves

Ok, thanks. That should solve the problem for negative value. But not for very small value.  small variable + 2 = 2 .

I didn't try it but I would guess so.

Philippe

• ###### Re: Using variable (global or local) in equation driven curves

humm.. The variable can range between +/-1E-8 to +/-1E-19. To get 1E-19 close to 1, I would need to multiply by maybe 1E17. But if the variable is rather close to 1E-8 then I would end-up with a potentially huge negative (-1E9) or positive number. If negative, I would need to add an even bigger positive number. I haven't tried it but I'm scared of the result... To get a dimension, I need to dimension a feature (like a dummy construction line) of that size 1E9. That's scary no ? Or is there any way to get a dimension defined without actually dimensionning a features like a construction line ?

It's annoying to discover that SolidWorks is not so fully "parametric".

Thanks for your help ! :-)

• ###### Re: Using variable (global or local) in equation driven curves

Philippe,

The wide range of your variable is going to make it very hard to work through the SolidWorks limitations. I believe SolidWorks can't handle lines below 1E-8 mm or above 1E6 mm. It would be safest to stay a factor or 10 or more above the lower limit and the upper limit line would have to be centered on the origin to fit within the maximum size envelope. So the usable dynamic range of SolidWorks is less than half of the range of your variable.

Is there any way to do something clever, like use the area of a square or the volume of a cube to get your variable?

Jerry Steiger