Jump to content

trimming many lines in auto cad 2013


PRA3889

Recommended Posts

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 by BIGAL
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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