CHPROP命令必须在每条绘制线之后调用;你把那句话放错了(两处)。还有一个右括号漏掉了。不要忘记定位所有变量以避免干扰。
- (defun c:TEST1 ( / a1 [color=red]klim per s1 s2 scl[/color] )
- (if (not (tblsearch "LAYER" "DASHDOT"))
- (command "_layer" "_m" "DASHDOT" "_c" "1" "" "")
- )
- (setq scl (getvar "useri1")[color=red])[/color]
- (setq klim (* 0.0017 scl))
- [color=red] [s](comamnd "_CHPROP" "" "_S" klim "")[/s][/color]
- (SETQ PER "DASHDOT" )
- (command "_linetype" "[color=red]_[/color]s" per "" )
- [color=red] [s](command "_CHPROP" (entlast) "" "_S" klim "")[/s][/color]
- (print "draw DASHDOT line ")
- (print "")
- (setq s1 (getpoint "give the first point :"))
- (print "")
- (WHILE (setq s2 (getpoint s1 " give the second point :"))
- (print "")
- (command "[color=red]_[/color]line" [color=red]"non"[/color] s1 [color=red]"non"[/color] s2 "")
- [color=red] (command "_CHPROP" (entlast) "" "_S" klim "")[/color]
- (setq s1 s2)
- )
- )
请注意代码的格式,因为这样会更容易阅读。 |