Author Topic: retreive Font caracter  (Read 1148 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
retreive Font caracter
« on: August 25, 2016, 10:13:03 AM »
Hi all,..

I've actually few drawing with special fonts using code to determine French caracter symbol...
ex:

%%144  = É
%%148 = è
%%130 = é
etc..

So I've wrote this code to retrive the TextString Code..but it doesn'T work.

Code: [Select]
(defun c:ctext (/ mytext1 mytext2 vlanam)
(setq mytext1 (cdr (assoc 1 (entget (setq enam (car (entsel)))))))
(setq vlaenam (vlax-ename->vla-object enam))
(setq mytext2 (vla-get-TextString vlaenam))
mytext1
mytext2
  )

I mean,...the code work,...be the result of text cannot retreive the code symbol...

EXCEPT......
if I edit them before !

??

(see attached drawing)

So I would like to know if someone can give me some direction on how I can make this.
Thank you.
Keep smile...

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: retreive Font caracter
« Reply #1 on: August 25, 2016, 10:36:29 AM »
I don't have your font to test (shows up as a box), but if I try it with the standard %%d, %%p, %%c, it always returns the code, not the symbol, regardless of vla or entget. Editing doesn't change anything.

If the list isn't too extensive, you could write something that would iterate through the string and translate the the symbols. :\
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Andrea

  • Water Moccasin
  • Posts: 2372
Re: retreive Font caracter
« Reply #2 on: August 25, 2016, 11:36:50 AM »
thank you..

the problem actually..

is if I select a text showing    =     ?MISSION
it should result  =                   =    %%144MISSION
who %%144 = É

but if I select item with the LISP code, it return...  "MISSION"
and he miss the "%%144" that I cannot compare to change or replace caracter.

However,..if BEFORE usign the LISP code....I dblclick on the text to edit and changing or not changing string..
then retry using the LISP code,....the result change and recongnize the  "%%144"

this is where I'm stuck.

Keep smile...