ALTA_EGO 0 Posted February 15 I wrote a macro to combine a bunch of lines into one polyline, but I can't get the final exit part of the command to happen. (defun c:penj()(command "pe" pause "y" "j" pause "x")) It works up until the second pause, but after I select the other lines to join and press enter, it gives me the standard Polyline Edit options: Edit polyline [Edit vertices/Close/Decurve/Fit/Join/Linetype mode/Reverse direction/Spline/Taper/Width/Undo] <eXit>: I want it to type "x" for me and exit the command automatically. Not sure why it isn't working? Very new to this forgive me Quote Share this post Link to post Share on other sites
Lee Mac 453 Posted February 15 (edited) AutoLISP is likely invoking an earlier version of the PEDIT command which has fewer options, notably omitting the eXit option (as users would previously have exited the command by pressing Enter). You could try changing the command expression to: (defun c:penj()(command "pe" pause "y" "j" pause "")) Or consider my existing example of this program here. Edited February 15 by Lee Mac 1 Quote Share this post Link to post Share on other sites
ALTA_EGO 0 Posted February 15 Thanks a bunch Lee. Weirdly enough just by changing the "x" to "", the command fails in a different way: I can only click on one line segment to be added instead of clicking on all the segments I want to join. In other words, the pause is only lasting for one click. I tried googling for older versions of PEDIT command but nothing came up. I wish there was some sort of reference online for which commands AutoLISP is actually invoking. I'm just going to keep learning and be sure to check your site next time! Quote Share this post Link to post Share on other sites
dan20047 12 Posted February 16 Check out this code which expands on your method but creates a selection set first, which is then passed onto the command prompt with a variable https://jtbworld.com/autocad-pljoinfuzz-lsp Quote Share this post Link to post Share on other sites
tombu 89 Posted February 16 For just a macro try: (setvar 'peditaccept 1)(ssget)(command "pedit" "M" "P" "" "J" "" "") 1 Quote Share this post Link to post Share on other sites