Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/17/2019 in all areas

  1. Consider the following: (defun c:blockdupes ( / ent idx ins lst rtn sel ) (if (setq sel (ssget "_X" '((0 . "INSERT")))) (progn (setq rtn (ssadd)) (repeat (setq idx (sslength sel)) (setq ent (ssname sel (setq idx (1- idx))) ins (cdr (assoc 10 (entget ent))) ) (if (vl-some '(lambda ( x ) (equal ins x 1e-4)) lst) (ssadd ent rtn) (setq lst (cons ins lst)) ) ) (sssetfirst nil rtn) ) ) (princ) ) Note that the code considers blocks to be duplicate based solely on insertion point coordinates which are within 1e-4 (0.0001) units of each other, independent of block name.
    1 point
×
×
  • Create New...