OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: jromkes on April 14, 2009, 03:30:44 AM

Title: how to reset odcl project
Post by: jromkes on April 14, 2009, 03:30:44 AM
How do I reset an odcl project.

I have a poject with a form. On the form I placed a button Reset to reset the form.
I tried al kinds of different things, like unloading, reloading etc. to reset the form to the initial values.
But I can't get any results.

Can anyone help me?
Title: Re: how to reset odcl project
Post by: Slavko Ivanovic on April 14, 2009, 04:29:31 AM
Hi there.
I'm no sure what you want to do in general.
You didn't provide any screen shot or code segment.


If you want to set some values to form elements, why not use function with multiple
set functions.

Project_Load with argument T always load initial values, but U probably know that.
If not read about Project_Load in Control Browser.

But anyway i don't know exactly where you facing with problems.
Send some code or screen shot. 


Title: Re: how to reset odcl project
Post by: Fred Tomke on April 14, 2009, 06:53:33 AM
Hello, jromkes,

welcome to OpenDCL. Unfortunately, there is no reset method to reset the form as known from HTML forms.
You can either call the Project_Load (http://www.opendcl.com/HelpFiles/index.php?page=Reference/Method/Project/Load.htm) method as Slavko meant or you have to keep initial values which are set and placed when the user presses the reset button.

Fred
Title: Re: how to reset odcl project
Post by: Slavko Ivanovic on April 14, 2009, 08:20:59 AM

Quote from: Slavko.Ivanovic on April 14, 2009, 04:29:31 AM
... If you want to set some values to form elements, why not use function with multiple
set functions.

Quote from: Fred Tomke on April 14, 2009, 06:53:33 AM
.... or you have to keep initial values which are set and placed when the user presses the reset button.
Fred
Fred
We are talking about the same thing, and when i read are posts again, i myself get confused.

  :D  ;D

jromkes, don't get confused with the way me and Fred trying to tell U what is all about.

Its simple:

1. If U creating forms in studio, and testing it in AutoCAD, and U want to see changes instantly,
   then instead (DCL_PROJECT_LOAD "My_Project") in your code put (DCL_PROJECT_LOAD "My_Project" T)

2. If you really need a button to reset form values, then you must write functions to set properties (values),
   for each control in form separately (in this case to set them to wanted "initial" values), and add them in
   button_OnClicked event function.
   (or u can make more intelligent function with arguments to call that function button_OnClicked event)


Title: Re: how to reset odcl project
Post by: jromkes on April 15, 2009, 01:29:31 AM
Thanks for the solutions.

I now added a little bit of code that changes all the changed properties to their initial values.

Jaco