Function GetName

Started by Emiliano, June 18, 2014, 09:32:27 AM

Previous topic - Next topic

Emiliano

Hello to all,
I need to use the function "GetName"

I try to simplify my problem:
Code (autolisp) Select

(setq NomeBottoneForm (dcl-Control-GetName plug-in/AttivaPlugIn/ButtonAttivaMapColori))
(dcl-Control-SetEnabled NomeBottoneForm nil)


This code, unfortunately, does not work.
In other words, in the second line "dcl-Control-SetEnabled" I need to insert a variable name for the control.

Maybe not work because GetName returns only the name of the button and not all the path "plug-in/AttivaPlugIn/ButtonAttivaMapColori."

Can you help?

owenwengerd

Quote from: Emiliano on June 18, 2014, 09:32:27 AM
Maybe not work because GetName returns only the name of the button and not all the path "plug-in/AttivaPlugIn/ButtonAttivaMapColori."

You can either construct the complete symbol name as a string, then (eval (read "symbol-name")) to get the handle; or you can use the "project" "form" "control" syntax to specify the control:
Code (autolisp) Select
(dcl-Control-SetEnabled "myproject" "myform" NomeBottoneForm nil)

Emiliano

Quote from: owenwengerd on June 18, 2014, 11:45:39 AM
You can either construct the complete symbol name as a string, then (eval (read "symbol-name")) to get the handle; or you can use the "project" "form" "control" syntax to specify the control:

Perfect!
thanks I solved it as you suggested