samifox Posted August 4, 2024 Posted August 4, 2024 (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? Quote
BIGAL Posted August 4, 2024 Posted August 4, 2024 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)) ) Quote
Recommended Posts
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.