[VBA/VB/C#]efan2000 14:23:36
Sub test()
Dim vl(0 To 7) As Double
vl(2) = 20
vl(4) = 20
vl(5) = 10
vl(7) = 10
Dim lwp As AcadLWPolyline
Set lwp = ThisDrawing.ModelSpace.AddLightWeightPolyline(vl)
'lwp.Closed = True
Debug.Print Now
Dim mc As mcArxProject1Lib.Curve
Set mc = New mcArxProject1Lib.Curve
Dim p(0 To 2) As Double
Dim v As Variant
Debug.Print "getArea: " & mc.getArea(lwp)
Debug.Print "getDistAtParam: " & mc.getDistAtParam(lwp, 2)
p(0) = 10
v = p
Debug.Print "getDistAtPoint: " & mc.getDistAtPoint(lwp, v)
Debug.Print "getEndParam: " & mc.getEndParam(lwp)
v = mc.getEndPoint(lwp)
Debug.Print "getEndPoint: " & v(0) & "," & v(1)
Debug.Print "getParamAtDist: " & mc.getParamAtDist(lwp, 10)
Debug.Print "getParamAtPoint: " & mc.getParamAtPoint(lwp, v)
v = mc.getPointAtDist(lwp, 10)
Debug.Print "getPointAtDist: " & v(0) & "," & v(1)
v = mc.getPointAtParam(lwp, 2)
Debug.Print "getPointAtParam: " & v(0) & "," & v(1)
Debug.Print "getStartParam: " & mc.getStartParam(lwp)
v = mc.getStartPoint(lwp)
Debug.Print "getStartPoint: " & v(0) & "," & v(1)
Debug.Print "isClosed: " & mc.isClosed(lwp)
Debug.Print Now
End Sub
2013-9-24 14:22:41
getArea: 200
getDistAtParam: 30
getDistAtPoint: 10
getEndParam: 3
getEndPoint: 0,10
getParamAtDist: .5
getParamAtPoint: 3
getPointAtDist: 10,0
getPointAtParam: 20,10
getStartParam: 0
getStartPoint: 0,0
isClosed: False
2013-9-24 14:22:41 |