Community
Solved! Go to Solution.
Solved by mario.lung. Go to Solution.
The only way I have got it working is to get the size of the active sheet, open a new window for that drawing (duplicate window), re-size the new window to the size of the sheet then zoom to about 101% so you don't get any of the page border.
It's not a perfect solution but It works without any noticeable effects.
Regards, Matt.
Hey, with your keywords i found this Code and it works perfect!
' Saves the active sheet as a bmp. ' Resolution - Specifies the output resolution of the bitmap in pixels per inch. ' Filename - Specifies the output filename. It should have a .bmp extension. Public Sub SaveDrawingAsBMP() Dim Resolution As Long Dim Filename As String Resolution = 400 Filename = "c:\temp\test.png" ' Get the active view. Dim oView As View Set oView = ThisApplication.ActiveView ' Determine if a drawing is active. If Not oView.Document.DocumentType = kDrawingDocumentObject Then MsgBox "A drawing must be active when running this macro." Exit Sub End If ' Get the drawing document and the active sheet. Dim oDoc As DrawingDocument Set oDoc = oView.Document Dim oSheet As Sheet Set oSheet = oDoc.ActiveSheet ' Change the size of the window so it has the same aspect ratio ' as the sheet. It changes the view such that it becomes smaller. oView.WindowState = kNormalWindow Dim dSheetAspectRatio As Double dSheetAspectRatio = oSheet.Width / oSheet.Height Dim dViewAspectRatio As Double dViewAspectRatio = oView.Width / oView.Height If dSheetAspectRatio > dViewAspectRatio Then oView.Width = oView.Height / dSheetAspectRatio Else oView.Height = oView.Width / dSheetAspectRatio End If ' Get the camera and use it to zoom in so only the sheet is seen. Dim oCamera As Camera Set oCamera = oView.Camera oCamera.Target = ThisApplication.TransientGeometry.CreatePoint(oSheet.Width / 2, oSheet.Height / 2, 0) oCamera.Eye = ThisApplication.TransientGeometry.CreatePoint(oCamera.Target.X, oCamera.Target.Y, 1) Call oCamera.SetExtents(oSheet.Width, oSheet.Height) oCamera.ApplyWithoutTransition ' Determine the number of pixels wide the output needs to be ' to result in the desired resolution. Dim lWidth As Long lWidth = (oSheet.Width / 2.54) * Resolution ' Save the bitmap. Call oView.SaveAsBitmap(Filename, lWidth, 0) End Sub