nickbs Posted February 26, 2017 Share Posted February 26, 2017 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 Quote Link to comment Share on other sites More sharing options...
nickbs Posted February 26, 2017 Author Share Posted February 26, 2017 ;;------------------------------------------------------ (defun c:v () (setvar "cmdecho" 0) (command "dim" "vertical"(setq txtstr (getdist "\ndim: ")) (ChangeDim valAdd 1) ) (princ) ) any help Please? Quote Link to comment Share on other sites More sharing options...
BKT Posted February 27, 2017 Share Posted February 27, 2017 Have you defined ChangeDim somewhere else? "error : no function definition " Quote Link to comment Share on other sites More sharing options...
nickbs Posted February 27, 2017 Author Share Posted February 27, 2017 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. Quote Link to comment Share on other sites More sharing options...
BKT Posted February 27, 2017 Share Posted February 27, 2017 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? Quote Link to comment Share on other sites More sharing options...
Dadgad Posted February 27, 2017 Share Posted February 27, 2017 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). Quote Link to comment Share on other sites More sharing options...
BKT Posted February 27, 2017 Share Posted February 27, 2017 Yeah, that's another thing to consider. I don't do floor plans so I wasn't sure if that needed to be a choice (one thickness or two) or not... Quote Link to comment Share on other sites More sharing options...
nickbs Posted February 27, 2017 Author Share Posted February 27, 2017 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.. Quote Link to comment Share on other sites More sharing options...
BKT Posted February 27, 2017 Share Posted February 27, 2017 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... Quote Link to comment Share on other sites More sharing options...
nickbs Posted February 27, 2017 Author Share Posted February 27, 2017 sure I would like to see your code. Everyone has different ways of doing things.. I like to see everyone's ideas. Thanks Nick Quote Link to comment Share on other sites More sharing options...
BKT Posted February 27, 2017 Share Posted February 27, 2017 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) ) Quote Link to comment Share on other sites More sharing options...
nickbs Posted February 27, 2017 Author Share Posted February 27, 2017 that is very close to what I was looking for. I need to remove some prompts. to make it quick and smooth. Nice thanks. Quote Link to comment Share on other sites More sharing options...
BKT Posted February 27, 2017 Share Posted February 27, 2017 Yeah, mess around with it. Somebody may come along with other ideas, too. Quote Link to comment Share on other sites More sharing options...
nickbs Posted February 27, 2017 Author Share Posted February 27, 2017 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 Quote Link to comment Share on other sites More sharing options...
BKT Posted February 27, 2017 Share Posted February 27, 2017 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! Quote Link to comment Share on other sites More sharing options...
nickbs Posted February 27, 2017 Author Share Posted February 27, 2017 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) ) Quote Link to comment Share on other sites More sharing options...
BKT Posted February 27, 2017 Share Posted February 27, 2017 Way to go, Nick! Looks good! Quote Link to comment Share on other sites More sharing options...
nickbs Posted February 27, 2017 Author Share Posted February 27, 2017 the autodesk group has me at rank 7 enthusiast. it should be rank 2 amateur. Quote Link to comment Share on other sites More sharing options...
BKT Posted February 27, 2017 Share Posted February 27, 2017 I'm a lurker on that forum. Someday, maybe I'll join up... Quote Link to comment Share on other sites More sharing options...
SLW210 Posted February 27, 2017 Share Posted February 27, 2017 Please read the Code Posting Guidelines and edit your Code to be included in Code Tags.[NOPARSE] Your Code Here[/NOPARSE] = Your Code Here Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.