Jump to content

Recommended Posts

Posted

I have just tried the LISP, and find that once completed, the extra lines form part of the whole polyline...

 

The LISP contains:

 

      (if
    (and pt (wcmatch (cdadr (entget (entlast))) "*POLYLINE*"))
     (command "_.pedit" ename "j" (entlast) "" "")))

 

Which joins the newly created polyline with the existing one.

Posted

I don't get it, why doesn't it work for me than? I have tried again, It makes a whole new polyline... o.O

Posted

Works fine on my machine (joins to original polyline).

Posted

----> Width is 0.00; error: no function definition: VLAX-CURVE-GETSTARTPOINT

 

Suddenly, somehow this /\ started to happen... o.O what would that be?

Posted

Either add this to the beginning of the code or to your acaddoc.lsp file

(vl-load-com)

Posted

Ahh yes make sure that the Visual LISP console is loaded (vl-load-com).

 

Either add it to the ACADDOC.lsp file, or at the start of the LISP itself.

 

As for the new polyline being created. - I have no idea - :huh: I am not sure really what could go wrong in such a routine, its such a simple routine.

Posted

After the (vl-load-com) placed in the beggining of the lisp this started to happen.

 

Select source polyline:

Width is 0*Cancel*

; error: Function cancelled

 

OBS.: on the previous error the command didn't even worked, now it works, I draw the polyline and everything it just bugs in the end, causing the polylines to be splitted, maybe the first time I had this same error prompt and I didn't saw it, which would be making the polylines be splitted.

----edit---

 

My acad version is 2009 btw

Posted

OUCH! I kept pressing ESC to stop drawing the polyline, I pressed enter, and TCHARAM! IT WORKS! 8D...

 

:oops: don't flame my stupidity x)

Posted

Haha, I see your mistake... maybe you can get away with pressing esc with in-built ACAD commands, but custom LISPs are a bit more "fragile" :)

 

I would recommend setting up a "right-click" customisation, so you can right-click to signal enter and thus exit the command, - makes things much easier. :thumbsup:

Posted

I'm just so used to the ESC pressing, it's involuntary heheh... I got one hand in the mouse the other one in the left upper corner of the keyboard, my thumb just goes around the keyboard and press the shortcuts while my pinky insanely press ESC ESC ESC ESC on every action. :D

  • 7 years later...
Posted

Lee,

 

Thanks for the code. Was browsing the forum and this was exactly what i was looking for!

 

Cheers

 

Jd

 

I accounted for if the user only picks one entity also, and so two statements are needed instead of one... also, I have to set the variable values at start and end.

 

A minor update:

 

(defun c:pj (/ varlist oldvars ss1)
   (setq varlist (list "cmdecho" "peditaccept")
     oldvars (mapcar 'getvar varlist)
   ) ;_  end setq
   (mapcar 'setvar varlist (list 0 1))
   (setq ss1 (ssget '((0 . "LINE"))))
   (if    (> (sslength ss1) 1)
   (progn
       (vl-cmdf "_pedit" "_M" ss1 "" "J" "0" "")
       (princ (strcat "\n" (itoa (sslength ss1)) " Lines Converted. "))
   ) ;_  end progn
   (progn
       (vl-cmdf "_pedit" ss1 "")
       (princ (strcat "\n" (itoa (sslength ss1)) " Line Converted. "))
   ) ;_  end progn
   ) ;_  end if
   (mapcar 'setvar varlist oldvars)
   (princ)
) ;_  end defun

 

Forgot to localise some variables and added a filter list. :oops:

  • 7 months later...
Posted
Just a quick one:

 

(defun c:pj (/ ss1)
   (setq varlist (list "cmdecho" "peditaccept")
     oldvars (mapcar 'getvar varlist)
   ) ;_  end setq
   (mapcar 'setvar varlist (list 0 1))
   (setq ss1 (ssget))
   (if    (> (sslength ss1) 1)
   (progn
       (vl-cmdf "_pedit" "_M" ss1 "" "J" "0" "")
       (princ (strcat "\n" (itoa (sslength ss1)) " Lines Converted. "))
   ) ;_  end progn
   (progn
       (vl-cmdf "_pedit" ss1 "")
       (princ (strcat "\n" (itoa (sslength ss1)) " Line Converted. "))
   ) ;_  end progn
   ) ;_  end if
   (mapcar 'setvar varlist oldvars)
   (princ)
) ;_  end defun

 

 

Hello Lee Mac... What is the name of this command? Is it a lisp?

Posted

baih: That would be "pj" which stands for Polyline Join. It is one of three lisp routines combined into one master routine that is included in Lee's PolyToolsV1-0.lsp. The other two are Polyline Close (pc) and Polyline Width (pw).

Posted
baih: That would be "pj" which stands for Polyline Join. It is one of three lisp routines combined into one master routine that is included in Lee's PolyToolsV1-0.lsp. The other two are Polyline Close (pc) and Polyline Width (pw).

 

Thanks for responding in my absence ReMark :thumbsup:

 

@baih0000, Please refer to the link I posted here.

Posted

Okay thank you... Hope that you can figure out a visual lisp for multi-stretch lines... If you have it, kindly introduce me a link to your art-work... Thanks once again...

  • 7 years later...
Posted

All the functions that use PEdit -> Multiple -> Join could (in my opinion) be improved by setting the fuzz to 0.0 in the code.

Because if you just press enter "" after "_J" the previously used fuzz is used, which might give an undesired effect.

An example of what can happen is shown in the image below.

So just replace the "" after "_J" with "0.0", and the fuzz is always reset to 0:

(command "_.pedit" "_m" ss "" "_j" "0.0" "")

 

fuzz.gif

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