liyanchao1 发表于 2004-2-23 11:54:00

如何从固定点到当前鼠标的位置画一条多段线

请教各位大哥,如何从一个固定点到当前的鼠标的位置画一条多段线?谢谢指教!

liyanchao1 发表于 2004-2-23 12:02:00

如果要画一条从固定点到当前鼠标位置的多段线,并且让它随着鼠标的移动而变化,该怎磨办?

myfreemind 发表于 2004-2-23 12:27:00

Sub ll()<BR>Dim p1(0 To 2) As Double<BR>Dim p2 As Variant<BR>Dim pntobj As Variant


Dim lobj As AcadLine


p1(0) = 100<BR>p1(1) = 100<BR>p1(2) = 0


p2 = ThisDrawing.Utility.GetPoint(p1, "p2")


       


Set lobj = ThisDrawing.ModelSpace.AddLine(p1, p2)


End Sub

myfreemind 发表于 2004-2-23 12:30:00

呵呵,没看清楚,上面那个是直线,这个才是多段线


Sub ll()<BR>Dim p1(0 To 2) As Double<BR>Dim p2 As Variant<BR>Dim pntobj As Variant


Dim lobj As AcadLWPolyline<BR>Dim vers(0 To 3) As Double


'p1(0) = 100<BR>'p1(1) = 100<BR>'p1(2) = 0


p2 = ThisDrawing.Utility.GetPoint(p1, "p2")


vers(0) = 100<BR>vers(1) = 100<BR>vers(2) = p2(0)<BR>vers(3) = p2(1)


Set lobj = ThisDrawing.ModelSpace.AddLightWeightPolyline(vers)


End Sub<BR>
页: [1]
查看完整版本: 如何从固定点到当前鼠标的位置画一条多段线