CAD/CAM discussion forum > CAD > Problems with Polyline

Problems with Polyline

Rank: 1

carlos6360

Newbie

posts: 2

Registered: 2014-6-5

Message 1 of 1

 Problems with Polyline
13-06-2014 07:03 . am | View his/her posts only
Dear. I have problems to create a polyline in VBA

Please, review This rutine
----------------------------------
Public Sub TRIPOLY(Pto1() As Double)
Dim objLayer As ZcadLayer
Dim objPolyLinea As ZcadPolyline
Dim lispto(0 To 11) As Double

lispto(0) = Pto1(0)
lispto(1) = Pto1(1)
lispto(2) = Pto1(2)
lispto(3) = Pto1(0) + 100
lispto(4) = Pto1(1)
lispto(5) = Pto1(2)
lispto(6) = Pto1(0) + 50
lispto(7) = Pto1(1) + 100
lispto(8) = Pto1(2)
lispto(9) = Pto1(0)
lispto(10) = Pto1(1)
lispto(11) = Pto1(2)

Set objPolyLinea = ThisDrawing.ModelSpace.AddPolyline(lispto)'Error 13
Set objLayer = ThisDrawing.Layers.Add("FORMAS")
objPolyLinea.Layer = "FORMAS"
objPolyLinea.color = zcBlue


End Sub
----------------------------------------------
The following error appears:

Run-time error '13':
Type mismatch

objPolyLinea = Nothing


Please help me.
regards
See also