.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating polyline

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
737 Views, 7 Replies

Creating polyline


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)

7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Anonymous


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)

Message 3 of 8
Anonymous
in reply to: Anonymous




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)

Message 4 of 8
Anonymous
in reply to: Anonymous


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)

Message 5 of 8
Anonymous
in reply to: Anonymous



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)

Message 6 of 8
Anonymous
in reply to: Anonymous


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)

Message 7 of 8
Anonymous
in reply to: Anonymous


Thanks for all polyline is created:)

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)

Message 8 of 8
Anonymous
in reply to: Anonymous


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:)

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)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost