VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SetWindowToPlot Coordinates

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
933 Views, 5 Replies

SetWindowToPlot Coordinates

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.
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

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.
Message 3 of 6
yiginiamre
in reply to: Anonymous

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
Message 4 of 6
absStructural
in reply to: Anonymous

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.

Message 5 of 6

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.

Message 6 of 6
lbhthriller
in reply to: absStructural

Thank you very much for your answer!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost