下面是代码:
-----------------------------------
'使用点数组创建轻量多段线(number为数组的元素个数)
Public Function AddLPline(ByRef pt() As Double, ByVal number As Integer) As AcadLWPolyline
On Error GoTo errHandle
If number Mod 2 <> 0 Then
MsgBox "数组元素个数必须为偶数!"
End If
Set AddLPline = ThisDrawing.ModelSpace.AddLightWeightPolyline(pt)
Exit Function
errHandle:
MsgBox "数组元素个数与参数不符!"
MsgBox Err.Description
End Function