Results 1 to 2 of 2

Thread: .dcl dialog box questions

  1. #1
    Member
    Join Date
    2013-02
    Posts
    10
    Login to Give a bone
    0

    Default .dcl dialog box questions

    Not sure if this is the proper forum to post this question, but it's the best I could find:

    I'm learning how to create dialog boxes (.dcl files) to run from lisp scripts, and I've been going through the tutorials at afralisp, and I have a few questions regarding nesting of dialog boxes...

    1) When I have a button on the initial dialog box open a second box (i.e. "Next"), the first box doesn't disappear. I've tried adding (done_dialog) into the (action_tile... command, but that doesn't do anything. Also, I've read the "Hiding Dialog Boxes" tutorial at afralisp, but, from what I understand, that only temporarily hides a dialog box, not close it.

    2) Will entering data in an edit_box on the first dialog box carry over to the second box? For instance, I have a series of 12 toggles in the first dialog, and if I select only one of them, will I be able to modify an is_enabled = false; command in the second box for the toggles I didn't select?

    3) Is there a way to open/convert my current .dcl file to an .odcl file for OpenDCL to read so I can possibly design/modify my dialog boxes in OpenDCL without having to create it from scratch again?


    I'm sure I have/will have more questions but these are the ones sticking out in my mind at the moment.


    My .dcl file defining my dialog boxes. The second dialog box, buck2, is only a place holder for now.

    Code:
    dcl_settings : default_dcl_settings { audit_level = 0; }
    buck : dialog {
     label = "Buckeye Project Creator";
      : boxed_column {
       label = "Enter Project Information Below:";
       :row {
       : column {
       : row {
        :text {
         label = "Terminal Name:";
        }
        : edit_box {
         key = "tn";
         width = 20;
         fixed_width = true;
        }
       }
       : row {
        : text {
         label = "Terminal Code:";
        }
        : edit_box {
         key = "tc";
         width = 10;
         fixed_width = true;
        }
       }
       : row {
        : text {
         label = "Project Number:";
        }
        : edit_box{
         key = "po";
         width = 10;
         fixed_width = true;
         }
        }
       : row {
        : text {
         label = "Project Name:";
        }
        : edit_box {
         key = "pn";
         width = 20;
         fixed_width = true;
         }
        }
       }
    
    
    /////////////////////////////////////////////////////////////
       
      : column {
       label = "Lanes to Include:";
       : row {
        : column {
         : toggle {
          label = "Lane 1";
          key = "ln1";
          }
         : toggle {
          label = "Lane 2";
          key = "ln2";
          }
         : toggle {
          label = "Lane 3";
          key = "ln3";
          }
         : toggle {
          label = "Lane 4";
          key = "ln4";
          }
         }
        : column {
         : toggle {
          label = "Lane 5";
          key = "ln5";
          }
         : toggle {
          label = "Lane 6";
          key = "ln6";
          }
         : toggle {
          label = "Lane 7";
          key = "ln7";
          }
         : toggle {
          label = "Lane 8";
          key = "ln8";
          }
         }
        : column {
         : toggle {
          label = "Lane 9";
          key = "ln9";
          }
         : toggle {
          label = "Lane 10";
          key = "ln10";
          }
         : toggle {
          label = "Lane 11";
          key = "ln11";
          }
         : toggle {
          label = "Lane 12";
          key = "ln12";
          }
         }
        }
       }
      }
    
    
     spacer;
     spacer;
    
    
    /////////////////////////////////////////////////////////////
    
    
      : row {
       label = "Drawing Number Information:";
       : column {
        : row {
         : text {
          label = "Cover Page (CO):";
          }
         : edit_box {
          key = "co";
          width = 2;
          fixed_width = true;
          }
         }
        : row {
         : text {
          label = "Conduit Diagrams (EI):";
          }
         : edit_box {
          key = "ei";
          width = 2;
          fixed_width = true;
          }
         }
        : row {
         : text {
          label = "Schematic Diagrams (SC):";
          }
         : edit_box {
          key = "sc";
          width = 2;
          fixed_width = true;
          }
         }
        : row {
         : text {
          label = "Fabrication Details (ED):";
          }
         : edit_box {
          key = "ed";
          width = 2;
          fixed_width = true;
          }
         }
        : row {
         : text {
          label = "Bill of Materials (EB):";
          }
         : edit_box {
          key = "eb";
          width = 2;
          fixed_width = true;
          }
         }
        : row {
         : text {
          label = "Reference Drawings (ER):";
          }
         : edit_box {
          key = "er";
          width = 2;
          fixed_width = true;
          }
         }
        }
       : column {}
       : column {}
       : column {}
       : column {}
       }
     }
    
    
    /////////////////////////////////////////////////////////////
    
    
     : row {
      : button {
       label = "Next";
       key = "next";
       width = 12;
       fixed_width = true;
       mnemonic = "N";
       is_default = true;
      }//end NEXT button
      : button {
       label = "Cancel";
       key = "cancel";
       width = 12;
       fixed_width = true;
      }//end CANCEL button
    
    
     }//end ROW
    
    
    }//end BUCKEYE DIALOG
    
    
    /////////////////////////////////////////////////////////////
     
    buck2 : dialog {
     label = "Buckeye Project Creator";
      : boxed_column{
       label = "Enter Drawing Specifics Below:";
       : boxed_column {
        : boxed_column {
         : boxed_column {
          : boxed_column {
          }
         }
        }
       }
      }
     ok_cancel;
    }
    
    
    /////////////////////////////////////////////////////////////

    The .lisp file I run in autocad to get the first box open, etc.
    Code:
    (defun c:buckproj (/)    
        (setq dcl_id (load_dialog "buckproj.dcl"))
        
        (if (not (new_dialog "buck" dcl_id))
        
            (exit)
            
        )
        
        (action_tile "cancel" "(done_dialog) (setq result nil)") ;; CANCEL button pressed
        
        (action_tile "next" 
        ;    "(done_dialog) (setq result nil) 
            "(buck2)") ;; NEXT button pressed
        
        (start_dialog)
        
        (unload_dialog dcl_id)
        
        (princ)
        
    )
    
    
    (defun buck2 ()
    
    
        (setq dcl_id1 (load_dialog "buckproj.dcl"))
        
        (if (not (new_dialog "buck2" dcl_id1))
        
            (exit)
            
        )
        
        (action_tile "cancel" "(done_dialog) (setq result1 nil)")
        
        (action_tile "accept" "(done_dialog) (setq result1 T)")
        
        (start_dialog)
        
        (unload_dialog dcl_id1)
        
        (princ)
        
    )

  2. #2
    Member
    Join Date
    2013-02
    Posts
    10
    Login to Give a bone
    0

    Default Re: .dcl dialog box questions

    Well, I played around with my code for a bit and I think I have answered my first two questions. I've left the second dialog box for testing, but I'll enter data into a few edit boxes, click a few toggles, and click next. Then, the second dialog pops up and I press ok. Then I have an alert box pop up telling me what I've entered into the edit_box's and if the toggles are on or off (1/0).

    .DCL code hasn't changed, so here is my lisp file...
    Code:
    (defun c:buckproj (/)
    	
    	(setq dcl_id (load_dialog "buckproj.dcl"))
    	
    	(if (not (new_dialog "buck" dcl_id))
    	
    		(exit)
    		
    	)
    	
    	(action_tile "cancel" "(done_dialog) (setq result nil)") ;; CANCEL button pressed
    	
    	(action_tile "next" 
    		(strcat
    			"(progn (setq tn (get_tile \"tn\"))"
    			"(setq tc (get_tile \"tc\"))"
    			"(setq po (get_tile \"po\"))"
    			"(setq pn (get_tile \"pn\"))"
    			"(setq ln1 (get_tile \"ln1\"))"
    			"(setq ln2 (get_tile \"ln2\"))"
    			"(setq ln3 (get_tile \"ln3\"))"
    			"(setq ln4 (get_tile \"ln4\"))"
    			"(setq ln5 (get_tile \"ln5\"))"
    			"(setq ln6 (get_tile \"ln6\"))"
    			"(setq ln7 (get_tile \"ln7\"))"
    			"(setq ln8 (get_tile \"ln8\"))"
    			"(setq ln9 (get_tile \"ln9\"))"
    			"(setq ln10 (get_tile \"ln10\"))"
    			"(setq ln11 (get_tile \"ln11\"))"
    			"(setq ln12 (get_tile \"ln12\"))"
    			"(buck2)"
    			"(done_dialog) (setq userclick T))"
    		)
    	)
    
    
    	(start_dialog)
    	
    	(unload_dialog dcl_id)
    	
    	
    	(princ)
    	
    )
    
    (defun buck2 ()
    
    	(setq dcl_id1 (load_dialog "buckproj.dcl"))
    	
    	(if (not (new_dialog "buck2" dcl_id1))
    	
    		(exit)
    		
    	)
    	
    	(action_tile "cancel" "(done_dialog) (setq result1 nil)")
    	
    	(action_tile "accept" "(done_dialog) (setq userclick T)")
    	
    	(start_dialog)
    	
    	(unload_dialog dcl_id1)
    	
    	(if userclick
    		
    		(alert (strcat 
    				"Terminal Name: " tn "\n" 
    				"Terminal Code: " tc "\n"
    				"Project Number: " po "\n"
    				"Project Name: " pn "\n"
    				"Lane 1 On/Off (1/0): " ln1 "\n"
    				"Lane 2 On/Off (1/0): " ln2 "\n"
    				"Lane 3 On/Off (1/0): " ln3 "\n"
    				"Lane 4 On/Off (1/0): " ln4 "\n"
    				"Lane 5 On/Off (1/0): " ln5 "\n"
    				"Lane 6 On/Off (1/0): " ln6 "\n"
    				"Lane 7 On/Off (1/0): " ln7 "\n"
    				"Lane 8 On/Off (1/0): " ln8 "\n"
    				"Lane 9 On/Off (1/0): " ln9 "\n"
    				"Lane 10 On/Off (1/0): " ln10 "\n"
    				"Lane 11 On/Off (1/0): " ln11 "\n"
    				"Lane 12 On/Off (1/0): " ln12 "\n"
    				)
    		)
    			   
    	)
    	
    	(princ)
    	
    )

Similar Threads

  1. 2014: 2 stair questions and 1 general coordination questions
    By utakecare2003 in forum Revit Architecture - General
    Replies: 0
    Last Post: 2014-08-16, 09:55 PM
  2. a few questions
    By mckenziewesley in forum Inventor - General
    Replies: 7
    Last Post: 2008-04-27, 08:00 PM
  3. Place questions within a Dialog Box
    By Lions60 in forum AutoLISP
    Replies: 6
    Last Post: 2006-12-06, 01:53 PM
  4. Drafting Questions (was>(Stupid) Newbie Questions)
    By Andrew Dobson in forum Revit Architecture - General
    Replies: 5
    Last Post: 2005-05-12, 09:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •