工作笔记吧 关注:46贴子:851
  • 2回复贴,共1

【VBA-AutoCAD】发送指令SendCommand和直接代码运行的比较

只看楼主收藏回复



1楼2011-12-07 17:50回复
    '旋转90度并缩放
    ThisDrawing.SendCommand "_rotate" & vbCr & "all" & vbCr & vbCr & "0,0" & vbCr & "90" & vbCr
    '第一种方法:发送命令,效率低
    'ThisDrawing.SendCommand "zoom" & vbCr & "W" & vbCr & "-15,-8" & vbCr & "40,8" & vbCr
    '第二种办法:代码,效率高
    Dim zoomLowLeft(0 To 2) As Double
    Dim zoomUpRight(0 To 2) As Double
    zoomLowLeft(0) = -15
    zoomLowLeft(1) = -8
    zoomLowLeft(2) = 0
    zoomUpRight(0) = 40
    zoomUpRight(1) = 8
    zoomUpRight(2) = 0
    ZoomWindow zoomLowLeft, zoomUpRight


    2楼2011-12-07 17:50
    回复
      赞一个,楼主写的好


      IP属地:新疆3楼2019-04-23 11:09
      回复