在粗略浏览之后,我添加了一些更正并压缩了一些表达式-以下可能仍然包含拼写错误并且未经测试,但希望能有所帮助:
- ;;This program is to draw a 3d model of a studwall
- (defun c:STUDwall ( / ceilinghgt firstud hdr1 hdr2 hdrftr hdrlth laststud pt1 pt10 pt11 pt12 pt2 pt3 pt4 pt5 pt6 pt7 pt8 pt9 secondlast stud studlth thk unflrbeamhgt wallhdr wallstud wallth width )
- (if (setq pt1 (getpoint "\nPick point: "))
- (progn
- (setq Ceilinghgt 96.0
- UnflrBeamhgt (+ Ceilinghgt 0.5) ; Gyproc thickness 0.5 off floor.
- Wallth 180.0
- Width 3.5
- Hdrlth (+ Wallth Width)
- Thk 1.5
- Studlth (- UnflrBeamhgt (* Thk 3))
- PT5 (list (car PT1) (cadr PT1) (+ (last PT1) 1.5))
- PT2 (polar PT5 0 Thk)
- PT3 (polar PT2 (/ pi 2) Width)
- PT4 (polar PT3 pi Thk)
- )
- (command "_.pline" "_non" PT5 "_non" PT2 "_non" PT3 "_non" PT4 "_non" PT5 "")
- (setq Wallstud (entlast)
- PT6 (polar PT1 0 Hdrlth)
- PT7 (polar PT6 (/ pi 2) Width)
- PT8 (polar PT7 pi Hdrlth)
- PT9 (list (car PT1) (cadr PT1) (+ (last PT1) 91.5))
- )
- (command "_.pline" PT1 "_non" PT6 "_non" PT7 "_non" PT8 "_non" PT1 "")
- (setq Wallhdr (entlast))
- (command "_.extrude" Wallhdr "" Thk)
- (setq HdrFtr (entlast))
- (command "_.extrude" Wallstud "" Studlth)
- (setq Stud (entlast)
- PT10 (list (car PT5) (cadr PT5) (+ (last PT5) Studlth))
- PT11 (list (car PT10) (cadr PT10) (+ (last PT10) 1.5))
- PT12 (list (+ (car PT1) (- Hdrlth 1.5)) (cadr PT1) (last PT1))
- )
- (command "_.copy" Hdrftr "" "_non" PT1 "_non" PT10)
- (setq Hdr1 (entlast))
- (command "_.copy" Hdr1 "" "_non" PT10 "_non" PT11)
- (setq Hdr2 (entlast))
- (command "_.copy" stud "" "_non" PT1 "_non" PT12)
- (setq Laststud (entlast))
- (command "_.copy" laststud "" "" "_non" '(-1.5 0 0))
- (setq Secondlast (entlast))
- (command
- "_.copy" secondlast "" "" "_non" '(-1.5 0 0)
- "_.array" stud "" "r" "1" (fix (/ (+ Wallth width) 16)) 16
- "_.copy" stud "" "" "_non" '(1.5 0 0)
- )
- (setq Firstud (entlast))
- (command "_.copy" Firstud "" "" "_non" '(1.5 0 0))
- )
- )
- (princ)
- )
|