OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Atwist on May 16, 2011, 12:15:30 PM

Title: Button to start lisp
Post by: Atwist on May 16, 2011, 12:15:30 PM
Hello all

I have a make a textbutton

Code (autolisp) Select
(defun c:start_Start_Tekstlayer25_OnClicked (/)
  (dcl_MessageBox "To Do: code must be added to event handler\r\nc:start_Start_Tekstlayer25_OnClicked" "To do")
)

But where put I the code to start the lisp.
I'm do not find in the samples of opendcl.

Atwist
Title: Re: Button to start lisp
Post by: Fred Tomke on May 16, 2011, 01:55:20 PM
Hello and welcome, it depends on what do you want to do. The "dcl_messagebox" line of your code sample is the line where do you have to put your code in.

Regards, Fred
Title: Re: Button to start lisp
Post by: Atwist on May 17, 2011, 12:57:52 AM
Thanks (Danke) Fred,

Looks like this??
Code (autolisp) Select
01.(defun c:start_Start_Tekstlayer25_OnClicked (/) 
02.  (load"cl";cl;) 
03.)


Atwist
Title: Re: Button to start lisp
Post by: Fred Tomke on May 17, 2011, 11:40:18 AM
Hi,

looks like a type mismatch?
I'm sure you meant

Code (autolisp) Select

(defun c:start_Start_Tekstlayer25_OnClicked (/)   
  (load "mylisp.lsp")
); c:start_Start_Tekstlayer25_OnClicked


Make sure that you don't make changes in the drawing within an event handler of a modal form using entmake or entmod. It could be that these changes will be suppressed.

Regards,
Fred
Title: Re: Button to start lisp
Post by: Atwist on May 17, 2011, 12:15:20 PM
Thanks Fred,

I'ts works

Thanks