I'm having difficulty with a creating a macro for a command to convert lines to polylines using the PEDIT command.
So far I'm trying to use ^C^C_PEDIT;M;\;; but I can't get it to close the PEDIT command. It just stops at the list of edits. I've tried to use a ^C at the end to close the command but to no avail.
Using AutoCAD 2013.
Any help will be greatly appreciated!
Thank you,
Tim
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
I think you just need to add one more semi-colon at the end of your macro.
Just tried adding the third semicolon and it still won't close the command. I keep getting stuck at the "Enter an option" portion of the command.
Thanks for the reply though.
Try changing the peditaccept variable to one first (and then you should only need the two semi-colons)
Yep, setting PEDITACCEPT to "1" was one of the first things I did yesterday when I was having trouble. Still stuck at the "Enter an option" portion of the command.
Thanks again for the reply.
Something like this perhaps.
^C^C_peditaccept;1;_select;_auto;\_Pedit;_m;_p;;;
HTH
Henrique
That did it!!! Many thanks to everyone that replied. I'm still confused as to why my original macro syntax didn't work but at least I have a working command.
Thanks again,
Tim
@terrametrix wrote:
So far I'm trying to use ^C^C_PEDIT;M;\;; but I can't get it to close the PEDIT command. It just stops at the list of edits. I've tried to use a ^C at the end to close the command but to no avail.
Using AutoCAD 2013.
Since you are using a full version of CAD, you could also use LISP, e.g.:
(defun c:pj ( / c p s ) (if (setq s (ssget "_:L" '((0 . "LINE,ARC,LWPOLYLINE")))) (progn (setq p (getvar 'peditaccept) c (getvar 'cmdecho) ) (setvar 'peditaccept 1) (setvar 'cmdecho 0) (command "_.pedit" "_M" s "" "_J" "" "") (setvar 'cmdecho c) (setvar 'peditaccept p) ) ) (princ) )
LISP allows for more error trapping, and also defines a command which may be repeated rather than clicking a button for every use.
@Lee_Mac wrote:
...
Since you are using a full version of CAD, you could also use LISP, e.g.:...
(if (setq s (ssget "_:L" '((0 . "LINE,ARC,LWPOLYLINE"))))
...
(command "_.pedit" "_M" s "" "_J" "" "") .......
Without [conforming to the OP's original macro that only converts Lines separately] the Join option:
(command "_.pedit" "_M" s "" "")
in which case there's no need to include Polylines in the selection set filter [they don't need conversion], and they should also consider whether or not they want Arcs.