乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 169|回复: 9

这个DWG文档究竟设置了什么打印导致范围大幅度偏移?

[复制链接]

24

主题

59

帖子

6

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
155
发表于 2014-8-5 19:17:00 | 显示全部楼层 |阅读模式
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我都试过,结果是一样的!!

本帖以下内容被隐藏保护;需要你回复后,才能看到!

游客,如果您要查看本帖隐藏内容请回复
回复

使用道具 举报

23

主题

561

帖子

13

银币

中流砥柱

Rank: 25

铜币
653
发表于 2014-8-6 11:23:00 | 显示全部楼层
可能原因,图形界线(limits)的问题,也有可能是教育版的问题
回复

使用道具 举报

24

主题

59

帖子

6

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
155
发表于 2014-8-6 14:15:00 | 显示全部楼层
我觉得不是你说的这样的问题
回复

使用道具 举报

13

主题

59

帖子

2

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
111
发表于 2014-8-14 23:47:00 | 显示全部楼层
我感觉应该将世界坐标转换成打印坐标。
回复

使用道具 举报

24

主题

59

帖子

6

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
155
发表于 2014-8-23 14:00:00 | 显示全部楼层
怎么转换打印的坐标!
回复

使用道具 举报

3

主题

58

帖子

2

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2014-8-24 15:06:00 | 显示全部楼层
PtMax_UCS = ThisDrawing.Utility.TranslateCoordinates(ptMax, acWorld, acDisplayDCS, False)            '将世界坐标(WCS)转换为显示坐标(DCS)
回复

使用道具 举报

24

主题

59

帖子

6

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
155
发表于 2014-10-26 10:58:00 | 显示全部楼层
还是不行!!!
回复

使用道具 举报

24

主题

59

帖子

6

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
155
发表于 2014-10-26 10:58:00 | 显示全部楼层
我觉得不是坐标的问题。应该是哪个变量出了问题。或者是内存出了问题!
回复

使用道具 举报

13

主题

59

帖子

2

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
111
发表于 2014-10-26 12:59:00 | 显示全部楼层
如果手动打印设置不偏移,而用自己写的代码打印发生偏移,我感觉就是坐标问题,仔细查查TranslateCoordinates的用法看看,打印坐标是2维的。
回复

使用道具 举报

24

主题

59

帖子

6

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
155
发表于 2014-11-27 08:56:00 | 显示全部楼层
其他图档没有问题。就这个图档有问题。你说是什么问题。还是代码的问题吗?
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-4-20 15:14 , Processed in 1.878182 second(s), 78 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表