9 Replies Latest reply on Jul 31, 2016 12:56 PM by Vladimir Urazhdin

    Part dimension not updating to global variable equation

    David Pudlo

      My part dimension isn't updating to the global variable that I set it to.

       

      I have variables set up to be defined in a text file, and when I update them there and rebuild they update in my part's equations editor (both the global variable value and the equation which sets the sketch dimension update), but the part doesn't automatically update.

       

      Photo below shows what it looks like when I changed the 'BoxHeight' variable to 10 (from 20) in the text file, rebuild the part, and open the equations editor. As you can see, box height has updated to a value of 10, the equation "D1@Sketch1" = "BoxHeight" now evaluates to 10, but on the part, the dimension (the one of the left of the part) still has a value of 20 (that's D1@Sketch1).

       

       

      When I go in to edit the dimension, I get this: "Global Variable 'BoxHeight' already exists":

       

      And it proceeds to tell me it's set to 'BoxHeight' which evaluates (here) tp 20", even though it's now evaluating to 10" (as it should) in the equation editor.

       

       

      Pressing rebuild in the dimension does nothing. The only way I've figured out to get it to update is to click on the equation value in the editor and, without changing anything, press OK. Then the part updates.

      (like this, except with a green check mark in the blue active field, I cannot click away before clicking ok, then it doesn't work)

       

      Other parts that I created in the same way (but which are simpler) appear to be updating just fine. So I don't think it's an issue with my solidworks or windows, but likely something broken within the part.

       

      Please advise.

        • Re: Part dimension not updating to global variable equation
          Richard K.

          I have the exact same problem.  CTRL+Q doesn't help, either.  Feels like a regression - if you search the old threads, I believe others had problems in old versions where equation-driven curves and dimensions didn't rebuild correctly.  I know it was working in SW2014; guessing it got bugged again in 2016.  Argh.

           

          There was mention of a "SuperRebuild" macro - I found it but haven't been able to get it to work in 64-bit.

          • Re: Part dimension not updating to global variable equation
            Kevin Chandler

            Hello,

             

            Is it a question of configurations?

            Is BoxHeight assigned/defined differently for the flat and for the folded?

             

            Cheers,

             

            Kevin

            • Re: Part dimension not updating to global variable equation
              Kevin Chandler

              Hello,

               

              In your first image, your global variables are checked in the linked column.

              Are they linked to an external file and defined there? If so, SW may be trying to create a new "BoxHeight" because of this and complains because the externally defined one already exists.

               

              Just a thought.

               

              Cheers,

               

              Kevin

              • Re: Part dimension not updating to global variable equation
                Richard K.

                Still no love from the SolidWorks team on this?

                 

                I tested under 2016 SP3 and it still seems broken.  I'm using an even more basic scenario without any external files.  Just global variables and equations, all within my part file.  And no warnings about variables already existing.

                 

                When I update a global variable in the Equation Editor window, all equations referencing it are updated within this window, but the actual dimensions in my sketches / model are not.  Clicking the "Rebuild" traffic light, checkmarking "Automatic rebuild", turning on/off Automatic solve order, CTRL+B, CTRL+Q... none of this helps.  Even fixed the SuperRebuild 2.0 script to run under 64-bit (involved updating some of the Declare statements with PtrSafe and making adjustments to match the 64-bit headers), but that didn't do it either. The only workaround I've found is to visit EACH the equation in the Equation Window that references the changed variable, and click the green checkmark next to it.  Nothing changes in the Equation Window itself, but it seems to be enough to trigger SolidWorks to "rebuild" that dimension (at least in most cases).

                 

                It seems to happen once my parts become more complex.  I haven't been able to recreate yet on a simple, single-equation part.  Willing to share a file that exhibits the behavior if anyone else wants to have a look.

                  • Re: Part dimension not updating to global variable equation
                    Bill Toft

                    Richard,

                    I have successfully worked on many projects using global variables that are linked to external Excel spreadsheets.

                    I just want to emphasize one concept: The external file CONTROLS the Global Variables in the SolidWorks model. (That is why they are greyed out in your first screen shot.) So if you want BoxHeight to change from 20 to 10, you open your text (or Excel) file and make that change. Then CTRL-Q will rebuild your model correctly. If you are NOT using an external file, then the correct place to update BoxHeight is in the Global Variables section of the Equation Editor. Then CTRL-Q will update the model. Note that if you are using Configurations (sheet metal), the Global Variable value can be different in each.

                     

                    From your original post, you do make your change in your external file, but D1@sketch1 does not automatically update. Then SolidWorks tells you BoxHeight already exists. This tells me something in that linkage got corrupted.

                    I suggest you edit D1@sketch1 and REMOVE the link to the Global Variable BoxHeight. Set the dimension to 20. Save & close the model, then open it again.

                    Go back and edit D1@sketch1 and ADD the link to the Global Variable BoxHeight. It should now be 10.

                     

                    If that doesn't work, please send me the file.

                    Bill

                  • Re: Part dimension not updating to global variable equation
                    Vladimir Urazhdin

                    This is the known issue since SW 2015:

                    SW 2016 issue. Links between components Global Variables in assembly are broken.

                    SPR 895813 is still open: changing the value of global variable equation in assembly does not update it on the part.

                    • Re: Part dimension not updating to global variable equation
                      Vladimir Urazhdin

                      Yes, in fact links between Global Variables Assemblies <-> Sub Assemblies are broken too.