JOIN not Working In Script

JOIN not Working In Script

Anonymous
Not applicable
1,309 Views
11 Replies
Message 1 of 12

JOIN not Working In Script

Anonymous
Not applicable

I'm making a script to join everything in a drawing, save, then move on to the next.

My script is as follows:

 

OPENFILE <1st drawing>

JOIN

ALL

 

SAVE

OPENFILE <next drawing>

 

This works perfect when it is typed out. When it is saved as a .scr file and ran  the process does not work.

It seems like a very simple script, and I cannot get around why it is not working.

 

When I physically type "JOIN" I have the choice of source or multiple objects (I reply with "ALL"):

TYPED.JPG

 

When it is scripted there is only the choice of "source object" and "ALL" fails (as seen below):

SCRIPT.JPG

 

I have also tried: 

_ai_selall

JOIN

 

This again works great when typed manually, but not when scripted. 

0 Likes
Accepted solutions (1)
1,310 Views
11 Replies
Replies (11)
Message 2 of 12

ВeekeeCZ
Consultant
Consultant

So do what you asked...

 

join

last

all

 

or try LISP to help...

 

(initcommandversion)

join

all

 
0 Likes
Message 3 of 12

Anonymous
Not applicable

I have no experience with LISP, so I'm trying to stick with what I know with .scr files.

I tried running what you suggested. Similar to what I've already been experiencing, the commands work well when manually typed, but when scripted it fails. No matter what I seem to do, the selection of objects after JOIN is flawed when scripted it seems. Here's the script I wrote:

 

FILEOPEN
<filename>
JOIN
last
all

 

What my command line says:

 

Command: JOIN
Select source object: last
Line, open polyline, arc, elliptical arc, or open spline expected.  Select a supported object: all
*Invalid selection*
Expects a point or Last

0 Likes
Message 4 of 12

ВeekeeCZ
Consultant
Consultant

That's a problem.

 

You need to supply the JOIN command (in it's "script/lisp" version) with some single linework entity first (line, arc, polyline), then with a group of entities (all). But how would you get some single entity automatically? The most simple way was to select the last object in the database. Unfortunately, it's not a linework type of entity in you case. I don't know of any different way using just a SCRIPT.

 

So you can either use the PEDIT command with its JOIN option, or go with LISP which gives you much more opportunities to solve the issue.

0 Likes
Message 5 of 12

Anonymous
Not applicable

Just a wild guess, but what happens if you try selecting all first, then join?

 

0 Likes
Message 6 of 12

Anonymous
Not applicable

Any resource in specific you would suggest to learn LISP?

0 Likes
Message 7 of 12

Anonymous
Not applicable

Exact same issue unfortunately 😓

0 Likes
Message 8 of 12

sthompson1021
Advisor
Advisor

Try using this with PEDIT command. It worked for me on a test dwg.

pedit
m
all


join


save

Y

close

0 Likes
Message 9 of 12

ВeekeeCZ
Consultant
Consultant

Lots of people consider THIS  site as good starting point.

I tough myself from a book (not eng).

 

If you decide to use the PEDIT, remember that there is PEDITACCEPT sysvar.

0 Likes
Message 10 of 12

Anonymous
Not applicable

I've tried PEDIT and it doesn't seem to work for my application. I work at an underground mining operation and the drawings I'm trying to join are underground tunnel face surveys. The drawing is 3D in nature with a bunch of broken up polylines generated from our mining software. I'm trying to join as many of the touching polylines to compress the drawing as much as possible. I've attached a sample drawing if you can get it to work.

0 Likes
Message 11 of 12

ВeekeeCZ
Consultant
Consultant
Accepted solution

Once again, this works. 

 

(initcommandversion)
join
all

 

 
Message 12 of 12

pendean
Community Legend
Community Legend
0 Likes