Jump to content
ALTA_EGO

Beginner Question re Polyline Edit macro

Recommended Posts

ALTA_EGO

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

 

Share this post


Link to post
Share on other sites
Lee Mac

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 by Lee Mac
  • Like 1

Share this post


Link to post
Share on other sites
ALTA_EGO

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! 

Share this post


Link to post
Share on other sites
dan20047

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

Share this post


Link to post
Share on other sites
tombu

For just a macro try: 

(setvar 'peditaccept 1)(ssget)(command "pedit" "M" "P" "" "J" "" "")

 

  • Like 1

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...