Jump to content

Center Text in a Circle


Recommended Posts

I did a search and didn't seem to find anything on this. I draw architectual floor plans and create column lines with a circle on the end of the line. I then insert text in the circle. usually a single digit or alpha character. The trouble is I often spend too much time trying to get the text to fit nicely in the center of the circle. Can anyone help me with this?

Link to comment
Share on other sites

  • Replies 29
  • Created
  • Last Reply

Top Posters In This Topic

  • ReMark

    9

  • alanjt

    7

  • gsksun4

    7

  • josemukalel

    3

Middle (Middle center) justify the text and use the center osnap of the circle as the insert point for the text.

Link to comment
Share on other sites

One more, just for fun...

 

(defun c:TIC (/ label pt dist)
 ;; MText label witin circle
 ;; Alan J. Thompson, 05.22.10

 (vl-load-com)
 (if (and (/= "" (setq label (getstring t "\nSpecify label: ")))
          (setq pt (getpoint "\nSpecify center point: "))
          (setq dist (getdist pt "\nSpecify radius of circle: "))
     )
   ((lambda (p)
      (entmakex (list '(0 . "CIRCLE") (cons 10 p) (cons 40 dist)))
      ((lambda (text)
         (vla-put-AttachmentPoint text 5)
         (vla-put-InsertionPoint text (vlax-3d-point p))
       )
        (vla-addMText
          (if (or (eq acmodelspace
                      (vla-get-activespace
                        (cond (*AcadDoc*)
                              ((setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object))))
                        )
                      )
                  )
                  (eq :vlax-true (vla-get-mspace *AcadDoc*))
              )
            (vla-get-modelspace *AcadDoc*)
            (vla-get-paperspace *AcadDoc*)
          )
          (vlax-3d-point p)
          0.
          label
        )
      )
    )
     (trans pt 0 1)
   )
 )
 (princ)
)

Link to comment
Share on other sites

(defun c:TCL (/ obj label)
 ;; Label selected circle with MText
 ;; Alan J. Thompson, 05.22.10

 (vl-load-com)
 (if (and (setq obj (car (entsel "\nSelect circle: ")))
          (or (eq "AcDbCircle" (vla-get-objectname (setq obj (vlax-ename->vla-object obj))))
              (alert "Invalid object!")
          )
          (/= "" (setq label (getstring t "\nSpecify label: ")))
     )
   ((lambda (p)
      ((lambda (text)
         (vla-put-AttachmentPoint text 5)
         (vla-put-InsertionPoint text p)
       )
        (vla-addMText
          (if (or (eq acmodelspace
                      (vla-get-activespace
                        (cond (*AcadDoc*)
                              ((setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object))))
                        )
                      )
                  )
                  (eq :vlax-true (vla-get-mspace *AcadDoc*))
              )
            (vla-get-modelspace *AcadDoc*)
            (vla-get-paperspace *AcadDoc*)
          )
          p
          0.
          label
        )
      )
    )
     (vla-get-center obj)
   )
 )
 (princ)
)

Link to comment
Share on other sites

Bill:

 

It was right there under your nose the entire time. You just had to look on your Tool Palettes on the Annotation tab. The very first entry at the top called Tag - Imperial is a number within a circle. The number is an attribute.

 

Seek and ye shall find.

 

I'm running 2010 too.

Link to comment
Share on other sites

Bill:

 

It was right there under your nose the entire time. You just had to look on your Tool Palettes on the Annotation tab. The very first entry at the top called Tag - Imperial is a number within a circle. The number is an attribute.

 

Seek and ye shall find.

 

I'm running 2010 too.

 

ReMark, another good find. Would like to know why the text in the circle doesn't take on the font set in the drawing? Or how can I set it to? It doesn't list out a font, and I don't want to explode it, but just to see what font lists out I did. No font listed, but style lists out as Tohoma.

Glenn

2009LT

Link to comment
Share on other sites

Bill:

 

It was right there under your nose the entire time. You just had to look on your Tool Palettes on the Annotation tab. The very first entry at the top called Tag - Imperial is a number within a circle. The number is an attribute.

 

Seek and ye shall find.

 

I'm running 2010 too.

Actually, the Dynamic one I created above (with scale parameter on the circle) was taken from that block and modified. :lol:

Link to comment
Share on other sites

OK...if you really, really don't want to reset the text style option every time you insert one of these symbols this is a kludge-type workaround.

 

The font used is called Tahoma. Open the Text Style dialog window and change the font style to something else. Finish by clicking Set Current then OK. The font style change should be reflected in any symbol you have already inserted and in any new ones you insert in the future.

Link to comment
Share on other sites

It's an attribute. The font can be reset.

Can you please explain? I tried in properties mgr, but no luck.

Link to comment
Share on other sites

OK...if you really, really don't want to reset the text style option every time you insert one of these symbols this is a kludge-type workaround.

 

The font used is called Tahoma. Open the Text Style dialog window and change the font style to something else. Finish by clicking Set Current then OK. The font style change should not be reflected in any symbol you have already inserted and in any new ones you insert in the future.

Why not just edit, rename and put back in Toolpalettes?

Link to comment
Share on other sites

Why not just edit, rename and put back in Toolpalettes?

I'm trying to change the attribute in the block editor, but no luck with the font.

I also changed the font in the text style mgr, then inserted another tag, but got same results.

Link to comment
Share on other sites

Semantics. You're right. The word "not" was inadvertantly included. Good catch. :)

 

Well ReMark, I appreciate your input. I can change the font and style in the manager, but that block still comes up Tahoma after doing so. Other new text has the font change. That's Mtext and Dtext. I won't waste any more of your time over this. I'm just cursed. Heh.

Thank you again friend.

Glenn

Link to comment
Share on other sites

I've tested it twice now and got it to work. You only need to change the font name you want AutoCAD to substitute for the style Tahoma. You do not change the style.

Link to comment
Share on other sites

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