速度可以忍受,当然和机器的配置有关。
我的工具集中隐藏/显示实体的程序
使用中的两个发现
1 在这个应用中vlax-map-collection 比vlax-for 效率略有提高,很少
2 vlax-ename->vla-object 是比较耗时间的,在利用 vlax-curve 部分函数时,直接用while 和 实体名 比 转换或者 vlax-for 效率要高很多

- (defun Ea:OnOffObj (ss mode / ent obj sl n)
- (if (= (type ss) 'PICKSET)
- (progn
- (vlax-map-collection
- (vla-get-activeselectionset
- (vla-get-activedocument (vlax-get-acad-object))
- )
- '(lambda (x) (vla-put-visible x mode))
- )
- )
- )
- )
- ;;隐藏实体
- (defun c:Ea:HideObj (/ s t0 t1)
- (princ "\n选择隐藏实体.....")
- (setq s (ssget))
- (ea:onoffobj s :vlax-false)
- (vl-cmdf ".time" "off" "d" "")
- (princ)
- )
- ;;显示全部实体
- (defun c:Ea:ShowALL (/ s t0 t1)
- (setq s (ssget "x" '((60 . 1))))
- (vl-cmdf ".time" "r" "on" "d" "")
- (ea:onoffobj s :vlax-true)
- (vl-cmdf ".time" "off" "d" "")
- (princ)
- )
- 命令: ea:hideobj
- 选择隐藏实体.....
- 选择对象: 指定对角点: 找到 27973 个
- 选择对象:
- 当前时间: 2004年5月9日 于 0:36:43:906 下午
- 此图形的各项时间统计:
- 创建时间: 2000年3月22日 于 15:03:48:210 下午
- 上次更新时间: 2004年5月8日 于 23:52:45:093 下午
- 累计编辑时间: 8 天 19:16:34.686
- 消耗时间计时器 (开): 0 天 00:00:00.031
- 下次自动保存时间: 0 天 00:00:00.000
- 当前时间: 2004年5月9日 于 0:36:46:609 下午
- 此图形的各项时间统计:
- 创建时间: 2000年3月22日 于 15:03:48:210 下午
- 上次更新时间: 2004年5月8日 于 23:52:45:093 下午
- 累计编辑时间: 8 天 19:16:37.389
- 消耗时间计时器 (关): [color=red] 0 天 00:00:02.734[/color]
- 下次自动保存时间: 0 天 00:00:00.000
- 27973
- 命令: ea:showall
- 当前时间: 2004年5月9日 于 0:38:06:968 下午
- 此图形的各项时间统计:
- 创建时间: 2000年3月22日 于 15:03:48:210 下午
- 上次更新时间: 2004年5月8日 于 23:52:45:093 下午
- 累计编辑时间: 8 天 19:17:57.748
- 消耗时间计时器 (开): 0 天 00:00:00.015
- 下次自动保存时间: 0 天 00:09:59.984
- 当前时间: 2004年5月9日 于 0:38:09:500 下午
- 此图形的各项时间统计:
- 创建时间: 2000年3月22日 于 15:03:48:210 下午
- 上次更新时间: 2004年5月8日 于 23:52:45:093 下午
- 累计编辑时间: 8 天 19:18:00.280
- 消耗时间计时器 (关): [color=red] 0 天 00:00:02.547[/color]
- 下次自动保存时间: 0 天 00:09:57.453
- 27973
复制代码 |