
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I asked a question a while ago to get help writting a LISP routine that would atuomaticaly calculate the thickness of tapered insulation on a flat roof given the slope and starting thickness of the insulation. I got back an excelent LISP routine that works like a charm. However I'd like to improve/expand on it but I'm having some trouble with it. Every time I have to run the routine I have to input the slope of the roof and the starting thickness. So I pulled out the variables from the Local area and set them to be a globale variables. So now I would like to show what the value of these variables are when prompted for the value. This way if they need to change I can change them or if they stay the same I can just enter through them. Kind of like when you are offsetting a line.
I would like it to look like this:
Enter the slope of the roof <.25>:
Enter starting thickness of just tapered insulation <.5>:
It seams to me that this should be a simple task of stating something like "\nEnter the slope of the roof <" *slope* ">: " but this returns an error.
Here is what I have for code:
(setq *slope* ".25") (setq *minins* ".5") (defun c:ti(/ p1 p2 di) (initerr) (setvar "cmdecho" 0) (command "undo" "m") (setq *slope* (getreal "\nEnter the slope of the roof: ")) (setq *minins* (getreal "\nEnter starting thickness of just tapered insulation: ")) (setq di (getdist "\nPick two points: ")) (setq di (/ di 12)) (setq di (* di *slope*)) (setq di (+ di *minins*)) ;(prin1 di) (command "_offset" di) (while (> (getvar 'cmdactive) 0) (command pause)) (reset) (princ) )
I guess I thought it should just be:
(setq *slope* (getreal "\nEnter the slope of the roof < " *slope* ">: ")) (setq *minins* (getreal "\nEnter starting thickness of just tapered insulation < " *minins* ">: "))
but this just causes the error. Any help or guidence you can give would be greatly appreciated. I think my problem is I don't understand how the getreal works!
Solved! Go to Solution.