- UID
- 8476
- 积分
- 442
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-8-4
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
有如下一段显示或者隐藏实体的LSP,但是隐藏是采用ENTDEL的,所以在关闭图形前必须先SHOWIT
否则图形会丢失,我觉得要是在程序中加上一段反应器程序,让我们在关闭图形的时候,自动提示或者自动SHOWIT,就会安全许多,我不大会反应器,不知道是否可以实现,请各位帮帮忙,谢谢
[php]
;HIDIT.lsp Hides objects temporarily. Viji Varghese, Kerala, India, May '01
;SHOWIT.lsp Replaces the hidden objects.
(defun
C:HIDIT (/ ANO SM ASET SM)
(if (/= ASETN NIL)
(setq *ASETN ASETN)
) ;_ end of if
(while (= ASET NIL) (setq ASET (ssget)))
(setq ASETN (sslength ASET))
(if (/= *ASETN NIL)
(setq *ASETN (+ ASETN *ASETN))
) ;_ end of if
(if (= *HIDESET NIL)
(setq *HIDESET (ssadd))
) ;_ end of if
(setq ANO 0)
(repeat ASETN
(setq SM (ssname ASET ANO))
(setq ANO (1+ ANO))
(setq *HIDESET (ssadd SM *HIDESET))
(entdel SM)
) ;_ end of repeat
(princ (strcat (rtos ASETN 2 0) " object(s) hidden \nIf you want the objects back, run Showit BEFORE you close the drawing."))
(alert "\t\tWarning! \nRun Showit to return objects before closing drawing. \nObjects will be lost otherwise.")
(princ)
) ;_ end of defun
(defun
C:SHOWIT (/ ANU ANO SMA)
(if (/= *HIDESET NIL)
(progn
(setq ANU (sslength *HIDESET))
(setq ANO 0)
(repeat ANU
(setq SMA (ssname *HIDESET ANO))
(setq ANO (1+ ANO))
(entdel SMA)
) ;_ end of repeat
(princ (strcat (rtos ANU 2 0) " object(s) replaced"))
(princ)
) ;_ end of progn
) ;_ end of if
(setq *HIDESET NIL)
(princ
"\nHIDIT.lsp SHOWIT.lsp Written by Viji Varghese, Kerala, India May '01"
) ;_ end of princ
(princ)
) ;_ end of defun
[/php] |
|