PDA

View Full Version : Easy walls


Madmarty
2008-07-19, 09:13 PM
Hello everyone, in my office, we just about always work on a massive hospital, of course we always use the same wall thicknesses when we can. I am working on a lisp to quicken my drafting, I'm tired of typing in:
ff (for offset) 4-7/8 SPACE
ff 4-1/4 SPACE
ff 5/8 SPACE
ff 2 1/8 SPACE
ff 4-7/8 SPACE

It can go on like this for a while when your drawing a renovation or addition on this huge hospital. I used that cool MDOFF.LSP from Glen Johnston to get me started (Thank You Glen), but I only know how to tell lisp to ask me how far i want the distances to be, I want it to be 5/8" or 4-7/8" every time I run it. Here's what I've tried:

(defun c:sw ()

(setq oldcmdecho (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq oldoffset (getvar "offsetdist"))

(setq ent (entsel "\nPick the line: "))
(setq side (getpoint "\nPick an offset side: "))
(setq dist (5/8 ))

(setvar "offsetdist" dist)

(command "offset" "" ent side "")

(setvar "cmdecho" oldcmdecho)
(setvar "offsetdist" oldoffset)


(princ)

)

Any help with that dist **** would be helpful.

Marty

Moderator Note:
Please use [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code)

fixo
2008-07-19, 09:37 PM
When you divide 2 numbers one of them
must be double:

(setq dist (5/8.0 ))

Hth

~'J'~

Madmarty
2008-07-19, 09:53 PM
OK, I tried that, It didnt work, to simplify I changed it to:

(setq dist (0.625))

but now...

Command: sw
Pick the line:
Pick an offset side: ; error: bad function: 0.625
Command:

'gile'
2008-07-19, 10:02 PM
Hi,

too much parents, try :

(setq dist (/ 5 8.0)) or (setq dist 0.625) or (setq dist (distof "5/8"))

Madmarty
2008-07-19, 10:35 PM
Neither of those did it, i both cases it says:

Command: sw
Pick the line:
Pick an offset side:
Requires numeric distance, two points, or option keyword.
; error: Function cancelled


AND this is on the command line:

Specify offset distance or [Through] <0'-0 5/8">:


I guess the lisp is cancelled and then it just takes me into offset, and it knows the distance

Madmarty
2008-07-19, 10:46 PM
Never mind, Thank you Gile, that was it, thank you too Fixo.
My mom would be so proud of me right now