Author Topic: Available FONTS list...  (Read 2554 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
Available FONTS list...
« on: February 24, 2006, 01:04:58 PM »
Hi all....

maybe last question before the weekend...i hope.

How do i get a list of available fonts in AutoCAD ?

What is the syntax of vla-get-FontFile ?

 :|
Keep smile...

dan19936

  • Guest
Re: Available FONTS list...
« Reply #1 on: February 28, 2006, 04:52:07 PM »
How do i get a list of available fonts in AutoCAD ?

http://tinyurl.com/j8c72

and

Code: [Select]
(vl-registry-descendents "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts" "")

LE

  • Guest
Re: Available FONTS list...
« Reply #2 on: February 28, 2006, 05:04:15 PM »
A function that might be handy...

Code: [Select]
;; (getShxFiles)
(defun getShxFiles  (/ lst)
  (setq
    lst (mapcar
  'strcase
  (mapcar
    'vl-filename-base
    (vl-directory-files
      (strcat
(vl-filename-directory (findfile "acad.exe"))
"\\Fonts"
)
      "*.shx"
      1))))
  (if (and lst (findfile "SIMPLEX.SHX"))
    (setq lst (append
lst
(list "SIMPLEX"))))
  lst)

And a way to get the fontfile for the current textstyle...

Code: [Select]
(vla-get-fontfile
  (vla-get-activetextstyle
    (vla-get-activedocument (vlax-get-acad-object))))

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Available FONTS list...
« Reply #3 on: March 02, 2006, 05:06:51 PM »
A function that might be handy...

Code: [Select]
;; (getShxFiles)
(defun getShxFiles  (/ lst)
  (setq
    lst (mapcar
  'strcase
  (mapcar
    'vl-filename-base
    (vl-directory-files
      (strcat
(vl-filename-directory (findfile "acad.exe"))
"\\Fonts"
)
      "*.shx"
      1))))
  (if (and lst (findfile "SIMPLEX.SHX"))
    (setq lst (append
lst
(list "SIMPLEX"))))
  lst)

And a way to get the fontfile for the current textstyle...

Code: [Select]
(vla-get-fontfile
  (vla-get-activetextstyle
    (vla-get-activedocument (vlax-get-acad-object))))

Thanks LE..
But a question...

U use..
Code: [Select]
(vl-filename-directory (findfile "acad.exe"))Bur is this the active ACAD.exe ?

I mean...I have 2002 2004 2005 and 2006 in my PC..
so how can I know wich one was found ?   :|

thanks.
Keep smile...

LE

  • Guest
Re: Available FONTS list...
« Reply #4 on: March 02, 2006, 05:14:40 PM »
No problem, it will work...

Open your autocad's and verify with

Command: (findfile "acad.exe")

It will be looking on the right one.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Available FONTS list...
« Reply #5 on: March 02, 2006, 05:19:33 PM »
From FINDFILE HELP ..

Quote
If filename does not specify a drive/directory prefix, findfile searches the AutoCAD library path.
If a drive/directory prefix is supplied, findfile looks only in that directory.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Available FONTS list...
« Reply #6 on: March 03, 2006, 01:40:49 PM »
good !!

thanks guys..

have a nice weekend all  ^-^   !

Keep smile...