找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1072|回复: 0

[求助]:关于vba在cad2005中循环打印的问题(有源码)

[复制链接]
发表于 2006-12-8 22:25:44 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我什么这段循环打印的vba程序在2002中可以使用

而在2005中只能打出一张就报错????

很不解,虚心请教

以下是源码:

Sub 批量打印()
    Dim x As Integer
    Dim i As Integer
    Dim length As Double
    Dim point1 As Variant, point2 As Variant
    Dim point3 As Variant
     Dim Message, Title, Default, MyValue
      point1 = ThisDrawing.Utility.GetPoint(, "请输入左下角点:")
    ReDim Preserve point1(0 To 1)  
   
    point2 = ThisDrawing.Utility.GetPoint(, "请输入右上角点:")
    ReDim Preserve point2(0 To 1)      
    point3 = ThisDrawing.Utility.GetPoint(, "输入第二张图纸左下角点:")
    ReDim Preserve point3(0 To 1)
  length = point3(0) - point1(0)
   
Message = "  输入打印多少张?  "

Title = "提醒:"   
Default = "1"   
x = InputBox(Message, Title, Default)
  For i = 1 To x Step 1
   
    ThisDrawing.ActiveLayout.SetWindowToPlot point1, point2
    ThisDrawing.ActiveLayout.GetWindowToPlot point1, point2
    ThisDrawing.ActiveLayout.PlotType = acWindow
    ThisDrawing.Plot.PlotToDevice        '用默认设置打印到打印机
    point1(0) = point1(0) + length:   point1(1) = point1(1)
    point2(0) = point2(0) + length:   point2(1) = point2(1)
    Next i
End Sub
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-9-28 15:33 , Processed in 0.368633 second(s), 32 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表