Jump to content

Plot Window Help


Olhado_

Recommended Posts

So, I know the attached code is pretty hard to read since I am getting my points from a LISP file (I know it better); but I am hoping someone can help me with a "Procedure Call request or arguement" error.

 

I get the error at the "SetWindowToPlot" line and I believe it has something to do with how UpperRight and LowerLeft is structured. I cannot see it.

 

Can anyone help, with the code I have available?

 

Sub PrintLock()
   Dim LowerLeft(0 To 1) As Variant
   Dim UpperRight(0 To 1) As Variant
   Dim blkName As String
   Dim Printer As String
   Dim PaperSize As String

   ' Get the Title Block Name defined from LISP routine
   blkName = Application.ActiveDocument.GetVariable("USERS1")

   ' Get the Upper Right Point of the Window defined from LISP routine
   UpperRight(0) = Application.ActiveDocument.GetVariable("USERR1")
   UpperRight(1) = Application.ActiveDocument.GetVariable("USERR2")

   ' Get the Lower Left Point of the Window defined from LISP routine
   LowerLeft(0) = Application.ActiveDocument.GetVariable("USERR3")
   LowerLeft(1) = Application.ActiveDocument.GetVariable("USERR4")

   MsgBox "Title Block: " & blkName & vbCr & _
          "Lower Left Point: " & LowerLeft(0) & " x " & LowerLeft(1) & vbCr & _
          "Upper Right Point: " & UpperRight(0) & " x " & UpperRight(1)

   Printer = "Adobe PDF"
   PaperSize = "User124" ' This is for ANSI F of the Adobe Printer

   Application.ActiveDocument.ActiveLayout.ConfigName = Printer

   Application.ActiveDocument.ActiveLayout.StyleSheet = "monochrome.ctb"
   Application.ActiveDocument.ActiveLayout.CenterPlot = True
   Application.ActiveDocument.ActiveLayout.StandardScale = ac1_1
   Application.ActiveDocument.ActiveLayout.SetWindowToPlot LowerLeft, UpperRight
   Application.ActiveDocument.ActiveLayout.GetWindowToPlot LowerLeft, UpperRight
   Application.ActiveDocument.ActiveLayout.PlotType = acWindow
   Application.ActiveDocument.ActiveLayout.CanonicalMediaName = PaperSize

   Application.ActiveDocument.ActiveLayout.RefreshPlotDeviceInfo
   Application.ActiveDocument.Plot.DisplayPlotPreview acFullPreview

End Sub

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...