ALTA_EGO Posted February 15, 2021 Posted February 15, 2021 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
Lee Mac Posted February 15, 2021 Posted February 15, 2021 (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, 2021 by Lee Mac 1 Quote
ALTA_EGO Posted February 15, 2021 Author Posted February 15, 2021 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
dan20047 Posted February 16, 2021 Posted February 16, 2021 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
tombu Posted February 16, 2021 Posted February 16, 2021 For just a macro try: (setvar 'peditaccept 1)(ssget)(command "pedit" "M" "P" "" "J" "" "") 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.