Dim Text with rectangle around the text.

Dim Text with rectangle around the text.

john.p.addy
Collaborator Collaborator
3,582 Views
10 Replies
Message 1 of 11

Dim Text with rectangle around the text.

john.p.addy
Collaborator
Collaborator

Good morning everyone,  I've ran into a issue that I can't figure out on my own.  I know it can  be done thru the Modify Dim Manager for all text.  I have two Dims that I need a rectangle drawn around the text.  

 

now I did find this thread, so either i don't understand it or its not answering what I'm wanting done

PROVIDING TEXT BOX TO THE DIMENSION - Autodesk Community - AutoCAD

 

johnpaddy_0-1710942051988.png

 

These are the only two dims I need this for.

 

 

 

Thank you,
John Addy
Electrical Engineering Tech.
Department of Defense
0 Likes
Accepted solutions (1)
3,583 Views
10 Replies
Replies (10)
Message 2 of 11

VincentSheehan
Advisor
Advisor

Change this in the Dimension Style.

 

Dimstyle.png

Vincent Sheehan

Sr. Civil Designer
Poly In 3D Blog

0 Likes
Message 3 of 11

john.p.addy
Collaborator
Collaborator

Thank you,  I do know that one.  That puts a box around all of the dims.  I only need it around the 2

Thank you,
John Addy
Electrical Engineering Tech.
Department of Defense
0 Likes
Message 4 of 11

pendean
Community Legend
Community Legend

@john.p.addy wrote:

....I only need it around the 2


All or nothing is your only choice in AutoCAD: sorry.

 

You'll need to manually edit the DIMTEXT then find an TTF font that has boxes around numbers to replace your 2 with it if this is a critical need for you. You'll have to dig in your PC's fonts list to find one like that too.

0 Likes
Message 5 of 11

john.p.addy
Collaborator
Collaborator

ok thank you,  

Thank you,
John Addy
Electrical Engineering Tech.
Department of Defense
0 Likes
Message 6 of 11

Simon_Weel
Mentor
Mentor

Create a new DIMstyle and use the current one as a copy. Then switch on the text frame and save the style. Select the two dims and set them with the new DIMstyle.

Simon_Weel_0-1710949326034.png

 

Message 7 of 11

john.p.addy
Collaborator
Collaborator

TO BE HONEST.  I HAVE NO CLUE WHAT I DID TO MAKE IT WORK.  I DID NOT SET UP A DIMSTYLE OR ANYTHING.   NOW I'M CONFUSED.  LOL

 

johnpaddy_0-1710949938778.png

 

 

 

Thank you,
John Addy
Electrical Engineering Tech.
Department of Defense
0 Likes
Message 8 of 11

john.p.addy
Collaborator
Collaborator

YES THAT WAS MY PLAN BUT SOME HOW I GOT IT TO WORK WITHOUT DOING THAT.   HOW, I HAVE NO CLUE.

Thank you,
John Addy
Electrical Engineering Tech.
Department of Defense
0 Likes
Message 9 of 11

john.p.addy
Collaborator
Collaborator
Accepted solution

SO I  FIGURED IT OUT.  IF YOU LOOK AT THIS ONE IT SHOWS THE " TEXT OFFSET " WITH A MINUS SIGN BEFORE THE NUMBERS, IT DISPLAYS THE BOX AROUND THE TEXT.

 

johnpaddy_0-1710950765272.png

 

WHEN YOU TAKE THE MINUS SIGN AWAY IT DOES AWAY WITH THE BOX AROUND THE NUMBERS AS SEEN BELOW.

 

johnpaddy_1-1710950943573.png

 

 

 

Thank you,
John Addy
Electrical Engineering Tech.
Department of Defense
Message 10 of 11

Kent1Cooper
Consultant
Consultant

No, it is certainly not all-or-nothing, and it's not necessary to change the Dimension Style definition.  This will force the DIMGAP setting for all selected Dimensions to be negative, to make the box, even if the size of the gap varies among multiple ones so that you wouldn't be able to handle it collectively in the Properties palette:

 

(defun C:DBT ; = Dimension Box Text
  (/ ss n dim)
  (if (setq ss (ssget '((0 . "DIMENSION"))))
    (repeat (setq n (sslength ss))
      (setq dim (ssname ss (setq n (1- n))))
      (setpropertyvalue dim "dimgap" (- (abs (getpropertyvalue dim "dimgap"))))
    ); repeat
  ); if
  (prin1)
)

 

It doesn't matter whether or not the Dimension's text is already boxed.

Kent Cooper, AIA
Message 11 of 11

TomBeauford
Advisor
Advisor

This one will Toggle the TextBox On/Off of selected Dimensions

;| Toggle Dimension Text Box to toggle Text offset (DIMGAP) to negative or positive.
https://www.cadtutor.net/forum/topic/68801-help-to-create-blank-dimensions-with-a-box/?tab=comments#comment-555956
Macro: ^P(or C:DimBoxText (load "DimBoxText.lsp"));DimBoxText
   Command line: (load "DimBoxText.lsp") DimBoxText |;

(vl-load-com)
(defun c:DimBoxText ( / ss i obj box)
  (if (setq ss (ssget '((0 . "Dimension"))))
    (repeat (setq i (sslength ss))
      (setq obj (vlax-ename->vla-object (ssname ss (setq i (1- i))))
			box (- 0.0 (vlax-get obj 'TextGap))
      )
      (vlax-put obj 'TextGap box)
    )
  )
  (princ)
)

 

64bit AutoCAD Map & Civil 3D 2023
Architecture Engineering & Construction Collection
2023
Windows 10 Dell i7-12850HX 2.1 Ghz 12GB NVIDIA RTX A3000 12GB Graphics Adapter
0 Likes