I am having a problem using printout2. When I run the macroit prints all sheets of the drawing. I have set the pageArray to 0,but I still get all pages plotting. What am I doing wrong? See code
Sub main()
Dim printer As String
Dim pageArray(0) As Long
pageArray(0) = 0
Set swApp = Application.SldWorks
Set model = swApp.ActiveDoc
Set swDraw = model
Set swSheet = swDraw.GetCurrentSheet
Call saveAsJPG
Debug.Print model.printer
Set ps = model.PageSetup
size = swSheet.GetSize(width, height)
width = Round(width * 39.36996, 2)
height = Round(height * 39.36996, 2)
If width = 17 And height = 11 Then
model.printer = "Engineering LaserJet"
printer = "Engineering LaserJet"
ps.PrinterPaperSize = bSize
ps.DrawingColor = 3
ps.Orientation = 2
End If
model.Extension.PrintOut2 pageArray, 1, True, printer, ""
end sub
Thanks
BryanSolidworksApi macros
Sub main()
Dim printer As String
Dim pageArray(0) As Long
pageArray(0) = 0
Set swApp = Application.SldWorks
Set model = swApp.ActiveDoc
Set swDraw = model
Set swSheet = swDraw.GetCurrentSheet
Call saveAsJPG
Debug.Print model.printer
Set ps = model.PageSetup
size = swSheet.GetSize(width, height)
width = Round(width * 39.36996, 2)
height = Round(height * 39.36996, 2)
If width = 17 And height = 11 Then
model.printer = "Engineering LaserJet"
printer = "Engineering LaserJet"
ps.PrinterPaperSize = bSize
ps.DrawingColor = 3
ps.Orientation = 2
End If
model.Extension.PrintOut2 pageArray, 1, True, printer, ""
end sub
Thanks
BryanSolidworksApi macros