Script to join all lines

Script to join all lines

Anonymous
Not applicable
2,849 Views
5 Replies
Message 1 of 6

Script to join all lines

Anonymous
Not applicable

Hi,

 

I am trying to write a script to join all lines using the Pedit / join command. I then intend to use ScriptPro to run the script on lots of drawings. I can't work out the correct code having tried lots of variation's. Here's a couple of attempts that don't work. If you can give me any help as to what I am doing wrong that would be greatly appreciated 🙂

------------------------------------------------------------------------------------------------------

PEDIT
Select polyline or [Multiple]: multiple
Select objects: all
Convert Lines, Arcs and Splines to polylines [Yes/No]? <Y> yes
Enter an option [Close/Open/Join/Width/Fit/Spline/Decurve/Ltype gen/Reverse/Undo]: join
Join Type = Extend
Enter fuzz distance or [Jointype] <0.00>: 0.0000
Enter an option [Close/Open/Join/Width/Fit/Spline/Decurve/Ltype gen/Reverse/Undo]: exit
qsave

 

------------------------------------------------------------------------------------------------------

PEDIT
multiple
all
yes
join
Extend
0.0000
exit
qsave

------------------------------------------------------------------------------------------------------

 

Thanks in advance

M

 

0 Likes
Accepted solutions (1)
2,850 Views
5 Replies
Replies (5)
Message 2 of 6

ВeekeeCZ
Consultant
Consultant
Why you don't just use the JOIN command?
0 Likes
Message 3 of 6

Anonymous
Not applicable

I could get that to work either! Humph! (This is the first Script I have tried to write)

0 Likes
Message 4 of 6

ВeekeeCZ
Consultant
Consultant
Maybe one more line behind the selection
all

join
0 Likes
Message 5 of 6

Anonymous
Not applicable

Thanks that has helped but I am not quite there yet. Below is the code I have so far. The Pedit part works and the +saveas part works. However the problem is after the Pedit part has run I can't figure a way to exit the command before the +saveas part.

---------------------------------------------

PEDIT
multiple
all

join
0.0000
 

+SAVEAS
dxf
2013dxf
16
yes

---------------------------------------------

this is the command line when the above script runs...

---------------------------------------------

Command: PEDIT
Select polyline or [Multiple]: multiple
Select objects: all 312 found
Select objects:
Convert Lines, Arcs and Splines to polylines [Yes/No]? <Y>
Enter an option [Close/Open/Join/Width/Fit/Spline/Decurve/Ltype gen/Reverse/Undo]: join
Join Type = Extend
Enter fuzz distance or [Jointype] <0.0000>: 0.0000
98 segments added to 41 polylines
Enter an option [Close/Open/Join/Width/Fit/Spline/Decurve/Ltype gen/Reverse/Undo]:
Command:  PEDIT
Select polyline or [Multiple]:
Select polyline or [Multiple]:
Select polyline or [Multiple]: +SAVEAS
*Invalid selection*
Expects a point or Window/Last/Crossing/BOX/ALL/Fence/WPolygon/CPolygon/Multiple]:
Select polyline or [Multiple]:

---------------------------------------------

all / any help appreciated!

Thanks

M

0 Likes
Message 6 of 6

ВeekeeCZ
Consultant
Consultant
Accepted solution

@Anonymous wrote:

Thanks that has helped but I am not quite there yet. Below is the code I have so far. The Pedit part works and the +saveas part works. However the problem is after the Pedit part has run I can't figure a way to exit the command before the +saveas part.

---------------------------------------------

PEDIT
multiple
all

join
0.0000
 <- there is the space, should not -- just an empty line

+SAVEAS
dxf
2013dxf
16
yes

 


Spoiler
PEDIT
multiple
all

join
0.0000

+SAVEAS
dxf
2013dxf
16
yes
0 Likes