Dialog Box link

Dialog Box link

Anonymous
Not applicable
1,607 Views
14 Replies
Message 1 of 15

Dialog Box link

Anonymous
Not applicable

Is there a tutorial for linking a dialog box to a lisp routine for point and click instead of keyboard entry?

0 Likes
Accepted solutions (1)
1,608 Views
14 Replies
Replies (14)
Message 2 of 15

Anonymous
Not applicable
0 Likes
Message 3 of 15

Sea-Haven
Mentor
Mentor

Explain more what you want draw a box and text, post image.

0 Likes
Message 4 of 15

Anonymous
Not applicable

I have a dialog box and need to link it to a lisp routine for drawing objects

0 Likes
Message 5 of 15

Anonymous
Not applicable

@Anonymous  It gets easier if you attach the program.

0 Likes
Message 6 of 15

scot-65
Advisor
Advisor

How about studying from a template?

 

Keep in mind the dialog shall only be used for gathering information from the user.

Do not pass GO, do not collect $200.

 

When the user selects the OK button, it is at that time one records the state of

the dialog box (using get_tile and optionally bundling all the tile states as a list).

From there the dialog closes and now one can enter the "Main Execution"

part of the program; evaluating each "setq" / item in the list.

 

There are common beginner oversights when working with tiles.

The most notable ones are Initializing the tiles and working with

radio_button. For the later, assign a key to the radio_row or radio_column

(boxed or otherwise) and use that key to set and get the radio button.

[As one contributor stated regarding radio buttons  "talk to the container

and not to the members inside the container"]

 

???

 


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

0 Likes
Message 7 of 15

Sea-Haven
Mentor
Mentor

You need to explain what it is your trying to do, ask 20 questions one after another ? Have a very complicated DCL that has sub dcl's, pick "bolt" and a whole new DCL appears regarding bolts. Force predefined chooses ?

 

All the above I have done, same with lots of others here we can only help if we really know what your trying to do.

 

Have a look at this example of drawing a kitchen table. It uses the library routine Multi getvals.lsp you can use that lisp in any program you want to write. 

 

 

0 Likes
Message 8 of 15

Anonymous
Not applicable

I have a dialog box to select weld symbol for construction. I have the lisp routine that runs it off a command line. I need to link the dialog box so that the lisp routine pulls the information from the dialog box and creates the symbol starting with the leader start point. See images.

Weld Dialog Box.JPGWeld results.JPG

0 Likes
Message 9 of 15

Sea-Haven
Mentor
Mentor

If you have both DCL & Lisp where is the problem or have you just got an image of what you want.

 

Post both here.

0 Likes
Message 10 of 15

Anonymous
Not applicable

I created the dialog box to use with an existing lisp routine. Just having trouble linking them together to get variables right to pull from dialog box. Want to take a look?

0 Likes
Message 11 of 15

Sea-Haven
Mentor
Mentor

Not just not me but if you don't post code we can not help. Once its here though its public then.

Message 12 of 15

Anonymous
Not applicable

Attached is the DCL and LISP. Have issues trying to pull info. Can't get set_tile or action_tile to work properly. Any help would be great.

0 Likes
Message 13 of 15

Moshe-A
Mentor
Mentor

@Anonymous  hi,

 

before you rush the program to control the dialog box, first need to fix the dcl code:

a radio buttons should be wrapped in radio_column/row or as you did boxed_radio_column/row

but look at what you did, you declare a boxed_radio_column to have a radio_row?

 

:boxed_radio_column {
	: row {
		: text {label = "Bottom Weld";key = "BW";}
		: radio_button {key = "B1"; label = "Bevel";}
		: radio_button {key = "BU1"; label = "Butt";}
		: radio_button {key = "F1"; label = "Fillet";}
		: radio_button {key = "FL1"; label = "Flare";}
		: radio_button {key = "V1"; label = "Vweld";}
	}
	: row {
 
		: edit_box {label = "Weld Size Bottom";
			edit_width = 3; key = "WSB";}
	}}

 

instead you should do something like this:

(untested)

 

: boxed_column {	
   label = "Bottom Weld";
   key = "BW";
   
   : radio_row {
     : radio_button {key = "B1";  label = "Bevel";}
     : radio_button {key = "BU1"; label = "Butt";}
     : radio_button {key = "F1";  label = "Fillet";}
     : radio_button {key = "FL1"; label = "Flare";}
     : radio_button {key = "V1";  label = "Vweld";}
   }
: edit_box { label = "Weld Size Bottom"; edit_width = 3; key = "WSB"; } }

so still have some work to to?!

 

moshe

 

0 Likes
Message 14 of 15

Moshe-A
Mentor
Mentor
Accepted solution

@Anonymous ,

 

and here is a skeleton program to control the dialog, untested.

also a full dcl is attached

a (while) function controls the dialog relay on variable what_next

when user pick OK, a (ctrl_accept) callback function is called to retrieve all tiles value

 

enjoy

moshe

 

 

(defun c:weld1 (/ ctrl_accept ; local function
		  dcl_id what_next bottom_weld top_weld weld_side_bottom weld_size_top tail_notes field_weld weld_all)

 ; callback 
 (defun ctrl_accept ()
  ; retrieve radio buttons
  (setq bottom_weld (get_tile "BW"))  
  (setq top_weld (get_tile "TW"))  

  ; retrieve edit box
  (setq weld_side_bottom (get_tile "WSB"))
  (setq weld_size_top (get_tile "WST"))
  (setq tail_notes (get_tile "note"))

  ; retrieve toggles 
  (setq field_weld (get_tile "fw1"))
  (setq weld_all (get_tile "aw1"))

  (done_dialog 1) ; close dialog
 ); ctrl_accept


 ; here start c:weld1 
 (setq dcl_id (load_dialog "weld1.dcl"))

 ; set some defaults
 ; ...
  
  
 (setq what_next 2)
       
 (while (> what_next 1)
  (if (not (new_dialog "weld1" dcl_id "" '(-1 -1))); open dialog at center
   (exit)
  ) 

  ; set tiles default value
  ; ...

   
  ; tiles control
  ; (action_tile "tile_key1" "expr_or_func")
  ; (action_tile "tile_key2" "expr_or_func")

  (action_tile "accept" "(ctrl_accept)") 
   
  (setq what_next (start_dialog))

  (cond
   ((= what_next 1) ; OK
    ; do your work here
    ; insert your weld blocks

   ); case
   ((= what_next 0) ; cancel
    ; do clean up if needed

   ); case
  ); cons
   
 ); while
  
 (unload_dialog dcl_id)
 (princ) 
)
0 Likes
Message 15 of 15

Moshe-A
Mentor
Mentor

Ken Martin,

 

please close this thread and mark it as your solution.

 

thank you

Moshe