PRA3889 Posted January 21, 2014 Share Posted January 21, 2014 how to trim all lines inside the circle in only one step in auto cad 2013 Drawing2.dwg Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 21, 2014 Share Posted January 21, 2014 (edited) No code but make a list of circles entname then loop, trim ent1 cen pt circle manually works. this is close (defun ah:trimcirs ( / x obj ss) (setvar "osmode" 0) (setq ss (ssget (list (cons 0 "Circle")))) (setq x 0) (repeat (sslength ss) (setq obj (ssname ss x)) (setq cenpt (cdr (assoc 10 (entget obj)))) (command "trim" obj "" cenpt "") (setq x (+ x 1)) ) ) (ah:trimcirs) Edited January 21, 2014 by BIGAL Quote Link to comment Share on other sites More sharing options...
nestly Posted January 21, 2014 Share Posted January 21, 2014 Since it's a constant pattern, perhaps use an ARRAY? Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 21, 2014 Share Posted January 21, 2014 The lisp routine in the link to the thread below by forum member irneb will trim out the lines in all the circles. See post #8. http://www.cadtutor.net/forum/showthread.php?68144-how-trim-many-line-inside-multi-circle-on-one-step&p=467090&viewfull=1#post467090 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 22, 2014 Share Posted January 22, 2014 2nd the use Irneb method Quote Link to comment Share on other sites More sharing options...
pBe Posted January 22, 2014 Share Posted January 22, 2014 Make a Break.... (Defun c:demo (/ cir lin cirline e int) (if (setq cir nil lin nil cirline (ssget '((0 . "CIRCLE,LINE"))) ) (progn (repeat (sslength cirline) (setq e (ssname cirline 0)) (if (eq (cdr (assoc 0 (entget (setq e (ssname cirline 0))))) "CIRCLE") (setq cir (cons (vlax-ename->vla-object e) cir)) (setq lin (cons e lin)) ) (ssdel e cirline) ) (foreach itm lin (if (and cir (setq int (vl-some '(lambda (x) (if (setq hit (vlax-invoke (vlax-ename->vla-object itm) 'intersectwith x acExtendNone )) (list x hit) ) ) cir )) (= (length (setq pts (cadr int))) 6) ) (command "_break" itm "_non" (list (car pts) (cadr pts)) "_non" (list (nth 3 pts) (nth 4 pts))) ) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
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.