• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

join two polylines

  • Thread starter Thread starter lx1127
  • Start date Start date

lx1127

Guest
Hello everyone,

and apologize for the question maybe stupid but I don't go out:
I would like to generate 2 polylinese say so:

/
dim pline1 as acadpolyline
dim pline2 as acadpolyline

dim pline3 as acadpolyline

'
dim points(8) as double
points(0) = 100 points(1) = 100 points(2) = 0
points(3) = 500 points(4) = 100 points(5) = 0
points(6) = 500 points(7) = 500 points(8) = 0

set pline1 = thisdrawing.modelspace.addpolyline(points)

(2)
dim pointsb(8) as double
pointsb(0) = 100 pointsb(1) = 100 pointsb(2) = 0
pointsb(3) = 100 pointsb(4) = 500 pointsb(5) = 0
pointsb(6) = 500 pointsb(7) = 500 pointsb(8) = 0

set pline2 = thisdrawing.modelspace. addpolyline(pointsb)
/


I would like to get a 3rd date from the union of 2 (like the one I get
with edit polylinea > join by acad)

I've tried all kinds of things.
/
count = application.activedocument.modelspace.count
set pline3 = autocad.application.activedocument.modelspace.item (count - 1)
/
but nothing to do my 2 pcs are always divided

Sorry again for the banal call but bah! :confused:

Where are you going?

Thank you in advance.
 
If you have the carriers containing the coordinates of both polylines you only need to create an additional carrier that contains the data of the first polyline and to follow those of the second.

dim pointsa(8) as double
dim pointsb(8) as double

created

dim pointsc(8+9) as double

Then

index = 0
for i=0 to 8
pointsc(s)=pointsa(index)
index = index +
next i
index = 0
for i=9 to 17
pointsc(s)=pointsb(index)
index = index +
next i

at this point you have joined the contents of the 2 carriers

set pline3 = thisdrawing.modelspace. addpolyline(pointsc)

bye
 
tnx rpor66

It was exactly the tip I needed,:finger:

now I proceed to the reverse:

if I create a poly make a mirror on the same
ex [Set mirrorObj = plineObj.Mirror(XY1, XY2)]then join the 2 I try to extrapolate the cordinates from the poly mirrorobj
and redesign an object as in your suggestion

I'll have something to have fun.

Thank you again
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top