如何 通过直线外一点 绘制与该直线成一定角度的 直线?
各位高人,请帮忙! 如何通过直线外一点 绘制与该直线成一定角度的 直线? 如下图,如何求出直线2啊?请不吝赐教!!谢谢。http://bbs.mjtd.com/data/attachment/album/201408/19/145751jddn04j52pd4zcwt.jpg 你是问数学问题,还是编程代码?
最好是 能够执行的VBA/VB/ActiveX/API 编程代码,给个思路 已感谢不尽了!!! 当然应该是在 autocad 环境中的VBA/VB/ActiveX/API 编程!!! 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
大致是这样 谢谢 您的回复, 算法搞通后,写程序就快了!
页:
[1]