TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Visual DCL Programming => Topic started by: lamarn on June 02, 2015, 02:56:26 PM

Title: Checkboxes 'on' in dcl
Post by: lamarn on June 02, 2015, 02:56:26 PM
Hi
I am trying to fix some default on.
Somehow in the preview it looks ok.
But when I run the code it doesn't do the job

Is this call 'value=1' the right way?
Thanks in advance
Title: Re: Checkboxes 'on' in dcl
Post by: T.Willey on June 15, 2015, 09:51:11 AM
Quote from: AutCAD help files for Toggle
value

    A quoted string containing an integer (default: "0") and specifying the initial state of the toggle. If the string is "0", the toggle box is blank (without a check mark). If it is "1", the box contains a check mark (or an X).

Looks right according to the help files.
Title: Re: Checkboxes 'on' in dcl
Post by: snownut2 on June 15, 2015, 10:06:35 AM
I usually control the the toggle box with the

Code - Auto/Visual Lisp: [Select]
  1.     (set_tile "lay" "1")
  2.  

in the lisp code, instead of the dcl definition.



Title: Re: Checkboxes 'on' in dcl
Post by: lamarn on June 15, 2015, 01:22:31 PM
Thanks for the hint!
Title: Re: Checkboxes 'on' in dcl
Post by: lamarn on June 15, 2015, 04:40:20 PM
This affects te button works but the code is a bit hard to get it really to working (default on does not react).
Title: Re: Checkboxes 'on' in dcl
Post by: snownut2 on June 15, 2015, 05:57:45 PM
The if statement @ line 543 sets the toggle box for the "lay" variable on or off depending on the presence of variable "lay-p", same with other toggles, so no matter what you set them for in the dcl code, they are set in the lisp file as needed.  The lisp file over-rides the dcl definition file, once the dcl is opened the lisp then populates the fields in it per the code within.

That's why I prefer to set toggles, radio buttons etc. from the lisp file not the dcl definition.


Title: Re: Checkboxes 'on' in dcl
Post by: lamarn on June 16, 2015, 03:44:56 AM
But if I put the 'on' clarification in the lisp before the if statement , it still shows up '0'
(?)
Title: Re: Checkboxes 'on' in dcl
Post by: snownut2 on June 16, 2015, 07:51:55 AM
You put it before the if statement, so the if statement is still evaluating and changing the status of the toggle.
Title: Re: Checkboxes 'on' in dcl
Post by: lamarn on June 16, 2015, 09:58:07 AM
Does not really matter where I put the statement.
Can't get it to work. (I am a d*f* lousy lisper ..;-) 
Title: Re: Checkboxes 'on' in dcl
Post by: roy_043 on June 16, 2015, 11:49:14 AM
You should go back to the original files (by gile). I am pretty sure that these files have proper code formatting which will make it easier for you to analyse and understand the code.
To change the default values you have to change the *-p variables.
Example:
After line 395 insert:
Code: [Select]
(setq lay-p T)
Title: Re: Checkboxes 'on' in dcl
Post by: lamarn on June 18, 2015, 04:42:32 PM
I did it !!! yeahhhh.... :)
I hope mr. Giles Chanteau will in the future work on the transparency mode..
Title: Re: Checkboxes 'on' in dcl
Post by: rkmcswain on June 18, 2015, 05:09:05 PM
I did it !!! yeahhhh.... :)

I love working with DCL.
I do it so infrequently that I have to stop and think about it each time. Maybe even consult this...


It's complex enough to present a challenge, yet not ridiculous/stupid complex where you end up giving up
 :)