将此更改为。fsa?
我已经尽我所能捆绑了所有的setq,我现在错过了什么?它加载并运行良好。订书钉(#)无法使用,因此我使用了附件
谢谢mike
2-10-14 31 .lsp 迈克,
你的格式化方法不是很清楚,我已经复习了你代码的第一部分(见下文)。看起来您有一些不平衡的括号,但是由于您的格式化方案,很难找到问题所在。请花些时间把你的代码整理好,问题所在就会清楚了。
(defun ls-error (str)
(if (/= str "Function canaeled")
(princ (strcat "\n Error Size,Offset,Length Change one Try again ERROR: " str))
)
(setvar "osmode" oom)
(setvar "blipmode" obm)
(setvar "dimzin" odz)
(setvar "dimazin" odaz)
(setq *error* olderr)
(princ)
)
(defun tan(ang) (/ (sin ang)(cos ang)))
(defun asin (sine) (atan sine (sqrt (- 1 (* sine sine )))))
(defun acos (cosine) (atan (sqrt (- 1 (* cosine cosine))) cosine))
(defun C:789 (/ svup2 )
;(command ".purge" "Block" "*" "no")
(command ".layer" "M" "1" "C" "7" ""
"M" "2" "C" "3" ""
"M" "3" "C" "4" ""
"M" "4" "C" "5" ""
"M" "5" "C" "7" ""
"M" "center" "C" "1" ""
"M" "6" "C" "1" ""
"M" "7" "C" "6" """"
".layer" "S""1"""
)
(setq olderr *error*
*error* ls-error
oom(getvar 'osmode)
obm(getvar 'blipmode)
odz(getvar 'dimzin)
ods(getvar 'dimscale)
ode(getvar'dimadec)
odaz (getvar 'dimazin)
)
(setvar "dimazin" 2)
(setvar "osmode" 0)
(setvar "blipmode" 0)
(setvar "dimzin"
(setvar "dimscale"
(setvar "dimadec" 4)
(setvar "cmdecho" 0)
(command ".viewres" "" 10000)
;(setvar "osmode" 4)
(command ".insert" "two day" "0,0" "" "" ""
".zoom" "all"
)
(initget "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35")
(setq pick (getkword"\nPick a number 1-35 and hit Enter"))
(command ".erase" "L" "")
(while (= pick "31")
(command ".insert" "CA1_31" "0,0" "" "" ""
".zoom" "A"
".zoom" ".9x"
)
(initget 7)
(setq Sia (getreal "\n Enter Curb Size {A}."))
(initget 7)
(setq Sib (getreal "\n Enter Curb Size {B}."))
(initget 7)
(setq sic (getreal "\n Enter Unit Size {C}."))
(initget 7)
(setq sid (getreal "\n Enter Unit Size {D}."));ALL Letter are up one
(command ".erase" "l" ""
".layer" "s" "Center" ""
)
(setq p1 (list 800 10)
p2 (polar p1 0 4)
p3 (polar p2 (/ pi 2) 12)
p4 (polar p3 0 1.5)
p5 (polar p4 (* pi 1.5) 1)
p6 (polar p5 0 (- sia 3))
p7 (polar p6 (/ pi 2) 1)
p8 (polar p7 0 1.5)
p9 (polar p8 (* pi 1.5) 12)
p10 (polar p9 0 4)
p11 (polar(polar(polar p3 0 (/ sia 2))(/ pi 2) 36) pi (/ sic 2))
p12 (polar p11 0 sic)
)
(command ".line" p1 p2 p3 p4 p5 ""
".line" p6 p7 p8 p9 p10 ""
".dimlinear" p3 p8 "h" (polar p3 (/ pi 2) 6)
".layer" "s" 3 ""
".rectangle" p11 (polar(polar p11 0 sic)(/ pi 2) 48)
".zoom" "w" (polar p11 (* pi 1.25) 68)(polar(polar p12 (/ pi 2) 48)(/ pi 4)30)
".zoom" ".9x"
".dimlinear" p11 p12 "h" (polar p11 (* pi 1.5) 6)
)
(command ".dimlinear" p11 p3 "h" (polar p11 (* pi 1.5) 18))
(setq en (entlast)
en (entget en)
ds "E")(entmod (subst (cons 1 ds) (assoc 1 en) en)
)
(command ".dimlinear" p12 p8 "h" (polar p12(* pi 1.5) 18))
(setq en (entlast)
en (entget en)
ds "F")(entmod (subst (cons 1 ds) (assoc 1 en) en)
)
(initget 1 "Yes No")
(setq ucoc (getkword"\n Is the Unit Center Over the Curb Offsets E and F ? {Yes No} "))
(setq ufs (if (= ucoc "No") 2));unit not center=2
(while (= ufs 2)
(initget 1 "E F")
(setq offs (getkword "\n Which Offset do you have {E} or {F} {Zero offset is OK next question}")
ufs 6
)
)
(while (= offs "E")
(initget 1)
(setq loffs (getreal "\n Enter Offset {E} Zero = Flat")
eofs(if (= loffs 0) 1 2)
offs l6
)
)
(setq eoff nil)
(while (= eofs 2)
(initget 1 "Inside Outside")
(setq eoff (getkword"\n Is the Unit Inside or Outside the Curb {I} or {O}")
eoff(if (= eoff "Inside") 0 pi)
offs l6
eofs 6
)
)
(while (= ucoc "Yes")
(command ".layer" "s" 3 "")
(command ".erase" "C"(polar p12 (* pi 1.75)16)(polar p11 (/ pi 1.33)16)"")
(setq p11 (polar(polar(polar p3 0 (/ sia 2))(/ pi 2) 36) pi (/ sic 2))
p12 (polar p11 0 sic)
)
谢谢你,现在工作是将进入。fas公司 Snow nut a freebie a check Bracks lisp雪地螺母
; by BIGAL date years ago 1980s
(defun c:chkbrk (/ opf bkt chekdfile rdctl wkfile currentln wln ltr ncln)
(setvar "cmdecho" 0)
(prompt "\nlook at end of line")
;(setq chekdfile (getstring "enter name of file :"))
(SETQ chekdfile (getfiled "Enter file name:" " " "LSP" 4))
(setq opf (open chekdfile "r"))
(setq bkt 0)
(setq blkl 0)
(setq rdctl 1)
(setq wkfile (open "c:\temp\wow.lsp" "w"))
(setq currentln "a")
(while (/= blkl 6)
(setq currentln (read-line opf))
(if (= currentln nil)(setq currentln ""))
(if (= currentln "")(setq blkl (+ 1 blkl))(setq blkl 1))
(setq wln currentln)
(while (/= wln "")
(setq ltr (substr wln 1 1))
(setq wln (substr wln 2))
(cond ((= (ascii ltr) 34) (if (= rdctl 0)(setq rdctl 1)(setq rdctl 0)))
((and (= ltr "(")(= rdctl 1))(setq bkt (+ bkt 1)))
((and (= ltr ")")(= rdctl 1))(setq bkt (- bkt 1)))
((and (= ltr ";")(= rdctl 1))(setq wln ""))
;(t (prompt ltr))
)
)
(setq ncln (strcat currentln ";" (itoa bkt)
(princ (itoa bkt))
(if (= rdctl 0) "string open" "")))
(if (/= currentln "")(write-line ncln wkfile))
)
(close wkfile)
(close opf)
(prompt (strcat "open brakets= " (itoa bkt) "."))
)
(setq ang1 nil
pt1 nil
pt2 nil
pt3 nil
pt4 nil
pt5 nil)
(princ)
谢谢比格尔,我会试试的。
布鲁斯
页:
[1]