Jump to content

Recommended Posts

Posted

Hi,

 

I want to have different contents in a popup_list (mylist21) depending of my choise in an another popup_list(mylist20). But when I have push the button "Choise" I get the message:

 

Command:

****** CQi ERROR HANDLER ******

Error: malformed list on input.

 

If I have less lines under action it works but there seems to be a limit of lines.

Is there a better way to do it?

 

 
dimdialog8 : dialog { // Första
label = "Dimention drawing";

: row {
: boxed_radio_column {
: row {  // Row 1
: boxed_radio_column { // Boxed_radio_column 1
 label = "Size Cabinet";
        key = "sizecab";
 : radio_button {          // defines the Lightweight radio button
  label = "&Small 2D";
  key = "str_s2";
  value="0";
  action="(if (= \"1\" $value)(progn "
          "(setq stor \"1\")"
         "(mode_tile \"but1\" 1)"
                              "(start_list \"mylist20\" 3)"                   
                              "(mapcar 'add_list mylist1)"
                              "(end_list)))"; 
         
                              }                          
 : radio_button {         // defines the old-style polyline radio button
  label = "&Medium 2D";
  key = "str_m2";
  value="0";   
  action="(if (= \"1\" $value)(progn "
          "(setq stor \"2\")"
         "(mode_tile \"but1\" 1)"
                              "(start_list \"mylist20\" 3)"                   
                              "(mapcar 'add_list mylist2)"
                              "(end_list)))";
                              }
         
 : radio_button {         // defines the old-style polyline radio button
  label = "&Large 2D";
  key = "str_l2";
         value="0";   
  action="(if (= \"1\" $value)(progn "
          "(setq stor \"3\")"
          "(mode_tile \"but1\" 1)"
                               "(start_list \"mylist20\" 3)"                   
                               "(mapcar 'add_list mylist3)"
                               "(end_list)))";                    
                }            
 : radio_button {         // defines the old-style polyline radio button
  label = "&Small 3D";
  key = "str_s3";
  value="0";   
  action="(if (= \"1\" $value)(progn "
          "(setq stor \"4\")"
          "(mode_tile \"but1\" 1)"
                               "(start_list \"mylist20\" 3)"                   
                               "(mapcar 'add_list mylist1)"
                               "(end_list)))";   
                }
                

 : radio_button {         // defines the old-style polyline radio button
  label = "&Medium 3D";
  key = "str_m3";
  value="0";   
  action="(if (= \"1\" $value)(progn "
          "(setq stor \"5\")"
          "(mode_tile \"but1\" 1)"
                               "(start_list \"mylist20\" 3)"                   
                               "(mapcar 'add_list mylist2)"
                               "(end_list)))";   
                }                 
 : radio_button {         // defines the old-style polyline radio button
  label = "&Large 3D";
  key = "str_l3";
  value="0";   
  action="(if (= \"1\" $value)(progn "
          "(setq stor \"6\")"
          "(mode_tile \"but1\" 1)"
                               "(start_list \"mylist20\" 3)"                   
                               "(mapcar 'add_list mylist3)"
                               "(end_list)))";   
                }                 

         
                                                  
             }// Boxed_radio_column 1
: boxed_radio_column { // Boxed_radio_column 2             
               : boxed_radio_row {
                 label = "Parts"; 
                key = "S2pop";
          value = "0";
               is_enabled = true;
               
 : boxed_radio_column {
 : popup_list {
               key = "mylist20";
               label = "&Select motor";
               fixed_width_font = true;
               width = 30;
               value = "";
        is_enabled = true;
             }
                                  //"(setq valle (strcat stor mychoise))"
            : button {
               key = "but1";
               label = "Choise";
               is_default = false;
               is_enabled = false;
               value="0";   
 action="(if (= \"1\" $value)(progn "
                    "(start_list \"mylist21\" 3)"
                    "(cond ((= mychoise s2val1)(setq source mylist73))"
                    "((= mychoise s2val2)(setq source mylist74) )"
                    "((= mychoise s2val3)(setq source mylist75) )"
                    "((= mychoise s2val4)(setq source mylist76) )"
                    "((= mychoise s2val5)(setq source mylist77) )"
                    "((= mychoise s2val6)(setq source mylist77) )"                     
                    "((= mychoise s3val1)(setq source mylist78) )"
                    "((= mychoise s3val2)(setq source mylist79) )"
                    "((= mychoise s3val3)(setq source mylist80) )"
                    "((= mychoise s3val4)(setq source mylist81) )"
                    "((= mychoise s3val5)(setq source mylist82) )"
                    "((= mychoise s3val6)(setq source mylist83) )"
                    "((= mychoise m2val1)(setq source mylist84) )"                     
                    "((= mychoise m2val2)(setq source mylist85) )"
                    "((= mychoise m2val3)(setq source mylist86) )"
                    "((= mychoise m2val4)(setq source mylist87) )"
                    "((= mychoise m2val5)(setq source mylist88) )"
                    "((= mychoise m2val6)(setq source mylist89) )"                     
                    "((= mychoise l2val1)(setq source mylist90) )"
                    "((= mychoise l2val2)(setq source mylist91) )"
                    "((= mychoise l2val3)(setq source mylist92) )"
                    "((= mychoise l2val4)(setq source mylist93) )"
                    "((= mychoise l2val6)(setq source mylist94) )"
                    "((= mychoise l3val1)(setq source mylist95) )"                     
                    "((= mychoise l3val2)(setq source mylist96) )"
                    "((= mychoise l3val3)(setq source mylist97) )"
                    "((= mychoise l3val4)(setq source mylist98) )"
                    "((= mychoise l3val5)(setq source mylist99) )"                 
                    "((= mychoise l3val6)(setq source mylist100) ))"                 
                    "(mapcar 'add_list source)"
                    "(end_list)))";
             }
             
 : popup_list {
               key = "mylist21";
               label = "&Select pump";
               fixed_width_font = true;
               width = 30;
               value = "";
         is_enabled = false;
         }
         : popup_list {
               key = "mylist7";
               label = "&Select cooler";
               fixed_width_font = true;
               width = 30;
               value = "";
        is_enabled = true;                
                            }
               
 : popup_list {
               key = "rep";
               label = "&Replenishment";
               fixed_width_font = true;
               width = 30;
               value = "";
         //is_enabled = false;                
             
                            }
             
                              }
                               }
}
               }
                    
: boxed_radio_row {
: row {
 label = "Panels";
: boxed_radio_column { // Boxed_radio_column 1
 label = "Panel";      // defines the radio button areas
          key = "panel";
 : radio_button {         // defines the ActiveX radio button
  label = "&Inga paneler";
  key = "ej_pan";
                }
 : radio_button {         // defines the ActiveX radio button
  label = "Med paneler";
  key = "med_pan";
  value = "1";
                }
 : radio_button {         // defines the (entmake) radio button
  label = "Med paneler+ljudoption";
  key = "med_ljudo";   
          }
          }
           
            
                   

: row {
 label = "Spider"; 
: column {        // defines the radio button areas
 : radio_button {         // defines the ActiveX radio button
  label = "&Ingen spider";
  key = "i_spid";
  value = "0";
 }

 : radio_button {         // defines the ActiveX radio button
  label = "&Placering höger sida";
  key = "phs";
  value = "1";
 }
 : radio_button {         // defines the ActiveX radio button
  label = "&Placering vänster sida";
  key = "pvs";
 }
 }
 : column {   
 : radio_button {         // defines the ActiveX radio button
  label = "&Panel utsida dörr";
  value = "1";   
  key = "pud";
 }
 : radio_button {         // defines the ActiveX radio button
  label = "&Panel insida dörr";
  key = "pid";
                }
           }
          }
   
   

}
}
}               
}
: boxed_row {
             : button {
               key = "accept";
               label = " Okay ";
               is_default = true;
             }
             : button {
               key = "cancel";
               label = " Cancel ";
               is_default = false;
               is_cancel = true;
             }
           } 
} //Sista

 

/DanDue_dimritn8.LSP

Posted

Maybe rather than cond find the nth position in list1 then just setq source nth position list2

Posted

Hi,

 

Thanks for your answer. I have used nth and I'm clooser to gool now. But I have problem to start my "list".

 

Can you see in my code what the problem is?.

 

 
dimdialog8 : dialog { // Första
label = "Dimention drawing";

: row {
: boxed_radio_column {
: row {  // Row 1
: boxed_radio_column { // Boxed_radio_column 1
 label = "Size Cabinet";
        key = "sizecab";
 : radio_button {          // defines the Lightweight radio button
  label = "&Small 2D";
  key = "str_s2";
  value="0";
  action="(if (= \"1\" $value)(progn "
          "(setq stor \"1\")"
         "(mode_tile \"but1\" 1)"
                              "(start_list \"mylist20\" 3)"                   
                              "(mapcar 'add_list mylist1)"
                              "(end_list)))"; 
         
                              }                          
 : radio_button {         // defines the old-style polyline radio button
  label = "&Medium 2D";
  key = "str_m2";
  value="0";   
  action="(if (= \"1\" $value)(progn "
          "(setq stor \"2\")"
         "(mode_tile \"but1\" 1)"
                              "(start_list \"mylist20\" 3)"                   
                              "(mapcar 'add_list mylist2)"
                              "(end_list)))";
                              }
         
 : radio_button {         // defines the old-style polyline radio button
  label = "&Large 2D";
  key = "str_l2";
         value="0";   
  action="(if (= \"1\" $value)(progn "
          "(setq stor \"3\")"
          "(mode_tile \"but1\" 1)"
                               "(start_list \"mylist20\" 3)"                   
                               "(mapcar 'add_list mylist3)"
                               "(end_list)))";                    
                }            
 : radio_button {         // defines the old-style polyline radio button
  label = "&Small 3D";
  key = "str_s3";
  value="0";   
  action="(if (= \"1\" $value)(progn "
          "(setq stor \"1\")"
          "(mode_tile \"but1\" 1)"
                               "(start_list \"mylist20\" 3)"                   
                               "(mapcar 'add_list mylist1)"
                               "(end_list)))";   
                }
                

 : radio_button {         // defines the old-style polyline radio button
  label = "&Medium 3D";
  key = "str_m3";
  value="0";   
  action="(if (= \"1\" $value)(progn "
          "(setq stor \"2\")"
          "(mode_tile \"but1\" 1)"
                               "(start_list \"mylist20\" 3)"                   
                               "(mapcar 'add_list mylist2)"
                               "(end_list)))";   
                }                 
 : radio_button {         // defines the old-style polyline radio button
  label = "&Large 3D";
  key = "str_l3";
  value="0";   
  action="(if (= \"1\" $value)(progn "
          "(setq stor \"3\")"
          "(mode_tile \"but1\" 1)"
                               "(start_list \"mylist20\" 3)"                   
                               "(mapcar 'add_list mylist3)"
                               "(end_list)))";   
                }                 

         
                                                  
             }// Boxed_radio_column 1
: boxed_radio_column { // Boxed_radio_column 2             
               : boxed_radio_row {
                 label = "Parts"; 
                key = "S2pop";
          value = "0";
               is_enabled = true;
               
 : boxed_radio_column {
 : popup_list {
               key = "mylist20";
               label = "&Select motor";
               fixed_width_font = true;
               width = 30;
               value = "";
        is_enabled = true;
             }
                                  //"(setq valle (strcat stor mychoise))"
            : button {
               key = "but1";
               label = "Choise";
               is_default = false;
               is_enabled = false;                             
               value="0";   
 action="(if (= \"1\" $value)(progn "
                    "(start_list \"mylist21\" 3)"
                    "(mapcar 'add_list source)"
                    "(end_list)))";
             }
                 // 
//Maybe rather than cond find the nth position in list1 then just setq source nth position list2
//(setq sizes '("1" "2" "3"))
//(action_tile "size" "(setq mychoise (nth (atoi $value) sizes))")
                     //"(setq pos (nth (atoi $value))"
                     //"(princ pos)"
             
 : popup_list {
               key = "mylist21";
               label = "&Select pump";
               fixed_width_font = true;
               width = 30;
               value = "";
        is_enabled = false;    
                    
         }
         : popup_list {
               key = "mylist7";
               label = "&Select cooler";
               fixed_width_font = true;
               width = 30;
               value = "";
        is_enabled = false;                
                            }
               
 : popup_list {
               key = "rep";
               label = "&Replenishment";
               fixed_width_font = true;
               width = 30;
               value = "";
         is_enabled = false;                
             
                            }
             
                              }
                               }
}
               }
                    
: boxed_radio_row {
: row {
 label = "Panels";
: boxed_radio_column { // Boxed_radio_column 1
 label = "Panel";      // defines the radio button areas
          key = "panel";
 : radio_button {         // defines the ActiveX radio button
  label = "&Inga paneler";
  key = "ej_pan";
                }
 : radio_button {         // defines the ActiveX radio button
  label = "Med paneler";
  key = "med_pan";
  value = "1";
                }
 : radio_button {         // defines the (entmake) radio button
  label = "Med paneler+ljudoption";
  key = "med_ljudo";   
          }
          }
           
            
                   

: row {
 label = "Spider"; 
: column {        // defines the radio button areas
 : radio_button {         // defines the ActiveX radio button
  label = "&Ingen spider";
  key = "i_spid";
  value = "0";
 }

 : radio_button {         // defines the ActiveX radio button
  label = "&Placering höger sida";
  key = "phs";
  value = "1";
 }
 : radio_button {         // defines the ActiveX radio button
  label = "&Placering vänster sida";
  key = "pvs";
 }
 }
 : column {   
 : radio_button {         // defines the ActiveX radio button
  label = "&Panel utsida dörr";
  value = "1";   
  key = "pud";
 }
 : radio_button {         // defines the ActiveX radio button
  label = "&Panel insida dörr";
  key = "pid";
                }
           }
          }
   
   

}
}
}               
}
: boxed_row {
             : button {
               key = "accept";
               label = " Okay ";
               is_default = true;
             }
             : button {
               key = "cancel";
               label = " Cancel ";
               is_default = false;
               is_cancel = true;
             }
           } 
} //Sista

 

 
(setq s2s3val "1")
(setq m2m3val "2")
(setq l2l3val "3")  

(setq sizes '("mylist74" "mylist75" "mylist76" "mylist77" "mylist78"))   
 
(action_tile "mylist20" 
"(setq mychoise (strcat $value stor))
(mode_tile \"mylist21\" 0)
(cond ((= stor l2l3val)(setq source (nth (atoi $value) sizes))))
(princ source)
(mode_tile \"but1\" 0)
 ")

 

/Dan

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...