本帖最后由 yaojing38 于 2024-11-28 09:30 编辑
- (Defun C:qz (/ CNAME ENT SS SS1 la lay n)
- (princ "\n请选择要前置的图层:")
- (setq ss (ssget))
- (repeat (setq n (sslength ss))
- (setq ent (ssname ss (setq n (1- n))))
- (setq la (cdr (assoc 8 (entget ent))))
- (if (not (member la lay)) (setq lay (cons la lay)))
- );;end repeat
- (setq cname (apply 'strcat (apply 'mapcar (cons 'strcat (list lay (mapcar '(lambda (x) ",") lay))))))
- (princ (strcat "\n选中了图层:" cname ))
- (setq ss1 (ssget "x" (list (cons 8 cname))))
- (vl-cmdf "draworder" ss1 "" "f")
- (princ)
- )
|