Jump to content

DCL Radio Buttons


woodman78

Recommended Posts

Hi,

 

I am trying to code a dcl file to create a dialog with a box of 2 columns of 2 radio buttons and under that a box with 2 columns of 7 radio buttons each. I keep getting errors in the dcl. Can anyone help??

 

Thanks

Link to comment
Share on other sites

  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

  • The Buzzard

    39

  • woodman78

    18

  • Lee Mac

    1

  • dober

    1

Top Posters In This Topic

Posted Images

Hi,

 

I am trying to code a dcl file to create a dialog with a box of 2 columns of 2 radio buttons and under that a box with 2 columns of 7 radio buttons each. I keep getting errors in the dcl. Can anyone help??

 

Thanks

Can you please post the dcl & lsp files.

Link to comment
Share on other sites

Hi,

 

I am trying to code a dcl file to create a dialog with a box of 2 columns of 2 radio buttons and under that a box with 2 columns of 7 radio buttons each. I keep getting errors in the dcl. Can anyone help??

 

Thanks

 

 

I am posting this as an example based on your description.

I would prefer you post yours so that it can be fixed.

 

example : dialog {                               //*dialog name
         label = "Example Dialog" ;             //*give it a label
         : row {                                //*define row
           : column {                           //*define column
             : boxed_radio_column {             //*define radio column
               label = "A Buttons" ;            //*give it a label
               : radio_button {                 //*define radio_button
                 key = "A1";                    //*give it a name
                 label = "A1";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "A2";                    //*give it a name
                 label = "A2";                  //*give it a label
               }                                //*end radio_button
             }                                  //*end boxed_radio_column
           }                                    //*end column
           : column {                           //*define column
             : boxed_radio_column {             //*define radio column
               label = "B Buttons" ;            //*give it a label
               : radio_button {                 //*define radio_button
                 key = "B1";                    //*give it a name
                 label = "B1";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "B2";                    //*give it a name
                 label = "B2";                  //*give it a label
               }                                //*end radio_button
             }                                  //*end boxed_radio_column
           }                                    //*end column
         }                                      //*end row
         : row {                                //*define row
           : column {                           //*define column
             : boxed_radio_column {             //*define radio column
               label = "C Buttons" ;            //*give it a label
               : radio_button {                 //*define radio_button
                 key = "C1";                    //*give it a name
                 label = "C1";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "C2";                    //*give it a name
                 label = "C2";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "C3";                    //*give it a name
                 label = "C3";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "C4";                    //*give it a name
                 label = "C4";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "C5";                    //*give it a name
                 label = "C5";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "C6";                    //*give it a name
                 label = "C6";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "C7";                    //*give it a name
                 label = "C7";                  //*give it a label
               }                                //*end radio_button
             }                                  //*end boxed_radio_column
           }                                    //*end column
           : column {                           //*define column
             : boxed_radio_column {             //*define radio column
               label = "D Buttons" ;            //*give it a label
               : radio_button {                 //*define radio_button
                 key = "D1";                    //*give it a name
                 label = "D1";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "D2";                    //*give it a name
                 label = "D2";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "D3";                    //*give it a name
                 label = "D3";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "D4";                    //*give it a name
                 label = "D4";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "D5";                    //*give it a name
                 label = "D5";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "D6";                    //*give it a name
                 label = "D6";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "D7";                    //*give it a name
                 label = "D7";                  //*give it a label
               }                                //*end radio_button
             }                                  //*end boxed_radio_column
           }                                    //*end column
         }                                      //*end row
         ok_cancel ;                            //*predifined OK/Cancel
         : row {                                //*define row
           : paragraph {                        //*define paragraph
             : text_part {                      //*define text
               label = "Designed by BD";        //*give it some text
             }                                  //*end text
             : text_part {                      //*define more text
               label = "for CCC NNRDO";         //*some more text
             }                                  //*end text
           }                                    //*end paragraph
         }                                      //*end row
       }                                        //*end dialog

Link to comment
Share on other sites

Buzzard,

this is the code I was using:

 

 
radio : dialog {    //dialog name
     label = "Existing Storm Sewers" ;  //give it a label
      :boxed_radio_column_1 {   //*define radio column
      label = "Choose a Type" ;    //*give it a label
       :row{
       : radio_button {   //*define radion button
       key = "T1" ;    //*give it a name
       label = "Type &1" ;   //*give it a label
       //value = "1" ;    //*switch it on
       }     //*end definition
     : radio_button {   //*define radio button
       key = "T2" ;    //*give it a name
       label = "Type &2" ;  //*give it a label
     }     //*end definition
          }
     :Row{
: radio_button {   //*define radio button
       key = "T3" ;    //*give it a name
       label = "Type &3" ; //*give it a label
       }     //*end definition
     : radio_button {   //*define radio button
       key = "T4" ;    //*give it a name
       label = "Type &4" ;  //*give it a label
     }     //*end definition
          }
       }     //*end radio column
    
      :boxed_radio_column_2 {   //*define radio column
      label = "Choose a Size" ;    //*give it a label
       :row{
       : radio_button {   //*define radion button
       key = "S1" ;    //*give it a name
       label = "1500mm" ;   //*give it a label
       //value = "1" ;    //*switch it on
       }     //*end definition
     : radio_button {   //*define radio button
       key = "S2" ;    //*give it a name
       label = "1350mm" ;  //*give it a label
     }     //*end definition
          }
     :Row{
: radio_button {   //*define radio button
       key = "S3" ;    //*give it a name
       label = "1200mm" ; //*give it a label
       }     //*end definition
     : radio_button {   //*define radio button
       key = "S4" ;    //*give it a name
       label = "1050mm" ;  //*give it a label
     }     //*end definition
          }
       }
ok_cancel ;    //predifined OK/Cancel
    : row {     //define row

    : paragraph {    //define paragraph
    : text_part {    //define text
    label = "Designed by Brian Deasy";  //give it some text
    }      //end text
    : text_part {    //define more text
    label = "for CCC NNRDO";   //some more text
    }      //end text
    }      //end paragraph
    }      //end row
    
    }      //end dialog

 

Your example was great. The one thing I wanted to do differently was that I wanted just one box per row but to keep the button layout so that would be 4 in the first box and 14 in the second.

 

Thanks

Link to comment
Share on other sites

Buzzard,

this is the code I was using:

 

 
radio : dialog {    //dialog name
     label = "Existing Storm Sewers" ;  //give it a label
      :boxed_radio_column_1 {   //*define radio column
      label = "Choose a Type" ;    //*give it a label
       :row{
       : radio_button {   //*define radion button
       key = "T1" ;    //*give it a name
       label = "Type &1" ;   //*give it a label
       //value = "1" ;    //*switch it on
       }     //*end definition
     : radio_button {   //*define radio button
       key = "T2" ;    //*give it a name
       label = "Type &2" ;  //*give it a label
     }     //*end definition
          }
     :Row{
: radio_button {   //*define radio button
       key = "T3" ;    //*give it a name
       label = "Type &3" ; //*give it a label
       }     //*end definition
     : radio_button {   //*define radio button
       key = "T4" ;    //*give it a name
       label = "Type &4" ;  //*give it a label
     }     //*end definition
          }
       }     //*end radio column

      :boxed_radio_column_2 {   //*define radio column
      label = "Choose a Size" ;    //*give it a label
       :row{
       : radio_button {   //*define radion button
       key = "S1" ;    //*give it a name
       label = "1500mm" ;   //*give it a label
       //value = "1" ;    //*switch it on
       }     //*end definition
     : radio_button {   //*define radio button
       key = "S2" ;    //*give it a name
       label = "1350mm" ;  //*give it a label
     }     //*end definition
          }
     :Row{
: radio_button {   //*define radio button
       key = "S3" ;    //*give it a name
       label = "1200mm" ; //*give it a label
       }     //*end definition
     : radio_button {   //*define radio button
       key = "S4" ;    //*give it a name
       label = "1050mm" ;  //*give it a label
     }     //*end definition
          }
       }
ok_cancel ;    //predifined OK/Cancel
    : row {     //define row

    : paragraph {    //define paragraph
    : text_part {    //define text
    label = "Designed by Brian Deasy";  //give it some text
    }      //end text
    : text_part {    //define more text
    label = "for CCC NNRDO";   //some more text
    }      //end text
    }      //end paragraph
    }      //end row

    }      //end dialog

 

Your example was great. The one thing I wanted to do differently was that I wanted just one box per row but to keep the button layout so that would be 4 in the first box and 14 in the second.

 

Thanks

 

Can you post the lisp also please.

Link to comment
Share on other sites

I was only using a lisp to load the dialog box just to get the layout right first. I hadn't started on that before I knew if it was possible.

Link to comment
Share on other sites

I was only using a lisp to load the dialog box just to get the layout right first. I hadn't started on that before I knew if it was possible.

 

I was going on your first description, However you seem to want this now done different and I am not sure of what you are describing. Also I need the lisp you were using to test the dcl. I do not care if it is complete or not. You mentioned you tested it, So you must have something?

 

I am just trying to help you, But you need to be clear in your post.

Link to comment
Share on other sites

Buzzard,

this is the code I was using:

 

 
radio : dialog {    //dialog name
     label = "Existing Storm Sewers" ;  //give it a label
      :boxed_radio_column_1 {   //*define radio column
      label = "Choose a Type" ;    //*give it a label
       :row{
       : radio_button {   //*define radion button
       key = "T1" ;    //*give it a name
       label = "Type &1" ;   //*give it a label
       //value = "1" ;    //*switch it on
       }     //*end definition
     : radio_button {   //*define radio button
       key = "T2" ;    //*give it a name
       label = "Type &2" ;  //*give it a label
     }     //*end definition
          }
     :Row{
: radio_button {   //*define radio button
       key = "T3" ;    //*give it a name
       label = "Type &3" ; //*give it a label
       }     //*end definition
     : radio_button {   //*define radio button
       key = "T4" ;    //*give it a name
       label = "Type &4" ;  //*give it a label
     }     //*end definition
          }
       }     //*end radio column

      :boxed_radio_column_2 {   //*define radio column
      label = "Choose a Size" ;    //*give it a label
       :row{
       : radio_button {   //*define radion button
       key = "S1" ;    //*give it a name
       label = "1500mm" ;   //*give it a label
       //value = "1" ;    //*switch it on
       }     //*end definition
     : radio_button {   //*define radio button
       key = "S2" ;    //*give it a name
       label = "1350mm" ;  //*give it a label
     }     //*end definition
          }
     :Row{
: radio_button {   //*define radio button
       key = "S3" ;    //*give it a name
       label = "1200mm" ; //*give it a label
       }     //*end definition
     : radio_button {   //*define radio button
       key = "S4" ;    //*give it a name
       label = "1050mm" ;  //*give it a label
     }     //*end definition
          }
       }
ok_cancel ;    //predifined OK/Cancel
    : row {     //define row

    : paragraph {    //define paragraph
    : text_part {    //define text
    label = "Designed by Brian Deasy";  //give it some text
    }      //end text
    : text_part {    //define more text
    label = "for CCC NNRDO";   //some more text
    }      //end text
    }      //end paragraph
    }      //end row

    }      //end dialog

 

Your example was great. The one thing I wanted to do differently was that I wanted just one box per row but to keep the button layout so that would be 4 in the first box and 14 in the second.

 

Thanks

 

From the above description I think this is what you want.

Not sure, However I do not recomend this type of layout as it is much too long in height. Let me know.

 

example : dialog {                               //*dialog name
         label = "Example Dialog" ;             //*give it a label
         : row {                                //*define row
           : column {                           //*define column
             : boxed_radio_column {             //*define radio column
               label = "A Buttons" ;            //*give it a label
               : radio_button {                 //*define radio_button
                 key = "A1";                    //*give it a name
                 label = "A1";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "A2";                    //*give it a name
                 label = "A2";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "A3";                    //*give it a name
                 label = "A3";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "A4";                    //*give it a name
                 label = "A4";                  //*give it a label
               }                                //*end radio_button
             }                                  //*end boxed_radio_column
           }                                    //*end column
         }                                      //*end row
         : row {                                //*define row
           : column {                           //*define column
             : boxed_radio_column {             //*define radio column
               label = "B Buttons" ;            //*give it a label
               : radio_button {                 //*define radio_button
                 key = "B1";                    //*give it a name
                 label = "B1";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "B2";                    //*give it a name
                 label = "B2";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "B3";                    //*give it a name
                 label = "B3";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "B4";                    //*give it a name
                 label = "B4";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "B5";                    //*give it a name
                 label = "B5";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "B6";                    //*give it a name
                 label = "B6";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "B7";                    //*give it a name
                 label = "B7";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "B8";                    //*give it a name
                 label = "B8";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "B9";                    //*give it a name
                 label = "B9";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "B10";                    //*give it a name
                 label = "B10";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "B11";                    //*give it a name
                 label = "B11";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "B12";                    //*give it a name
                 label = "B12";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "B13";                    //*give it a name
                 label = "B13";                  //*give it a label
               }                                //*end radio_button
               : radio_button {                 //*define radio_button
                 key = "B14";                    //*give it a name
                 label = "B14";                  //*give it a label
               }                                //*end radio_button
             }                                  //*end boxed_radio_column
           }                                    //*end column
         }                                      //*end row
         : row {                                //*define row
           ok_cancel ;                            //*predifined OK/Cancel
           : paragraph {                        //*define paragraph
             : text_part {                      //*define text
               label = "Designed by BD";        //*give it some text
             }                                  //*end text
             : text_part {                      //*define more text
               label = "for CCC NNRDO";         //*some more text
             }                                  //*end text
           }                                    //*end paragraph
         }                                      //*end row
       }                                        //*end dialog

Link to comment
Share on other sites

Here is your dcl and a lsp I provided for testing.

Your main problem was naming the boxed_radio_column which you called boxed_radio_column_1 so on & so forth.

You also had some rows misplaced and no columns.

Please try to develope a neater format, It will help to avoid some mistakes.

 

I will let you finish the rest. Use the examples I provided above.

If you should get stuck, Let me know.

 

DCL

radio : dialog {    //dialog name
       label = "Existing Storm Sewers" ;  //give it a label
       : row {
         : column {
           : boxed_radio_column {   //*define radio column
             label = "Choose a Type" ;    //*give it a label
             : radio_button {   //*define radion button
               key = "T1" ;    //*give it a name
               label = "Type &1" ;   //*give it a label
               //value = "1" ;    //*switch it on
             }     //*end definition
             : radio_button {   //*define radio button
               key = "T2" ;    //*give it a name
               label = "Type &2" ;  //*give it a label
             }     //*end definition
           }
         }
         : column {
           : boxed_radio_column {   //*define radio column
             : radio_button {   //*define radio button
               key = "T3" ;    //*give it a name
               label = "Type &3" ; //*give it a label
             }     //*end definition
             : radio_button {   //*define radio button
               key = "T4" ;    //*give it a name
               label = "Type &4" ;  //*give it a label
             }     //*end definition
           }
         }     //*end column
       }     //*end row
       : row {
         : column {
           : boxed_radio_column {   //*define radio column
             label = "Choose a Size" ;    //*give it a label
             : radio_button {   //*define radion button
               key = "S1" ;    //*give it a name
               label = "1500mm" ;   //*give it a label
               //value = "1" ;    //*switch it on
             }     //*end definition
             : radio_button {   //*define radio button
               key = "S2" ;    //*give it a name
               label = "1350mm" ;  //*give it a label
             }     //*end definition
           }
         }
         : column {
           : boxed_radio_column {   //*define radio column
             label = "?" ;    //*give it a label
             : radio_button {   //*define radio button
               key = "S3" ;    //*give it a name
               label = "1200mm" ; //*give it a label
             }     //*end definition
             : radio_button {   //*define radio button
               key = "S4" ;    //*give it a name
               label = "1050mm" ;  //*give it a label
             }     //*end definition
           }
         }
       }
       : row {     //define row
         ok_cancel ;    //predifined OK/Cancel
         : paragraph {    //define paragraph
           : text_part {    //define text
             label = "Designed by Brian Deasy";  //give it some text
           }      //end text
           : text_part {    //define more text
             label = "for CCC NNRDO";   //some more text
           }      //end text
         }      //end paragraph
       }      //end row
     }      //end dialog

 

LSP

(defun C:RADIO ()
 (setq dcl_id (load_dialog "radio.dcl")) ;load dialog
 (if
   (not (new_dialog "radio" dcl_id) ;test for dialog
   );not
   (progn
     (alert "Can not find your dcl file")
     (exit) ;exit if no dialog
   )
 );if
 (action_tile "cancel" ;if cancel button pressed
  "(done_dialog)(setq userclick nil)" ;close dialog, set flag
 );action_tile
 (action_tile "accept" ;if O.K. pressed
  "(done_dialog)(setq userclick T))" ;??? Is this standard code.
 );action tile
 (start_dialog) ;start dialog
 (unload_dialog dcl_id) ;unload


)

Link to comment
Share on other sites

Here is the above code formated, I think the way you wanted.

Please let me know if this is OK.

All new radio buttons added have a (?) for the label. I did not have the info.

 

Radio.dcl

radio : dialog {                                 //*dialog name
       label = "Existing Storm Sewers";         //*give it a label
       : row {                                  //*define row
         : column {                             //*define column
           : boxed_radio_column {               //*define radio column
             label = "Choose a Type";           //*give it a label
             : radio_button {                   //*define radion button
               key = "T1";                      //*give it a name
               label = "Type &1";               //*give it a label
             //value = "1";                     //*switch it on
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "T2";                      //*give it a name
               label = "Type &2";               //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "T3";                      //*give it a name
               label = "Type &3";               //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "T4" ;                     //*give it a name
               label = "Type &4";               //*give it a label
             }                                  //*end definition
           }                                    //*end boxed_radio_column
         }                                      //*end column
       }                                        //*end row
       : row {                                  //*define row
         : column {                             //*define column
           : boxed_radio_column {               //*define radio column
             label = "Choose a Size";           //*give it a label
             : radio_button {                   //*define radion button
               key = "S1" ;                     //*give it a name
               label = "1500mm";                //*give it a label
             //value = "1";                     //*switch it on
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S2";                      //*give it a name
               label = "1350mm";                //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S3";                      //*give it a name
               label = "1200mm";                //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S4";                      //*give it a name
               label = "1050mm";                //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S5";                      //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S6";                      //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S7";                      //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S8";                      //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S9";                      //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S10";                     //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S11";                     //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S12";                     //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S13";                     //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S14";                     //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
           }                                    //*end boxed_radio_column
         }                                      //*end column
       }                                        //*end row
       : row {                                    //*define row
         : column {                               //*define column
           ok_cancel ;                            //*predifined OK/Cancel
           : paragraph {                          //*define paragraph
             : text_part {                        //*define text
               label = "Designed by Brian Deasy"; //*give it some text
             }                                    //*end text
             : text_part {                        //*define more text
               label = "for CCC NNRDO";           //*some more text
             }                                    //*end text
           }                                      //*end paragraph
         }                                        //*end column
       }                                          //*end row
     }                                            //*end dialog

 

The lisp file below is only to test the appearance of the dcl above.

 

Radio.lsp

(defun C:RADIO ()
 (setq dcl_id (load_dialog "radio.dcl")) ;load dialog
 (if
   (not (new_dialog "radio" dcl_id)      ;test for dialog
   )                                     ;not
   (progn
     (alert "Can not find your dcl file")
     (exit)                              ;exit if no dialog
   )
 )                                       ;if
 (action_tile "cancel"                   ;if cancel button pressed
  "(done_dialog)(setq userclick nil)"    ;close dialog, set flag
 )                                       ;action_tile
 (action_tile "accept"                   ;if O.K. pressed
  "(done_dialog)(setq userclick T))"     ;??? Is this standard code.
 )                                       ;action tile
 (start_dialog)                          ;start dialog
 (unload_dialog dcl_id)                  ;unload
)

Link to comment
Share on other sites

Thanks for that Buzzard. What I was trying to do was as you have done but instead of having one column which makes the window long, was to have two columns but with the boxes as you have them? Is that possible??

Link to comment
Share on other sites

Thanks for that Buzzard. What I was trying to do was as you have done but instead of having one column which makes the window long, was to have two columns but with the boxes as you have them? Is that possible??

 

 

Many things are possible, But try to make the attempt. You need to take out the (: row {) and its end bracket (}) on the second group of buttons. Try to keep a neat format.

 

I would suggest you trying to use a popup list to save space instead of the radio buttons. If I get some time I could make an example for you. I am just a little busy at the moment. A popup list will save you alot of space, But would involve less dcl coding and more lsp coding. Just something new for you to learn.

 

Good Luck

Link to comment
Share on other sites

I got that sorted Buzzard but ran into another little problem. When the dialog is loaded I can select one item per row. I have been looking at examples on the web and they seem to only have one or one column per boxed_column.

 

 
radio1 : dialog {                                 //*dialog name
       label = "Existing Storm Sewers";         //*give it a label
       
      : row {                                  //*define row
         : column {                             //*define column
          : boxed_radio_column {               //*define radio column
             label = "Choose a Type";           //*give it a label
                   : row {                                  //*define row
              : radio_button {                   //*define radion button
                key = "T1";                      //*give it a name
                label = "Type &1";               //*give it a label
              //value = "1";                     //*switch it on
              }                                  //*end definition
              : radio_button {                   //*define radio button
                key = "T3";                      //*give it a name
                label = "Type &3";               //*give it a label
              }                                  //*end definition
                   }                                        //*end row
                   : row {                                  //*define row
              : radio_button {                   //*define radio button
                key = "T2";                      //*give it a name
                label = "Type &2";               //*give it a label
              }                                  //*end definition
              : radio_button {                   //*define radio button
                key = "T4" ;                     //*give it a name
                label = "Type &4";               //*give it a label
              }                                  //*end definition
                    }                                        //*end row
          }                                    //*end boxed_radio_column
         }                                      //*end column
      }                                        //*end row
      : row {                                  //*define row
         : column {                             //*define column
           : boxed_radio_column {               //*define radio column
             label = "Choose a Size";           //*give it a label
                   : row {                                  //*define row
 : radio_button {                   //*define radion button
                key = "S1" ;                     //*give it a name
                label = "1500mm";                //*give it a label
              value = "1";                     //*switch it on
              }                                  //*end definition
              : radio_button {                   //*define radio button
                key = "S2";                      //*give it a name
                label = "1350mm";                //*give it a label
              }                                  //*end definition
                   }                                        //*end row
                   : row {                                  //*define row
              : radio_button {                   //*define radio button
                key = "S3";                      //*give it a name
                label = "1200mm";                //*give it a label
              }                                  //*end definition
              : radio_button {                   //*define radio button
                key = "S4";                      //*give it a name
                label = "1050mm";                //*give it a label
              }                                  //*end definition
                   }                                        //*end row
                   : row {                                  //*define row
              : radio_button {                   //*define radio button
                key = "S5";                      //*give it a name
                label = "900mm";                     //*give it a label
              }                                  //*end definition
              : radio_button {                   //*define radio button
                key = "S6";                      //*give it a name
                label = "750mm";                     //*give it a label
              }                                  //*end definition
                   }                                        //*end row
                   : row {                                  //*define row
              : radio_button {                   //*define radio button
                key = "S7";                      //*give it a name
                label = "675mm";                     //*give it a label
              }                                  //*end definition
              : radio_button {                   //*define radio button
                key = "S8";                      //*give it a name
                label = "600mm";                     //*give it a label
              }                                  //*end definition
                   }                                        //*end row
                   : row {                                  //*define row
              : radio_button {                   //*define radio button
                key = "S9";                      //*give it a name
                label = "525mm";                     //*give it a label
              }                                  //*end definition
              : radio_button {                   //*define radio button
                key = "S10";                     //*give it a name
                label = "450mm";                     //*give it a label
              }                                  //*end definition
                   }                                        //*end row
                   : row {                                  //*define row
              : radio_button {                   //*define radio button
                key = "S11";                     //*give it a name
                label = "375mm";                     //*give it a label
              }                                  //*end definition
              : radio_button {                   //*define radio button
                key = "S12";                     //*give it a name
                label = "300mm";                     //*give it a label
              }                                  //*end definition
                   }                                        //*end row
                   : row {                                  //*define row
              : radio_button {                   //*define radio button
                key = "S13";                     //*give it a name
                label = "225mm";                     //*give it a label
              }                                  //*end definition
              : radio_button {                   //*define radio button
                key = "S14";                     //*give it a name
                label = "150mm";                     //*give it a label
              }                                  //*end definition
                   }                                        //*end row
           }                                    //*end boxed_radio_column
         }                                      //*end column
       }                                        //*end row
       : row {                                    //*define row
         : column {                               //*define column
           ok_cancel ;                            //*predifined OK/Cancel
           : paragraph {                          //*define paragraph
             : text_part {                        //*define more text
               label = "CCC NNRDO       v1.0.21.07.2009";           //*some more text
             }                                    //*end text
           }                                      //*end paragraph
         }                                        //*end column
       }                                          //*end row
     }                                            //*end dialog

 

I'll have a look at the popup list. I know the guys in my office and if they have to scroll through 2 popup lists to find what they are looking there will throw a wobler!! If you are doing a complex drainage drawings then the radio are much quicker.

 

Thanks for the push!!!

radio1.PNG

Link to comment
Share on other sites

This code is revised.

No more bad argument nil errors.

The DCL contains four radio buttons with a popup list.

The buttons and list will save last entry for the drawing session.

Program also has a built-in loop.

Just remember that popup list are still faster than no code at all.

With the features that were added this is a very fast and compact method.

 

DCL

popup : dialog {                                 //*dialog name
       label = "Existing Storm Sewers";         //*give it a label
       : row {                                  //*define row
         : column {                             //*define column
           : boxed_radio_column {               //*define radio column
             label = "Choose a Type";           //*give it a label
             : radio_button {                   //*define radion button
               key = "T1";                      //*give it a name
               label = "Type &1";               //*give it a label
             //value = "1";                     //*switch it on
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "T2";                      //*give it a name
               label = "Type &2";               //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "T3";                      //*give it a name
               label = "Type &3";               //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "T4" ;                     //*give it a name
               label = "Type &4";               //*give it a label
             }                                  //*end definition
           }                                    //*end boxed_radio_column
         }                                      //*end column
       }                                        //*end row
       : row {                                  //*define row
         : boxed_column {                       //*define boxex_column
           : popup_list {
             label = "Choose a Size";           //*give it a label 
             key = "S1";
             edit_width = 8;
           }
           : spacer {
             height = 0;
           }
         }                                      //*end boxed_column
       }                                        //*end row
       : row {                                    //*define row
         : column {                               //*define column
           ok_cancel ;                            //*predifined OK/Cancel
           : paragraph {                          //*define paragraph
             : text_part {                        //*define text
               label = "Designed by Brian Deasy"; //*give it some text
             }                                    //*end text
             : text_part {                        //*define more text
               label = "for CCC NNRDO";           //*some more text
             }                                    //*end text
           }                                      //*end paragraph
         }                                        //*end column
       }                                          //*end row
     }                                            //*end dialog

 

LSP

(defun C:POPUP ()
 (POPUP_MF)
 (princ)
)
(defun POPUP_MF (/ SIZE$ SIZE# HOLE SIZE)
 (or H:OLE (setq H:OLE "T1"))
 (setq SIZE 1500)
 (setq S1_list
  '("1500mm" "1350mm"
    "1250mm" "1050mm"
     "900mm"  "750mm"
     "675mm"  "600mm"
     "525mm"  "450mm"
     "375mm"  "300mm"
     "225mm"  "150mm"))
 (setq dcl_id (load_dialog "popup.dcl"))
 (if (not (new_dialog "popup" dcl_id))
   (progn
     (alert "Can not find your dcl file")
     (exit)))
 (start_list "S1")
 (mapcar 'add_list S1_list)
 (end_list)
 (set_tile H:OLE "1")
 (action_tile "T1"
  "(setq H:OLE \"T1\")")
 (action_tile "T2"
  "(setq H:OLE \"T2\")")
 (action_tile "T3"
  "(setq H:OLE \"T3\")")
 (action_tile "T4"
  "(setq H:OLE \"T4\")")
 (if SIZE:DEF
   (set_tile "S1" (itoa SIZE:DEF)))
 (action_tile "cancel"
  "(done_dialog)(setq userclick nil)")
 (action_tile "accept"
   (strcat
    "(progn
     (setq S:IZE (atoi (get_tile \"S1\")) SIZE:DEF S:IZE)"
    "(done_dialog)(setq userclick T))"))
 (start_dialog)
 (unload_dialog dcl_id)
 (if userclick
   (VARIABLE)
 )
 (princ)
)
(defun VARIABLE ()
 (progn
   (cond
     ((= H:OLE "T1"))
     ((= H:OLE "T2"))
     ((= H:OLE "T3"))
     ((= H:OLE "T4"))
   )
 )
 (setq HOLE H:OLE)
 (progn
   (setq SIZE$ (fix S:IZE))
   (setq SIZE$ (nth S:IZE S1_list))
   (cond
     ((= SIZE$ "1500mm")(setq SIZE# 1500))
     ((= SIZE$ "1350mm")(setq SIZE# 1350))
     ((= SIZE$ "1250mm")(setq SIZE# 1250))
     ((= SIZE$ "1050mm")(setq SIZE# 1050))
     ((= SIZE$  "900mm")(setq SIZE#  900))
     ((= SIZE$  "750mm")(setq SIZE#  750))
     ((= SIZE$  "675mm")(setq SIZE#  675))
     ((= SIZE$  "600mm")(setq SIZE#  600))
     ((= SIZE$  "525mm")(setq SIZE#  525))
     ((= SIZE$  "450mm")(setq SIZE#  450))
     ((= SIZE$  "375mm")(setq SIZE#  375))
     ((= SIZE$  "300mm")(setq SIZE#  300))
     ((= SIZE$  "225mm")(setq SIZE#  225))
     ((= SIZE$  "150mm")(setq SIZE#  150))
   )
 )
 (setq SIZE (RTOS SIZE# 2 0)) 
 (ANSWER)
 (princ)
)
(defun ANSWER ()
 (progn
   (ALERT (strcat "Hole selected is: "HOLE""))
   (ALERT (strcat "Size selected is: "SIZE"mm"))
 )
 (POPUP_MF)
 (princ)
)

Document1.JPG

Link to comment
Share on other sites

And now here are two popup lists that work in the same manner.

Instead of having the program report back what you selected, You

can use the variables to execute or use in your functions.

Note that the variable SIZE# is for a real number incase you need to use a real.

I did not know if you needed this, But I included it anyway.

I hope these examples will give you an idea as to what can be done

with the programming.

 

DCL

popup2 : dialog {                                   //*dialog name
        label = "Existing Storm Sewers";           //*give it a label
        : row {                                    //*define row
          : boxed_column {                         //*define boxex_column
            : popup_list {
              label = "Choose a Hole Type";        //*give it a label 
              key = "T1";
              edit_width = 8;
            }
            : spacer {
              height = 0;
            }
          }                                        //*end column
        }                                          //*end row
        : row {                                    //*define row
          : boxed_column {                         //*define boxex_column
            : popup_list {
              label = "Choose a Size";             //*give it a label 
              key = "S1";
              edit_width = 8;
            }
            : spacer {
              height = 0;
            }
          }                                        //*end boxed_column
        }                                          //*end row
        : row {                                    //*define row
          : column {                               //*define column
            ok_cancel ;                            //*predifined OK/Cancel
            : paragraph {                          //*define paragraph
              : text_part {                        //*define text
                label = "Designed by Brian Deasy"; //*give it some text
              }                                    //*end text
              : text_part {                        //*define more text
                label = "for CCC NNRDO";           //*some more text
              }                                    //*end text
            }                                      //*end paragraph
          }                                        //*end column
        }                                          //*end row
      }                                            //*end dialog

LSP

(defun C:POPUP2 ()
 (POPUP_MF)
 (princ)
)
(defun POPUP_MF (/ HOLE$ SIZE$ SIZE# HOLE SIZE)
 (setq SIZE# 1500)
 (setq T1_list
  '("Type 1" "Type 2"
    "Type 3" "Type 4"))
 (setq S1_list
  '("1500mm" "1350mm"
    "1200mm" "1050mm"
     "900mm"  "750mm"
     "675mm"  "600mm"
     "525mm"  "450mm"
     "375mm"  "300mm"
     "225mm"  "150mm"))
 (setq dcl_id (load_dialog "popup2.dcl"))
 (if (not (new_dialog "popup2" dcl_id))
   (progn
     (alert "Can not find your dcl file")
     (exit)))
 (start_list "T1")
 (mapcar 'add_list T1_list)
 (end_list)
 (start_list "S1")
 (mapcar 'add_list S1_list)
 (end_list)
 (if HOLE2:DEF
   (set_tile "T1" (itoa HOLE2:DEF)))
 (if SIZE2:DEF
   (set_tile "S1" (itoa SIZE2:DEF)))
 (action_tile "cancel"
  "(done_dialog)(setq userclick nil)")
 (action_tile "accept"
   (strcat
    "(progn
     (setq H:OLE2 (atoi (get_tile \"T1\")) HOLE2:DEF H:OLE2)"
    "(setq S:IZE2 (atoi (get_tile \"S1\")) SIZE2:DEF S:IZE2)"
    "(done_dialog)(setq userclick T))"))
 (start_dialog)
 (unload_dialog dcl_id)
 (if userclick
   (VARIABLE)
 )
 (princ)
)
(defun VARIABLE ()
 (progn 
   (setq HOLE$ (fix H:OLE2))
   (setq HOLE$ (nth H:OLE2 T1_list))
   (cond
     ((= HOLE$ "TYPE 1"))
     ((= HOLE$ "TYPE 2"))
     ((= HOLE$ "TYPE 3"))
     ((= HOLE$ "TYPE 4"))
   )
 )
 (setq HOLE HOLE$)
 (progn 
   (setq SIZE$ (fix S:IZE2))
   (setq SIZE$ (nth S:IZE2 S1_list))
   (cond
     ((= SIZE$ "1500mm")(setq SIZE# 1500))
     ((= SIZE$ "1350mm")(setq SIZE# 1350))
     ((= SIZE$ "1200mm")(setq SIZE# 1200))
     ((= SIZE$ "1050mm")(setq SIZE# 1050))
     ((= SIZE$  "900mm")(setq SIZE#  900))
     ((= SIZE$  "750mm")(setq SIZE#  750))
     ((= SIZE$  "675mm")(setq SIZE#  675))
     ((= SIZE$  "600mm")(setq SIZE#  600))
     ((= SIZE$  "525mm")(setq SIZE#  525))
     ((= SIZE$  "450mm")(setq SIZE#  450))
     ((= SIZE$  "375mm")(setq SIZE#  375))
     ((= SIZE$  "300mm")(setq SIZE#  300))
     ((= SIZE$  "225mm")(setq SIZE#  225))
     ((= SIZE$  "150mm")(setq SIZE#  150))
   )
 )
 (setq SIZE (RTOS SIZE# 2 0)) 
 (ANSWER)
 (princ)
)

(defun ANSWER ()
 (progn
   (ALERT (strcat "Hole selected is: "HOLE" "))
   (ALERT (strcat "Size selected is: "SIZE"mm "))
 )
 (POPUP_MF)
 (princ)
)

Document1.JPG

Link to comment
Share on other sites

Thanks for that Buzzard. I have to say it is a very neat solution and the more I run it the more I am being won over to the ways of the popup box. I have kept the dcl the same and tried to modify the lsp as below in the answer routine to use the hole and size to create a linetype name and layer name and then run that out thru a polyline as I had before. I am getting bad function errors. I think I am right in saying the in answer HOLE and SIZE are already converted to strings so I don't need to convert them any further. Is that correct???

 

 

 

 
(defun C:POPUP3 ()
 (POPUP_MF)
 (princ)
)
(defun POPUP_MF (/ HOLE$ SIZE$ SIZE# HOLE SIZE a b)
 (setq SIZE# 1500)
 (setq T1_list
  '("Type 1" "Type 2"
    "Type 3" "Type 4"))
 (setq S1_list
  '("1500mm" "1350mm"
    "1200mm" "1050mm"
     "900mm"  "750mm"
     "675mm"  "600mm"
     "525mm"  "450mm"
     "375mm"  "300mm"
     "225mm"  "150mm"))
 (setq dcl_id (load_dialog "popup2.dcl"))
 (if (not (new_dialog "popup2" dcl_id))
   (progn
     (alert "Can not find your dcl file")
     (exit)))
 (start_list "T1")
 (mapcar 'add_list T1_list)
 (end_list)
 (start_list "S1")
 (mapcar 'add_list S1_list)
 (end_list)
 (if HOLE2:DEF
   (set_tile "T1" (itoa HOLE2:DEF)))
 (if SIZE2:DEF
   (set_tile "S1" (itoa SIZE2:DEF)))
 (action_tile "cancel"
  "(done_dialog)(setq userclick nil)")
 (action_tile "accept"
   (strcat
    "(progn
     (setq H:OLE2 (atoi (get_tile \"T1\")) HOLE2:DEF H:OLE2)"
    "(setq S:IZE2 (atoi (get_tile \"S1\")) SIZE2:DEF S:IZE2)"
    "(done_dialog)(setq userclick T))"))
 (start_dialog)
 (unload_dialog dcl_id)
 (if userclick
   (VARIABLE)
 )
 (princ)
)
(defun VARIABLE ()
 (progn 
   (setq HOLE$ (fix H:OLE2))
   (setq HOLE$ (nth H:OLE2 T1_list))
   (cond
     ((= HOLE$ "TYPE 1"))
     ((= HOLE$ "TYPE 2"))
     ((= HOLE$ "TYPE 3"))
     ((= HOLE$ "TYPE 4"))
   )
 )
 (setq HOLE HOLE$)
 (progn 
   (setq SIZE$ (fix S:IZE2))
   (setq SIZE$ (nth S:IZE2 S1_list))
   (cond
     ((= SIZE$ "1500mm")(setq SIZE# 1500))
     ((= SIZE$ "1350mm")(setq SIZE# 1350))
     ((= SIZE$ "1200mm")(setq SIZE# 1200))
     ((= SIZE$ "1050mm")(setq SIZE# 1050))
     ((= SIZE$  "900mm")(setq SIZE#  900))
     ((= SIZE$  "750mm")(setq SIZE#  750))
     ((= SIZE$  "675mm")(setq SIZE#  675))
     ((= SIZE$  "600mm")(setq SIZE#  600))
     ((= SIZE$  "525mm")(setq SIZE#  525))
     ((= SIZE$  "450mm")(setq SIZE#  450))
     ((= SIZE$  "375mm")(setq SIZE#  375))
     ((= SIZE$  "300mm")(setq SIZE#  300))
     ((= SIZE$  "225mm")(setq SIZE#  225))
     ((= SIZE$  "150mm")(setq SIZE#  150))
   )
 )
 (setq SIZE (RTOS SIZE# 2 0)) 
 (ANSWER)
 (princ)
)

(defun ANSWER ()
 (progn
   ;(ALERT (strcat "Hole selected is: "HOLE" "))
   ;(ALERT (strcat "Size selected is: "SIZE"mm "))
        (setq a (strcat "CCC_DR_" (SIZE)(HOLE))
              b (strcat "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_" (SIZE)))
        (if (not (tblsearch "LTYPE" a))
             (command "_.-linetype" "_l" a "acadiso.lin" ""))
             (command "._-layer"   "_N"   b   "_M"   b   "_L"   a  b   "_C"   "84"   b   "_LW"   "0.3"   b    "" )
(command "pline" pause "width" "0.0" "0.0" pause "width" "0.0" "0.0")
 )
 (POPUP_MF)
 (princ)
)

Link to comment
Share on other sites

Thanks for that Buzzard. I have to say it is a very neat solution and the more I run it the more I am being won over to the ways of the popup box. I have kept the dcl the same and tried to modify the lsp as below in the answer routine to use the hole and size to create a linetype name and layer name and then run that out thru a polyline as I had before. I am getting bad function errors. I think I am right in saying the in answer HOLE and SIZE are already converted to strings so I don't need to convert them any further. Is that correct???

 

I am glad you saw the light and yes, At that point they are strings. If you get stuck, Just let me know.

I will look at the additions and get back to you later.

Link to comment
Share on other sites

I am glad you saw the light and yes, At that point they are strings. If you get stuck, Just let me know.

I will look at the addtions and get back to you later.

 

 

woodman78,

 

Again I do not have your linetypes, So I am working blind folded here.

Use the dcl & lsp below. I had to remove some paren from you additions.

Program now stops to look for the linetype as I have mentioned I do not have.

This should work for you.

 

Type POPUP3 to start.

Just make sure you use both codes below only.

 

DCL

popup3 : dialog {                                   //*dialog name
        label = "Existing Storm Sewers";           //*give it a label
        : row {                                    //*define row
          : boxed_column {                         //*define boxex_column
            label = "Choose a Type";               //*give it a label 
            : popup_list {
              key = "T1";
              label = "Type";                      //*give it a label 
              edit_width=8;
              alignment = centered;
            }
            : spacer {
              height = 0;
            }
          }                                        //*end column
        }                                          //*end row
        : row {                                    //*define row
          : boxed_column {                         //*define boxex_column
            label = "Choose a Size";               //*give it a label 
            : popup_list {
              key = "S1";
              label = "Size";                      //*give it a label 
              edit_width=8;
              alignment = centered;
            }
            : spacer {
              height = 0;
            }
          }                                        //*end boxed_column
        }                                          //*end row
        : row {                                    //*define row
          : column {                               //*define column
            ok_cancel ;                            //*predifined OK/Cancel
            : paragraph {                          //*define paragraph
              : text_part {                        //*define text
                label = "Designed by Brian Deasy"; //*give it some text
              }                                    //*end text
              : text_part {                        //*define more text
                label = "for CCC NNRDO";           //*some more text
              }                                    //*end text
            }                                      //*end paragraph
          }                                        //*end column
        }                                          //*end row
      }                                            //*end dialog

 

LSP

(defun C:POPUP3 ()
 (POPUP_MF)
 (princ)
)
(defun POPUP_MF (/ HOLE$ SIZE$ SIZE# HOLE SIZE a b)
 (setq SIZE# 1500)
 (setq T1_list
  '("Type 1" "Type 2"
    "Type 3" "Type 4"))
 (setq S1_list
  '("1500mm" "1350mm"
    "1200mm" "1050mm"
     "900mm"  "750mm"
     "675mm"  "600mm"
     "525mm"  "450mm"
     "375mm"  "300mm"
     "225mm"  "150mm"))
 (setq dcl_id (load_dialog "popup3.dcl"))
 (if (not (new_dialog "popup3" dcl_id))
   (progn
     (alert "Can not find your dcl file")
     (exit)))
 (start_list "T1")
 (mapcar 'add_list T1_list)
 (end_list)
 (start_list "S1")
 (mapcar 'add_list S1_list)
 (end_list)
 (if HOLE2:DEF
   (set_tile "T1" (itoa HOLE2:DEF)))
 (if SIZE2:DEF
   (set_tile "S1" (itoa SIZE2:DEF)))
 (action_tile "cancel"
  "(done_dialog)(setq userclick nil)")
 (action_tile "accept"
   (strcat
    "(progn
     (setq H:OLE2 (atoi (get_tile \"T1\")) HOLE2:DEF H:OLE2)"
    "(setq S:IZE2 (atoi (get_tile \"S1\")) SIZE2:DEF S:IZE2)"
    "(done_dialog)(setq userclick T))"))
 (start_dialog)
 (unload_dialog dcl_id)
 (if userclick
   (VARIABLE)
 )
 (princ)
)
(defun VARIABLE ()
 (progn 
   (setq HOLE$ (fix H:OLE2))
   (setq HOLE$ (nth H:OLE2 T1_list))
   (cond
     ((= HOLE$ "TYPE 1"))
     ((= HOLE$ "TYPE 2"))
     ((= HOLE$ "TYPE 3"))
     ((= HOLE$ "TYPE 4"))
   )
 )
 (setq HOLE HOLE$)
 (progn 
   (setq SIZE$ (fix S:IZE2))
   (setq SIZE$ (nth S:IZE2 S1_list))
   (cond
     ((= SIZE$ "1500mm")(setq SIZE# 1500))
     ((= SIZE$ "1350mm")(setq SIZE# 1350))
     ((= SIZE$ "1200mm")(setq SIZE# 1200))
     ((= SIZE$ "1050mm")(setq SIZE# 1050))
     ((= SIZE$  "900mm")(setq SIZE#  900))
     ((= SIZE$  "750mm")(setq SIZE#  750))
     ((= SIZE$  "675mm")(setq SIZE#  675))
     ((= SIZE$  "600mm")(setq SIZE#  600))
     ((= SIZE$  "525mm")(setq SIZE#  525))
     ((= SIZE$  "450mm")(setq SIZE#  450))
     ((= SIZE$  "375mm")(setq SIZE#  375))
     ((= SIZE$  "300mm")(setq SIZE#  300))
     ((= SIZE$  "225mm")(setq SIZE#  225))
     ((= SIZE$  "150mm")(setq SIZE#  150))
   )
 )
 (setq SIZE (RTOS SIZE# 2 0)) 
 (ANSWER)
 (princ)
)

(defun ANSWER ()
 (progn
   (setq a (strcat "CCC_DR_" "SIZE" "HOLE"))
   (setq b (strcat "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_" "SIZE"))
   (if
     (not
       (tblsearch "LTYPE" a)
     )
     (command "_.-linetype" "_l" a "acadiso.lin" "")
   )
   (command "._-layer"   "_N"   b   "_M"   b   "_L"   a  b   "_C"   "84"   b   "_LW"   "0.3"   b    "" )
   (command "pline" pause "width" "0.0" "0.0" pause "width" "0.0" "0.0")
 )
 (POPUP_MF)
 (princ)
)

Link to comment
Share on other sites

That seems to do it alright. Just one thing though. When I run the lsp it loads the dialog box and when I choose my options and press OK it disappears. I start to draw the pline and at the second point the box reappears and I have to press OK again. the Pline command then starts again. Does the box need to be hidden on the userclick??

 

Here is the code that I made a few small changes to to get the linetypes to load and the linetype file.

 

 
(defun C:POPUP3 ()
 (POPUP_MF)
 (princ)
)
(defun POPUP_MF (/ HOLE$ SIZE$ SIZE# HOLE SIZE a b)
 (setq SIZE# 1500)
 (setq T1_list
  '("Type 1" "Type 2"
    "Type 3" "Type 4"))
 (setq S1_list
  '("1500mm" "1350mm"
    "1200mm" "1050mm"
     "900mm"  "750mm"
     "675mm"  "600mm"
     "525mm"  "450mm"
     "375mm"  "300mm"
     "225mm"  "150mm"))
 (setq dcl_id (load_dialog "popup3.dcl"))
 (if (not (new_dialog "popup3" dcl_id))
   (progn
     (alert "Can not find your dcl file")
     (exit)))
 (start_list "T1")
 (mapcar 'add_list T1_list)
 (end_list)
 (start_list "S1")
 (mapcar 'add_list S1_list)
 (end_list)
 (if HOLE2:DEF
   (set_tile "T1" (itoa HOLE2:DEF)))
 (if SIZE2:DEF
   (set_tile "S1" (itoa SIZE2:DEF)))
 (action_tile "cancel"
  "(done_dialog)(setq userclick nil)")
 (action_tile "accept"
   (strcat
    "(progn
     (setq H:OLE2 (atoi (get_tile \"T1\")) HOLE2:DEF H:OLE2)"
    "(setq S:IZE2 (atoi (get_tile \"S1\")) SIZE2:DEF S:IZE2)"
    "(done_dialog)(setq userclick T))"))
 (start_dialog)
 ;(unload_dialog dcl_id)
 (if userclick
     (VARIABLE)
 (unload_dialog dcl_id)
 )
 (princ)
)
(defun VARIABLE ()
 (progn 
   (setq HOLE$ (fix H:OLE2))
   (setq HOLE$ (nth H:OLE2 T1_list))
   (cond
     ((= HOLE$ "TYPE 1"))
     ((= HOLE$ "TYPE 2"))
     ((= HOLE$ "TYPE 3"))
     ((= HOLE$ "TYPE 4"))
   )
 )
 (setq HOLE HOLE$)
 (progn 
   (setq SIZE$ (fix S:IZE2))
   (setq SIZE$ (nth S:IZE2 S1_list))
   (cond
     ((= SIZE$ "1500mm")(setq SIZE# 1500))
     ((= SIZE$ "1350mm")(setq SIZE# 1350))
     ((= SIZE$ "1200mm")(setq SIZE# 1200))
     ((= SIZE$ "1050mm")(setq SIZE# 1050))
     ((= SIZE$  "900mm")(setq SIZE#  900))
     ((= SIZE$  "750mm")(setq SIZE#  750))
     ((= SIZE$  "675mm")(setq SIZE#  675))
     ((= SIZE$  "600mm")(setq SIZE#  600))
     ((= SIZE$  "525mm")(setq SIZE#  525))
     ((= SIZE$  "450mm")(setq SIZE#  450))
     ((= SIZE$  "375mm")(setq SIZE#  375))
     ((= SIZE$  "300mm")(setq SIZE#  300))
     ((= SIZE$  "225mm")(setq SIZE#  225))
     ((= SIZE$  "150mm")(setq SIZE#  150))
   )
 )
 (setq SIZE (RTOS SIZE# 2 0)) 
 (ANSWER)
 (princ)
)

(defun ANSWER ()
 (progn
   (setq a (strcat "CCC_DR_" SIZE "_" HOLE)
         b (strcat "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_" SIZE "_" HOLE)
   )
   (if
     (not
       (tblsearch "LTYPE" a)
     )
     (command "_.-linetype" "_l" a "acadiso.lin" "")
   )
   (command "._-layer"   "_N"   b   "_M"   b   "_L"   a  b   "_C"   "84"   b   "_LW"   "0.3"   b    "" )
   (command "pline" pause "width" "0.0" "0.0" pause "width" "0.0" "0.0" "")
   (command "pline")
 )
 (POPUP_MF)
 (princ)
)

acadiso.txt

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...