9 Replies Latest reply on Dec 12, 2013 1:41 PM by Matt Martens

    Edit Sheet Format Event Trigger???

    Shawn Pantzke

      Good day all,

       

      Does anyone out there know of an event trigger for edit sheet format? Basically I want to trigger a routine that tells users NO!! when they try to edit the sheet format of a drawing.

       

      Thaks in advance,

       

      SLP

        • Re: Edit Sheet Format Event Trigger???
          Matt Martens

          There does not appear to be anything for edit sheet format.

            • Re: Edit Sheet Format Event Trigger???
              Simon Turner

              I notice that CommandOpenPreNotify gets fired with Command=1501

              Not sure if that uniquely identifies that operation though.

                • Re: Edit Sheet Format Event Trigger???
                  Shawn Pantzke

                  Simon,

                   

                  Thanks for the idea. I have been playing with it this morning and it seems to work, have not tested extensively to see if there are any side effects.

                   

                  I can get the function to fire when the edit sheet format command is called, but now I would like to give the user an input box to enter a password and if the password is incorrect, all done to this point, kill the command to edit sheet format

                   

                  If this was a PostNotify, which there does not seem to be one, I would just exit editor, since this is a PreNotify the Editor is not yet open. So the bigger question would be is there a way to cancel the current command?

                   

                  Thanks,

                   

                  SLP

              • Re: Edit Sheet Format Event Trigger???
                Shawn Pantzke

                So here it is. I got it to work. Basically what it does is when a user sends the command to edit sheet format of a drawing an input box asking for the password. If the password is incorrect the drawing will enter the editor, but as soon as something is selected it will exit.

                 

                Basically this will lock down the edit sheet format functionality of SolidWorks to authorized users.

                 

                The larger problem is going to be to get users to run it. Possible an autorun on open or create an application that runs silently in the background on computer startup.

                 

                SLP

                  • Re: Edit Sheet Format Event Trigger???
                    Matt Martens

                    I use an altered shortcut to start SW that automatically runs the attached macro (you can only run a single macro this way). The attached macro basically runs several other macros that have class modules in them. It allows me run multiple macros at startup. You will need to alter the line with swApp.RunMacro to give the correct arguments for your macro.

                     

                    You will also need to alter the shortcuts your coworkers use to open SW in order for the macro to start. There are instructions at the top of the macro for how to alter the shortcut.