.NET

Reply
*Darienas
Message 1 of 8 (204 Views)

Creating polyline

204 Views, 7 Replies
06-14-2005 02:40 AM

Hi I trying to create  polyline but Vb.net
show mee eror what is wrong in my code

thanks


Dim

line As
size=2> AutoCAD.Common.AcadLine


Dim stpoint(1),
endpoint(1)
As
Object


stpoint(0) = 0


stpoint(1) = 0


endpoint(0) = 1000


endpoint(1) = 1000


line = m_oAeccDoc2.ModelSpace.AddLine(stpoint,
endpoint)

*Albert Szilvasy
Message 2 of 8 (203 Views)

Re: Creating polyline

06-14-2005 10:31 AM in reply to: *Darienas

You need 3D points.

 

Albert


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


Hi I trying to create  polyline but Vb.net
show mee eror what is wrong in my code

thanks


Dim

line
size=2>As
AutoCAD.Common.AcadLine


Dim stpoint(1),
endpoint(1)
As
Object


stpoint(0) = 0


stpoint(1) = 0


endpoint(0) = 1000


endpoint(1) = 1000


line = m_oAeccDoc2.ModelSpace.AddLine(stpoint,
endpoint)

*Darienas
Message 3 of 8 (203 Views)

Re: Creating polyline

06-14-2005 09:32 PM in reply to: *Darienas



it must bee like now ? and mabe you know how to create
3dpolyline?


Dim

line As
size=2> AutoCAD.Common.AcadLine


Dim stpoint(2),
endpoint(2)
As
Object


stpoint(0) = 0


stpoint(1) = 0


stpoint(2) = 0


endpoint(0) = 1000


endpoint(1) = 1000


endpoint(2) = 1000


line = m_oAeccDoc2.ModelSpace.AddLine(stpoint,
endpoint)



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


You need 3D points.

 

Albert


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


Hi I trying to create  polyline but Vb.net
show mee eror what is wrong in my code

thanks


Dim

line
size=2>As
AutoCAD.Common.AcadLine


Dim stpoint(1),
endpoint(1)
As
Object


stpoint(0) = 0


stpoint(1) = 0


endpoint(0) = 1000


endpoint(1) = 1000


line = m_oAeccDoc2.ModelSpace.AddLine(stpoint,
endpoint)

*Albert Szilvasy
Message 4 of 8 (203 Views)

Re: Creating polyline

06-14-2005 09:39 PM in reply to: *Darienas

No, I think you also need to declare your arrays as
Double:

Dim
stpoint(2), endpoint(2)
As
Double

 

Yes, I know how to create a
3dpolyline.

 

Albert


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">




it must bee like now ? and mabe you know how to create
3dpolyline?


Dim

line
size=2>As
AutoCAD.Common.AcadLine


Dim stpoint(2),
endpoint(2)
As
Object


stpoint(0) = 0


stpoint(1) = 0


stpoint(2) = 0


endpoint(0) = 1000


endpoint(1) = 1000


endpoint(2) = 1000


line = m_oAeccDoc2.ModelSpace.AddLine(stpoint,
endpoint)



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


You need 3D points.

 

Albert


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


Hi I trying to create  polyline but
Vb.net show mee eror what is wrong in my code

thanks


Dim

line
size=2>As
AutoCAD.Common.AcadLine


Dim stpoint(1),
endpoint(1)
As
Object


stpoint(0) = 0


stpoint(1) = 0


endpoint(0) = 1000


endpoint(1) = 1000


line = m_oAeccDoc2.ModelSpace.AddLine(stpoint,
endpoint)

*Darienas
Message 5 of 8 (203 Views)

Re: Creating polyline

06-14-2005 10:58 PM in reply to: *Darienas


Hi ,


Now I taing create 3D poline, I have the array
of  3d points, but hee dont crete mee the array, the eror is in the last
line, where is the problem,


thanks


Albert Szilvasy


 


Dim

asis As
size=2> AutoCAD.Common.Acad3DPolyline



Dim taskas(2)
As
color=#0000ff size=2>Double


Dim i, j
color=#0000ff size=2>As

size=2>Integer


Dim atstumas,
atstumas1, bx, bby, z1, cx, cy, z2

size=2>As

size=2>Double


oSites = m_oAeccDoc.Sites


Site = oSites.Item(ComboBox1.Text)


trasa = Site.Alignments.Item(ComboBox2.Text)


stotisp = trasa.Profiles.Item(ComboBox3.Text)


oAStations = trasa.GetStations(tipas.aeccMajor, 5, 5)


j = 0


Dim
taskai(oAStations.Count - 1)
As
size=2> Array


 


For i = 0
color=#0000ff size=2>To
oAStations.Count - 1
color=#0000ff size=2>Step
1


stotis = oAStations.Item(i)


atstumas1 = stotis.Station


bx = stotis.Easting


bby = stotis.Northing


z1 = stotisp.ElevationAt(stotis.Station)


taskas(0) = bx


taskas(1) = bby


taskas(2) = z1


taskai(i) = taskas



Next



asis = m_oAeccDoc2.ModelSpace.Add3DPoly(taskai)



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


No, I think you also need to declare your arrays
as Double:

Dim
stpoint(2), endpoint(2)
As
size=2> Double

 

Yes, I know how to create a
3dpolyline.

 

Albert


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">




it must bee like now ? and mabe you know how to
create 3dpolyline?


Dim

line
size=2>As
AutoCAD.Common.AcadLine


Dim stpoint(2),
endpoint(2)
As
Object


stpoint(0) = 0


stpoint(1) = 0


stpoint(2) = 0


endpoint(0) = 1000


endpoint(1) = 1000


endpoint(2) = 1000


line = m_oAeccDoc2.ModelSpace.AddLine(stpoint,
endpoint)



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


You need 3D points.

 

Albert


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


Hi I trying to create  polyline but
Vb.net show mee eror what is wrong in my code

thanks


Dim

line
size=2>As
AutoCAD.Common.AcadLine


Dim stpoint(1),
endpoint(1)
As
Object


stpoint(0) = 0


stpoint(1) = 0


endpoint(0) = 1000


endpoint(1) = 1000


line = m_oAeccDoc2.ModelSpace.AddLine(stpoint,
endpoint)

*Rick Francken
Message 6 of 8 (203 Views)

Re: Creating polyline

06-15-2005 10:45 AM in reply to: *Darienas

What you show below creates an AcadLine
object.  If you want to create a polyline, shouldn't you be calling
ThisDrawing.ModelSpace.AddPolyline(...) instead?


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


Hi I trying to create  polyline but Vb.net
show mee eror what is wrong in my code

thanks


Dim

line
size=2>As
AutoCAD.Common.AcadLine


Dim stpoint(1),
endpoint(1)
As
Object


stpoint(0) = 0


stpoint(1) = 0


endpoint(0) = 1000


endpoint(1) = 1000


line = m_oAeccDoc2.ModelSpace.AddLine(stpoint,
endpoint)

*Darienas
Message 7 of 8 (203 Views)

Re: Creating polyline

06-15-2005 09:34 PM in reply to: *Darienas

Thanks for all polyline is created:smileyhappy:

For Rick
Francken, ThisDrawing is using in VBA, but when usinng
vb.net or Vb6 then using m_oAeccDoc2 or els variable

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


What you show below creates an AcadLine
object.  If you want to create a polyline, shouldn't you be calling
ThisDrawing.ModelSpace.AddPolyline(...) instead?


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


Hi I trying to create  polyline but Vb.net
show mee eror what is wrong in my code

thanks


Dim

line
size=2>As
AutoCAD.Common.AcadLine


Dim stpoint(1),
endpoint(1)
As
Object


stpoint(0) = 0


stpoint(1) = 0


endpoint(0) = 1000


endpoint(1) = 1000


line = m_oAeccDoc2.ModelSpace.AddLine(stpoint,
endpoint)

*Rick Francken
Message 8 of 8 (203 Views)

Re: Creating polyline

06-16-2005 11:55 AM in reply to: *Darienas

Sorry to get hung up on the "ThisDrawing"
reference...I was thinking only of the "AddLine" versus "AddPolyline"
call.  I should not have referred to ThisDrawing at all.

 

-Rick


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


Thanks for all polyline is created:smileyhappy:

For Rick
Francken, ThisDrawing is using in VBA, but when usinng
vb.net or Vb6 then using m_oAeccDoc2 or els
variable

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


What you show below creates an AcadLine
object.  If you want to create a polyline, shouldn't you be calling
ThisDrawing.ModelSpace.AddPolyline(...) instead?


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


Hi I trying to create  polyline but
Vb.net show mee eror what is wrong in my code

thanks


Dim

line
size=2>As
AutoCAD.Common.AcadLine


Dim stpoint(1),
endpoint(1)
As
Object


stpoint(0) = 0


stpoint(1) = 0


endpoint(0) = 1000


endpoint(1) = 1000


line = m_oAeccDoc2.ModelSpace.AddLine(stpoint,
endpoint)

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.