;;楼主的函数 (defun AO:GETLASTENT (*LASTENT* / NEWENTSEL EN) ;ENT->*LASTENT* (if (/= NIL *LASTENT*) (progn (setq NEWENTSEL (ssadd)) (while (/= (setq *LASTENT* (entnext *LASTENT*)) NIL) (setq EN (entget *LASTENT*)) (if (not (member '("0 . SEQEND") EN));不完整,欠一些物件没有去除 (ssadd *LASTENT* NEWENTSEL) ) ) (setq *LASTENT* NIL) ) ) NEWENTSEL )
;;只是例子,没有除错 (defun C:TT (/ ENDLAST SUM_MIRROR) (setvar "CMDECHO" 1) (setq ENDLAST (entlast)) (command ".MIRROR" (ssget) "" PAUSE PAUSE "N") (command "_.MOVE" (AO:GETLASTENT ENDLAST) "") ) |