| Author |
Message |
FELIPE
Guest
|
Posted:
Wed Jan 12, 2005 11:30 pm Post subject:
text inside of a circle |
|
|
Does anyone out there have a routine that centers selected text to the center of a circle.
|
|
| Back to top |
|
 |
Walt Engle
Guest
|
Posted:
Wed Jan 12, 2005 11:56 pm Post subject:
Re: text inside of a circle |
|
|
| Why not justify to center and use center of circle? |
|
| Back to top |
|
 |
T.Willey
Guest
|
Posted:
Wed Jan 12, 2005 11:57 pm Post subject:
Re: text inside of a circle |
|
|
Just make your text justified to middle, then move it from the insertion point to the center point. If you want to make it faster, only turn on those two options of the running osnaps.
Tim
|
|
| Back to top |
|
 |
ECCAD
Guest
|
Posted:
Thu Jan 13, 2005 12:06 am Post subject:
Re: text inside of a circle |
|
|
Here is a quick one.
;; Center Text to Circle
;; CT.lsp
(defun C:CT ( / ent cent ss txt )
(prompt "\nPick Circle:")
(setq ss (ssget))
(if ss
(progn
(setq ent (entget (ssname ss 0))); get Circle entity
(setq cent (cdr (assoc 10 ent))); get Center point
(prompt "\nPick a Single Line of Text")
(setq ss nil)
(setq ss (ssget))
(if ss
(progn
(setq ent (entget (ssname ss 0))); get the Text Entity
(setq txt (cdr (assoc 1 ent))); get the Value of the Text
(if txt
(progn
(command "_erase" ss ""); remove old text
(command "_text" "m" cent "" "" txt); insert new text
); progn
); if
); progn
); if
); progn
); if
(princ)
); function
---------
Bob |
|
| Back to top |
|
 |
Tom Smith
Guest
|
Posted:
Thu Jan 13, 2005 12:15 am Post subject:
Re: text inside of a circle |
|
|
I tend toward the simple approach, middle justify the text and snap to
center of circle.
If this happens frequently, I'd make the circle and text an attributed
block. Place the block and edit the attribute. |
|
| Back to top |
|
 |
FELIPE
Guest
|
Posted:
Thu Jan 13, 2005 12:16 am Post subject:
Re: text inside of a circle |
|
|
Sorry Bob,
I guess I don't know how to use this routine.
I tried to select the circle and the text, and then the text string again and the text disappeared. |
|
| Back to top |
|
 |
Rogerio_Brazil
Guest
|
Posted:
Thu Jan 13, 2005 12:27 am Post subject:
Re: text inside of a circle |
|
|
Try it.
Move text polygon...
Justify text to Middle Center and move to centroid of polygon.
(circle, rectangle).
[]s,
Rogério
;;;MIDDLECENTER JUSTIFY AND MOVE TEXT TO CENTROID - BEGIN
(defun C:MTP (/ ENT ELST PTS SS1 OLDOSM INS TXT EI p1 p2 p3 p4)
(setvar "cmdecho" 0)
(command "STYLE" "STANDARD" "verdana" "0" "1" "0" "N" "N");;optional
(setq OLDOSM (getvar "osmode"))
(SETQ TXT (ENTSEL "\n Pick only text to move to center to Polygon:"));LOCALIZAÇÃO DE INSERÇÃO DE TEXTO SELECIONADO
;(SETQ INS (OSNAP (CADR TXT) "INSERT"));PONTO DE INSERÇÃO
(setq ET (cdr(assoc 0(entget(car TXT)))));;TYPE: TEXT
(SETQ EL (cdr(assoc 8(entget(car TXT)))));;LAYER
(SETQ EI (cdr(assoc 10(entget(car TXT)))));;PONTO DE INSERÇÃO
(SETQ EH (cdr(assoc 40(entget(car TXT)))));;ALTURA
(SETQ EA (cdr(assoc 50(entget(car TXT)))));;ÂNGULO DO TEXTO?
(SETQ TS (cdr(assoc 1(entget(car TXT)))));;TEXT STRING
(setvar "clayer" EL)
(COMMAND "ERASE" "SI" TXT)
(COMMAND "TEXT" "MC" EI EH EA TS)
(COMMAND "MOVE" (ENTLAST) "" (CDR (ASSOC 10 (ENTGET (ENTLAST)))) EI )
(COMMAND "CHANGE" "last" "" "P" "C" "1" "" )
(setvar "osmode" 0)
;================================================
(princ "\n Get Centroid...")
(if (setq Curent (car (entsel "\n Select a closed Polyline (Polygon): ")))
(progn
(setq OldCmd (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(command "_.COPY" CurEnt "" '(0 0 0) '(0 0 0)
"_.REGION" (entlast) ""
)
(setq RegObj (vlax-ename->vla-object (entlast)))
(vla-GetBoundingBox RegObj 'MinPnt 'MaxPnt)
(setq MinPnt (vlax-safearray->list MinPnt)
OriCen (vlax-safearray->list
(vlax-variant-value
(vla-get-Centroid RegObj)
)
)
CurCen (mapcar '- OriCen MinPnt)
)
(vla-Erase RegObj)
(mapcar 'princ (list "\n Relative centroid: " CurCen))
(mapcar 'princ (list "\n Absolute centroid: " OriCen))
(setvar "CMDECHO" OldCmd)
)
)
(COMMAND "CHANGE" "last" "" "P" "C" "bylayer" "" )
(command "change" (ENTLAST) "" "" OriCen "" "" "" "")
(setvar "osmode" OLDOSM)
(princ "\n Done!")
(princ)
)
;;;MIDDLECENTER JUSTIFY AND MOVE TEXT TO CENTROID - BEGIN |
|
| Back to top |
|
 |
Rogerio_Brazil
Guest
|
Posted:
Thu Jan 13, 2005 12:31 am Post subject:
Re: text inside of a circle |
|
|
To set text height and don´t modify your text style:
(command "STYLE" "STANDARD" "" "0" "1" "0" "N" "N") |
|
| Back to top |
|
 |
ECCAD
Guest
|
Posted:
Thu Jan 13, 2005 12:35 am Post subject:
Re: text inside of a circle |
|
|
Just pick the Circle (only), hit Enter Key, then, pick the text
when prompted.
Bob |
|
| Back to top |
|
 |
W. Kirk Crawford
Guest
|
Posted:
Thu Jan 13, 2005 3:11 am Post subject:
Re: text inside of a circle |
|
|
Felipe,
I wrote something about centering a letter/s in a circle. Like change letter balloons. This file was in CADalyst.
Look in autodesk.autocad.customer-files. centerit.lsp Hope it works the way you want. It changes the justification to center, and
then moves it to the center of the circle. One click.
W. Kirk Crawford
Rochester Hills, Michigan
"FELIPE" <nospam@address.withheld> wrote in message news:31104787.1105554688713.JavaMail.jive@jiveforum1.autodesk.com...
> Does anyone out there have a routine that centers selected text to the center of a circle. |
|
| Back to top |
|
 |
W. Kirk Crawford
Guest
|
Posted:
Thu Jan 13, 2005 3:13 am Post subject:
Re: text inside of a circle |
|
|
Tom,
Your way is, I believe, The Proper Way.
But where I work, just get it done.
W. Kirk Crawford
Rochester Hills, Michigan |
|
| Back to top |
|
 |
Tom Smith
Guest
|
Posted:
Thu Jan 13, 2005 6:07 pm Post subject:
Re: text inside of a circle |
|
|
Kirk, he didn't explain the application, but I was thinking of something
like a column grid bubble. Just takes a sec to define an attributed block,
then forever after it's faster to place than drawing individual circles and
placing text inside. If it's anything like that, I'd prefer to have the
thing as a single entity anyway, rather than two. |
|
| Back to top |
|
 |
|
|
|
|