Bryco 发表于 2008-9-16 13:55:29

相对于用户选择的点绘制Pline

本人'm使用Getpoint标识空间中的x、y、z位置
我希望能够在用户定义的距离和角度相对于我选择的点绘制一条Pline(如“23”lt;45)
有人知道怎么做吗?

Bryco 发表于 2008-9-16 21:21:12

罪恶和罪恶会让你达到目的

Bryco 发表于 2008-9-16 21:57:41


Sub plineinput()
Dim p As AcadLWPolyline
Dim p1, pts(3) As Double
Dim dist As Double, ang As Double
Dim util As AcadUtility
Dim x As Double, y As Double
Set util = ThisDrawing.Utility
p1 = util.GetPoint(, "Pick")
dist = util.GetReal("Length")
ang = util.GetReal("Angle")
ang = ang * Pi / 180 'degrees TO RADIANS
x = Cos(ang) * dist
y = Sin(ang) * dist
pts(0) = p1(0): pts(1) = p1(1)
pts(2) = p1(0) + x: pts(3) = p1(1) + y
Set p = ThisDrawing.ModelSpace.AddLightWeightPolyline(pts)
End Sub
使用@23<45“;您需要解析;字符串返回

Bryco 发表于 2008-9-17 12:14:05

谢谢Bryco!

Bryco 发表于 2008-9-17 19:39:59

不客气。

Bryco 发表于 2008-9-18 14:23:33

ThisDrawing.Utility。PolarPoint也可能是一种选择;如果我正确理解这个问题
页: [1]
查看完整版本: 相对于用户选择的点绘制Pline