bradb Posted June 25, 2012 Posted June 25, 2012 When toleranceing dimensions we use the Mtext and stack as tolerance. I am trying to modify this routine that I use to place diameter symbols to dimensions. I think my problem is in the (setq tol (strcat, but I can't figure out how to write it. In this code I am putting a +.000 -.002 tolerance. I need the dimension to stay hot. Any help would be appriecated. (defun c:M2 (/ d1 lijst1 tol oldtxt a new) (setq d1 (entsel)) (setq d1 (car d1)) (setq lijst1 (entget d1)) (setq tol (strcat "[url="file://\\A1;d1{\\H0.90x;\\S"]\\A1;d1{\\H0.90x;\\S[/url]" +.000^-.002";}\"")) (setq oldtxt (cdr (assoc 1 lijst1))) (if (= oldtxt "") (setq oldtxt "<>") (setq a b) ) (setq new (strcat oldtxt tol)) (command "dim1") (command "newtext" new d1) (PRINC) ) Quote
MSasu Posted June 25, 2012 Posted June 25, 2012 Perhaps? (setq tol "%%C<>{\\H0.9x;\\S+0.001\"^-0.002\";}") Quote
bradb Posted June 25, 2012 Author Posted June 25, 2012 A couple minor edits to make it look the way I need. But works exaclty like I need thanks. Quote
MSasu Posted June 25, 2012 Posted June 25, 2012 You're welcome! You may simplify that code: (defun c:M2( / d1 tol ) (setq tol "%%C<>{\\H0.9x;\\S+0.001\"^-0.002\";}") [color=red] (while [/color](setq d1 (entsel)) (command "_dim1" "_newtext" [color=red]tol[/color] d1[color=red] ""[/color]) [color=red] )[/color] (princ) ) Quote
Tharwat Posted June 25, 2012 Posted June 25, 2012 You may find this one useful with ssget .... (defun c:test (/ ss i sn e) (vl-load-com) (if (setq ss (ssget "_:L" '((0 . "*DIMENSION")))) (repeat (setq i (sslength ss)) (setq sn (ssname ss (setq i (1- i)))) (vla-put-textoverride (vlax-ename->vla-object sn) "%%C<>{\\H0.9x;\\S+0.001\"^-0.002\";}" ) ) ) (princ) ) Quote
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.