Silent Pedit

Silent Pedit

hmsilva
Mentor Mentor
5,837 Views
51 Replies
Message 1 of 52

Silent Pedit

hmsilva
Mentor
Mentor
I'm trying to execute a pedit command in a lisp routine, without echoing, with no luck...

cmdecho and nomutt dont resolve my problem...

Can somebody points me the right way please...

Any help would be most appreciated.

Cheers

Henrique

EESignature

0 Likes
5,838 Views
51 Replies
Replies (51)
Message 21 of 52

john.uhden
Mentor
Mentor

I see you have received other very nice gifts.

Maybe you would like to try my QJOIN.lsp.  I have apparently posted it before.

 

; Program automatically joins to one selected line, arc, or polyline
; all possible lines, arcs, and polylines on the same layer and elevation.

; v3.0 (10-21-97) added support for R14 LWPOLYLINEs
; v15.00 (04-07-00) for R15
; v15.01 (10-14-02) fixed missing |elev for LWPOLYLINE
; v15.02 (08-07-04) added "peditaccept" for R16+

John F. Uhden

0 Likes
Message 22 of 52

danielrT8PHL
Participant
Participant
Thank you very much. Terrific help. I will be trying all of these suggestions this afternoon!
0 Likes
Message 23 of 52

danielrT8PHL
Participant
Participant
Thank you very much. Terrific help. I will be trying all of these suggestions this afternoon!
The PEDITACCEPT does not exist in 2002. PEDIT response includes conversion, Join, close, edit.....etc which is a bit time consuming.


0 Likes
Message 24 of 52

john.uhden
Mentor
Mentor

QJOIN behaves as though PEDITACCEPT is ON, even for releases prior to R16.

John F. Uhden

0 Likes
Message 25 of 52

danielrT8PHL
Participant
Participant

Hi, just tried QJoin lisp and I receive the following error. ACAD 2002 does not have the PEDITACCEPT variable (unfortunately). 

 

Command: qjoin
QJOIN v15.02 (c)1994-2004, John F. Uhden, Cadlantic; error: An error has
occurred inside the *error* functionno function definition: @Anonymous_UNDO_END
Command:

0 Likes
Message 26 of 52

danielrT8PHL
Participant
Participant

If I have a several joined lines (such as a square), I would like to run a lisp that converts them all into a polyline. The polylinejoin.lsp is what I'm looking for, but it is not compatible with version 2002. 

0 Likes
Message 27 of 52

ВeekeeCZ
Consultant
Consultant

Try this simple one. 

(defun c:pljoin (/ ss convert)
  (if (setq ss (ssget "_:L" '((0 . "LINE,ARC,LWPOLYLINE"))))
    (progn
      (setq convert (ssget "_P" '(( 0 . "LINE,ARC"))))
      (command "_pedit" "_m" ss "")
      (if convert
        (command "_y"))
      (if (/= (sslength ss) 1)
        (command "_j" 0))
      (command "")))
  (princ)
  )

@john.uhden I thought that you still have 2002, or that's not true anymore?

Message 28 of 52

danielrT8PHL
Participant
Participant

This works! Thanks very much for all the help. This is a terrific forum! 

Cheers! 

0 Likes
Message 29 of 52

danielrT8PHL
Participant
Participant

Is there any way to modify PLJOIN to allow the user to click on one entity of a closed 2D sketch (such as one line in a square etc) and it automatically joins all 4 lines together as a PLINE? Right now you have to click on each entity, or window all of them.....

 

Thanks again for the responses! 

0 Likes
Message 30 of 52

ВeekeeCZ
Consultant
Consultant

@danielrT8PHL wrote:

Is there any way to modify PLJOIN to allow the user to click on one entity of a closed 2D sketch (such as one line in a square etc) and it automatically joins all 4 lines together as a PLINE?...


 

If you have Express Tools installed, then the following should work.

Otherwise, you could use similarly Lee's routine Chain Selection HERE

 

(defun c:fsjoin (/ ss convert)

  (setq #fsmode "ON") (c:FASTSEL) ; requires Express Tools instaled
  
  (if (setq ss (ssget "_:L" '((0 . "LINE,ARC,LWPOLYLINE"))))
    (progn
      (setq convert (ssget "_P" '(( 0 . "LINE,ARC"))))
      (command "_pedit" "_m" ss "")
      (if (and convert
               (or (not (getvar 'peditaccept)) 
                   (= 0 (getvar 'peditaccept))))
        (command "_y"))
      (if (/= (sslength ss) 1)
        (command "_j" 0))
      (command "")))
  (princ)
  )
0 Likes
Message 31 of 52

Kent1Cooper
Consultant
Consultant

@danielrT8PHL wrote:

Is there any way to modify PLJOIN to allow the user to click on one entity of a closed 2D sketch (such as one line in a square etc) and it automatically joins all 4 lines together as a PLINE? Right now you have to click on each entity, or window all of them.....


The attachment to Message 17 works that way [and is an enhancement of some preceding versions -- see the description of the differences in that message and the comments at the top of the file].  But if you have no PEDITACCEPT System Variable, you would again need to make the adjustments in Message 19.

Kent Cooper, AIA
0 Likes
Message 32 of 52

john.uhden
Mentor
Mentor

I still have 2002 at home as well as C3D 2016 (the latter wanting a new computer that I can't afford).

At work (yay!) we run LDT 2004.  I have graduated to being just a lowly draftsman; it's great.

Remember the movie Under Siege?  Steven Seagal played the part of Casey Ryback, actually an ex Navy Seal, but on assignment to the captain as a cook, "just a lowly lowly cook."

John F. Uhden

0 Likes
Message 33 of 52

john.uhden
Mentor
Mentor

My mistake... it had functions defined elsewhere.

This version should take care of that.

 

John F. Uhden

0 Likes
Message 34 of 52

danielrT8PHL
Participant
Participant

I tired this edit to polylinejoin.lsp, but it still isn't working. I have attached the edited file for you to check in case I have done something foolishly wrong........

 

(AutoCAD 2002; no peditaccpet var)

 

Here is the error message:

 

Command: pj
To join objects into Polyline(s) [pick 1 to join all possible to it],
Select objects: 1 found
Select objects: Specify opposite corner: 0 found
Select objects:
Yes or No, please.
Yes or No, please.
; error: An error has occurred inside the *error* functionFunction cancelled

0 Likes
Message 35 of 52

danielrT8PHL
Participant
Participant

No luck on my end with QJoin, unfortunately...

0 Likes
Message 36 of 52

john.uhden
Mentor
Mentor

Did you grip the object to see if anything had been joined to it?

Was there something else touching it end-to-end?

It works for me.  Anyone else?

John F. Uhden

0 Likes
Message 37 of 52

danielrT8PHL
Participant
Participant

yes, qjoin doesn't work for me. The Polylinejoin is very close. Hoping Kent can take a look at the edit i did to see if there's anything i'm missing

0 Likes
Message 38 of 52

john.uhden
Mentor
Mentor
I am seriously surprised why QJOIN isn't working for you. I've been using
it all the time since 1997 (whatever). You did grab the last version I
posted, right?

<>
Virus-free.
www.avg.com
<>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

John F. Uhden

0 Likes
Message 39 of 52

danielrT8PHL
Participant
Participant

yup, this is the error I receive. 

 

Command: _appload QJOIN.LSP successfully loaded.
Command:
Command:
Command: qjoin
QJOIN v15.02 (c)1994-2004, John F. Uhden, Cadlantic; error: An error has
occurred inside the *error* functionno function definition: @Anonymous_UNDO_END
Command:

 

0 Likes
Message 40 of 52

Kent1Cooper
Consultant
Consultant

@danielrT8PHL wrote:

I tired this edit to polylinejoin.lsp, but it still isn't working. I have attached the edited file for you to check in case I have done something foolishly wrong........

 

(AutoCAD 2002; no peditaccpet var)

....


 

I can't test it in Acad2002, but in 2019 your edited version works for me.  There must be something about the operation of PEDIT back then that is different.  Try "commenting out" the suppression of command echoing, so you can see what went on, that is, put a semicolon at the beginning of this line:

(setvar 'cmdecho 0)

 

and re-load it and run it again to see whether the command-prompt sequence suggests anything.

Kent Cooper, AIA
0 Likes