嗨,上校
不确定你的意思,但是
希望这会有所帮助,只需在屏幕上选择点即可
- Public Sub DrawMLineDynamicaly()
- ' partially borrowed from Tony Tanzillo's 'Getpoint' function
- Dim pickPt As Variant
- Dim mlCoords() As Double
- Dim i As Integer
- Dim oMline As AcadMLine
- i = 0
- On Error Resume Next
- pickPt = ThisDrawing.Utility.GetPoint(, vbCr & "First point: ")
- If Err = 0 Then
- ReDim mlCoords(2)
- mlCoords(i) = pickPt(0): mlCoords(i + 1) = pickPt(1): mlCoords(i + 2) = 0#
- Do Until Err.Number <> 0
- i = i + 3
- pickPt = ThisDrawing.Utility.GetPoint(pickPt, vbCr & "Pick next point or press Enter to stop: ")
- ReDim Preserve mlCoords(UBound(mlCoords) + 3)
- mlCoords(i) = pickPt(0): mlCoords(i + 1) = pickPt(1): mlCoords(i + 2) = 0#
- If oMline Is Nothing Then
- Set oMline = ThisDrawing.ModelSpace.AddMLine(mlCoords)
- oMline.Update
- Else
- oMline.Coordinates = mlCoords
- oMline.Update
- End If
- Loop
- End If
- End Sub
~'J'~ |