Hello! I'm hoping someone can help me. Currently, when I do drawings, I give my machinists drawings with each point, and they program their machines. To do that, they calculate the round part diameters, which is basically 5" - 2x<Dim>.
I'd like it if I could give them drawings with the real number, and in parenthesis next to it, 5-2x<Dim>.
I've attached a jpg of what I normally give them and how I'd like it to look. Is this something do-able via a macro or something? Thanks in advance
@plohret wrote:....
I'd like it if I could give them drawings with the real number, and in parenthesis next to it, 5-2x<Dim>.
.... Is this something do-able via a macro or something? ....
Yes, I'm sure it is. Would you want to do it in the process of drawing Ordinate Dimensions, or would want to select existing Dimensions and have their text content altered? [I ask because I see one in your edited image that doesn't have that parenthetical value.]
I'd much prefer to do it at the time I create the dimension, but selecting the dimension and running a macro works too.
I'd like to have one command for normal ordinate (which is obviously the regular dimordinate command) and another one (dimord2 or something) that would create the modified text.
Thanks!
@plohret wrote:I'd much prefer to do it at the time I create the dimension, but selecting the dimension and running a macro works too.
I'd like to have one command for normal ordinate (which is obviously the regular dimordinate command) and another one (dimord2 or something) that would create the modified text.
Thanks!
The select-existing approach will be a lot simpler, because of the nature of Ordinate Dimensions being ambiguous about whether it's the X or Y ordinate you're after, determined dynamically as you move the cursor. [You can't dig the measured value out of the entity data until after the Dimension is drawn.] If you're willing to have the parenthetical value not appear until after you designate the X-or-Y choice, and not as you're moving the cursor, or to specify X or Y in advance [that is, have separate commands, or select an option within a command], it would be comparatively easy to do it as the Dimensions are created rather than afterwards. But it may be possible even to drag it with the parenthetical value already included. Altering them afterwards would be pretty straightforward.
I'll probably play with that later, but I'm on the way out the door....
Please try the following code.
;;; DIMSUFFIX.lsp by 3wood ;;; https://sites.google.com/site/cadkits/home (defun C:DIMSUFFIX (/ ss n vl-obj) (setq ss (ssget '((0 . "DIMENSION")))) (if ss (progn (setq n 0) (repeat (sslength ss) (setq vl-obj (vlax-ename->vla-object (ssname ss n))) (vla-put-TextSuffix vl-obj (strcat " (" (rtos (- 5.0 (* 2.0 (vla-get-Measurement vl-obj))) (vla-get-Unitsformat vl-obj) (vla-get-PrimaryUnitsPrecision vl-obj) ) ")" ) ) (setq n (1+ n)) ) ) ) )
I had to add (vl-load-com) in there but it worked.
After playing with this some, I'm probably better off putting all my dimensions in with dimordinate then running this on the ones I want the extra text on, so it's perfect. Thanks!