Jump to content

add or subract for drywall when measuring to rough framing


nickbs

Recommended Posts

Hello, At work when we are doing a set of production prints we modify the dimension to compensate for drywall on the floor plan. 1/2" or 5/8" drywall

We draw the floor plans with finished drywall, so for framing dimensions we have to compensate.

;;------------------------------------------------------

(defun c:v ()

(setvar "cmdecho" 0)

(command "dim" "vertical")

(prompt "\nDim: VERTICAL ")

(princ)

)

;;-----------------------------------------------------------------

(defun c:H ()

(setvar "cmdecho" 0)

(command "dim" "horizontal")

(prompt "\nDim: HORIZONTAL ")

(princ)

)

 

How would I modify these simply lisps to give the option to add or subtract 1/2" or 5/8' drywall for the finished dimension? Instead of manually typing in the dimension?

 

Thanks 8)

Link to comment
Share on other sites

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

  • BKT

    10

  • nickbs

    10

  • SLW210

    1

  • Dadgad

    1

Top Posters In This Topic

;;------------------------------------------------------

(defun c:v ()

(setvar "cmdecho" 0)

(command "dim" "vertical"(setq txtstr (getdist "\ndim: "))

(ChangeDim valAdd 1)

)

(princ)

)

 

 

 

any help Please?

Link to comment
Share on other sites

no not yet,, I was trying to piece my idea together here.. I need to hit the books hard on lisp soon.

 

I was attempting to use this line,

 

(setq valAdd (getdist "\nValue to add or subtract at original text: "))

(ChangeDim valAdd 42)

)

 

But I don't want to have to select the dimension. Set the variable first and then make the dimension.

Link to comment
Share on other sites

Just so I've got this straight - you don't want to have to go back and select the dimension, you want to place the dimension and have the program override the dimension by either 1/2" or 5/8" while placing it?

Link to comment
Share on other sites

Just so I've got this straight - you don't want to have to go back and select the dimension, you want to place the dimension and have the program override the dimension by either 1/2" or 5/8" while placing it?

 

Presumably, the dimension adjustment might need to be twice the relevant thickness of the drywall, if both of the walls were drywalled (and with the same material). :|

Link to comment
Share on other sites

BKT, no I don't want to have to go back , set the variable and then run a dimension.

 

You will never need to compensate twice on a partition detail plan. Not the way that we draw anyway.. :D

Link to comment
Share on other sites

nickbs, I was kind of interested in ways to go about this so I threw together some code to play with. It requires you to choose thickness, plus or minus, and one or two thicknesses. I can post what I have if you want to take a look. It ain't pretty, but something to look at.

 

Oh, and during my testing I had to set the DIMZIN to "3" to get Architectural units. I'm usually in decimal...

Link to comment
Share on other sites

OK, take a look. Nothing fancy - no error checking, just slapped together...

 

The "p" is for "plus", "m" is "minus":

 

(defun c:test (/ chg mod num en1 ed)

(alert "\nEnter Drywall Thickness:   p1=1/2\", m1=-1/2\", p5=5/8\", m5=-5/8\"")

(initget "p1 m1 p5 m5")

(setq chg (getkword "\nEnter Drywall Thickness < p1/m1/p5/m5 > : "))

(alert "\nOne Drywall Thickness or Two?")

(initget "1 2")

(setq thk (getreal "\nOne Drywall Thickness or Two: < 1 / 2 > : "))

(cond
 ((= chg "p1") (setq mod 0.5))
 ((= chg "m1") (setq mod -0.5))
 ((= chg "p5") (setq mod 0.625))
 ((= chg "m5") (setq mod -0.625))
 (t nil)
)

(setq mod (* thk mod))

(command "dimlinear" pause pause pause)
(command)

(setq num (+ mod (cdr (assoc 42 (entget (entlast))))))

(setq num (strcat "(" (rtos num 4 3) ")"))

(setq en1 (entlast))

(setq ed (entget en1))

(setq ed (subst (cons 1 num) (assoc 1 ed) ed))

(entmod ed)

(princ)

)

Link to comment
Share on other sites

I was even trying to put the brackets in to show that the dimension was modified () , you did that without asking. I'm not a fan of the alert. I think that I like princ better..

 

Thanks again.. Nick

Link to comment
Share on other sites

I confess I saw your posts on the Autodesk forum, so I worked the brackets in. :)

Yeah, take the alerts out, and if you don't need two sides, you could take that out, too.

 

You're welcome!

Link to comment
Share on other sites

after a few mods it does exactly what I wanted

 

(defun c:t (/ chg mod num en1 ed)

 

(princ "\nEnter Drywall Thickness: 1=+1/2\", 2=-1/2\", 3=+5/8\", 4=-5/8\"")

 

(initget "p1 m1 p5 m5")

 

(setq chg (getkword "\nEnter Drywall Thickness : "))

 

;;(princ "\nOne Drywall Thickness or Two?")

 

;;(initget "1 2")

 

;;(setq thk (getreal "\nOne Drywall Thickness or Two: : "))

 

(cond

((= chg "p1") (setq mod 0.5))

((= chg "m1") (setq mod -0.5))

((= chg "p5") (setq mod 0.625))

((= chg "m5") (setq mod -0.625))

(t nil)

)

 

;;(setq mod (* thk mod))

 

(command "dimlinear" pause pause pause)

(command)

 

(setq num (+ mod (cdr (assoc 42 (entget (entlast))))))

 

(setq num (strcat "(" (rtos num 4 3) ")"))

 

(setq en1 (entlast))

 

(setq ed (entget en1))

 

(setq ed (subst (cons 1 num) (assoc 1 ed) ed))

 

(entmod ed)

 

(princ)

 

)

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...