[求助]请高手分析:用VBA打印这个文件,打印的不是设好窗口的范围
<p><br/>问题同上,代码如下。打印机选成你的机子上有的打印机,大家可试试。用同样的代码打印别的文件没问题。请高手分析原因。</p><p>Public Sub test()<br/> Dim pLayout As AcadLayout<br/> Dim minPnt(1) As Double<br/> Dim maxPnt(1) As Double<br/> <br/> Set pLayout = ThisDrawing.ActiveLayout<br/> <br/> minPnt(0) = 0: minPnt(1) = 0<br/> maxPnt(0) = 200: maxPnt(1) = 100<br/> pLayout.SetWindowToPlot minPnt, maxPnt<br/> pLayout.PlotType = acWindow<br/> <br/> ThisDrawing.Plot.DisplayPlotPreview acFullPreview<br/>End Sub</p> <p><font face="Verdana">Public Sub test()<br/> Dim pLayout As AcadLayout<br/> Dim minPnt(2) As Double<br/> Dim maxPnt(2) As Double<br/> <br/> Set pLayout = ThisDrawing.ActiveLayout<br/> <br/> minPnt(0) = 0: minPnt(1) = 0<br/> maxPnt(0) = 200: maxPnt(1) = 100</font></p><p><font face="Verdana"></font> </p>
<p><font face="Verdana"> </p>
<p><br/></font><font face="Verdana"> Dim min_Pnt, max_Pnt As Variant<br/> min_Pnt = ThisDrawing.Utility.TranslateCoordinates(minPnt, 0, 3, False)<br/> max_Pnt = ThisDrawing.Utility.TranslateCoordinates(maxPnt, 0, 3, False)<br/> ReDim Preserve min_Pnt(0 To 1)<br/> ReDim Preserve max_Pnt(0 To 1)</font></p>
<p><font face="Verdana"></font> </p>
<p><font face="Verdana"> </p>
<p><br/> pLayout.SetWindowToPlot min_Pnt, max_Pnt<br/> pLayout.PlotType = acWindow<br/> <br/> ThisDrawing.Plot.DisplayPlotPreview acFullPreview<br/>End Sub<br/></p></font> <p>请大家试试,很奇怪,分析一下原因。</p>
页:
[1]