未知命令...
[*];;抛一段简单代码,程序可正常运行,可根据个人需求修改。
[*];;实体SOLD填充时总出现"未知命令。。。",应该不是"qaflags"的问题
[*];;个人感觉问题出在"sold"填充没有比例和倾角上
;;调用command时的参数匹配性出问题;另外ctrl+z撤销时出现 _u GROUP (LISP 表达式)。。。
[*];;以上两个问题应该很常见的通用问题,
[*]
[*](defun C:TC (/ ent n oth_layer oth_name ss)
[*](setvar "cmdecho" 0)
[*](setvar "MEASUREMENT" 1)
[*](initget"A B C D E F G H J K L M N")
[*](setq ent (getstring "\n请指定填充图案[小草(A)/斜杠(B)/十字(C)/硂(D)/五边形(E)/五角星(F)/矩形(G)/泥土(H)/实体亮显(I)/墙柱填充(J)/素混凝土(K)/蜂窝(L)/后浇带(M)]:"))
[*](princ "\n选择对象")
[*](if (setq ss (ssget (list (cons -4 "<or") (cons -4 "<and") (cons 0 "LWPOLYLINE") (cons 70 1) (cons -4 "and>") (cons 0 "CIRCLE") (cons -4 "or>")) ));针对封闭线进行操作
[*] (progn
[*] (setq n 0)
[*] (repeat (sslength ss)
[*] (setq oth_name (ssname ss n))
[*] (cond
[*] ((= "A" (strcase ent)) (command "bhatch" "s" oth_name "" "p" "GRASS" "20" "0""co" 173 "" ""))
[*] ((= "B" (strcase ent)) (command "bhatch" "s" oth_name "" "p" "ANSI31" "80" "0" "co" 173 "" ""))
[*] ((= "C" (strcase ent)) (command "bhatch" "s" oth_name "" "p" "CROSS" "50" "0" "co" 173 "" ""))
[*] ((= "D" (strcase ent)) (command "bhatch" "s" oth_name "" "p" "ARMORED" "10" "0" "co" 83 "" ""));墙柱砼填充
[*] ((= "E" (strcase ent)) (command "bhatch" "s" oth_name "" "p" "HEX" "50" "0""co" 173 "" ""))
[*] ((= "F" (strcase ent)) (command "bhatch" "s" oth_name "" "p" "STARS" "50" "0" "co" 173 "" ""))
[*] ((= "G" (strcase ent)) (command "bhatch" "s" oth_name "" "p" "SQUARE" "50" "0" "co" 173 "" ""))
[*] ((= "H" (strcase ent)) (command "bhatch" "s" oth_name "" "p" "EARTH" "50" "45" "co" 173 "" ""))
[*] ((= "I" (strcase ent)) (command "_.bhatch" "s" oth_name "" "p" "SOLID" "co" 255 "" ""));
[*] ((= "J" (strcase ent))
[*] (setq oth_layer (cdr (assoc 8 (entget oth_name))))
[*] (if (or (= "S_COLU" oth_layer) (= "S_WALL" oth_layer))
[*] (if (tblsearch "LAYER" (strcat oth_layer "_HACH"))
[*] (progn
[*] (setvar "clayer" (strcat oth_layer "_HACH"))
[*] (command "bhatch" "s" oth_name "" "p" "SOLID" "co" "bylayer" "" "" "")
[*] )
[*] )
[*] (command "_.bhatch" "s" oth_name "" "p" "SOLID" "co" 15 "" "")
[*] )
[*] );
[*] ((= "K" (strcase ent)) (command "bhatch" "s" oth_name "" "p" "CONCRETE" "15" "0" "co" 173 "" ""));素混凝土
[*] ((= "L" (strcase ent)) (command "bhatch" "s" oth_name "" "p" "HONEY" "70" "0" "co" 173 "" ""))
[*] ((= "M" (strcase ent)) (command "bhatch" "s" oth_name "" "p" "NET" "100" "45""co" 43 "" ""))
[*] ;((= "N" (strcase ent)) (command "bhatch" "s" oth_name "" "p" "EARTH" "80" "45" "co" 173 "" ""))
[*] ;((= "O" (strcase ent)) (command "bhatch" "s" oth_name "" "p" "NET" "100" "45""co" 43 "" ""))
[*] (T (command "bhatch" "s" oth_name "" "p" "GRASS" "200" "0""co" 173 "" ""))
[*] )
[*] (setq n (1+ n))
[*] )
[*] )
[*])
[*](command "UNDO" "E")
[*](princ)
[*])
未知命令就是你的COMMAND后面多了个""
页:
[1]