Message 1 of 9
Problem using PlotWindow with PlotToDevice - prints wrong
Not applicable
09-18-2000
10:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am writing a batch plot utility in VBA for AutoCAD 14.01. It has to be
able to handle a couple of different titleblock sizes. Each titleblock size
already has a configuration set up in the Preferences menu with their
respective paper sizes, rotations, line weights, etc. I was thinking all I
would have to do is set the PlotWindow size and then send it through the
correct configuration with PlotToDevice, but apparently I was mistaken. I
have monitored all the values calculated for the two window corners for each
drawing and verified both corners are calculated perfectly. LLcorner is
initialized to the insertion point of the block and URcorner is derived from
LLcorner, the titleblock width and height and the titleblock scale. When
the drawings print, though, the area printed does not match the values
assigned in PlotWindow. I've gone through the code numerous times and have
exhausted all logical reasoning (which is probably my problem...I'm thinking
too logically). I've also tried placing a Sleep command before PlotToDevice
thinking maybe the code executed too fast for the PlotWindow values to be
set before plotting the drawing, but it had no noticeable effect. Any
suggestions or help would be very much appreciated. TIA.
Select Case TBSize
Case "Bsize"
LLcorner(0) = LLcorner(0) + 0.375 * insScale
URcorner(0) = LLcorner(0) + 16.1875 * insScale: URcorner(1) =
LLcorner(1) + 10.59375 * insScale: URcorner(2) = LLcorner(2)
ThisDrawing.Plot.PlotWindow LLcorner, URcorner
ThisDrawing.Plot.PlotToDevice "BSize"
Case "AsizeP"
URcorner(0) = LLcorner(0) + 10 * insScale: URcorner(1) = LLcorner(1)
+ 7.875 * insScale: URcorner(2) = LLcorner(2)
ThisDrawing.Plot.PlotWindow LLcorner, URcorner
ThisDrawing.Plot.PlotToDevice "85X11P"
Case "AsizeL"
URcorner(0) = LLcorner(0) + 7.875 * insScale: URcorner(1) =
LLcorner(1) + 10 * insScale: URcorner(2) = LLcorner(2)
ThisDrawing.Plot.PlotWindow LLcorner, URcorner
ThisDrawing.Plot.PlotToDevice "85X11L"
Case "Dsize"
URcorner(0) = LLcorner(0) + 21.6 * insScale: URcorner(1) =
LLcorner(1) + 32.4 * insScale: URcorner(2) = LLcorner(2)
ThisDrawing.Plot.PlotWindow LLcorner, URcorner
ThisDrawing.Plot.PlotToDevice "CheckD"
End Select
M.E.T.
able to handle a couple of different titleblock sizes. Each titleblock size
already has a configuration set up in the Preferences menu with their
respective paper sizes, rotations, line weights, etc. I was thinking all I
would have to do is set the PlotWindow size and then send it through the
correct configuration with PlotToDevice, but apparently I was mistaken. I
have monitored all the values calculated for the two window corners for each
drawing and verified both corners are calculated perfectly. LLcorner is
initialized to the insertion point of the block and URcorner is derived from
LLcorner, the titleblock width and height and the titleblock scale. When
the drawings print, though, the area printed does not match the values
assigned in PlotWindow. I've gone through the code numerous times and have
exhausted all logical reasoning (which is probably my problem...I'm thinking
too logically). I've also tried placing a Sleep command before PlotToDevice
thinking maybe the code executed too fast for the PlotWindow values to be
set before plotting the drawing, but it had no noticeable effect. Any
suggestions or help would be very much appreciated. TIA.
Select Case TBSize
Case "Bsize"
LLcorner(0) = LLcorner(0) + 0.375 * insScale
URcorner(0) = LLcorner(0) + 16.1875 * insScale: URcorner(1) =
LLcorner(1) + 10.59375 * insScale: URcorner(2) = LLcorner(2)
ThisDrawing.Plot.PlotWindow LLcorner, URcorner
ThisDrawing.Plot.PlotToDevice "BSize"
Case "AsizeP"
URcorner(0) = LLcorner(0) + 10 * insScale: URcorner(1) = LLcorner(1)
+ 7.875 * insScale: URcorner(2) = LLcorner(2)
ThisDrawing.Plot.PlotWindow LLcorner, URcorner
ThisDrawing.Plot.PlotToDevice "85X11P"
Case "AsizeL"
URcorner(0) = LLcorner(0) + 7.875 * insScale: URcorner(1) =
LLcorner(1) + 10 * insScale: URcorner(2) = LLcorner(2)
ThisDrawing.Plot.PlotWindow LLcorner, URcorner
ThisDrawing.Plot.PlotToDevice "85X11L"
Case "Dsize"
URcorner(0) = LLcorner(0) + 21.6 * insScale: URcorner(1) =
LLcorner(1) + 32.4 * insScale: URcorner(2) = LLcorner(2)
ThisDrawing.Plot.PlotWindow LLcorner, URcorner
ThisDrawing.Plot.PlotToDevice "CheckD"
End Select
M.E.T.