Here is the lisp code and dcl. When i run this the dialogue box opens up but as soon as it opens up it goes away and the command line says error to few arguments. I am not real familiar with dialogue boxes in code so all help will be appreciated.
Lisp code
Code:
(defun C:filter ()
(setq ff (list "" "2in." "4in."))
(setq dcl_id (load_dialog "filter.DCL"))
(if
(not (new_dialog "filter" dcl_id))
(exit)
)
(set_tile "fr" "0")
(set_tile "fc" "0")
(set_tile "ff")
(mode_tile "fr" 2)
(mode_tile "fc" 2)
(mode_tile "ff" 2)
(action_tile "fr" "(setq data_fr (get_tile \"fr\"))")
(action_tile "fc" "(setq data_fc (get_tile \"fc\"))")
(action_tile "ff" "(setq data_ff (get_tile \"ff\"))")
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
(setq ans (start_dialog))
(unload_dialog dcl_id)
(setq old_osnap1 (getvar "osmode"))
(setvar "osmode" 0)
(setq filr (atoi data_fr))
(setq filc (atoi data_fc))
(setq filf (atoi data_ff))
(fillayout)
(setvar "osmode" old_osnap1)
)
(defun fillayout ()
(setq filpnt (getpoint "\n Select Placement of filter"))
(setq filpnt1(polar filpnt (dtr 0) filf))
(setq filpnt2(polar filpnt1(dtr 90)(* filr 24)))
(setq filpnt3(polar filpnt2(dtr 180)filf))
(command "line" filpnt filpnt1 filpnt2 filpnt3"C")
(while (<(cadr filpnt) (-(cadr filpnt3)24))
(setq filpnt(list (car filpnt)(+(cadr filpnt)24)))
(setq filpnt1 (list (car filpnt1) (+(cadr filpnt1)24)))
(command "line" filpnt filpnt1"")
);; end of while
(fillclayout)
);; end of fillayout
(defun fillclayout ()
(setq filpnt4 (polar filpnt3 (dtr 90) 24))
(setq filpnt5(polar filpnt4 (dtr 0) filf))
(setq filpnt6(polar filpnt5(dtr 90)(* filc 24)))
(setq filpnt7(polar filpnt6(dtr 180)filf))
(command "line" filpnt4 filpnt5 filpnt6 filpnt7"C")
(while (<(cadr filpnt4) (-(cadr filpnt7)24))
(setq filpnt4(list (car filpnt4)(+(cadr filpnt4)24)))
(setq filpnt5 (list (car filpnt5) (+(cadr filpnt5)24)))
(command "line" filpnt4 filpnt5"")
);; end of while
);; end of fillayout
DCL
Code:
filter : dialog {label = "Flat Filters";
: column {label = "Information";
: edit_box {label = "Enter Number of Filter Rows:";
key = "fr";
edit_limit = 8;
edit_width = 8;}
: edit_box {label = "Enter Number of Filter Columns:";
key = "fc";
edit_limit = 8;
edit_width = 8;}
: popup_list {label = "Enter Width of Unit:";
key = "ff";
edit_limit = 8;
edit_width = 8;}}
spacer;
ok_cancel;
spacer;
spacer;
spacer;
:text_part{label = "Designed and Created";}
:text_part{label = "by Jeremy Preston";}}