5 Replies Latest reply on Jan 13, 2015 5:18 AM by None None

    Dont view .PNG API

    None None

      Hello,

      I would like to know if it is possible to not view a .PNG file after saving in a macro.

       

      For a .PDF file is the command:

      swExportPDFData.ViewPdfAfterSaving

       

      Is there a command like this for .PNG?

        • Re: Dont view .PNG API
          Deepak Gupta

          I don't think that has been implemented yet. The best would be to do a save as PNG manually and uncheck that option. After that SW would remember that option. Alternatively you can check the windows registry for that option and can toggle that option.

            • Re: Dont view .PNG API
              None None

              I have found the registry under :HKEY_CURRENT_USER/Software/SolidWorks/SOLIDWORKS 2015/Export Settings/View PNG After Saving

              type:REG_DWORD


              And now the next question

              How can i change the value of the registery in VBA?

                • Re: Dont view .PNG API
                  Deepak Gupta

                  How can i change the value of the registery in VBA?

                  Read and Write Windows Registry with VBA

                  • Re: Dont view .PNG API
                    Keith Rice

                    Hi,

                     

                    I have bad news for you. Even if you modify the registry with your macro, you would have to restart SolidWorks for the change to take effect. When SolidWorks loads, it reads the registry settings at that time. It doesn't read them when a particular event occurs, like saving a PNG. We were experiencing the exact same problem with regards to viewing a PDF after save. To remedy the problem, the SolidWorks API team actually had to create the very API call you referenced, IExportPdfData::ViewPdfAfterSaving. You should write to them and ask them to implement a similar API call for PNG.

                     

                    What would be nice is if they simply created a generic API call that would suppress this action for any save.

                     

                    Keith

                    SolidWorks API Tutorials

                      • Re: Dont view .PNG API
                        None None

                        Hi Keith,

                         

                        That's my problem. If I change the registry value. The changed value will only apply until SolidWorks is rebooted. So the only option is to turn off  "View PNG after saving" manually. I hope there will be a API for this.