Name Data Type Description

LowerLeftCorner Variant A two-element array of doubles specifying in paper units the

X and Y values, measured from the origin, for the lower-left corner of the window to be plotted

UpperRightCorner Variant A two-element array of doubles specifying in paper units the

X and Y values, measured from the origin, for the upper-right corner of the window to be plotted

The following example illustrates how to implement this method by retrieving a window to plot from the user and then plotting that part of the drawing to file:

Public Sub PlotWindow() Dim varLowerLeftCorner As Variant Dim varUpperRightCorner As Variant Dim dblLowerLeftCorner(1) As Double Dim dblUpperRightCorner(1) As Double Dim intCount As Integer Dim strFilename As String

'set the plot type varLowerLeftCorner = ThisDrawing.Utility.GetPoint(, _

"Select lower-left corner of window: ") varUpperRightCorner = ThisDrawing.Utility.GetCorner(varLowerLeftCorner, _

"Select upper-right corner of window: ")

For intCount = 0 To 1

dblLowerLeftCorner(intCount) = CDbl(varLowerLeftCorner(intCount)) dblUpperRightCorner(intCount) = CDbl(varUpperRightCorner(intCount)) Next intCount

ThisDrawing.ActiveLayout.SetWindowToPlot dblLowerLeftCorner, _

dblUpperRightCorner

ThisDrawing.ActiveLayout.PlotType = acWindow 'initiate the plot strFilename = InputBox("Enter a filename to plot to") If strFilename = "" Then Exit Sub

ThisDrawing.Plot.PlotToFile strFilename

End Sub

0 0

Post a comment