TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on August 23, 2005, 03:40:40 PM
-
what is the DXF groupCode to know the lenght of selected TEXT or MTEXT ?
I know this was the insertion point..
(setq t1 (cdr (assoc 10 text)))
so if it is bottom left...i need the bottom right end point.
I know also the justification style..
;;Justification Horizontal method
(setq t2 (cdr (assoc 72 text)))
;;Justification Vertical method
(setq t3 (cdr (assoc 73 text)))
but can find a way to detect the lenght of text.
any suggestion ?
thanks
-
(textbox ...)
-
I was thinking (strlen ...) I guess it depends on what she means by length.
-
She?
-
guess based on "Andrea." Appologies if I'm wrong.
-
guess based on "Andrea." Appologies if I'm wrong.
I've made that mistake before as well. :oops: I'm sure no offence is taken. (I hope not, anyway!)
-
Noted and filed away for future occasions. Sorry Andrea.
-
No foul I'm sure, I was just confused.
Anyway, see this (http://groups.google.ca/group/autodesk.autocad.customization/tree/browse_frm/thread/d984fa2dda816397/3b1808efd97eecbe?rnum=1&hl=en&q=defun+textbox+puckett&_done=%2Fgroup%2Fautodesk.autocad.customization%2Fbrowse_frm%2Fthread%2Fd984fa2dda816397%2F1872d815610ec70b%3Flnk%3Dst%26q%3Ddefun+textbox+puckett%26rnum%3D2%26hl%3Den%26#doc_1872d815610ec70b) or this (http://groups.google.ca/group/autodesk.autocad.customization/tree/browse_frm/thread/a7669e7a0a9dc611/f2d95276d861edaa?rnum=1&hl=en&q=defun+textbox+puckett&_done=%2Fgroup%2Fautodesk.autocad.customization%2Fbrowse_frm%2Fthread%2Fa7669e7a0a9dc611%2F3b2821df0b33610c%3Flnk%3Dst%26q%3Ddefun+textbox+puckett%26rnum%3D1%26hl%3Den%26#doc_b3d52e1fb49a1226) for ideas.
-
No problemo..
I'm Italian....Andrea mean Andrew... :wink:
MP...the 2 codes you give me is not working...
don't know exactly why..I don't know the textbox function..
and not very familiar with lamda to...
so....need to learn alittle more..
thanks.
-
I can assure you those functions do work, but they were mentioned as ideas only; i.e. show you how the textbox and getboundingbox functions (actually getboundingbox is a subroutine) work.
If I understood your question you are looking for the length of the text (in drawing units, not string length). Either route will work (I'd suggest bounding box as it will work on a variety of objects not just text) but I digress.
Have you read the help file for either textbox or getboundingbox?
-
And away we go . . . . to Autolisp land.
-
A bounding box, on rotated mtext especially, could get pretty tricky for getting the length.
-
More code to look at. :)
http://www.theswamp.org/phpBB2/viewtopic.php?t=6045
-
(http://www.theswamp.org/screens/mp/bugle.png)
CAB to the rescue.
-
nice....thanks.