马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
;;门窗搜索
- [FONT=courier new]
- (defun tq_getwinno (ewin / ent winstyle reactor)
- (setq ent (entget ewin))
- (while (/= (cdar ent) "TqWindow") (setq ent (cdr ent)))
- (setq winstyle (cdr (assoc '341 ent)))
- (setq reactor (entget (cdr (assoc '330 (entget winstyle)))))
- (while (AND (not (equal (cdadr reactor) winstyle)) reactor)
- (setq reactor (cdr reactor))
- )
- (cdar reactor)
- )
- (defun c:mcss (/ o_mc n_mc s n n1 n2 ins)
- (if (setq o_mc (getstring "\n请输入要搜索的门窗<退出>: "))
- (progn
- (setq s (ssget "x" (list (cons 0 "TQWINDOW"))))
- (setq n (sslength s))
- (setq n (- n 1))
- (while (>= n 0)
- (setq n1 (ssname s n))
- (setq n2 (tq_getwinno n1))
- (setq ins (cdr (assoc 10 (entget n1))))
- (if (= n2 (strcase o_mc))
- (progn
- (command "zoom" "c" ins "")
- (princ "\n屏幕中心的门窗编号为")
- (princ n2)
- (initget "y n")
- (setq yn
- (getkword
- "\,要改变门窗类型吗?<N>: "
- )
- )
- (if (= yn "y")
- (progn
- (command "_mcglx" n1 "")
- )
- (princ "\n正在搜索下一个门窗...")
- )
- )
- )
- (setq n (- n 1))
- )
- (setq s nil)
- )
- )
- (princ "\n门窗搜索完毕!")
- (princ)
- )
- [/FONT]
|