Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help with DCL twin list boxes?

6 REPLIES 6
Reply
Message 1 of 7
rapidcad
588 Views, 6 Replies

Help with DCL twin list boxes?

Ok, I’m not going to pretend that I understand this DCL stuff very well. I have read my textbooks, carefully read the websites, tried countless variations and have not come up with a way to do this. I feel like I’m very close, but I lack one detail somewhere.

 

I’ve been trying to modify a complex dialog box which sets a list of 3 global variables; a conveyor frame type, the roller spacing and the width. These get saved at the unloading of the dialog by a simple function: (180MODES). My mnl file has the beginning default values set like so:

 

(setq f_typ_VAL "4.5" 
n_wid_VAL "22" 
r_ctrs_VAL "3\" [c1]" 
)

The rules I have to manage with the dialog box are that there are:

  • two types of frame - 4.5” and CRUZ.
  • 4.5 can have 2.25” roller spacing or 3” roller spacing
  • CRUZ can only have 3” roller spacing
  • 4.5 comes in 6 available widths, (list "13" "16" "22" "28" "34" "40")
  • but CRUZ only comes in 4 of those same widths. (list "16" "22" "28" "34")

I have modified an old dialog box about as much as I can in order to address the changes I was recently given. This dialog used to have one list of widths – and I had it working fairly well.

However, now that I try to do this with two list boxes – the last driven by the first, which in itself is driven by the two radio buttons, I am missing something. Everything works except I never actually get the width variable to update and I don’t know why. I am missing something.

Would anyone be able to show me what I am missing? I’ve been working on this since Thursday and I don’t think I have made any further progress today.

 

DCL:

TGWDBS : dialog {
 label = "TGW XR40 Dynamic Block Setup";
 :row
 {
  :boxed_radio_column 
  {
   label        = "Frame Type";
   width        = 20;
   fixed_width  = true;
   fixed_height = true;
   alignment    = top;
   :radio_button{key = "4.5";               label = "4 1/2\"";}
   :radio_button{key = "CRUZ";      	    label = "7 1/2\" Cruz";}
  }
  :list_box
  {
   key    = "RCs";
   label  = "Roller Centers";
   width  = 20;
  }
   :list_box
  {
   key    = "BFs";
   label  = "Width Between Frames";
   width  = 20;
  }
 }
 ok_cancel;
}

 here's the code (all variable locallization and error trapping removed for now)...

 

(defun c:180TGWDBS ( / )
  
 (defun 180MODES ();function for storing global variables
   (Setq 180MODE (list f_typ_VAL r_ctrs_VAL n_wid_VAL))
   )
  
(defun 180MODER ();function for returning global variables
  (setq f_typ_VAL (car 180MODE)
        r_ctrs_VAL (cadr 180MODE)
        n_wid_VAL (caddr 180MODE)
	)
 )

(defun 180TGW-DBS_01;dialog box subfunction 
  (180key / rlr_ctrs)
    (setq rlr_ctrs(atoi(get_tile"RCs")))
    (cond
    ((= 180key "4.5")    	(progn (180TGW-DBS_02 LIST4.5RC)(setq f_typ_VAL "4.5")(set_tile"RCs""0")(180TGW-DBS_03 LISTNOMW)))
    ((= 180key "CRUZ")		(progn (180TGW-DBS_02 LISTCRUZRC)(setq f_typ_VAL "7.5 CRUZ")(set_tile"RCs""0")(180TGW-DBS_03 LISTCRUZW)))
    ((= 180key "BFs")		(WIDTHPICKER))
    ((= 180key "accept")
      (cond
        ((=(get_tile"4.5")"1")(progn(setq r_ctrs_VAL(nth rlr_ctrs LIST4.5RC))(180TGW-DBS_03 LISTNOMW)))
	((=(get_tile"CRUZ")"1")(progn(setq r_ctrs_VAL(nth rlr_ctrs LISTCRUZRC))(180TGW-DBS_03 LISTCRUZW)))
	((=(get_tile"BFs")"1")  (WIDTHPICKER))  
    )
  )
)
 )
(defun 180TGW-DBS_02;;;;dialog box subfunction - this populates the first list box
  (180r_ctrs / 180foreach)
  (start_list "RCs")
  (foreach 180foreach 180r_ctrs(add_list 180foreach))
  (end_list)
)
(defun 180TGW-DBS_03;;;;dialog box subfunction - this populates the second list box
  (180r_BFs / 180Bforeach)
  (start_list "BFs")
  (foreach 180Bforeach 180r_BFs(add_list 180Bforeach))
  (end_list)
)
(DEFUN WIDTHPICKER (/);;dialog box subfuncton trying to set the width variable after picking from the second list box
(if (= f_typ_VAL "4.5")
  (cond
    ((= (get_tile "13") "1") (setq n_wid_VAL (nth 0 LISTNOMW)))
    ((= (get_tile "16") "1") (setq n_wid_VAL (nth 1 LISTNOMW)))
    ((= (get_tile "22") "1") (setq n_wid_VAL (nth 2 LISTNOMW)))
    ((= (get_tile "28") "1") (setq n_wid_VAL (nth 3 LISTNOMW)))
    ((= (get_tile "34") "1") (setq n_wid_VAL (nth 4 LISTNOMW)))
    ((= (get_tile "40") "1") (setq n_wid_VAL (nth 5 LISTNOMW)))
  )
  (cond
    ((= (get_tile "16") "1") (setq n_wid_VAL (nth 0 LISTCRUZW)))
    ((= (get_tile "22") "1") (setq n_wid_VAL (nth 1 LISTCRUZW)))
    ((= (get_tile "28") "1") (setq n_wid_VAL (nth 2 LISTCRUZW)))
    ((= (get_tile "34") "1") (setq n_wid_VAL (nth 3 LISTCRUZW)))
  )

)
  )

  
  (setq temp180mode 180mode);save the current variable values in case of error or cancel
  (180MODER);recall the current values
;set up my lists of values
  (setq
    LIST4.5RC (list "2.25\" [b1]" "3\" [c1]")
    LISTCRUZRC (list "3\" [c1]")
    LISTCRUZW (list "16" "22" "28" "34")
    LISTNOMW (list "13" "16" "22" "28" "34" "40")
  )

  (if(<(setq dcl_file_id(load_dialog"180test.dcl"))0)(exit));loading the dcl
  (if(not(new_dialog"TGWDBS"dcl_file_id))(exit));identifying the dialog name

;;;setting up the dialog box to display the current values to the user
  (cond
    	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "2.25\" [b1]")(= n_wid_VAL "13")) (progn  (set_tile"4.5" "1")(180TGW-DBS_02 LIST4.5RC) (set_tile "RCs" "0")(180TGW-DBS_03 LISTNOMW) (setq XRBF "0")(set_tile "BFs" XRBF)))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "2.25\" [b1]")(= n_wid_VAL "16")) (progn  (set_tile"4.5" "1")(180TGW-DBS_02 LIST4.5RC) (set_tile "RCs" "0")(180TGW-DBS_03 LISTNOMW) (setq XRBF "1")(set_tile "BFs" XRBF)))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "2.25\" [b1]")(= n_wid_VAL "22")) (progn  (set_tile"4.5" "1")(180TGW-DBS_02 LIST4.5RC) (set_tile "RCs" "0")(180TGW-DBS_03 LISTNOMW) (setq XRBF "2")(set_tile "BFs" XRBF)))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "2.25\" [b1]")(= n_wid_VAL "28")) (progn  (set_tile"4.5" "1")(180TGW-DBS_02 LIST4.5RC) (set_tile "RCs" "0")(180TGW-DBS_03 LISTNOMW) (setq XRBF "3")(set_tile "BFs" XRBF)))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "2.25\" [b1]")(= n_wid_VAL "34")) (progn  (set_tile"4.5" "1")(180TGW-DBS_02 LIST4.5RC) (set_tile "RCs" "0")(180TGW-DBS_03 LISTNOMW) (setq XRBF "4")(set_tile "BFs" XRBF)))
  	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "2.25\" [b1]")(= n_wid_VAL "40")) (progn  (set_tile"4.5" "1")(180TGW-DBS_02 LIST4.5RC) (set_tile "RCs" "0")(180TGW-DBS_03 LISTNOMW) (setq XRBF "5")(set_tile "BFs" XRBF)))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "3\" [c1]")(= n_wid_VAL "13")) (progn  (set_tile"4.5" "1")(180TGW-DBS_02 LIST4.5RC) (set_tile "RCs" "1")(180TGW-DBS_03 LISTNOMW) (setq XRBF "0")(set_tile "BFs" XRBF)))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "3\" [c1]")(= n_wid_VAL "16")) (progn  (set_tile"4.5" "1")(180TGW-DBS_02 LIST4.5RC) (set_tile "RCs" "1")(180TGW-DBS_03 LISTNOMW) (setq XRBF "1")(set_tile "BFs" XRBF)))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "3\" [c1]")(= n_wid_VAL "22")) (progn  (set_tile"4.5" "1")(180TGW-DBS_02 LIST4.5RC) (set_tile "RCs" "1")(180TGW-DBS_03 LISTNOMW) (setq XRBF "2")(set_tile "BFs" XRBF)))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "3\" [c1]")(= n_wid_VAL "28")) (progn  (set_tile"4.5" "1")(180TGW-DBS_02 LIST4.5RC) (set_tile "RCs" "1")(180TGW-DBS_03 LISTNOMW) (setq XRBF "3")(set_tile "BFs" XRBF)))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "3\" [c1]")(= n_wid_VAL "34")) (progn  (set_tile"4.5" "1")(180TGW-DBS_02 LIST4.5RC) (set_tile "RCs" "1")(180TGW-DBS_03 LISTNOMW) (setq XRBF "4")(set_tile "BFs" XRBF)))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "3\" [c1]")(= n_wid_VAL "40")) (progn  (set_tile"4.5" "1")(180TGW-DBS_02 LIST4.5RC) (set_tile "RCs" "1")(180TGW-DBS_03 LISTNOMW) (setq XRBF "5")(set_tile "BFs" XRBF)))
	((and (= f_typ_VAL "7.5 CRUZ")(= n_wid_VAL "16")) (progn  (set_tile"CRUZ" "1")(180TGW-DBS_02 LISTCRUZRC) (set_tile "RCs" "0")(180TGW-DBS_03 LISTCRUZW) (setq XRBF "0")(set_tile "BFs" XRBF)))
	((and (= f_typ_VAL "7.5 CRUZ")(= n_wid_VAL "22")) (progn  (set_tile"CRUZ" "1")(180TGW-DBS_02 LISTCRUZRC) (set_tile "RCs" "0")(180TGW-DBS_03 LISTCRUZW) (setq XRBF "1")(set_tile "BFs" XRBF)))
	((and (= f_typ_VAL "7.5 CRUZ")(= n_wid_VAL "28")) (progn  (set_tile"CRUZ" "1")(180TGW-DBS_02 LISTCRUZRC) (set_tile "RCs" "0")(180TGW-DBS_03 LISTCRUZW) (setq XRBF "2")(set_tile "BFs" XRBF)))
	((and (= f_typ_VAL "7.5 CRUZ")(= n_wid_VAL "34")) (progn  (set_tile"CRUZ" "1")(180TGW-DBS_02 LISTCRUZRC) (set_tile "RCs" "0")(180TGW-DBS_03 LISTCRUZW) (setq XRBF "3")(set_tile "BFs" XRBF)))
	(T (progn  (set_tile"4.5" "1")(180TGW-DBS_02 LIST4.5RC) (set_tile "RCs" "1")(180TGW-DBS_03 LISTNOMW) (setq XRBF "2")(set_tile "BFs" XRBF)))
)

  (action_tile"4.5" "(180TGW-DBS_01 $key)")
  (action_tile"CRUZ" "(180TGW-DBS_01 $key)")
  (action_tile"BFs" "(180TGW-DBS_01 $key)")
  
  (action_tile"accept"        "(180TGW-DBS_01 $key)(done_dialog 1)")
  (action_tile"cancel"        "(done_dialog 0)")
  (setq answer (start_dialog))

(unload_dialog dcl_file_id)

(if (= answer 0)
    (setq 180mode temp180mode);if cancelling - restore the old variable values
    (180MODES);if everyrhing worked  - save teh variables to the list 180mode
 )

 (princ)               
)



 

Any help greatly appreciated.

 

Ron

ADN CAD Developer/Operator
6 REPLIES 6
Message 2 of 7
scot-65
in reply to: rapidcad

Without getting into too much detail, you can greatly simplify

the program by using three radio buttons and only one list box.

 

"4.5 - 2.25 roller"

"4.5 - 3.00 roller"

"Cruz - 3.00 roller"

 

Make an action_tile to each of these and populate the list box accordingly.

 

 

Replace the foreach with (mapcar 'add_list [YourList]) as shown here:

 

(start_list "Lis201")(mapcar 'add_list NVList)(end_list)

 

Set an initialization section in your program - just after the new_dialog call

and you will not need to have an outside source do this for you.

 

(if (not f_typ_val)

 (setq ...

Maybe even suggest turning this into a list so as not to intefere with other programs...

(if (not USER_TGWDBS)

 (setq USER_TGWDBS (list "4.5" "22" "3"))

);if

...and to access the list:

(nth 0 USER_TGWDBS), (nth 1 USER_TGWDBS), etc.


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 3 of 7
rapidcad
in reply to: scot-65

Thanks Scot - A classic case of looking at something so long that I failed to see the easy solutiuon! I will give your suggestions a try and see if I can make it work. I think I can do this much. I may fire back with some questions regarding the callback functions and the list management - but I think I will be able to do it this way.

 

Really appreciate the extra set of eyes - especially of someone who knows this stuff far better thatn I do.

ADN CAD Developer/Operator
Message 4 of 7
scot-65
in reply to: rapidcad

I was in a bit of a rush yesterday and only hit on the highlights...

 

I have found that most newbie developers tend to try and execute code while the dialog box is still open.

The main purpose of the dialog interface is to gather information so that a program will execute based

on the supplied information.

 

Consider the following:

 

:radio_column {key="Rad100"

 :radio_button {key="Rad101"}

 :radio_button {key="Rad102"}

 :radio_button {key="Rad103"}

}

 

By supplying a "key" to the radio column, you can now set and retrieve which button is active.

(set_tile "Rad100" "Rad101")

 

Out of order thoughts:

(cond

 ( (= (get_tile "Rad100") "Rad101") [do stuff] )

 ( (= (get_tile "Rad100") "Rad102") [do stuff] )

);cond

 

As far as action_tile, I only use $value and $reason to toggle mode_tile. Never needed it for any other reason.

 

(start_list "Lis101")(mapcar 'addlist '("1" "2" "3"))(end_list)

 

(action_tile "Rad101" "(REPOPULATE 1)")

(action_tile "Rad102" "(REPOPULATE 2)")

(action_tile "Rad103" "(REPOPULATE \"Unk.\")") ;<-- notice the escapes on the quotes, therefore write a subroutine.

 

Where

(defun REPOPULATE ( a / )

 (cond

  ( (= a 1) (start_list "Lis101")(mapcar 'addlist '("1" "2" "3"))(end_list) )

  ( (= a 2) (start_list "Lis101")(mapcar 'addlist '("4" "5" "6"))(end_list) )

  (T (princ) )

 );cond

);defun

 

And finally,

(action_tile "accept" "(GET_INFORMATION)(done_dialog 1)")

 

Where GET_INFORMATION will be a subroutine that fetches "Rad100" value and "Lis101" position.

(setq USER_180TGWDBS (list

 (get_tile "Rad100")

 (get_tile "Lis101")

))

This is all you will need to begin executing code: (nth 0 USER_180TGWDBS) and (nth 1 USER_180TGWDBS).

 

See attached template I use to begin DCL type projects.


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 5 of 7
rapidcad
in reply to: scot-65

Thanks for the in-depth info, Scot, I'll attempt to digest it!  However, I am under the gun to get something to the users next week, (not in final form) so I might just have to revisit this and really learn my DCL a little later. I took your advice and simplified (combined the roller spacing and frame type variables into 3 radio button choices) and drove a single list box (alternating two lists) with the buttons. I am really struggling to understand the terms and theory of a lot of this - I learn so much better by dissecting examples and trying to replicate something. However, when anyone takes the time to help me, I feel obligated to dig in and try to get an understaning of what they are trying to communicate.

 

As a patch, I have basically the same messy dialog box code (with your structural simplication) up and running for the time being. It really seems to work for all the various user interaction possibilities. However, I must clean this up eventually.

 

Thanks again!

Ron

 

DCL code:

TGWDBS : dialog {
 label = "TGW XR40 Dynamic Block Setup";
 :row
 {
  :boxed_radio_column 
  {
   //key		= "Radio1";
   label        = "Frame Type / Roller Center";
   width        = 20;
   fixed_width  = true;
   fixed_height = true;
   alignment    = top;
   :radio_button{key = "XR40-2";          label = "4 1/2\" Frame, 2 1/4\" RC";}
   :radio_button{key = "XR40-3";           label = "4 1/2\" Frame, 3\" RC";}
   :radio_button{key = "CRUZ";      	    label = "7 1/2\" Cruz Frame, 3\" RC";}
  }
   :list_box
  {
   key    = "BFs";
   label  = "Width Between Frames";
   width  = 20;
  }
 }
 ok_cancel;
}

 

 

 

LISP code:

(defun c:180TGWDBS ( / )
  
 (defun 180MODES ();function for storing global variables
   (Setq 180MODE (list f_typ_VAL r_ctrs_VAL n_wid_VAL))
   )
  
(defun 180MODER ();function for returning global variables
  (setq f_typ_VAL (car 180MODE)
        r_ctrs_VAL (cadr 180MODE)
        n_wid_VAL (caddr 180MODE)
	)
 )

(defun 180TGW-DBS_01;dialog box subfunction 
  (180key / widths)
    (setq widths(atoi(get_tile"BFs")))
    (cond
    ((= 180key "XR40-2")    	(progn (180TGW-DBS_02 LISTNOMW)(setq f_typ_VAL "4.5")(setq r_ctrs_VAL "2.25\" [b1]")(WIDTHSET)));(set_tile"BFs""0")
    ((= 180key "XR40-3")    	(progn (180TGW-DBS_02 LISTNOMW)(setq f_typ_VAL "4.5")(setq r_ctrs_VAL "3\" [c1]")(WIDTHSET)));(set_tile"BFs""0")
    ((= 180key "CRUZ")		(progn (180TGW-DBS_02 LISTCRUZW)(setq f_typ_VAL "7.5 CRUZ")(setq r_ctrs_VAL "3\" [c1]")(WIDTHSET)));(set_tile"BFs""0")
    ((= 180key "accept")
      (cond
        ((=(get_tile"XR40-2")"1")(progn(setq f_typ_VAL "4.5")(setq r_ctrs_VAL "2.25\" [b1]")(180TGW-DBS_02 LISTNOMW)(setq n_wid_VAL(nth widths LISTNOMW))))
	((=(get_tile"XR40-3")"1")(progn(setq f_typ_VAL "4.5")(setq r_ctrs_VAL "3\" [c1]")(180TGW-DBS_02 LISTNOMW)(setq n_wid_VAL(nth widths LISTNOMW))))
	((=(get_tile"CRUZ")"1")(progn(setq f_typ_VAL "7.5 CRUZ")(setq r_ctrs_VAL "3\" [c1]")(180TGW-DBS_02 LISTCRUZW)(setq n_wid_VAL(nth widths LISTCRUZW))))
    )
  )
)
 )

(defun 180TGW-DBS_02;;;;dialog box subfunction - this populates the second list box
  (180r_BFs / 180Bforeach)
  (start_list "BFs")
  (foreach 180Bforeach 180r_BFs(add_list 180Bforeach))
  (end_list)
)
(DEFUN WIDTHSET (/);;dialog box subfuncton trying to set the width variable after picking from the second list box
(if (= f_typ_VAL "4.5")
  (cond
    ((= n_wid_VAL "13") (set_tile "BFs" "0"))
    ((= n_wid_VAL "16") (set_tile "BFs" "1"))
    ((= n_wid_VAL "22") (set_tile "BFs" "2"))
    ((= n_wid_VAL "28") (set_tile "BFs" "3"))
    ((= n_wid_VAL "34") (set_tile "BFs" "4"))
    ((= n_wid_VAL "40") (set_tile "BFs" "5"))
  )
  (cond
    ((= n_wid_VAL "13") (set_tile "BFs" "0"))
    ((= n_wid_VAL "16") (set_tile "BFs" "0"))
    ((= n_wid_VAL "22") (set_tile "BFs" "1"))
    ((= n_wid_VAL "28") (set_tile "BFs" "2"))
    ((= n_wid_VAL "34") (set_tile "BFs" "3"))
    ((= n_wid_VAL "40") (set_tile "BFs" "3"))
  )

)
  )
  
  (setq temp180mode 180mode);save the current variable values in case of error or cancel
  (180MODER);recall the current values
;set up my lists of values
  (setq
;    LIST4.5RC (list "2.25\" [b1]" "3\" [c1]")
;    LISTCRUZRC (list "3\" [c1]")
    LISTCRUZW (list "16" "22" "28" "34")
    LISTNOMW (list "13" "16" "22" "28" "34" "40")
  )

  (if(<(setq dcl_file_id(load_dialog"180test2.dcl"))0)(exit));loading the dcl
  (if(not(new_dialog"TGWDBS"dcl_file_id))(exit));identifying the dialog name

;;;setting up the dialog box to display the current values to the user
  (cond
    	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "2.25\" [b1]")(= n_wid_VAL "13")) (progn  (set_tile"XR40-2" "1") (180TGW-DBS_02 LISTNOMW) (set_tile "BFs" "0")))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "2.25\" [b1]")(= n_wid_VAL "16")) (progn  (set_tile"XR40-2" "1") (180TGW-DBS_02 LISTNOMW) (set_tile "BFs" "1")))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "2.25\" [b1]")(= n_wid_VAL "22")) (progn  (set_tile"XR40-2" "1") (180TGW-DBS_02 LISTNOMW) (set_tile "BFs" "2")))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "2.25\" [b1]")(= n_wid_VAL "28")) (progn  (set_tile"XR40-2" "1") (180TGW-DBS_02 LISTNOMW) (set_tile "BFs" "3")))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "2.25\" [b1]")(= n_wid_VAL "34")) (progn  (set_tile"XR40-2" "1") (180TGW-DBS_02 LISTNOMW) (set_tile "BFs" "4")))
  	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "2.25\" [b1]")(= n_wid_VAL "40")) (progn  (set_tile"XR40-2" "1") (180TGW-DBS_02 LISTNOMW) (set_tile "BFs" "5")))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "3\" [c1]")(= n_wid_VAL "13")) (progn  (set_tile"XR40-3" "1") (180TGW-DBS_02 LISTNOMW) (set_tile "BFs" "0")))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "3\" [c1]")(= n_wid_VAL "16")) (progn  (set_tile"XR40-3" "1") (180TGW-DBS_02 LISTNOMW) (set_tile "BFs" "1")))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "3\" [c1]")(= n_wid_VAL "22")) (progn  (set_tile"XR40-3" "1") (180TGW-DBS_02 LISTNOMW) (set_tile "BFs" "2")))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "3\" [c1]")(= n_wid_VAL "28")) (progn  (set_tile"XR40-3" "1") (180TGW-DBS_02 LISTNOMW) (set_tile "BFs" "3")))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "3\" [c1]")(= n_wid_VAL "34")) (progn  (set_tile"XR40-3" "1") (180TGW-DBS_02 LISTNOMW) (set_tile "BFs" "4")))
	((and (= f_typ_VAL "4.5")(= r_ctrs_VAL "3\" [c1]")(= n_wid_VAL "40")) (progn  (set_tile"XR40-3" "1") (180TGW-DBS_02 LISTNOMW) (set_tile "BFs" "5")))
	((and (= f_typ_VAL "7.5 CRUZ")(= n_wid_VAL "16")) (progn  (set_tile"CRUZ" "1") (set_tile "RCs" "0")(180TGW-DBS_02 LISTCRUZW) (set_tile "BFs" "0")))
	((and (= f_typ_VAL "7.5 CRUZ")(= n_wid_VAL "22")) (progn  (set_tile"CRUZ" "1") (set_tile "RCs" "0")(180TGW-DBS_02 LISTCRUZW) (set_tile "BFs" "1")))
	((and (= f_typ_VAL "7.5 CRUZ")(= n_wid_VAL "28")) (progn  (set_tile"CRUZ" "1") (set_tile "RCs" "0")(180TGW-DBS_02 LISTCRUZW) (set_tile "BFs" "2")))
	((and (= f_typ_VAL "7.5 CRUZ")(= n_wid_VAL "34")) (progn  (set_tile"CRUZ" "1") (set_tile "RCs" "0")(180TGW-DBS_02 LISTCRUZW) (set_tile "BFs" "3")))
	(T (progn  (set_tile"XR40-3" "1") (180TGW-DBS_02 LISTNOMW) (set_tile "BFs" "2")))
)

  (action_tile"XR40-2" "(180TGW-DBS_01 $key)")
  (action_tile"XR40-3" "(180TGW-DBS_01 $key)")
  (action_tile"CRUZ" "(180TGW-DBS_01 $key)")
  (action_tile"BFs" "(180TGW-DBS_01 $key)")
  
  (action_tile"accept"        "(180TGW-DBS_01 $key)(done_dialog 1)")
  (action_tile"cancel"        "(done_dialog 0)")
  (setq answer (start_dialog))

(unload_dialog dcl_file_id)

(if (= answer 0)
    (setq 180mode temp180mode);if cancelling - restore the old variable values
    (180MODES);if everyrhing worked  - save teh variables to the list 180mode
 )

 (princ)               
)

 

ADN CAD Developer/Operator
Message 6 of 7
scot-65
in reply to: rapidcad

What code example I have supplied so far will get you to 90% of the user input program part.

The bits and pieces are not very organized, but you want to learn, huh?

 

In addition, some notes (and recaps):

With 3 radio buttons and one list box, only 2 values are stored - the radio column key and the list box position.

Use the action tile for each radio button to repopulate the list box and reset the list box key to "0". Nothing else.

Saving the dialog's current state for each of these radio button actions is redundant (a common misconception).

 

There is no action tile required for the list box, for your case, unless you plan to done dialog (which is not ergonomic).

Had there been a second list box, and a line was selected in the first list box, the action would cause the second list box

to repopulate (only). You would use the $value carrier to do this action. Going deeper, if another radio button is selected,

repopulate the first list, and mode_tile = 1 the second list until an action is detected in the first list.

 

Action tile "accept" will be used to record the current state of the dialog box.

It is here that you "GET" the current values of the radio column key and the list box position key, then done dialog 1.

 

Yes, it is messy that I see you have leftover second list box items.


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 7 of 7
rapidcad
in reply to: scot-65

Thanks again for the help. I will revisit this next week, but I have a real deadline to get a number of changes to parts of my dynamic block program that ARE visible to the user and getting this dialog box completely efficient in programming behind the scenes has to be a lower priority according to my management. Hope that doen't sound cross - I mean it in a nice way. I really appreciate the help, but I must set this aside until I take care of quite a stack of revisions.

 

Sincerely,

 

Ron

ADN CAD Developer/Operator

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost