Calling an AutoLISP function if the function name is a string?

By Gopinath Taget

This can be achieved by using (eval (list (read "string"))). Here is some sample code:

(defun adts_function ()
   (princ "\nDeveloper Technical Services")
   (princ)
)
(defun c:test ()
   (setq fname "adts_function")
   (eval (list (read fname)))
  
)
(prompt "\nCommand c:test defined")
(princ)


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading