Author Topic: My code does not run when initializing events  (Read 375 times)


  • Member
  • *
  • Posts: 1
My code does not run when initializing events
« on: October 08, 2022, 04:17:11 PM »
Good evening dear friends, please if someone could guide me, when i do the following routine:

where it loads the form, but it does not start any of the events, #OnInitialize or #OnClicked, what could be happening, thanks for the answers.

P.s. The form only has the following elements:

- a label (Etiqueta1)
- a text box (CajadeTexto1)
- a button (Botodetexto1)

My AutoCAD is 2021 and i use version, and I also tried with and none of them run the events.

(defun c:hello()
  (command "_OPENDCL")
  (dcl_project_load "01_hello_world" T)
  (dcl_form_show 01_hello_world_Formulario1) 

(defun c:01_hello_world/Formulario1#OnInitialize (/)
  (dcl_MessageBox "Hello World!!!")
(defun c:01_hello_world/Formulario1_OnInitialize (/)  (dcl_Control_SetCaption 01_hello_world/Formulario1/Etiqueta1 "Type text to Box And Click Button")

(defun c:01_hello_world/Formulario1/BotondeTexto1#OnClicked (/)
   (dcl_MessageBox "Hello World!!!")
  (setq txtBoxString (dcl-Control-GetText 01_hello_world/Formulario1/CajadeTexto1))
  (alert (strcat "Hi" txtBoxString))


  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
    • Outside The Box
Re: My code does not run when initializing events
« Reply #1 on: October 09, 2022, 06:13:39 PM »
Likely your lisp event function names do not match the names in the .odcl file. If you open your .odcl file in OpenDCL Studio, you can copy/paste the event function names from studio to your lisp file.