您好,我正在使用此lisp代码在图形中插入围栏线型。我有一个小问题,因为a使用了很多行。问题是当我给予
(setvar“LTSCALE”6)然后线型设置中的全局比例因子转换为6。当我插入带有(setvar“LTSCALE”2)的线型时,全局比例因子转换为2。结果变得一团糟。我想将“属性”菜单中的线型比例更改为6或2,而不是全局比例因子。当我选择一条直线时,“特性”菜单中的线型比例为1。
- (DEFUN C:SYR2 (/ CONVERT KLIM OLD_CLT S1 S2 SCL SS)
- (setq old_clt (getvar 'CELTYPE))
- (if (and (not (tblsearch "ltype" "fence"))
- (findfile "C:\\topocad\\topo.lin")
- )
- (command "-linetype" "l" "fence" "C:\\topocad\\topo.lin" "")
- )
- (if (tblsearch "ltype" "fense")
- (progn
- (setq ss (ssadd))
- (COMMAND "_layer" "_m" "_fense" "_c" "140" "_fense" "_lt" "fense" "fense" "")
- (SETQ KLIM 1)
- (COMMAND "_linetype" "_s" "fense" "")
- (setvar "PSLTSCALE" 1)
- (setvar "LTSCALE" 6)
- (setvar "MSLTSCALE" 1)
- (SETQ S1 (GETPOINT "\ngive the first point :"))
- (WHILE (SETQ S2 (GETPOINT S1 "\ngive the second point :"))
- (COMMAND "_line" "non" S1 "non" S2 "")
- (COMMAND "_CHPROP" (ENTLAST) "" "_S" KLIM "")
- (ssadd (ENTLAST) ss)
- (SETQ S1 S2)
- )
- (setvar 'CELTYPE old_clt)
- (initget "Yes No")
- (if (and (setq
- convert (cond
- ((getkword "\nconvert to polyline? [Yes/No] <N>: "))
- ("No")
- )
- )
- (/= (sslength ss) 0)
- (= convert "Yes")
- )
- (if (= (getvar 'PEDITACCEPT) 0)
- (command "_.pedit" "_M" ss "" "_Y" "_J" "" "")
- (command "_.pedit" "_M" ss "" "_J" "" "")
- )
- )
- )
- )
- (princ)
- )
|