明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2481|回复: 1

[VBA]输入弧形长度旋转复制物体

[复制链接]
发表于 2003-11-18 17:00:00 | 显示全部楼层 |阅读模式
本帖最后由 作者 于 2003-11-18 17:22:20 编辑

Sub a1()
On Error Resume Next
Dim obj As AcadObject
Dim P1 As Variant
ThisDrawing.Utility.GetEntity obj, P1, vbCrLf & "请选择要复制的物体:"
If Err Then Exit Sub
Dim cenpnt As Variant
Dim r As Double
cenpnt = ThisDrawing.Utility.GetPoint(, "请选取圆心")
If Err Then Exit Sub
r = ThisDrawing.Utility.GetDistance(cenpnt, "请输入半径:")
If Err Then Exit Sub
Dim dist, du As Double
Dim n As Integer
n = 0
Do While n < 1
   n = ThisDrawing.Utility.GetInteger("请输入复制个数:")
Loop
If Err Then Exit Sub
dist = ThisDrawing.Utility.GetReal("请输入旋转距离:")
If Err Then Exit Sub

du = dist / r
Dim i As Integer
For i = 1 To n
   Set obj = obj.Copy
   obj.Rotate cenpnt, du
Next

End Sub
发表于 2011-6-18 11:55:20 | 显示全部楼层
好东东,学习了~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-29 07:01 , Processed in 0.142985 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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