- UID
- 76071
- 积分
- 1505
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2003-8-30
- 最后登录
- 1970-1-1
|
发表于 2004-9-19 13:11:39
|
显示全部楼层
Public Sub test111()
Dim pnt
Dim dot(2) As Double
Dim angle As Double
Dim oBlock As AcadBlock
Dim oUcs As AcadUCS
Set oBlock = ThisDrawing.Blocks.Add(dot, "*U")
Dim p1
p1 = ThisDrawing.Utility.PolarPoint(dot, Atn(1), 10)
oBlock.AddLine dot, p1
pnt = ThisDrawing.Utility.GetPoint
angle = ThisDrawing.Utility.GetAngle(pnt)
ThisDrawing.ModelSpace.InsertBlock pnt, oBlock.Name, 1, 1, 1, angle
Set oUcs = ThisDrawing.UserCoordinateSystems.Add(pnt, ThisDrawing.Utility.PolarPoint(pnt, angle, 1), ThisDrawing.Utility.PolarPoint(pnt, angle + Atn(1) * 2, 1), "Test")
Dim oEntitys(0) As AcadEntity
Set oEntitys(0) = oBlock(0)
a = ThisDrawing.CopyObjects(oEntitys, ThisDrawing.ModelSpace)
Set oEntitys(0) = a(0)
oEntitys(0).TransformBy oUcs.GetUCSMatrix
a = oEntitys(0).EndPoint
MsgBox a(0)
oUcs.Delete
End Sub
好像复杂了一点,其实可以用ThisDrawing.Utility.PolarPoint解决好像简单一些 |
|