Author Topic: Textbox - unwanted behavior? Box text by Lee Mac as example  (Read 3059 times)

0 Members and 1 Guest are viewing this topic.

ziele_o2k

  • Newt
  • Posts: 49
Textbox - unwanted behavior? Box text by Lee Mac as example
« 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 routine, example in attached screen.
We found solution for spaces problem but now I have no idea what to do with that...

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Textbox - unwanted behavior? Box text by Lee Mac as example
« Reply #1 on: March 19, 2018, 08:50:51 AM »
What version of AutoCAD are you using?
It works as expect in 2017 here.





ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Textbox - unwanted behavior? Box text by Lee Mac as example
« Reply #2 on: March 19, 2018, 09:15:43 AM »
Probably A2014...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Textbox - unwanted behavior? Box text by Lee Mac as example
« Reply #3 on: March 19, 2018, 09:26:15 AM »
Quick test here and it's dependent on the textstyle .. these TTF don't show up correctly.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Textbox - unwanted behavior? Box text by Lee Mac as example
« Reply #4 on: March 19, 2018, 09:28:16 AM »
@ronjonp - what version?  My image in post #2 contains a TTF font, where it does work. (2017)

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Textbox - unwanted behavior? Box text by Lee Mac as example
« Reply #5 on: March 19, 2018, 09:31:36 AM »
@ronjonp - what version?  My image in post #2 contains a TTF font, where it does work. (2017)
AutoCAD 2018

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Textbox - unwanted behavior? Box text by Lee Mac as example
« Reply #6 on: March 19, 2018, 09:46:21 AM »
Interesting.


I just did this in 2018.



ronjonp

  • Needs a day job
  • Posts: 7526
Re: Textbox - unwanted behavior? Box text by Lee Mac as example
« Reply #7 on: March 19, 2018, 10:10:26 AM »
Maybe try it on the attached drawing.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Textbox - unwanted behavior? Box text by Lee Mac as example
« Reply #8 on: March 19, 2018, 10:46:29 AM »
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).




ronjonp

  • Needs a day job
  • Posts: 7526
Re: Textbox - unwanted behavior? Box text by Lee Mac as example
« Reply #9 on: March 19, 2018, 10:57:57 AM »
Yup ... I'm using THIS .. with an offset factor of 0.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Textbox - unwanted behavior? Box text by Lee Mac as example
« Reply #10 on: March 19, 2018, 11:03:13 AM »
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 :
Quote
(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)
)
« Last Edit: March 19, 2018, 11:06:58 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ziele_o2k

  • Newt
  • Posts: 49
Re: Textbox - unwanted behavior? Box text by Lee Mac as example
« Reply #11 on: March 19, 2018, 11:31:17 AM »
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.
« Last Edit: March 19, 2018, 11:35:11 AM by ziele_o2k »

ziele_o2k

  • Newt
  • Posts: 49
Re: Textbox - unwanted behavior? Box text by Lee Mac as example
« Reply #12 on: March 19, 2018, 11:53:54 AM »
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 and example calling function at bottom of site to check.