SetWindowToPlot Coordinates

SetWindowToPlot Coordinates

Anonymous
Not applicable
1,689 Views
5 Replies
Message 1 of 6

SetWindowToPlot Coordinates

Anonymous
Not applicable
Does anyone know a reason that 9000 or so would be added to coordinates
passed to SetWindowToPlot?

ThisDrawing.ActiveLayout.RefreshPlotDeviceInfo
Set oPltConf = ThisDrawing.PlotConfigurations("DwfExport")
With oPltConf
.PlotType = acWindow
.SetWindowToPlot dLowLt, dUprRt
.UseStandardScale = True
.StandardScale = acScaleToFit
End With

If I do a -PLOT at the command line, the coordinates are 'shifted' from what
was passed. I've verified this by drawing a line to the points used above.
No UCSs are present...........I'm stumped. The distance between the lower
left/upper right is good.........just shifted 9000 units.
0 Likes
1,690 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
In case anyone else stumbles across something like this, the following 'work
around' does work, but I would like to know the true answer to the original
post

Dim sPlotString As String
sPlotString = "-plot yes" & vbCr & vbCr & vbCr & vbCr & vbCr & vbCr &
vbCr & vbCr & _
Format(dLowLt(0), "0.00") & "," & Format(dLowLt(1),
"0.00") & vbCr & _
Format(dUprRt(0), "0.00") & "," & Format(dUprRt(1),
"0.00") & vbCr & _
vbCr & vbCr & vbCr & vbCr & vbCr & vbCr & _
sDwfNam & vbCr
If Dir(sDwfNam) <> "" Then sPlotString = sPlotString & "Y" & vbCr
sPlotString = sPlotString & "n" & vbCr & "y" & vbCr
ThisDrawing.SendCommand sPlotString

While googling this problem earlier this afternoon I came across an old
(several years) post of mine about a similar issue. I've used the
SetWindowToPlot in a couple of other macros without problem since then, so
I'm wondering what I'm missing with all of this.
0 Likes
Message 3 of 6

Anonymous
Not applicable
Hay Tom,

The year is 2008, the month is May and the cad version is AutoCAD 2008.

Guess what, I just spent five days trying to solve the same problem. So I guess Autodesk well fix this problem in the AutoCAD 3008.

Thanks for the Post Tom.

-J
0 Likes
Message 4 of 6

absStructural
Enthusiast
Enthusiast

1-29-2013, using AutoCAD 2012... and I'm experiencing this issue on 'some' drawings.  Again, no UCS is present... it just doesn't make any sense.

0 Likes
Message 5 of 6

absStructural
Enthusiast
Enthusiast

Well - in case anyone else runs across this... I found the answer here: http://forums.autodesk.com/t5/Visual-Basic-Customization/ActiveX-SetPlotWindow/td-p/321369 

 

In short, SetWindowToPlot expects the values in DCS (Display Coordinate System).  DCS is not always equal to WCS - so you have to translate the points from WCS to DCS.  I am still a bit puzzled by the fact that 95% of the time (if not more) DCS == WCS.

0 Likes
Message 6 of 6

lbhthriller
Community Visitor
Community Visitor
Thank you very much for your answer!
0 Likes