- ;;预设常用 -------------------- TC
- ;;V1.2
- ;;优化代码,去掉拼凑代码重新设计
- ;;增加记忆功能,提高填充的使用方便性
- ;;在V1.1的基础上实现点选,与对象选择并存,并且都可以多选。
- ;;----------------------------------
- (defun c:TC (/ opt oldcolor num_HType *num_HType* ss )
- (setvar "measurement" 1) ; 设置公制单位
- (setvar "cmdecho" 0) ; 关闭命令响应
- (setq oldcolor (getvar "cecolor"))
- (command "_layer" "m" "4BD-METAL" "c" "201" "" "l" "c" "" "")
- (setvar "clayer" "4BD-METAL")
- (if *num_HType*
- (setq num_HType (getint (strcat "\n选择填充样式 ①BD玻璃实体 ②BD金属实体 ③拉丝80 ④地砖300 ⑤地砖800 ⑥木地板 ⑦木夹板 ⑧木纹 ⑨钢砼: <" (rtos *num_HType* 2 0) ">")))
- (setq num_HType (getint "\n选择填充样式 ①BD玻璃实体 ②BD金属实体 ③拉丝80 ④地砖300 ⑤地砖800 ⑥木地板 ⑦木夹板 ⑧木纹 ⑨钢砼: " ))
- )
- (if (not num_HType)
- (setq num_HType *num_HType*)
- (setq *num_HType* num_HType)
- )
- (setq opt num_HType)
-
- (if (< 0 opt 10) (eval (read(strcat "(tianchong" (itoa opt) ")"))));根据选项参数执行填充样式
-
- (if (setq ss (ssget))
- (command "bhatch" "s" ss "" "") ;如果选择集不为空,则执行对象填充
- (progn ;如果选择集为空,则执行点选命令
- (prompt "\n请拾取填充内部点:\n")
- (command "bhatch" pause)
- (while (> (getvar "CMDACTIVE") 0) (command PAUSE))
- ))
-
- (command "color" oldcolor)
- (princ)
- )
- (defun tianchong1 ()
- (prompt "\n当前样式: ①BD玻璃实体填充\n")
- (prompt "\n请选择对象,跳过则为拾取内部点:\n")
- (command "color" "131")
- (command "bhatch" "p" "solid" "")
- )
- (defun tianchong2 (/ ss)
- (command "_layer" "m" "4BD-METAL" "c" "201" "" "l" "c" "" "")
- (prompt "\n当前样式: ②BD金属实体填充\n")
- (prompt "\n请选择对象,跳过则为拾取内部点:\n")
- (command "color" "201")
- (setvar "clayer" "4BD-METAL")
- (command "bhatch" "p" "solid" "")
- (setq ss (entlast))
- (COMMAND "CHANGE" SS "" "PROPERTIES" "la" "4BD-METAL" "")
- )
- (defun tianchong3 ()
- (prompt "\n当前样式: ③拉丝间距80\n")
- (prompt "\n请选择对象,跳过则为拾取内部点:\n")
- (command "color" "8")
- (command "bhatch" "p" "U" "0" "80" "N" "")
- )
- (defun tianchong4 ()
- (prompt "\n当前样式: ④300x300地砖\n")
- (prompt "\n请选择对象,跳过则为拾取内部点:\n")
- (command "color" "8")
- (command "bhatch" "p" "U" "0" "300" "Y" "")
- )
- (defun tianchong5 ()
- (prompt "\n当前样式: ⑤800x800地砖\n")
- (prompt "\n请选择对象,跳过则为拾取内部点:\n")
- (command "color" "8")
- (command "bhatch" "p" "U" "0" "800" "Y" "")
- )
- (defun tianchong6 ()
- (prompt "\n当前样式: ⑥灰色木地板\n")
- (prompt "\n请选择对象,跳过则为拾取内部点:\n")
- (command "color" "8")
- (command "bhatch" "p" "木地板" "80" "0" "")
- )
- (defun tianchong7 ()
- (prompt "\n当前样式: ⑦暗色木夹板\n")
- (prompt "\n请选择对象,跳过则为拾取内部点:\n")
- (command "color" "250")
- (command "bhatch" "p" "木夹板" "1" "0" "")
- )
- (defun tianchong8 ()
- (prompt "\n当前样式: ⑧暗色木纹\n")
- (prompt "\n请选择对象,跳过则为拾取内部点:\n")
- (command "color" "250")
- (command "bhatch" "p" "木纹01" "10" "0" "")
- )
- (defun tianchong9 ()
- (prompt "\n当前样式: ⑨暗色钢砼\n")
- (prompt "\n请选择对象,跳过则为拾取内部点:\n")
- (command "color" "250")
- (command "bhatch" "p" "钢筋混凝土" "20" "0" "")
- )
|