这个DWG文档究竟设置了什么打印导致范围大幅度偏移?
Sub Example_SetWindowToPlot()' This example allows the user to define an area in the current layout
' and displays a plot preview of the defined area.
'
' * Note: You have to exit the
' plot preview before the VBA example will stop and control will be returned
Dim point1 As Variant, point2 As Variant
' Get first point in window
point1 = ThisDrawing.Utility.GetPoint(, "Click the lower-left of the window to plot.")
ReDim Preserve point1(0 To 1) ' Change this to a 2D array by removing the Z position
' Get second point in window
point2 = ThisDrawing.Utility.GetPoint(, "Click the upper-right of the window to plot.")
ReDim Preserve point2(0 To 1) ' Change this to a 2D array by removing the Z position
' Send information about window to current layout
ThisDrawing.ActiveLayout.SetWindowToPlot point1, point2
' Read back window information
ThisDrawing.ActiveLayout.GetWindowToPlot point1, point2
MsgBox "Press any key to plot the following window:" & vbCrLf & vbCrLf & _
"Lower Left: " & point1(0) & ", " & point1(1) & vbCrLf & _
"Upper Right: " & point2(0) & ", " & point2(1)
' Be sure to plot a view, not some other plot style
ThisDrawing.ActiveLayout.PlotType = acWindow
' Send Plot To Window
ThisDrawing.Plot.DisplayPlotPreview acFullPreview
End Sub
用上面这个示例代码测试一般的图档,打印范围是正确的。但是打印我附件上的这个文件就大幅度的偏移,各位大侠帮我找找原因究竟设置了什么情况。
我错了个自动打印图框的插件,在工作中时不时会遇到一些图档打印偏位,导致这个功能无法正常使用。在以往遇到这种情况我是把这个图档上所有内容CTRL+C复制到新建的一个CAD文档中后正常使用。所以我断定是这个图档内部设置了什么东西。但是一直都没有找出来。苦惑我5年之久了!!!!!
CAD2004到2012我都试过,结果是一样的!!
可能原因,图形界线(limits)的问题,也有可能是教育版的问题 我觉得不是你说的这样的问题 我感觉应该将世界坐标转换成打印坐标。 怎么转换打印的坐标! PtMax_UCS = ThisDrawing.Utility.TranslateCoordinates(ptMax, acWorld, acDisplayDCS, False) '将世界坐标(WCS)转换为显示坐标(DCS) 还是不行!!! 我觉得不是坐标的问题。应该是哪个变量出了问题。或者是内存出了问题! 如果手动打印设置不偏移,而用自己写的代码打印发生偏移,我感觉就是坐标问题,仔细查查TranslateCoordinates的用法看看,打印坐标是2维的。 其他图档没有问题。就这个图档有问题。你说是什么问题。还是代码的问题吗?
页:
[1]
2