;;做选择标记
(defun c:fs_mksstag (/ a mk)
  (defun mk (/ date hand pt)
    (setq pt (entmakex '((0 . "POINT") (10 0 0 0) (60 . 1))))
    (setq hand (fsxm-getendxf pt 5))
    (entdel pt)
    (setq date (menucmd	(strcat	"M=$(edtime,"
				(rtos (getvar "date") 2 8)
				",YYYY-MO-DD  H:MM.SS)"
			)
	       )
    )
    (setq *fsxm_seltag* (list hand date))
    (princ (strcat "\n已做好选择标记：" date))
    (princ)
  )
  (cond	(*fsxm_seltag*
	 (princ (strcat "\n发现选择标记：" (cadr *fsxm_seltag*)))
	 (initget "N D S C")
	 (setq
	   a (getkword
	       "\n[替换标记(N)/清除标记(D)/选择标记后(S)/退出(C)]<N>："
	     )
	 )
	 (cond ((= a "D")
		(setq *fsxm_seltag* nil)
		(princ "\n*****选择标记已成功清除*****")
	       )
	       ((= a "N") (mk))
	       ((= a "S") (c:fs_selsstag))
	 )
	)
	(t (mk))
  )
  (princ)
)
;;选择标记后
(defun c:fs_selsstag (/ len ss)
  (cond
    (*fsxm_seltag*
     (princ (strcat "\n找到选择标记：" (cadr *fsxm_seltag*)))
     (setq ss (fsxm-newselection (handent (car *fsxm_seltag*))))
     (setq len (sslength ss))
     (cond
       ((zerop len)
	(princ "\n*****自标记后没有新的图元产生*****")
       )
       (t
	(princ
	  (strcat "\n共选取了<" (itoa len) ">个标记后产生的图元")
	)
	(sssetfirst nil ss)
       )
     )
    )
    (t
     (alert
       "\n没有发现可用的选择标记！\n做标记请执行【fs_mksstag】命令!"
     )
    )
  )
  (princ)
)