不一定是图层问题,找了个140几个图层的dwg测试,用时不到1秒。以下是测试图层获取时间函数:
- (defun c:test (/ t0 tc)
- (setq t0 (getvar "TDUSRTIMER"))
- (setq tc (fy_tbl "LAYER"))
- (mapcar 'princ (list "\n图层数量:" (length tc) "个,(用时 " (* (- (getvar "TDUSRTIMER") t0) 86400) " 秒)"))
- (princ)
- )
- (defun fy_tbl (tbl / lay layer layname) ;符号表
- ;"LAYER"、"LTYPE"、"VIEW"、"STYLE"、"BLOCK"、"UCS"、"APPID"、"DIMSTYLE" "VPORT"
- (setq layer nil lay (tblnext tbl T))
- (while (/= lay nil)
- (setq layname (cdr (assoc 2 lay))
- layer (cons layname layer)
- lay (tblnext tbl)
- )
- )
- (setq layer (acad_strlsort layer))
- )
- (princ "\n测试获取图层时间,命令:test")
- (princ)
|