AutoCAD:VBA怎么取一条直线的两个端点?!
2个回答
展开全部
Public Sub test()
Dim lobj As AcadObject
Dim sp As Variant
Dim ep As Variant
ThisDrawing.Utility.GetEntity lobj, ep, "请选择一直线:"
If lobj.ObjectName = "AcDbLine" Then
sp = lobj.StartPoint
ep = lobj.EndPoint
MsgBox "直线御知起点坐标X=" & sp(0) & " Y=" & sp(1) & vbCrLf & " 止点团掘坐标X=" & ep(0) & " Y="镇或消 & ep(1)
Else
MsgBox "所选取的不是直线!"
End If
End Sub
Dim lobj As AcadObject
Dim sp As Variant
Dim ep As Variant
ThisDrawing.Utility.GetEntity lobj, ep, "请选择一直线:"
If lobj.ObjectName = "AcDbLine" Then
sp = lobj.StartPoint
ep = lobj.EndPoint
MsgBox "直线御知起点坐标X=" & sp(0) & " Y=" & sp(1) & vbCrLf & " 止点团掘坐标X=" & ep(0) & " Y="镇或消 & ep(1)
Else
MsgBox "所选取的不是直线!"
End If
End Sub
展开全部
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |