M Enter(for multiple)
select all your lines you want to join Enter
convert to polylines Enter (defaults to yes)
J Enter (for join)
fuzz distance? Enter (defaults to zero)
Enter (closes command)
all lines are now joined. Provided the lines had touching ends that is.
Hmmmm, and this is faster than join?
(somewhat tongue in cheek) It's amazing what "progarammers" do to save one key sytoke or one pick.
Yes, guilty myself upon reflection.
The fastest way (by far) I have found is to edit your double click function for Line entities.
In the CUI under Double Click Actions, select the action for Line.
Under Macro (on the right) enter: ^C^CPEDIT;J;
You should also set the PEDITACCEPT variable to 1.
Then you just have to double click a line to turn it into a polyline and leave you in Join mode where you can window (or select) your other lines to join. Enter (right click) when done and you are good to go.
NO KEYPRESSES AT ALL!
That method is best However I will edit your macro just a bit.
you wrote ^C^CPEDIT;J;
try this instead ^C^CPEDIT;Y;J;
so just double click any line then window the ones to join
hit enter twice to finish the command.
I don't need the extra 'Y' in my macro because I like to have the PEDITACCEPT variable set to 1. Yours is a great modification for those who may not want to change their PEDITACCEPT variable.
1) create a new lisp routine called pjoin.lsp
2) Paste this into it:
(defun C:JP (/ EHCO PT1 PTLL PTUR ENT LAYR OC ETYPE ENT2 ENT3)
(setq ECHO (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setvar "peditaccept" 0)
(setq PTLL (getvar "vsmin")
PTUR (getvar "vsmax"))
(setq ENT (entsel "Select object to become polyline:")
LAYR (cdr (assoc 8 (entget (car ENT))))
ETYPE (cdr (assoc 0 (entget (car ENT))))
(command "_layer" "_s" LAYR "_off" "*" "" "")
(setq PT1 (cadr ENT))
(if (or (= ETYPE "LWPOLYLINE") (= ETYPE "POLYLINE"))
(setq OC (cdr (assoc 70 (entget (car ENT)))))
(if (= OC 0)
(command "_PEDIT" PT1 "_J" "_C" PTLL PTUR "" "")
(command "_Select" PT1 "")
(setq ENT2 (ssget PT1)
ENT2 (entget (ssname ENT2 0))
OC (cdr (assoc 70 ENT2))
(command "_PEDIT" PT1 "_y" "_J" "_C" PTLL PTUR "" "")
(setq ENT3 (entget (entlast))
OC (cdr (assoc 70 ENT3))
(command "_Layer" "a" "r" "temp" "" "")
(setvar "cmdecho" ECHO)
(setvar "peditaccept" 1)
(if (= OC 1)
(prompt "\nPolyline is closed\n")
(prompt "\nPolyline is open...find break and try again\n")
3) End AutoCAD, open your acaddoc.lsp file, and paste this in it: (LOAD "pjoin.LSP")
4) Start ACAD back up and you're good to go. Simply type pj and select any items you want. You can even use window or crossing. As long at the lines touch correctly, they will become a joined polyline.
thanks for the lsp cad peeps - i will be using this one all the time from now on
can anyone tell me how to create an ICON so that i can click to start the command (instead of typing PLJOIN or equivalent)?
I'd like to add this icon to my quick access toolbar (cad 2011)
Ummm.. have you tried looking in the help documantation under CUI?
Access a broad range of knowledge to help get the most out of your products and services.