Jump to content

Adding Polyline Vertices LISP routine


Recommended Posts

Posted

Here is a lisp routine that i use which I find quite useful. It inserts a vertice point on a polyline at any point you pick on the polyline. I find I use it for floor areas that need to be updated. I have a polyline outline but may need to change the shape to reflect the new floor area. Instead of redrawing the the polyline or manually breaking it and adding the addition, this lisp routine does it all as simple as a click. Hope everyone else finds it useful too, let me know

 

(DEFUN C:plv ()

(setq obj (ssget))

(setq br1 (getpoint "\nPick Break Point: "))

(COMMAND "-GROUP" "c" "pl0" "" obj "" "BREAK" obj br1 br1 "pedit" "last" "j" "g" "pl0" "" "" "-group" "explode" "pl0")

)

Posted
(defun c:plv  (/ pt obj)
     (cond ((and
                  (setq pt (getpoint "\nPick Break point: "))
                  (setq obj (car (nentselp
                                       (setq pt   (osnap pt  "near")))))
                  (eq "LWPOLYLINE" (cdr (assoc 0 (entget obj))))
                  (command "_break" obj "_non" pt "_non"  pt
                        "_join"  obj "_last" "")))))

Posted

An uneeded lisp, as AutoCAD now uses Miltifunctional Grips for polylines, hatches, and even more in 2012.

 

Multifunctional grips are controlled by GRIPMULTIFUNCTIONAL system variable.

  1. If you change it to 0, then it turns off multifunctional grips completely.
  2. If you change it to 1, then you still can use grip for editing and switch between options by pressing [ctrl] key.
  3. If you set it to 2, then you still can edit using grip by accessing menu like image above.
  4. If you use 3, then you can access this grip for editing both using [ctrl] key and menu. This is the default value.

I have mine set to 1. I dont like the pop up that it brings, but I can select the grip and right click to access the options.

 

Might save you a few keystrokes by using this.

  • 1 year later...
Posted
(defun c:plv  (/ pt obj)
     (cond ((and
                  (setq pt (getpoint "\nPick Break point: "))
                  (setq obj (car (nentselp
                                       (setq pt   (osnap pt  "near")))))
                  (eq "LWPOLYLINE" (cdr (assoc 0 (entget obj))))
                  (command "_break" obj "_non" pt "_non"  pt
                        "_join"  obj "_last" "")))))

 

This is a good one, thanks. Is it possible to end the routine with the polyline selected?

Posted (edited)

any help to make it work on 3d polyline so the added point must have same elevation of picked point

Edited by motee-z

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