;;CONVERT.LSP Unit Conversions. (defun c:cv (/ go go1 from to) (setq from '("link" "rod" "chain" "inches" "feet" "survey_feet" "yards" "mile" "" "millimeters" "centimeters" "decimeters" "meters" "dekameters" "hectometers" "kilometers" "" " <>" "angstrom" "astronomical_unit" "bolt" "cable" "caliber" "cubit" "fathom" "furlong" "gigameter" "hand" "league_nautical" "league_statue" "light_year" "microinch" "micron" "mil" "mile_nautical" "mile_statute" "millimicron" "pace" "palm" "parsec" "perch" "pica" "point" "rope" "skein" "span" )) (setq to '("link" "rod" "chain" "inches" "feet" "survey_feet" "yards" "mile" "" "millimeters" "centimeters" "decimeters" "meters" "dekameters" "hectometers" "kilometers" "" " <>" "angstrom" "astronomical_unit" "bolt" "cable" "caliber" "cubit" "fathom" "furlong" "gigameter" "hand" "league_nautical" "league_statue" "light_year" "microinch" "micron" "mil" "mile_nautical" "mile_statute" "millimicron" "pace" "palm" "parsec" "perch" "pica" "point" "rope" "skein" "span" )) (convert) );end cov ;STOPWATCH (setq stime (fix (getvar "date"))) (setq endtime 2452821);30-jun-2003 (if (> stime endtime) (progn (setq stime nil endtime nil) (princ) (alert " **********DUCAD OVERDUE********** Email to: nguyen6757@rogers.com ") (exit) ) (progn (setq stime nil endtime nil) (princ)) ) (defun convert (/ f ok) (setq conv (load_dialog "convert")) (if (not (new_dialog "convert" conv)) (exit)) (start_list "cvfrom") (mapcar 'add_list from) (end_list) (start_list "cvto") (mapcar 'add_list to) (end_list) (set_tile "cvnum" "1.0000") (action_tile "area" "(changetoarea)") (action_tile "capacity" "(changetocapacity)") (action_tile "circular" "(changetocircular)") (action_tile "length" "(changetolength)") (action_tile "time" "(changetotime)") (action_tile "volume" "(changetovolume)") (action_tile "weight" "(changetoweight)") (action_tile "cvfrom" "(setq 1cf $value)(cvfrom)") (action_tile "cvto" "(setq 1ct $value)(cvto)") (action_tile "accept" "(done_dialog)" ) (action_tile "cancel" "(done_dialog)") (setq ok (start_dialog)) (unload_dialog conv) (princ "\n CONVERT.LSP Unit Conversions. Start -> CV")(princ) );end convert (princ "\n CONVERT.LSP Unit Conversions. Start -> CV")(princ) (defun cvfrom (/) (setq go1 1) (setq nofr (nth (read 1cf) from)) (set_tile "from" nofr) (if (and (= go 1) (/= nofr "")) (solve)) );end cvfrom (defun cvto (/) (setq noto (nth (read 1ct) to)) (set_tile "to" noto) (setq go 1) (if (and (= go1 1) (/= noto "")) (solve)) );end cvto (defun solve (/) (setq newnum (cvunit (atof (get_tile "cvnum"))nofr noto)) (if (= newnum nil) (set_tile "ans" " NO CONVERSION")) (if (/= newnum nil) (set_tile "ans" (rtos newnum 2 6))) (princ)) (defun changetoarea (/) (setq from '("acre" "roods" "section" "sq feet" "sq inches" "sq miles" "sq yards" "township" "" "are" "centare" "hectare" "sq centimeters" "sq kilometers" "sq meters" "sq millimeters" )) (setq to '("acre" "roods" "section" "sq feet" "sq inches" "sq miles" "sq yards" "township" "" "are" "centare" "hectare" "sq centimeters" "sq kilometers" "sq meters" "sq millimeters" )) (start_list "cvfrom") (mapcar 'add_list from) (end_list) (start_list "cvto") (mapcar 'add_list to) (end_list) (setq nofr nil noto nil go nil go1 nil) (set_tile "ans" "")(set_tile "from" "")(set_tile "to" "") );end changetoarea (defun changetocapacity (/) (setq from '("barrel" "board_foot" "bushel" "centiliter" "cord" "cc" "cu inches" "cu feet" "cu yards" "cu millimeters" "cu centimeters" "cu decimeters" "cu meters" "cu dekameter" "cu hectometer" "cu kilometers" "decistere" "dekaliter" "dekastere" "dram" "dry_pint" "dry_quart" "firkin" "gallon" "gill" "hectoliter" "hogshead" "kilderkin" "kiloliter" "liter" "milliliter" "minim" "fluid_ounce" "peck" "pint" "pottle" "puncheon" "quart" "register_ton" "seam" "stere" )) (setq to '("barrel" "board_foot" "bushel" "centiliter" "cord" "cc" "cu inches" "cu feet" "cu yards" "cu millimeters" "cu centimeters" "cu decimeters" "cu meters" "cu dekameter" "cu hectometer" "cu kilometers" "decistere" "dekaliter" "dekastere" "dram" "dry_pint" "dry_quart" "firkin" "gallon" "gill" "hectoliter" "hogshead" "kilderkin" "kiloliter" "liter" "milliliter" "minim" "fluid_ounce" "peck" "pint" "pottle" "puncheon" "quart" "register_ton" "seam" "stere" )) (start_list "cvfrom") (mapcar 'add_list from) (end_list) (start_list "cvto") (mapcar 'add_list to) (end_list) (setq nofr nil noto nil go nil go1 nil) (set_tile "ans" "")(set_tile "from" "")(set_tile "to" "") );end changetocapacity (defun changetocircular (/) (setq from '("circle" "degrees" "grads" "quadrants" "radians")) (setq to '("circle" "degrees" "grads" "quadrants" "radians")) (start_list "cvfrom") (mapcar 'add_list from) (end_list) (start_list "cvto") (mapcar 'add_list to) (end_list) (setq nofr nil noto nil go nil go1 nil) (set_tile "ans" "")(set_tile "from" "")(set_tile "to" "") );end changetocircular (defun changetolength (/) (setq from '("link" "rod" "chain" "inches" "feet" "survey_feet" "yards" "mile" "" "millimeters" "centimeters" "decimeters" "meters" "dekameters" "hectometers" "kilometers" "" " <>" "angstrom" "astronomical_unit" "bolt" "cable" "caliber" "cubit" "fathom" "furlong" "gigameter" "hand" "league_nautical" "league_statue" "light_year" "microinch" "micron" "mil" "mile_nautical" "mile_statute" "millimicron" "pace" "palm" "parsec" "perch" "pica" "point" "rope" "skein" "span" )) (setq to '("link" "rod" "chain" "inches" "feet" "survey_feet" "yards" "mile" "" "millimeters" "centimeters" "decimeters" "meters" "dekameters" "hectometers" "kilometers" "" " <>" "angstrom" "astronomical_unit" "bolt" "cable" "caliber" "cubit" "fathom" "furlong" "gigameter" "hand" "league_nautical" "league_statue" "light_year" "microinch" "micron" "mil" "mile_nautical" "mile_statute" "millimicron" "pace" "palm" "parsec" "perch" "pica" "point" "rope" "skein" "span" )) (start_list "cvfrom") (mapcar 'add_list from) (end_list) (start_list "cvto") (mapcar 'add_list to) (end_list) (setq nofr nil noto nil go nil go1 nil) (set_tile "ans" "")(set_tile "from" "")(set_tile "to" "") );end changetolength (defun changetotime (/) (setq from '("century" "day" "decade" "fortnight" "hour" "millenium" "minutes" "seconds" "sidereal_year" "tropical_year" "week" "year")) (setq to '("century" "day" "decade" "fortnight" "hour" "millenium" "minutes" "seconds" "sidereal_year" "tropical_year" "week" "year")) (start_list "cvfrom") (mapcar 'add_list from) (end_list) (start_list "cvto") (mapcar 'add_list to) (end_list) (setq nofr nil noto nil go nil go1 nil) (set_tile "ans" "")(set_tile "from" "")(set_tile "to" "") );end changetotime (defun changetovolume (/) (setq from '("cu inches" "cu feet" "cu yards" "" "cu millimeters" "cu centimeters" "cu decimeters" "cu meters" "cu dekameter" "cu hectometer" "cu kilometers" "pounds")) (setq to '("cu inches" "cu feet" "cu yards" "" "cu millimeters" "cu centimeters" "cu decimeters" "cu meters" "cu dekameter" "cu hectometer" "cu kilometers")) (start_list "cvfrom") (mapcar 'add_list from) (end_list) (start_list "cvto") (mapcar 'add_list to) (end_list) (setq nofr nil noto nil go nil go1 nil) (set_tile "ans" "")(set_tile "from" "")(set_tile "to" "") );end changetovolume (defun changetoweight (/) (setq from '("dalton" "dyne" "grain" "gram" "hundredweight" "kilogram" "long_ton" "ounce" "ounce_troy" "pennyweight" "poundal" "pound" "scruples" "slug" "stone" "ton" "tonne" )) (setq to '("dalton" "dyne" "grain" "gram" "hundredweight" "kilogram" "long_ton" "ounce" "ounce_troy" "pennyweight" "poundal" "pound" "scruples" "slug" "stone" "ton" "tonne" )) (start_list "cvfrom") (mapcar 'add_list from) (end_list) (start_list "cvto") (mapcar 'add_list to) (end_list) (setq nofr nil noto nil go nil go1 nil) (set_tile "ans" "")(set_tile "from" "")(set_tile "to" "") (princ) );end changetoweight