Jump to content

Recommended Posts

Posted

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

Posted

Perhaps?

(setq tol "%%C<>{\\H0.9x;\\S+0.001\"^-0.002\";}")

Posted

A couple minor edits to make it look the way I need. But works exaclty like I need thanks.

Posted

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

Posted

That one works well also. Thanks again

Posted

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

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