4 Replies Latest reply on Jul 9, 2010 3:35 PM by Deepak Gupta

    Macro/Scripting help

    Damon Frashure

      Hi!  I'm new to the forums (and to my company).  I was hoping that someone could offer some help in setting up a script that will go through a directory, open every part and assembly file, set them to dimetric, save, and close the file.  For some reason, about half the files in the directory I inhereted are zoomed so far in that I can't actually tell what it is from the thumbnail.  Any help in the way of a script, or just pointing in the right direction would be greatly appreciated!  Thanks!

        • Re: Macro/Scripting help
          Charles Culp

          Which version of SolidWorks was used to create these documents?

           

          Newer (2008+? I'm guessing) versions will all save the thumbnail from the same view, much as you are trying to do with a macro. So a macro is not nessisary. You can use the task scheduler to just open, and resave these documents to the current version (2010 I hope). Then they will all be showing the same view at full size.

           

          Start Menu>Programs>SolidWorks>SolidWorks Tools>SolidWorks Task Scheduler. There should be an option for Convert Files, and you can set it up to run overnight (that is why it is in the task scheduler).

            • Re: Macro/Scripting help
              Damon Frashure

              We had been using 2007, but have just started slowly migrating to 2010.  I've got the task scheduled for right when I leave tonight, so hopefully that will do the trick for the thumbnails.  I would still like to reset though the view in the model to dimetric though if there's a way to do that too.

               

              Thanks!

                • Re: Macro/Scripting help
                  Charles Culp

                  Damon,

                   

                  I suppose a macro could be written to do this, but here is something else that might be just as easy, and doesn't require writing any code.

                   

                  There are already hot keys set up for different views. CTRL+1 is front, CTRL+4 is right, etc (if you use the number pad then it makes sense). CTRL+7 is isometric, so you can just hit CTRL+7 whenever you open up a new part file. If you really want dimetric, and not isometric, you can make your own hotkey. Go to Tools>Customize>Keyboard, then under "Search for" type "dimetric". Then if you click in the "Shortcut(s)" box, you can type in your own shortcut key to choose the dimetric view. Just use this shortcut key whenever you open up a part/assembly file.

              • Re: Macro/Scripting help
                Deepak Gupta

                Here is a macro if need one Zoom and Rebuild