Jump to content

Beginner Question re Polyline Edit macro


Recommended Posts

Posted

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

 

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

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! 

Posted

For just a macro try: 

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

 

  • Like 1

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...