Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/10/2020 in all areas

  1. I finish the code work with circle select with radius and plines and lines ;;Create by Georgi Georgiev - TRUDY ;;Date: 09.07.2020 (defun c:sel (/) (vl-load-com) (setq clear nil) (setq sel1 (ssget ":S" '((0 . "LWPOLYLINE,line,circle")))) (repeat (setq i (sslength sel1)) (setq nam (ssname sel1 (setq i (1- i)))) (setq ent (entget nam)) (princ (cdr (assoc 0 ent))) (if (= (cdr (assoc 0 ent)) "CIRCLE") (setq rad (cdr (assoc 40 ent))) (setq len (vla-get-length (vlax-ename->vla-object nam))) ) ) (setq selall (ssget "X" (list (assoc 0 ent)))) (repeat (setq i (sslength selall)) (setq namall (ssname selall (setq i (1- i)))) (setq entall (entget namall)) (if (= (cdr (assoc 0 ent)) "CIRCLE") (setq radall (cdr (assoc 40 entall))) (setq lenall (vla-get-length (vlax-ename->vla-object namall))) ) (if (= (cdr (assoc 0 ent)) "CIRCLE") (if (= rad radall) (setq clear (ssadd namall sel1)) (princ)) (if (= len lenall) (setq clear (ssadd namall sel1)) (princ)) ) ) (sssetfirst nil clear) (princ) ) If you need some change tell Hope to help you
    1 point
  2. Try this: (defun c:foo (/ _getlength e l l2 r s) ;; RJP » 2020-07-09 ;; Select objects with similar length (defun _getlength (e / ep) (if (vl-catch-all-error-p (setq ep (vl-catch-all-apply 'vlax-curve-getendparam (list e)))) 0. (vlax-curve-getdistatparam e ep) ) ) (cond ((and (setq e (car (entsel "\nPick an object to set length filter: "))) (setq s (ssget))) (setq r (ssadd)) (setq l (_getlength e)) (foreach x (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (and (setq l2 (_getlength x)) (equal l l2 1e-4) (ssadd x r)) ) (sssetfirst nil r) ) ) (princ) )
    1 point
×
×
  • Create New...