dbakeg00 Posted March 2, 2010 Posted March 2, 2010 Hello All, First, let me start off by saying that I'm a rookie at LISP So, I found this LISP online that will draw an elevation and an orientation of a pressure vessel along with a data table. It seems to work pretty well except for a couple of things. 1.) It asks for and draws elements in mm, is there anyone who can help me to fix the LISP so that it will draw in inches? 2.) It only asks for the I.D. right now, could anyone possibly help me to make the LISP put forth the option of I.D. or O.D.? 3.) It asks for the material of the vessel, but I don't see where it uses the that input. I tried looking through that code, but like I said I'm a noobie. Anyone have any thoughts? Thanks in advance for any help, I know this is a lot to ask. ; Name: pv (pressure vessel design) ; Description:Design a pressure vessel t ; hat according with China Spec.(basicly s ; ame as ASME) ; By: zuo wei ; ; Inputs:Design Pressure, Inside diamete ; r, Shell Height. ; ; Returns:A Design summary table and to ; draw the designed pressure vessel. ; ;This code is copyrighted and has ; limited warranties.Please see http://w ; ww.Planet-Source-Code.com/vb/scripts/Sho ; wCode.asp?txtCodeId=84&lngWId=13 ;for details. ;************************************** (defun c:pv () (setvar "osmode" 0) (setq tth (getvar "textsize")) (setq clu (list "Design Codes" "Densign Pressure MPa (G)" "Design Temperature (oC)" "Inside Diameter (mm)" "Vessel Hight (mm)" "Medium" "Test Pressure MPa" "Volume (m^3)" "Empty Weight (kg)" "Body Materials" "Shell Thick (mm)" "Head Thick (mm)" "Outside Paint Area (m^2)" ) ) (setq pt0 (getpoint "\nDRAWING BASE POINT: ")) (if (setq prss (getreal "\ Design Pressure at MPa (1 psi=0.007Mpa) : ")) (if (setq mat (getstring "\ Vessel Material: ")) (if (setq vid (getreal "\ Vessel ID in mm: ")) (if (setq shll (getreal "\ Shell Length: ")) (list (cons 10 prss) (cons 20 mat) (cons 30 vid) (cons 40 shll) (cons 50 pt1) ) ) ) ) ) (if (< prss 0.1) (setq prss 0.1)) (setq fy 107) (cond ((eq mat "16Mn") (setq fy 163)) ((eq mat "A709")(setq fy 163)) ((eq mat "Gr50") (setq fy 163)) ((eq mat "Q345") (setq fy 163))) ;(command "text" pt0 "" 0 fy) (setq st (/ (* prss vid) (- (* fy 2) prss))) (setq st (+ 2 st)) (setq ht (/ (* prss vid) (- (* fy 2) (* 0.5 prss)))) (setq ht (+ 3 ht)) (if (< st (+ ht 2)) (setq st ht)) (if (< ht st) (setq ht (+ 0 st)) ) (Setq st0 (rtos (* 2 (atof (rtos (/ st 2) 2 0)))2 0 )) (Setq ht0 (rtos (* 2 (atof (rtos (/ ht 2) 2 0)))2 0 )) (setq st (atof st0)) (setq ht (atof ht0)) (Setq vid0 (* 200 (atof (rtos (/ vid 200) 2 0)))) (setq vid1 (rtos vid0 2 0)) (setq vid vid0) (setq vsl (+ shll (/ vid 2) ht ht)) (setq tprss (* prss 1.5)) (setq vvl (/ (+ (* pi (/ vid 2) (/ vid 2) shll) (* 1.3333333 pi (expt (/ vid 2) 3)) ) (expt 1000 3) ) ) (setq vwg (/ (* 1.2 (+ (* pi shll st vid) (* pi vid vid ht)) 7850) (expt 1000 3) ) ) (setq parea (/ (+ (* pi shll vid) (* pi vid vid)) (expt 1000 2))) (Setq prss0 (rtos prss 2 2)) (Setq vsl0 (rtos vsl 2 0)) (Setq tprss0 (rtos tprss 2 2)) (Setq vvl0 (rtos vvl 2 2)) (Setq vwg0 (rtos vwg 2 2)) (Setq parea0 (rtos parea 2 2)) (setq rw (list "GB-150" prss0 "Ambient" vid1 vsl0 "Air" tprss0 vvl0 vwg0matst0 ht0 parea0 ) ) (setq i 0) (setq tth (/ (+ vsl vid vid) 200)) (setvar "textsize" tth) (setq tt1 (* tth 1.) (setq tt2 (* tth 26)) (setq pt1 (polar pt0 0 vid)) (while (<= i 13) (progn (setq aa (nth i clu)) (setq pt1 (polar pt1 (* pi 1.5) tt1)) (command "text" pt1 "" 0 aa) (setq pt2 (list (+ (car pt1) (- tt2 0)) (+ (cadr pt1) (- tt1 0))) ) (command "rectang" pt1 pt2 "") (setq e1 (entlast)) (setq pt1aa (polar pt1 (* 1.25 pi) (* 0.625 tth))) (command "move" e1 "" pt1 pt1aa "") (setq i (+ i 1)) ) ) (setq i 0) (setq tt2 (* tth 12)) (setq pt1 (polar pt0 0 (+ (* tth 26) vid))) (while (<= i 13) (progn (setq aa (nth i rw)) (setq pt1 (polar pt1 (* pi 1.5) tt1)) (command "text" pt1 "" 0 aa) (setq pt2 (list (+ (car pt1) (- tt2 0)) (+ (cadr pt1) (- tt1 0))) ) (command "rectang" pt1 pt2 "") (setq e1 (entlast)) (setq pt1aa (polar pt1 (* 1.25 pi) (* 0.625 tth))) (command "move" e1 "" pt1 pt1aa "") (setq i (+ i 1)) ) ) (command "layer" "make" 11 "color" 7 "" "ltype" "continuous" "" "") (command "layer" "set" 11 "") (setq pt1 (polar pt0 0 0)); (setq pt2 (polar pt1 0 (/ vid 2))) (setq pt3 (polar pt2 (* pi 0.5) shll)) (setq pt4 (polar pt1 0 (+ st (/ vid 2)))) (setq pt5 (polar pt4 (* pi 0.5) shll)) (setq pt2a (polar pt1 pi (/ vid 2))) (setq pt3a (polar pt2a (* pi 0.5) shll)) (setq pt4a (polar pt1 pi (+ st (/ vid 2)))) (setq pt5a (polar pt4a (* pi 0.5) shll)) (command "line" pt2 pt3 "") (setq e1 (entlast)) (command "line" pt4 pt5 "") (setq e2 (entlast)) (command "line" pt2a pt3a "") (setq e3 (entlast)) (command "ellipse" "Arc" pt2 pt2a (/ vid 4) 180 360 "" "") (setq e4 (entlast)) (command "line" pt4a pt5a "") (setq e5 (entlast)) (command "ellipse" "a" pt4 pt4a (+ (/ vid 4) ht) 180 360 "" "" ) (setq e6 (entlast)) (command "line" pt5 pt5a "") (setq e7 (entlast)) (command "line" pt4 pt4a "") (setq e8 (entlast)) (command "change" e1 e3 e4 "" "properties" "color" 3 "LT" "hidden" "") (setq pt10 (polar pt0 (/ pi 2) (/ shll 2))) (setq pt11 (polar pt10 0 (* vid 0.55))) (command "line" pt10 pt11 "") (setq e9 (entlast)) (setq pt6 (polar pt0 (/ pi -2) (+ (/ vid 4) ht))) (setq pt7 (polar pt6 (/ pi 2) vsl)) (command "line" pt6 pt7 "") (setq e10 (entlast)) (command "mirror" e9 "" pt0 pt6 "n" "") (setq e11 (entlast)) (command "mirror" e4 "" pt10 pt11 "n" "") (setq e17 (entlast)) (command "mirror" e6 "" pt10 pt11 "n" "") (setq e18 (entlast)) (command "change" e9 e10 e11 "" "properties" "color" 1 "LT" "center" "") (setq pt20 (polar pt0 (/ pi -2) (* 1.3 vid))); (command "circle" pt20 "d" vid "") (setq e13 (entlast)) (command "circle" pt20 "d" (+ vid (* st 2)) "") (setq e14 (entlast)) (command "change" e13 "" "properties" "color" 3 "LT" "hidden" "") (setq pt21 (polar pt20 0 (* 0.55 vid))) (setq pt22 (polar pt20 (/ pi 2) (* 0.55 vid))) (command "line" pt20 pt21 "") (setq e15 (entlast)) (command "line" pt20 pt22 "") (setq e16 (entlast)) (command "change" e15 e16 "" "properties" "color" 1 "LT" "center" "") (setq ptp1 pt4);00 (setq ptp2 pt4a);od (setq ptp3 pt5a);sh (setq ptp4 pt6);bottom (setq ptp5 pt7);top (setq e01 e2);shl (setq e02 e5);shll (setq e03 e6);hd (setq e04 e18);hdb (setq e05 e14);cp (setq ptd (polar ptp1 (/ pi 2) (* 0.2 shll))) (command "dimlinear" ptp1 ptp2 ptd "") (setq ptd (polar ptp4 0 (* 0.65 vid))) (command "dimlinear" ptp4 ptp5 ptd "") (setq e19 (entlast)) (setq ptd (polar ptp4 0 (* 0.6 vid))) (command "dimlinear" pt4 pt5 ptd "") (command "dimlinear" ptp4 pt4 "V" ptd "") ; ; (setvar "osmode" 4135) ) -db Quote
Cad64 Posted March 2, 2010 Posted March 2, 2010 Did you happen to notice this line: "This code is copyrighted and has limited warranties. Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=84&lngWId=13" Quote
dbakeg00 Posted March 2, 2010 Author Posted March 2, 2010 I did notice that...but I figured that: 1.) it is given out as free ware on the website so it would be ok for me to re-post it in its completeness; 2.) I didn't remove the author's information or try to take credit for his work; and 3.) just because it's copyrighted, doesn't mean I am not allowed to change it. Those were my thoughts before posting the thread. Am I reasoning incorrectly or did I miss something. I certainly didn't mean to break any rules or offend anyone. Quote
The Buzzard Posted March 2, 2010 Posted March 2, 2010 I did notice that...but I figured that: 1.) it is given out as free ware on the website so it would be ok for me to re-post it in its completeness; 2.) I didn't remove the author's information or try to take credit for his work; and 3.) just because it's copyrighted, doesn't mean I am not allowed to change it. Those were my thoughts before posting the thread. Am I reasoning incorrectly or did I miss something. I certainly didn't mean to break any rules or offend anyone. Take note to line no.2: Terms of Agreement: By using this code, you agree to the following terms... 1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge. 2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws. 3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description. Quote
dbakeg00 Posted March 2, 2010 Author Posted March 2, 2010 I apologize for not taking the time to look at the referenced website. I am currently in the process of asking for permission from the author to repost this LISP routine for the purpose of tailoring it to my specific needs. I'll keep everyone updated. Thanks. -db Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.