4 Replies Latest reply on Nov 25, 2013 10:08 AM by Paal Eilertsen

    Problem saving as tif

    Paal Eilertsen

      Hi,

       

      I have some code that saves an assembly view as a tif. During the automated process the window with the view is resized to fit a specific dimension and the user is asked to zoom the view to a desired zoom level. The code then saves the assembly as a tif. My problem is that with SW 2011 it seems that SW adds additional "canvas" size to the tif. Meaning that the image actually has a different zoom than the original view.

       

      This means that the user must actually crop and resize the image afterwards. Before SW 2011 this was not an issue.

       

      Is there a way to work around this?

       

      I have been thinking that the user can zoom more but then the view is not in the way we want it representet in the image, which seems not that intuitive to do .

       

      Any help would be appreciated!

       

      Best regards

      Pål Eilertsen

        • Re: Problem saving as tif
          Deepak Gupta

          Paal please upload that macro here and someone might be able to debug the issue.

           

          Please use "advanced editor" in case you want to attach any files.Click on reply and then click "use advanced editor".

           

          Editor.png

            • Re: Problem saving as tif
              Paal Eilertsen

              Hi,

               

              The total code is large and complex but I will give an example:

               

              gSWApp.ArrangeWindows(0)

              gSWApp.CreateNewWindow()

              gSWApp.ActiveDoc.ActiveView.FrameState = swConst.swWindowState_e.swWindowNormal

              gSWApp.ActiveDoc.ActiveView.FrameLeft = 0

               

               

              gSWApp.ActiveDoc.ActiveView.FrameTop = 0

              gSWApp.ActiveDoc.ActiveView.FrameWidth = 500

              gSWApp.ActiveDoc.ActiveView.FrameHeight = 700

               

              gMainAssembly.ViewZoomtofit2()

              gSWApp.ActiveDoc.ActiveView.ZoomByFactor(1.7)

              gSWApp.ActiveDoc.ActiveView.ZoomByFactor(1.7)

               

              'message to user to change the view

              MsbBox(message)

               

              gMainAssembly.SaveAs2("file.tif", 0, True, True)

               

              Hope this helps?

              And as I mentioned. This worked fine before with regards to the size of the canvas.

               

              Best regards

              Pål Eilertsen