Join command

Join command

eakos1
Advocate Advocate
1,100 Views
2 Replies
Message 1 of 3

Join command

eakos1
Advocate
Advocate

How works the join command in autolisp?

Basically I want to gather some objects in a selection set and at the end I want to join them. 

 

Here are two LINEs and 3 ARCs in the picture.

With pedit I can join them:   (command "pedit" "M" (ssget) "" "Y" "J" "" "")

 

I tried to use the join command but it not works for me (command "join" (ssget))

In AutoCAD in the command line it works, I select all the lines and joint command makes a polyline from them . 

Why is in autolisp a selection set not a good input for join command. 

eakos1_0-1706722125154.png

 

0 Likes
Accepted solutions (1)
1,101 Views
2 Replies
Replies (2)
Message 2 of 3

Kent1Cooper
Consultant
Consultant
Accepted solution

JOIN from inside a (command) function works in an old way, wanting to be given a single object to begin with, then things to join to it.  [Even then, it doesn't seem to work for me, giving it inputs like that -- I can't figure out why.]  But you can force it to work in the "modern" way, accepting multiple object selection initially, with a preceding (initcommandversion) function.  But you also need to tell it you're done picking things with an Enter after the (ssget):

 

(initcommandversion)

(command "_.join" (ssget) "")

Kent Cooper, AIA
Message 3 of 3

john.uhden
Mentor
Mentor

@Kent1Cooper  & @eakos1 ,

I don't know if this would comply with his needs, but I have a QJOIN command that joins all lines, arcs, plines to one another if they meet end-to-end and are on the same layer, and I think at the same elevation.  I use it all the time.  If it doesn't work 100% then I follow with my PJOIN command to pick pieces in order with options to correct elevation differences, adjust one endpoint if within one tolerance, or create a new segment to connect.  Objects need not to be on the same layer, but it does include the option for elevation adjustment.  It's neat because it cold grips the entire polyline at the start and with each addition so that the user can see what's been joined.  Oh yeah, it checks for closure by proximity, closes it if within, and provides the option to close if not.

The only thing I have never addressed is if the previous segment to the closure is bulged, then the closing segment is bulged when you might want it to be straight.  But then I have my BULGE command which can set a segment's bulge to 0.

John F. Uhden

0 Likes