这会让你开始
我对你的直径有误解
更改所有尺寸以适合
- (defun C:SS (/ cpt dia1 dia2 dist dpt ept hgt1 thk2
- sol1 sol2 sol3 sol4 spt subsol1 subsol2 thk1)
- (setvar "cmdecho" 0)
- (command "._-view" "_swiso")
- (command "._vscurrent" "_2")
- (setq dia1 (getdist "\nEnter big pipe diameter <168.3> : "))
- (if (not dia1)(setq dia1 168.3))
- (setq hgt1 (getdist "\nEnter pipe height <1000> : "))
- (if (not hgt1)(setq hgt1 150.))
- (setq thk1 (getdist "\nEnter pipe thickness <8> : "))
- (if (not thk1)(setq thk1 8.))
- (setq dia2 (getdist "\nEnter the conjunction pipe diameter <114.3> : "))
- (if (not dia2)(setq dia2 114.3))
- (setq thk2 (getdist "\nEnter thickness of insulation <40.0> : "))
- (if (not thk2)(setq thk2 40.))
- (setq dist (getdist "\nEnter distance between pipe axises <1000>: "))
- (if (not dist)(setq dist 1000.))
- (setq cpt (getpoint "\nPick center point of the big pipe: ")
- spt (list (car cpt)(+ (cadr cpt) hgt1)(caddr cpt))
- ept (list (car cpt)(- (cadr cpt) hgt1)(caddr cpt))
- )
- (command "._cylinder" "_non" spt dia1 "_A" ept)
- (setq sol1 (entlast))
- (command "._cylinder" "_non" spt (- dia1 (* 2 thk1)) "_A" ept)
- (setq subsol1 (entlast))
- (command "._rotate3d" sol1 "" "_X" "_non" cpt -45.)
- (setq sol1 (entlast))
- (command "._rotate3d" subsol1 "" "_X" "_non" cpt -45.)
- (setq subsol1 (entlast))
- (setq dpt (list (+ (car cpt) dist) (cadr cpt)(caddr cpt)))
- (command "._copy" sol1 "" "_non" cpt "_non" dpt)
- (setq sol2 (entlast))
- (command "._rotate3d" sol2 "" "_X" "_non" cpt 90.)
- (setq sol2 (entlast))
- (command "._copy" subsol1 "" "_non" cpt "_non" dpt)
- (setq subsol2 (entlast))
- (command "._rotate3d" subsol2 "" "_X" "_non" cpt 90.)
- (setq subsol2 (entlast))
- (command "._cylinder" "_non" cpt dia2 "_A" dpt)
- (setq sol3 (entlast))
- (command "._cylinder" "_non" cpt (+ dia2 (/ thk2 2.)) "_A" dpt)
- (setq sol4 (entlast))
- (command "._subtract" sol4 "" sol3 "")
- (setq sol4 (entlast))
- (command "._subtract" sol4 "" subsol1 "")
- (setq sol4 (entlast))
- (command "._subtract" sol4 "" subsol2 "")
- (setq sol4 (entlast))
- (command "._subtract" sol4 "" sol1 "")
- (setq sol4 (entlast))
- (command "._subtract" sol4 "" sol2 "")
- (command "._vscurrent" "_C")
- (setvar "cmdecho" 1)
- (princ)
- )
~'J'~ |