Visual Basic Customization

Visual Basic Customization

Reply
*TomD
Message 1 of 5 (294 Views)

SetWindowToPlot Coordinates

294 Views, 4 Replies
11-30-2006 01:16 PM
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.
*TomD
Message 2 of 5 (294 Views)

Re: SetWindowToPlot Coordinates

11-30-2006 01:47 PM in reply to: *TomD
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.
Distinguished Contributor
yiginiamre
Posts: 207
Registered: ‎03-09-2005
Message 3 of 5 (294 Views)

Re: SetWindowToPlot Coordinates

05-14-2008 08:55 AM in reply to: *TomD
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
Active Contributor
absStructural
Posts: 36
Registered: ‎07-15-2010
Message 4 of 5 (208 Views)

Re: SetWindowToPlot Coordinates

01-29-2013 03:03 PM in reply to: *TomD

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.

Active Contributor
absStructural
Posts: 36
Registered: ‎07-15-2010
Message 5 of 5 (205 Views)

Re: SetWindowToPlot Coordinates

01-29-2013 03:44 PM in reply to: absStructural

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.

Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.