Author Topic: Expand on this?  (Read 5628 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Expand on this?
« Reply #15 on: March 06, 2007, 06:02:39 PM »
CAB beat me to the punch but here's my version:

Code: [Select]
(defun CREATE_TEXTSTYLE (TxtSty hgt Wdth Font / Doc vltxt lst msg)
  (vl-load-com)
  (setq Doc   (vla-get-activedocument (vlax-get-acad-object))
vltxt (vla-Add (vla-Get-Textstyles Doc) TxtSty)
lst   (list (cons '"Height" Hgt)
    (cons '"Width" Wdth)
    (cons '"Fontfile" font)
      )
msg   (if (tblsearch "style" TxtSty)
(strcat "\nText Style '" TxtSty "' Updated....")
(strcat "\nText Style '" TxtSty "' Created....")
      )
  )
  (mapcar '(lambda (x)
     (if (vl-catch-all-apply
   'vlax-put
   (list
     vltxt
     (car x)
     (cdr x)
   )
)
       (progn
(princ
   (strcat "\nBad mojo detected in " (car x) " setting.")
)
(princ "\nText Style Creation Failed! \n")
(vl-catch-all-apply 'vla-delete (list vltxt))
(exit)
       )
     )
   )
  lst
  )
  (princ msg)
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC