Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, im trying to work on this LISP that gets a slope for a driveway and creates a text of the returning data. I still have alot of work to do, but Im having trouble with the initial selection of Yes or No. What am I doing wrong? Please help a noob.
(defun c:XC (/ mn dp tof tofn toc tocn dis tmn tdp mtof mtoc mdis slope mdn apron)
(initget "Yes No")
(if =(getkword "\nSelection? [Yes/No] <Y>: ");selection of data or manual entry
((setq mn(getreal "\nEnter SLOPE tolerance: "))
(setq dp
(cond
((getreal "\nEnter standard drop <Enter for 0.67>: "))
(0.67)
)
)
(setq tof (entsel "\nSelect TOF: "))
(setq tofn (atof (getpropertyvalue tof "ELEV2")))
(setq toc (entsel "\nSelect TOC: "))
(setq tocn (atof (getpropertyvalue toc "ELEV2")))
(setq dis (getdist tofn tocn))
)
(setq tmn (getreal "\nEnter SLOPE tolerance: "))
(setq tdp
(cond
((getreal "\nEnter standard drop or <Enter for 0.67>: "))
(0.67)
)
)
(setq mtof (getreal "\nEnter TOF: "))
(setq mtoc (getreal "\nEnter TOC: "))
(setq mdis (getreal "\nEnter Distance: "))
(setq slope (* 100 (- mtof tdp (/ mtoc mdis)))); Slope [TOF-STANDARD DROP-TOC/DISTANCE=% SLOPE]
(setq mdn (- mtof (+ mtoc (* tmn mdis)) 0.375)); Drop needed [TOF-(DESIRED SLOPE*DISTANCE)+TOC-0.375=DROP NEEDED]
(setq apron (- mtof (+ 0.375 mdn))); apron [TOF-(0.375+DROP NEEDED)=RECOMMENDED APRON]
(print slope apron mtoc mtof mdis tdp)
)
(princ)
)
Solved! Go to Solution.