Jump to content

add or subract for drywall when measuring to rough framing


nickbs

Recommended Posts

Nick, I took a closer look at your changes and I'm wondering if they would work the way you have them shown here. The INITGET entries need to match the GETKWORD entries. The "1" will work, but not the 2,3 or 4. You can just change them to match, as well as in the COND statement. See the red entries below:

 

(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 "[color=red]1 2 3 4[/color]")

(setq chg (getkword "\nEnter Drywall Thickness < 1/2/3/4 > : "))

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

;;(initget "1 2")

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

(cond
 ((= chg "[color=red]1[/color]") (setq mod 0.5))
 ((= chg "[color=red]2[/color]") (setq mod -0.5))
 ((= chg "[color=red]3[/color]") (setq mod 0.625))
 ((= chg "[color=red]4[/color]") (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

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

  • BKT

    10

  • nickbs

    10

  • SLW210

    1

  • Dadgad

    1

Top Posters In This Topic

BKT thanks for showing me that. I think that I would of figured it out. and you were right 1 did work but 234 didn't.,

 

Have a good weekend,, PEace Nick 8)

Link to comment
Share on other sites

Just a subtle way of not doing the same thing twice, entlast. Other suggestion would be a dcl with radio buttons version 2.

 

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

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

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

(entmod ed)

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...