TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: ziele_o2k on March 18, 2018, 10:17:56 AM
-
I have big problem with autolisp function textbox.
If string in text consists of some specific characters (for exmple: only dashes), then teturned coordinates by textbox function are wrong.
As example you can use LeeMac's Box Text (http://www.lee-mac.com/boxtext.html) routine, example in attached screen.
We found solution for spaces problem (https://www.theswamp.org/index.php?topic=51573.msg566569#msg566569) but now I have no idea what to do with that...
-
What version of AutoCAD are you using?
It works as expect in 2017 here.
(https://i.imgur.com/F7txMQr.png)
-
Probably A2014...
-
Quick test here and it's dependent on the textstyle .. these TTF don't show up correctly.
-
@ronjonp - what version? My image in post #2 contains a TTF font, where it does work. (2017)
-
@ronjonp - what version? My image in post #2 contains a TTF font, where it does work. (2017)
AutoCAD 2018
-
Interesting.
I just did this in 2018.
(https://i.imgur.com/7uCZwCG.png)
-
Maybe try it on the attached drawing.
-
Still works okay (yellow boxes are mine). Perhaps we are not conducting the same tests?
I'm running the Box Text routine from LeeMac as stated in the original post (with default 0.35 offset factor).
(https://i.imgur.com/COQ9pjE.png)
-
Yup ... I'm using THIS (http://www.lee-mac.com/lisp/html/BoxTextV1-2.html) .. with an offset factor of 0.
-
I'm running the Box Text routine from LeeMac as stated in the original post (with default 0.35 offset factor).
That explains things...
I was using :
(defun c:frame ( / enx pl )
(setq enx (entget (car (entsel "\nPick text..."))))
(setq pl (mapcar '(lambda ( x ) (mapcar '+ (cdr (assoc 10 enx)) x)) (textbox enx)))
(vl-cmdf "_.RECTANGLE" "_non" (car pl) "_non" (cadr pl))
(princ)
)
-
I forgot to check topic since morning and so many replies.
I'm using autocad 2018 and zwcad 2015, same wrong results with Lee Mac Box Text (TTF times new roman as font).
rkmcswain uses propably default offset as 0.35 not 0 as me and ronjonp
It seems to work fine with shx fonts
Edit:
I wrote to Autodesk, I will post their opinion.
-
I made some history review. TTF font support was introduced to autocad in AutoCAD Release 13 - 1994, AutoLISP was developed way before that - maybe here is problem?
But from other site, getboundingbox method also don't work (Visual-List introduced in 2000) - use http://www.lee-mac.com/boundingbox.html (http://www.lee-mac.com/boundingbox.html) and example calling function at bottom of site to check.