(defun c:xdtb_erase_coincide (/ ss lens ents nums)
(xdrx-begin)
(if (and (setq ss (xdrx-ssget
(xdrx-string-multilanguage
"\n选择要处理的对象<退出>:"
"\nSelect objects to process <Exit>:"
)
)
)
(setq lens (sslength ss))
(setq ents (xd::pickset:coincide ss))
)
(progn
(setq nums 0)
(mapcar '(lambda (x)
(xdrx-entity-delete (setq coins (cdr x)))
(setq nums (+ nums (length coins)))
)
ents
)
(xdrx-prompt
(xdrx-string-formatex
(xdrx-string-multilanguage
"\n搜寻实体 %d ...\n共发现 %d 组重合的对象...\n删除了其中 %d 个重合实体."
"\nSearching for entities %d...\nA total of %d groups of Coincide objects were found...\n%d of the coinciding entities were deleted."
)
lens
(length ents)
nums
)
)
)
(progn
(xdrx-prompt
(xdrx-string-multilanguage
"\n没有发现重合实体."
"\nNo coinciding entities found."
)
)
)
)
(xdrx-end)
(princ)
)
=======================
The above LISP code uses the XDRX-API, which can be downloaded from
https://github.com/xdcad/XDrx-APIThe XDRX API encapsulates AcDb, AcEd, AcGe, AcBr... C++ library, using C++ methods to develop LISP programs.Thousands of Lisp functions are available.
Modify message