Jump to content

deleting segment but creating a new polyline instead


Recommended Posts

Posted

 

(defun c:delseg ( / e )
    (if (and (setq e (entsel "\nSelect LWPolyline: "))
             (= "LWPOLYLINE" (cdr (assoc 0 (entget (car e)))))
        )
        (command "_.trim" e "" e "")
    )
    (princ)
)

 

this is  LM code. i cant get the second part to work. 

is e present the whole poly or just the segment? 

how to do it?

Posted

So you would pick the segment you want to remove, then use Break at the 2 vertice points either side of the segment.

Get co ordinates of pline.

 

A start for you.

(defun c:plseg()
(setq plent (entsel "\nSelect Pline  segment"))
(setvar "osmode" 0)
(setq
      pick (cadr plent)
      plObj (vlax-ename->vla-object (car plent))
      pick2 (vlax-curve-getclosestpointto plobj pick)
      param (vlax-curve-getparamatpoint plObj pick2)
      segment (fix param)
	  co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent)))))
(setq pt1 (nth segment co-ord))
(setq pt2 (nth (+ segment 1) co-ord))
)

 

 

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