在“if”语句中,似乎是通过用括号括起来对命令进行分组。相反,您需要使用“progn”对它们进行分组。
所以试试看:
- (if (< 500 lth)
- (progn
- (command "pline" ar1 "w" "0" "0" t1 "w" "50" "0" t2"")
- (setq sa1(entlast))
- (command "pline" ar2 "w" "0" "0" t3 "w" "50" "0" t4"")
- (setq sa2(entlast))
- (command "pline" ar3 "w" "0" "0" t5 "w" "50" "0" t6"")
- (setq sa3(entlast))
- (command "change" sa1"" "p" "la" "GRILLE" "")
- (command "change" sa2"" "p" "la" "GRILLE" "")
- (command "change" sa3"" "p" "la" "GRILLE" "")
- )
- (progn
- (command "pline" ar4 "w" "0" "0" t7 "w" "50" "0" t8"")
- (setq sa4(entlast))
- (command "change" sa4"" "p" "la" "GRILLE" "")
- ))
我可以看到一些压缩代码的方法,例如更改3个对象的层:
(命令“change”sa1 sa2 sa3““p”“la”“grill”) |