明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1191|回复: 0

[原创][分享]创建出同dli命令创建的一样的标注

[复制链接]
发表于 2008-7-17 00:10:00 | 显示全部楼层 |阅读模式
本帖最后由 作者 于 2010-5-22 16:37:00 编辑
  1. Sub AddDimRotated()
  2.     Dim dimObj As AcadDimRotated
  3.     Dim point1 As Variant
  4.     Dim point2 As Variant
  5.     Dim location As Variant
  6.     Dim rotAngle As Double
  7.     Dim rotAngleNunmer As Integer
  8.      
  9.     rotAngleNunmer = 1
  10.      
  11.     With ThisDrawing.Utility
  12.         point1 = (.GetPoint(, "请指定标注起始点(按Esc或Enter或左健退出):"))
  13.         If IsEmpty(point1) Then Exit Sub
  14.     End With
  15.      
  16.     With ThisDrawing.Utility
  17.         point2 = (.GetPoint(, "请指定标注结束点(按Esc或Enter或左健退出):"))
  18.         If IsEmpty(point2) Then Exit Sub
  19.     End With
  20.      
  21.     With ThisDrawing.Utility
  22.         location = (.GetPoint(, "请指定标注基准点(按Esc或Enter或左健退出):"))
  23.         If IsEmpty(location) Then Exit Sub
  24.     End With
  25.      
  26.     On Error Resume Next
  27.     rotAngleNunmer = ThisDrawing.Utility.GetInteger(vbCrLf & "输入标注位置 [上(1)/下(2)/左(3)/右(4)]: <" & rotAngleNunmer & ">:")
  28.      
  29.     Select Case rotAngleNunmer
  30.         Case 1, 2
  31.             rotAngle = 0
  32.         Case 3, 4
  33.             rotAngle = 90
  34.     End Select
  35.      
  36.     rotAngle = rotAngle * 3.141592 / 180#       ' covert to Radians
  37.      
  38.     Set dimObj = ThisDrawing.ModelSpace.AddDimRotated(point1, point2, location, rotAngle)
  39. End Sub
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-26 07:21 , Processed in 0.135485 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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