Author Topic: Checkboxes 'on' in dcl  (Read 2307 times)

0 Members and 1 Guest are viewing this topic.

lamarn

  • Swamp Rat
  • Posts: 514
Checkboxes 'on' in dcl
« 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
Design is something you should do with both hands. My 2d hand , my 3d hand ..

T.Willey

  • Needs a day job
  • Posts: 5183
Re: Checkboxes 'on' in dcl
« Reply #1 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.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

snownut2

  • Swamp Rat
  • Posts: 919
  • ADT 2004 - AutoCad 2011 Bricscad 15
Re: Checkboxes 'on' in dcl
« Reply #2 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.



God helps those who helps themselves.
A little searching goes a long ways.

lamarn

  • Swamp Rat
  • Posts: 514
Re: Checkboxes 'on' in dcl
« Reply #3 on: June 15, 2015, 01:22:31 pm »
Thanks for the hint!
Design is something you should do with both hands. My 2d hand , my 3d hand ..

lamarn

  • Swamp Rat
  • Posts: 514
Re: Checkboxes 'on' in dcl
« Reply #4 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).
Design is something you should do with both hands. My 2d hand , my 3d hand ..

snownut2

  • Swamp Rat
  • Posts: 919
  • ADT 2004 - AutoCad 2011 Bricscad 15
Re: Checkboxes 'on' in dcl
« Reply #5 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.


God helps those who helps themselves.
A little searching goes a long ways.

lamarn

  • Swamp Rat
  • Posts: 514
Re: Checkboxes 'on' in dcl
« Reply #6 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'
(?)
Design is something you should do with both hands. My 2d hand , my 3d hand ..

snownut2

  • Swamp Rat
  • Posts: 919
  • ADT 2004 - AutoCad 2011 Bricscad 15
Re: Checkboxes 'on' in dcl
« Reply #7 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.
God helps those who helps themselves.
A little searching goes a long ways.

lamarn

  • Swamp Rat
  • Posts: 514
Re: Checkboxes 'on' in dcl
« Reply #8 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 ..;-) 
Design is something you should do with both hands. My 2d hand , my 3d hand ..

roy_043

  • Swamp Rat
  • Posts: 1428
  • BricsCAD 16
Re: Checkboxes 'on' in dcl
« Reply #9 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)

lamarn

  • Swamp Rat
  • Posts: 514
Re: Checkboxes 'on' in dcl
« Reply #10 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..
Design is something you should do with both hands. My 2d hand , my 3d hand ..

rkmcswain

  • Swamp Rat
  • Posts: 814
Re: Checkboxes 'on' in dcl
« Reply #11 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
 :)