;;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)
) 我和其他人一样有效吗?任何一种做3d墙的方式。使用厚度。
谢谢大个子艾尔和李,我会试试你修改后的动作,谢谢。 李-麦克,谢谢你,它很管用。我以前没有见过你,但这似乎成功了。当我看着的时候!修正前的spt y坐标是一个非常小的数字-2.346。。e 13你知道是什么引起的吗。可能是单位精度设置还是其他?
谢谢
好东西
请参阅我的教程的第一节以获取解释。
此类值通常由双精度浮点数的舍入引起(在AutoLISP中也称为double或reals)-2.3456e-13是-0.00000000000023456的指数表示法,即一个非常小的数字。因此,这很可能是将算术运算应用于0.0的结果,导致在每次计算中都会出现难以置信的小舍入误差。
由于浮点格式的本质,这种舍入错误是不可避免的,因为将数字存储到无限精度将需要无限量的内存。双精度占用64位内存(8字节),允许大约15位有效精度。
页:
1
[2]