BKT Posted February 27, 2017 Share Posted February 27, 2017 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) ) Quote Link to comment Share on other sites More sharing options...
nickbs Posted March 4, 2017 Author Share Posted March 4, 2017 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 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 5, 2017 Share Posted March 5, 2017 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) 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.