- Public Sub ss()
- Dim obj As AcadEntity, pt As Variant
- ThisDrawing.Utility.GetEntity obj, pt, "选择直线:"
- Dim objL As AcadLine, objL2 As AcadLine, pt1 As Variant, dblLen As Double, dblRA As Double, pt2(2) As Double
- If obj.ObjectName = "AcDbLine" Then
- Set objL = obj
- pt1 = ThisDrawing.Utility.GetPoint(pt, "选择点:")
- dblLen = ThisDrawing.Utility.GetDistance(pt1, "输入距离:")
- dblRA = ThisDrawing.Utility.GetAngle(pt1, "输入夹角(角度制):")
- pt2(0) = pt1(0) + dblLen * Cos(dblRA + objL.Angle)
- pt2(1) = pt1(1) + dblLen * Sin(dblRA + objL.Angle)
- Set objL2 = ThisDrawing.ModelSpace.AddLine(pt1, pt2)
- End If
- End Sub
大致是这样 |