Jump to content

Recommended Posts

Posted

Hi All I was wondering what is wrong in fellowing code?>>

 

LISP FILE>>>

 

 ;;;--- If the "Okay" button was pressed
 (if (= ddiag 2)

   (if(= radios "choice1")
 (progn
      (setq ip (getpoint "\n Center point: "))
      (command "circle" ip pause)
 )
     ;;;--- Else draw a polygon
 (progn
   (setq ip (getpoint "\n Center Point: "))
   (command "_sphere" ip pause)
 )
 )

 )

 

 

DCL CODE>>>

 

samp6 : dialog {    //dialog name
     label = "Cabinet Drawer V2.1" ;  //give it a label

      : column {
      : row {     //define row

      : boxed_column {    //define radio column
      : radio_column {
      key = "radios" ;
      label = "Type" ;    //give it a label


       : radio_button {   //define radion button
       key = "choice1" ;   //give it a name
       label = "Cabinet free standing" ; //give it a label
       value = "1" ;    //switch it on
       }     //end definition

     : radio_button {   //define radio button
       key = "choice2" ;   //give it a name
       label = "Cabinet with back" ;  //give it a label
     }     //end definition
     }
     }

       }     //end radio column
       }     //end row

 

In this code it always draw an _sphere and no circle....

Best Regards MR

Posted

Hi

 

Maybe the following could be one option

 

(defun c:foo (/ DCL_File DclId toggle ip)

 (setq DCL_File "samp6.dcl")

 (if
   (not
     (minusp
(setq DclId (load_dialog DCL_File)))
     )

   (progn

     ;Create dialog
     (new_dialog "samp6" DclId)
     ;When user hits ok return value of first radio button
     (action_tile
"accept"
"(setq toggle (get_tile  \"choice1\"))")
     (start_dialog)

     (if
;Choice1 highlighted RETVAL toggle = "1"
;Choice2 highlighted RETVAL toggle = "0"
 (= toggle "1")
(progn
  (setq ip (getpoint "\n Center point: "))
  (command "circle" ip pause))
     ;;;--- Else draw a polygon
     (progn
(setq ip (getpoint "\n Center Point: "))
(command "_sphere" ip pause))
     )
     )
   )
 )

 

samp6 : dialog {    //dialog name
     label = "Cabinet Drawer V2.1" ;  //give it a label

      : column {
      : row {     //define row

      : boxed_column {    //define radio column
      : radio_column {
      key = "radios" ;
      label = "Type" ;    //give it a label


       : radio_button {   //define radion button
       key = "choice1" ;   //give it a name
       label = "Cabinet free standing" ; //give it a label
       value = "1" ;    //switch it on
       }     //end definition

     : radio_button {   //define radio button
       key = "choice2" ;   //give it a name
       label = "Cabinet with back" ;  //give it a label
     }     //end definition
     }
     }

    

       }     //end radio column
      
       }     //

      ok_only ;
      }

 

Regards

 

Jammie

Posted

hm well, now i think it'snt correct comming out... I should set the whole code instead... I made myself. maybe I just forget something, I am in an starters stadium....

 

Lisp

(defun C:samp6()
 ;;;--- Load the dcl file
 (setq dcl_id (load_dialog "samp6.dcl"))
 ;;;--- Load the dialog definition if it is not already loaded
 (if (not (new_dialog "samp6" dcl_id))
   (progn
    (alert "The samp6.DCL file could not be loaded!")
     (exit)
   )
 )
 ;;;--- If an action event occurs, do this function
 (action_tile "cancel" "(setq ddiag 1)(done_dialog)")
 (action_tile "accept" "(setq ddiag 2)(done_dialog)")

;;;--- Display the dialog box
 (start_dialog)
 ;;;--- Unload the dialog box
 (unload_dialog dcl_id)
;;;--- If the cancel button was pressed - display message
 (if (= ddiag 1)
   (princ "\n \n ...samp6 Cancelled. \n ")
 )
 ;;;--- If the "Okay" button was pressed
 (if (= ddiag 2)
 (if(= radios "choice1")
 (progn
   (setq pt(getpoint "\n Center point: "))
   (command "circle" pt pause)
 )
 ;;;--- Else draw a sphere
 (progn
   (setq pt(getpoint "\n Center Point: "))
   (command "_sphere" pt pause)
 )
 )

 )

 ;;;--- Suppress the last echo for a clean exit
 (princ)
) 

 

Dcl..

 

samp6 : dialog {    //dialog name
     label = "Cabinet Drawer V2.1" ;  //give it a label

      : column {
      : row {     //define row

      : boxed_column {    //define radio column
      : radio_column {
label = "Type" ;   //give it a label
       key = "radios" ;



       : radio_button {   //define radion button
       key = "choice1" ;   //give it a name
       label = "Cabinet free standing" ; //give it a label
       value = "0" ;    //switch it on
       }     //end definition

     : radio_button {   //define radio button
       key = "choice2" ;   //give it a name
       label = "Cabinet with back" ;  //give it a label
       value = "0" ;
     }     //end definition
     }
     }

       }     //end radio column
       }     //end row
       

       : boxed_column {   //define boxed column
         label = "&Size";   //give it a label


       : edit_box {    //define edit box
         key = "eb1" ;    //give it a name
         label = "Length :" ;   //give it a label
         edit_width = 10 ;   //30 characters
         value = "";
       }     //end edit box
     //end edit box
  : edit_box {    //define edit box
           key = "eb2" ;   //give it a name
           label = "Widht :" ;   //give it a label
           edit_width = 10 ;   //30 characters
           value = "";
       }     //end edit box
     //end edit box
  : edit_box {    //define edit box
           key = "eb3" ;   //give it a name
           label = "Depth :" ;   //give it a label
           edit_width = 10 ;   //30 characters
           value = "";
       }     //end edit box
     //end edit box

  : edit_box {    //define edit box
           key = "eb4" ;   //give it a name
           label = "Materialethickness :" ; //give it a label
           edit_width = 10 ;   //30 characters
           value = "";
       }     //end edit box
     //end edit box

      }     //end boxed column
       : boxed_column {   //define boxed column
         label = "&Specifics";   //give it a label



       : edit_box {    //define edit box
         key = "eb5" ;    //give it a name
         label = "Back offset :" ;  //give it a label
         edit_width = 10 ;   //30 characters
         value = "";
       }     //end edit box
     //end edit box
       : edit_box {    //define edit box
         key = "eb6" ;    //give it a name
         label = "Thickness back :" ;  //give it a label
         edit_width = 10 ;   //30 characters
         value = "";
       }     //end edit box
     //end edit box
      }     //end boxed column

   :toggle{
     key = "save";
     label = "Save Settings";
     value = 1;
    }



    ok_cancel ;    //predifined OK/Cancel

    : row {     //define row

    : image {     //define image tile
    key = "im" ;    //give it a name
    height = 1.0 ;    //and a height
    width = 1.0 ;    //and now a width
    }      //end image

    : paragraph {    //define paragraph

    : text_part {    //define text
    label = "Designed and Created";  //give it some text
    }      //end text

    : text_part {    //define more text
    label = "By MR. CAD - MITCHELL RODHOUSE"; //some more text
    }      //end text

    }      //end paragraph

    }      //end row

    }      //end dialog

 

I aslo believe I have to saveVars? I am not sure what it means...

Hope you will be able to help on...

ps1 :"notice". It wil open an dialog, don't mention the tekst.. it just has to draw an sphere and circle by selecting the choice1 or choice2.

 

Best Regards MR

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