4 Replies Latest reply on Apr 3, 2014 12:25 PM by Jeroen Janssen Andeweg

    The value "0" messes things up

    Jeroen Janssen Andeweg

      Hi all,

       

      I thought I made a mistake but I was wrong.

      After 2 frustrating hours of looking for the error, I have found out that SolidWorks does not like the value "0" at all.

      My app creates global variables. The varaibles are used as values for dimensions. But whenever a global variable has the value 0, the dimension does not get the global varaible string.

       

      D1@Sketch1 has a value/equation, does not matter what, let's say 44 which 'Evaluates to' 44

       

      This works:

      My app runs and a value has changed

      My app creates Global variable "GV_01" with value 23

      My app updates - dimension D1@Sketch1 will get the value/equation ="GV_01" which 'Evaluates to' 23

      When "GV_01" has changed to another value my app updates the Global variable and after rebuild the value of the dimension also updates. All good

       

      This does not work:

      My app runs and a value has changed

      My app creates Global variable "GV_01" with value 0

      My app updates - dimension D1@Sketch1 will not change the value/equation 44 which 'Evaluates to' 44

       

      I did tests and it does not matter what type the dimension is, mm or deg, it refuses to set my dimension to the new created global variable string.

       

      Now why is that?