Author Topic: HELP WITH A PROGRAM FOR CAD..PLEASE.  (Read 21910 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #30 on: December 08, 2004, 12:50:28 PM »
Paul,
Good find. Looks like a nice software package. I didn't download it though.

AVCAD
I was playing with the DCL file & this is what I came up with but had to quit.
Are you going to have Scale choices or let the user enter numbers?

Code: [Select]
dialog_p : dialog
{
label = "Equipment Rack Creation Center";
: boxed_column {
: popup_list {
             label = "Rack Height:";
             key = "rack_h";          // what the user selected
             value = "0" ;            // initial value
             edit_width = 30;         // fix the width (optional)
             }
: toggle {
             label = "Casters:";
             key = "caster_h";        // what the user selected
             value = "1" ;            // initial value
             fixed_width = true;
             }
: toggle {
             label = "Side Panels:";
             key = "sidepanels_h";    // what the user selected
             value = "1" ;            // initial value
             fixed_width = true;
             }
: popup_list {
             label = "Scale to insert:";
             key = "r_scale";          // what the user selected
             value = "0" ;            // initial value
             edit_width = 5;         // fix the width (optional)
             }
}

: boxed_column {
      label = "[ Panel Information ]";
  : row {
    //  Text to display the panel number
    : text {
      key = "panelnum";
      label = "Panel #1 Bottom";
      width = 30;
    }
  }

  : row {
         : edit_box {
          label = "Panel Height";
          key = "ph";
          edit_width = 2;
          edit_limit = 2;
          fixed_width = true;
          value = "0";
        }
   : boxed_radio_row {
      : radio_button {
        key = "columns1";
        label = "1 Column";
        }
      : radio_button {
        key = "columns2";
        label = "2 Columns";
        }
      : radio_button {
        key = "columns3";
        label = "3 Columns";
        }
     }
  }
 
  : row {
    //  Panel Height Selection
    : boxed_radio_column {
      : radio_button {
        key = "tr1";
        label = "1 Text Row";
        }
      : radio_button {
        key = "tr2";
        label = "2 Text Rows";
        }
      : radio_button {
        key = "tr3";
        label = "3 Text Rows";
        }
      : radio_button {
        key = "tr4";
        label = "4 Text Rows";
        }
     }
  //   Column 1 Text, for 4 rows
  : boxed_column {
        : edit_box {
          label = "Label";
          key = "Txt1_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Label";
          key = "Txt1_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Label";
          key = "Txt1_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Label";
          key = "Txt1_4";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
  } //column
  //   Column 2 Text, for 4 rows
  : boxed_column {
        : edit_box {
          label = "Label";
          key = "Txt2_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Label";
          key = "Txt2_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Label";
          key = "Txt2_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Label";
          key = "Txt2_4";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
  } //column
  //   Column 3 Text, for 4 rows
  : boxed_column {
        : edit_box {
          label = "Label";
          key = "Txt3_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Label";
          key = "Txt3_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Label";
          key = "Txt3_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Label";
          key = "Txt3_4";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
  } //column
} //row


  spacer;
  : row {
    : button {
      label ="Page Up";
      key ="pageup";
      fixed_width = true;
    }
    : button {
      label ="Page Dn";
      key ="pagedn";
      fixed_width = true;
    }
    : button {
      label ="Insert";
      key ="Insert";
      fixed_width = true;
    }
    : cancel_button {
      label = "Cancel";
    }
  }


}

}
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

AVCAD

  • Guest
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #31 on: December 08, 2004, 04:09:44 PM »
Well here is what I got so far with your help.

Code: [Select]

dialog_p : dialog
{
label = "Equipment Rack Creation Center";
: boxed_column {
: popup_list {
             label = "Rack Height:";
             key = "rack_h";          // what the user selected
             value = "0" ;            // initial value
             edit_width = 30;         // fix the width (optional)
             }
: toggle {
             label = "Casters:";
             key = "caster_B";        // what the user selected
             value = "0" ;            // initial value
             fixed_width = true;
             }
: toggle {
             label = "Side Panels:";
             key = "sidepanels_B";    // what the user selected
             value = "0" ;            // initial value
             fixed_width = true;
             }
: toggle {
             label = "Scale:";
             key = "scale_B";           // what the user selected
             value = "0" ;            // initial value
             fixed_width = true;        
             }
             
: boxed_column {
      label = "[ Panel Information ]";
  : row {
  //  Text to display the panel number
    : text {
      key = "panelnum";
      label = "Panel #1";
      width = 30;
    }}
 
 : popup_list {
             label = "Panel Height:";
             key = "panel_h";              // what the user selected
             value = "0" ;            // initial value
             edit_width = 30;         // fix the width (optional)
             }
             
 : boxed_radio_column {
      : radio_button {
        key = "columns1";
        label = "Full panel";
        }
      : radio_button {
        key = "columns2";
        label = "2 way split panel";
        }
      : radio_button {
        key = "columns3";
        label = "3 way split panel";
        }
     }
  }
 
  : row {
    //  Panel Height Selection
    : boxed_radio_column {
      : toggle {
        key = "tr1";
        label = "First line";
        }
      : toggle {
        key = "tr2";
        label = "Second Line";
        }
      : toggle {
        key = "tr3";
        label = "Fourth Line";
        }
      : toggle {
        key = "tr4";
        label = "Fifth Line";
        }
     }
  //   Column 1 Text, for 4 rows
  : boxed_column {
        : edit_box {
          label = "Left";
          key = "Txt1_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Left";
          key = "Txt1_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Left";
          key = "Txt1_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Left";
          key = "Txt1_4";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
  } //column
  //   Column 2 Text, for 4 rows
  : boxed_column {
        : edit_box {
          label = "Center";
          key = "Txt2_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Center";
          key = "Txt2_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Center";
          key = "Txt2_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Center";
          key = "Txt2_4";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
  } //column
  //   Column 3 Text, for 4 rows
  : boxed_column {
        : edit_box {
          label = "Right";
          key = "Txt3_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Right";
          key = "Txt3_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Right";
          key = "Txt3_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
        : edit_box {
          label = "Right";
          key = "Txt3_4";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "0";
        }
  } //column
} //row


spacer;
  : row {
    : button {
      label ="Previous";
      key ="prev";
      fixed_width = true;
    }
    : button {
      label ="Next";
      key ="next";
      fixed_width = true;
    }
    : button {
      label ="Insert";
      key ="Insert";
      fixed_width = true;
    }
    : cancel_button {
      label = "Cancel";
      fixed_width = true;
    }
    }
    }
    }



Code: [Select]

 (defun popup_rack (/ rack_h dcl_id hght click)

  ; the list the user sees
  (setq rack_h
        (list
          "25 Unit Rack"
          "30 Unit Rack"
          "35 Unit Rack"
          "40 Unit Rack"
          "45 Unit Rack"
          )
        )

    (setq panel_h
        (list
          "1 RU"
          "2 RU"
          "3 RU"
          "4 RU"
          "5 RU"
          "6 RU"
          "7 RU"
          "8 RU"
          "9 RU"
          "10 RU"
          "11 RU"
          "12 RU"
          )
        )
   
 ; the list the user sees
 ; "1" = YES
  (setq caster_B "0")
  (setq sidepanels_B "0")
  (setq scale_B "0")

 ;;----------------------dcl stuff-----------------------------
  ;load dialog
  (setq dcl_id (load_dialog "dialog_p.dcl"))

  ;test for dialog
  (if (not (new_dialog "dialog_p" dcl_id))
    (exit)
    );if

  (start_list "rack_h") (mapcar 'add_list rack_h) (end_list)
  (start_list "panel_h") (mapcar 'add_list panel_h) (end_list)
  (start_list "caster_B") (mapcar 'add_list caster_h) (end_list)
  (start_list "sidepanels_B") (mapcar 'add_list sidepanels_h) (end_list)

        (action_tile "accept"

               (strcat
                 "(progn
                    (setq hght (get_tile \"rack_h\")
                          pnhght (get_tile \"panel_h\")
                          caster (get_tile \"caster_b\")
                          side_p (get_tile \"sidepanels_b\")
                          scale (get_tile \"scale_b\")
                          )"
                    "(done_dialog) (setq click T)
                 )"
               )
 ;strcat
  );action tile

(action_tile "cancel"

             "(done_dialog)
             (setq click nil)"
             );action_tile

(start_dialog)(unload_dialog dcl_id)

(if click
  (setq ans_lst
        (list
          (nth (atoi hght) rack_h)
 (nth (atoi pnhght) panel_h)
          (nth (atoi caster) caster_b)
          (nth (atoi side_p) sidepanels_b)
 (nth (atoi scale) scale_b)
          )
        )
  ; else
  (exit)
  );if userclick
)




here is a screen of what it looks like.

Thanks CAB and Mark for the help. Think we are getting some where.

http://http://www.theswamp.org/screens/AVCAD/GUI.bmp

There is much work to be done still think though. But what do I know!!!

PDJ

  • Guest
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #32 on: December 08, 2004, 05:56:42 PM »
I realize this is a learning experience which is always good AVCAD but, did you by chance look at the program I mentioned earlier?  I think it's just what you're looking for.  It actually uses rack units that are supplied by Chatworth.  I haven't looked as to whether it's open source or not to see if you could add your own blocks or not though.

AVCAD

  • Guest
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #33 on: December 09, 2004, 11:22:05 AM »
I downloaded the program, but I have not looked at it yet.

There a few reason I wanted to persue creating my own though.

1. I have never done DCL before.
2. I will know how it works.
3. I can use this new knowledge to create other programs.
4. I can get rid of this crappy Block Manager I have. That is if I can create my own.

I will look at it though. It might be something good.

AVCAD

  • Guest
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #34 on: December 09, 2004, 02:29:48 PM »
OK...yet again I worked on the GUI

http://www.theswamp.org/screens/AVCAD/GUI1.bmp

I have figured out how to use the Image dialog but I do not know how to get the image preview in to that location.

Every thing just always comes out stacked. And I can really move anything where I want it.

Help on this?

Code: [Select]

dialog_p : dialog
{
label = "Equipment Rack Creation Center";
: boxed_column {
             label = "Rack Information";
             fixed_width = true;
: popup_list {
             label = "Rack Height:";
             key = "rack_h";          // what the user selected
             edit_width = 20;         // fix the width (optional)
             }
: toggle {
             label = "Casters:";
             key = "caster_B";        // what the user selected
             value = "0" ;            // initial value
             fixed_width = true;
             }
: toggle {
             label = "Side Panels:";
             key = "sidepanels_B";    // what the user selected
             value = "0" ;            // initial value
             fixed_width = true;
             }
: toggle {
             label = "Scale:";
             key = "scale_B";           // what the user selected
             value = "0" ;            // initial value
             fixed_width = true;        
             }
             }
             
: boxed_column {
      label = "Panel Information";
      fixed_width = true;
  : row {
  //  Text to display the panel number
    : text {
      key = "panelnum";
      label = "Panel #1";
      fixed_width = true;
    }}
 
 : popup_list {
             label = "Panel Height:";
             key = "panel_h";            // what the user selected
             edit_width = 19;         // fix the width (optional)
             }

 : boxed_radio_column {
        label = "Type of Panel";
        fixed_width = true;
      : radio_button {
        key = "columns1";
        label = "Full panel";
        }
      : radio_button {
        key = "columns2";
        label = "2 way split panel";
        }
      : radio_button {
        key = "columns3";
        label = "3 way split panel";
        }
        }
        }
       
 : row {
    //  Panel Text - First line
    : boxed_radio_row {
      : toggle {
        key = "tr1";
        label = "1st line";
        fixed_width = true;
        }
    : edit_box {
          label = "Left";
          key = "Txt1_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
        }
    : edit_box {
          label = "Center";
          key = "Txt2_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
        }
     : edit_box {
          label = "Right";
          key = "Txt3_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }
    }
    }

  : row {
    //  Panel Text - Second line
    : boxed_radio_row {
      : toggle {
        key = "tr2";
        label = "2nd line";
        fixed_width = true;
        }
    : edit_box {
          label = "Left";
          key = "Txt1_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
        }
    : edit_box {
          label = "Center";
          key = "Txt2_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
        }
     : edit_box {
          label = "Right";
          key = "Txt3_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }
    }
    }

    : row {
    //  Panel Text - Third line
    : boxed_radio_row {
      : toggle {
        key = "tr3";
        label = "3rd line";
        fixed_width = true;
        }
    : edit_box {
          label = "Left";
          key = "Txt1_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
        }
    : edit_box {
          label = "Center";
          key = "Txt2_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
        }
     : edit_box {
          label = "Right";
          key = "Txt3_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }
    }
    }

  : row {
    : button {
      label ="Previous";
      key ="prev";
      fixed_width = true;
    }
    : button {
      label ="Next";
      key ="next";
      fixed_width = true;
    }
    : button {
      label ="Insert";
      key ="Insert";
      fixed_width = true;
    }
    : cancel_button {
      label = "Cancel";
      fixed_width = true;      
    }
    }
    }
   


Code: [Select]

  (defun popup_rack (/ rack_h dcl_id hght click)

  ; the list the user sees
  (setq rack_h
        (list
          "25 Unit Rack"
          "30 Unit Rack"
          "35 Unit Rack"
          "40 Unit Rack"
          "45 Unit Rack"
          )
        )

    (setq panel_h
        (list
          "1 RU"
          "2 RU"
          "3 RU"
          "4 RU"
          "5 RU"
 "6 RU"
 "7 RU"
 "8 RU"
 "9 RU"
 "10 RU"
 "11 RU"
 "12 RU"
          )
        )
   
 ; the list the user sees
 ; "1" = YES
  (setq caster_B "0")
  (setq sidepanels_B "0")
  (setq scale_B "0")

 ;;----------------------dcl stuff-----------------------------
  ;load dialog
  (setq dcl_id (load_dialog "dialog_p.dcl"))

  ;test for dialog
  (if (not (new_dialog "dialog_p" dcl_id))
    (exit)
    );if

  (start_list "rack_h") (mapcar 'add_list rack_h) (end_list)
  (start_list "panel_h") (mapcar 'add_list panel_h) (end_list)
  (start_list "caster_B") (mapcar 'add_list caster_h) (end_list)
  (start_list "sidepanels_B") (mapcar 'add_list sidepanels_h) (end_list)

        (action_tile "accept"

               (strcat
                 "(progn
                    (setq hght (get_tile \"rack_h\")
                          pnhght (get_tile \"panel_h\")
                          caster (get_tile \"caster_b\")
                          side_p (get_tile \"sidepanels_b\")
                          scale (get_tile \"scale_b\")
                          )"
                    "(done_dialog) (setq click T)
                 )"
               )
 ;strcat
  );action tile

(action_tile "cancel"

             "(done_dialog)
             (setq click nil)"
             );action_tile

(start_dialog)(unload_dialog dcl_id)

(if click
  (setq ans_lst
        (list
          (nth (atoi hght) rack_h)
 (nth (atoi pnhght) panel_h)
          (nth (atoi caster) caster_b)
          (nth (atoi side_p) sidepanels_b)
 (nth (atoi scale) scale_b)
          )
        )
  ; else
  (exit)
  );if userclick
)



Also how do you get the things to not be availble or availble depending on what buttons are clicked on and off.

For the Slide Images in the preview there will only be 8 differant previews. Only dealing with the Casters, Side Panel, Scale and a blank Rack.

The Panels will not be in the preview cause there really is a n unlimited amount of options on these with all the panel heights.

Is there away to ahve a scroll bar on this for the Panel INformation sections so that they can scroll thru the panels? YOu know Panel 1,2,3,4,5.....these will also need to belinked some how. To act with eachother. Like if Panel #1 is 3 RU in height. Then Panels #2 & 3 cant be availble cause Panel #1 will take up their spots. Make sense??

I thin I am getting the Hang of teh GUI side of this but I have a feeling the real challenge will be the Codeing of the actual actions of teh GUI.

Thanks for the help guys.

{edited}

You know what I just thought of...

why not just hav ethe Next button assocaited with the Panel # section. SO when you hit next it goes to the next availble unit like using th example above it woudl jump to Panel #4. Is that possible?

AVCAD

  • Guest
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #35 on: December 09, 2004, 02:54:29 PM »
Quote from: PDJ
I realize this is a learning experience which is always good AVCAD but, did you by chance look at the program I mentioned earlier?  I think it's just what you're looking for.  It actually uses rack units that are supplied by Chatworth.  I haven't looked as to whether it's open source or not to see if you could add your own blocks or not though.


I just took a look at that program. Looks ok at first but the racks do not come in to scale which is a problem. And I can not use a specific Company's Racks due to thefact theveryones racks are differant. I use general rack details. And we send out recommendations on what rachs we think they should use. My details of rack are only  for diagramtic purpose and only show what equipment should be placed in that rack and where.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #36 on: December 09, 2004, 05:50:27 PM »
Quote from: AVCAD
why not just hav ethe Next button assocaited with the Panel # section. SO when you hit next
it goes to the next availble unit like using th example above it woudl jump to Panel #4.
Is that possible?

That is why I gave you the 'PageUp' 'PageDn' buttons. Not to cahange the page but the panel.
 'Next' 'Previous' works just as well for wording. It can say anything that makes sense to you.
Use mode_tile to dim the tile.
Quote
Sets the mode of a dialog box tile
(mode_tile key mode)

Arguments

key

A string that specifies the tile. The key argument is case-sensitive.

mode

An integer that can be one of the following:
0  Enable tile
1  Disable tile
2  Set focus to tile
3  Select edit box contents
4  Flip image highlighting on or off

Return Values

nil
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

AVCAD

  • Guest
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #37 on: December 10, 2004, 02:23:08 PM »
here is the latest GUI.

http://www.theswamp.org/screens/AVCAD/GUI2.bmp

I am having some really difficulty with SLD files on this I dont know why they wont come up. I have been to Afralisp 's site and searched the forums. I think the code it correct and the slide files are in the Search path of ACAD and they ar ein the Main directoy of the program.

Any help would be great. I thikn I might be ata wall right now. I dont know where to go from here.

Here is the DCL code:

Code: [Select]

dialog_p : dialog
{
label = "Equipment Rack Creation Center";
: boxed_column {                                // start boxed column
          label = "Rack Information";
          fixed_width = true;
         
: edit_box {                                    // starts edit box
          label = "Rack Tag:";
          key = "Rtag";
          edit_width = 4;
          edit_limit = 4;
          fixed_width = true;
          value = "R1";
          }                                     // ends edit box
       
: popup_list {                                  // starts popup_list
          label = "Rack Height:";
          key = "rack_h";          
          edit_width = 20;          
          }                                     // ends popup_list
         
: toggle {                                      // starts toggle button
          label = "Casters:";
          key = "caster_B";        
          value = "0" ;            
          fixed_width = true;
          }                                     // ends toggle button
         
: toggle {                                      // starts toggle button
          label = "Side Panels:";
          key = "sidepanels_B";    
          value = "0" ;            
          fixed_width = true;
          }                                     // ends toggle button
         
: toggle {                                      // starts toggle button
          label = "Scale:";
          key = "scale_B";          
          value = "0" ;            
          fixed_width = true;        
          }                                     // ends toggle button
         
          }                                     // ends boxed column
             
: boxed_column {                                // starts boxed column
          label = "Panel Information";
          fixed_width = true;
         
: row {                                         // starts row

  : text {                                      //starts text
          key = "panelnum";
          label = "Panel #1";
          fixed_width = true;
          }                                     //ends text
          }                                     // ends boxed column
 
: popup_list {                                  // starts pop_up list
          label = "Panel Height:";
          key = "panel_h";
          edit_width = 19;
          }                                     // ends popup_list

: boxed_radio_column {                          //starts boxed radio column
          label = "Type of Panel";
          fixed_width = true;
         
  : radio_button {                              // starts radio button
          key = "columns1";
          label = "Full panel";
          }                                     // ends radio button
         
  : radio_button {                              //starts radio button
          key = "columns2";
          label = "2 way split panel";
          }                                     // ends radio button
         
  : radio_button {                              // starts radio button
          key = "columns3";
          label = "3 way split panel";
          }                                     // ends radio button
          }                                     // ends boxed radio column
          }                                     // ends boxed column
 
: row {                                         // starts row
   
  : boxed_radio_row {                           // starts box radio button row
 
    : toggle {                                  // starts toggle button
          is_enabled = false;
          key = "tr1";
          label = "1st line";
          fixed_width = true;
          }                                     // ends toggle button
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Left";
          key = "Txt1_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text  
       
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Center";
          key = "Txt2_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
       
 : edit_box {                                   // starts user text
          is_enabled = false;
          label = "Right";
          key = "Txt3_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
    }                                           // ends box radio button row
    }                                           // ends row

: row {                                         // starts row
   
  : boxed_radio_row {                           // starts box radio button row
 
    : toggle {                                  // starts toggle button
          is_enabled = false;
          key = "tr2";
          label = "2nd line";
          fixed_width = true;
          }
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Left";
          key = "Txt1_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
       
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Center";
          key = "Txt2_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Right";
          key = "Txt3_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
    }                                           // ends box radio button row
    }                                           // ends row

: row {                                         // starts row

  : boxed_radio_row {                           // starts box radio button row
 
    : toggle {                                  // starts toggle button
          is_enabled = false;
          key = "tr3";
          label = "3rd line";
          fixed_width = true;
          }                                     // ends toggle button
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Left";
          key = "Txt1_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Center";
          key = "Txt2_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Right";
          key = "Txt3_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
    }                                           // ends box radio button row  
    }                                           // ends row

: row {                                         // starts row

  : button {                                    // starts button
          label ="&Previous";
          key ="prev";
          fixed_width = true;
          }                                     // ends button
         
  : button {                                    // starts button
          label ="&Next";
          key ="next";
          fixed_width = true;
          }                                     // ends button
         
  : button {                                    // starts button
          label ="&Insert";
          key ="Insert";
          fixed_width = true;
          }                                     // ends button
         
  : cancel_button {                             // starts cancle button
          label = "&Cancel";
          fixed_width = true;      
          }                                     // ends cancle button
         
: boxed_row {
  : image {                                     // define image tile
     key = "smw" ; // give it a name
     fixed_height = true; // and a height
     fixed_width = true; // and now a width
     aspect_ratio = 1.0;
     }                                          // end image
     }                                          // end boxed row
     
: paragraph {                                   // starts parapgraph

  : text_part {        // starts text
     label = "Designed and Created"; // text
     } // ends text

  : text_part {        // starts text
     label = "By: xxxxx xxxxxxx - 2005";        // text
     
     }                                          // ends text
     }                                          // ends paragraph
     }                                          // end row
     
  : text_part {        // starts text
     label = "www.theSwamp.org";        // text
     }                                          // ends text
     }                                          // ends dialog




Here is the LSP code

Code: [Select]

;; use this line to run program
;; (setq return (popup_rack))

(defun popup_rack (/ rack_h dcl_id hght click)

  ; the list the user sees
  (setq rack_h
        (list
          "25 Unit Rack"
          "30 Unit Rack"
          "35 Unit Rack"
          "40 Unit Rack"
          "45 Unit Rack"
          )
          )

    (setq panel_h
        (list
          "1 RU"
          "2 RU"
          "3 RU"
          "4 RU"
          "5 RU"
 "6 RU"
 "7 RU"
 "8 RU"
 "9 RU"
 "10 RU"
 "11 RU"
 "12 RU"
          )
          )
   
 ; the list the user sees
 ; "1" = YES
  (setq caster_b "0")
  (setq sidepanels_b "0")
  (setq scale_b "0")

 ; begin slide file code
  (setq w (dimx_tile "smw") ; get image tile width
        h (dimy_tile "smw") ; get image tile height
)
 
(start_image "smw")         ; start the image
  (slide_image 0 0 w h "smw")                           ; use company logo
  (end_image) ; end image
; end slide file code
   
 ;;----------------------dcl stuff-----------------------------
  ;load dialog
  (setq dcl_id (load_dialog "dialog_p.dcl"))

  ;test for dialog
  (if (not (new_dialog "dialog_p" dcl_id))
    (exit)
    );if

  (start_list "rack_h") (mapcar 'add_list rack_h) (end_list)
  (start_list "panel_h") (mapcar 'add_list panel_h) (end_list)

        (action_tile "accept"

               (strcat
                 "(progn
                    (setq hght (get_tile \"rack_h\")
                          pnhght (get_tile \"panel_h\")
                          caster (get_tile \"caster_b\")
                          side_p (get_tile \"sidepanels_b\")
                          scale (get_tile \"scale_b\")
                          )"
                    "(done_dialog) (setq click T)
                 )"
               )
 ;strcat
  );action tile

(action_tile "cancel"

             "(done_dialog)
             (setq click nil)"
             );action_tile
 
(start_dialog)(unload_dialog dcl_id)

(if click
  (setq ans_lst
        (list
          (nth (atoi hght) rack_h)
 (nth (atoi pnhght) panel_h)
          (nth (atoi caster) caster_b)
          (nth (atoi side_p) sidepanels_b)
 (nth (atoi scale) scale_b)
          )
        )
 
  ; else
  (exit)
  );if userclick
)



Thanks for the help guys. But I do need more still....I am a noob at this.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #38 on: December 10, 2004, 02:42:28 PM »
See comments in code....
Code: [Select]
dialog_p : dialog
{
label = "Equipment Rack Creation Center";
//   Add this row to keep slide in same row
: row {
//-----------------------------------------
: boxed_column {                                // start boxed column
          label = "Rack Information";
          fixed_width = true;
         
: edit_box {                                    // starts edit box
          label = "Rack Tag:";
          key = "Rtag";
          edit_width = 4;
          edit_limit = 4;
          fixed_width = true;
          value = "R1";
          }                                     // ends edit box
       
: popup_list {                                  // starts popup_list
          label = "Rack Height:";
          key = "rack_h";            
          edit_width = 20;          
          }                                     // ends popup_list
         
: toggle {                                      // starts toggle button
          label = "Casters:";
          key = "caster_B";        
          value = "0" ;            
          fixed_width = true;
          }                                     // ends toggle button
         
: toggle {                                      // starts toggle button
          label = "Side Panels:";
          key = "sidepanels_B";    
          value = "0" ;            
          fixed_width = true;
          }                                     // ends toggle button
         
: toggle {                                      // starts toggle button
          label = "Scale:";
          key = "scale_B";            
          value = "0" ;            
          fixed_width = true;        
          }                                     // ends toggle button
         
          }                                     // ends boxed column
         
 //  *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
 //    ADD SLIDE CODE HERE  
 //  *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
// End of Row added  
}
 // ------------------------
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #39 on: December 10, 2004, 02:53:13 PM »
You're just to fast for CAB. :D

-AVCAD
couple things. after making those screen shots convert them to .jpg or .png, that makes them much smaller. see http://www.theswamp.org/screens/AVCAD/GUI2.png

these are the changes I made to your code, note: I don't have the slide but hopefully it will work on your end. Sorry for the lack of participation but I kinda busy.
Code: [Select]


;; use this line to run program
;; (setq return (popup_rack))

(defun popup_rack (/ rack_h dcl_id hght click)

                                        ; the list the user sees
  (setq    rack_h
         (list
           "25 Unit Rack"        "30 Unit Rack"
           "35 Unit Rack"        "40 Unit Rack"
           "45 Unit Rack"
           )
        )

  (setq    panel_h
         (list
           "1 RU"     "2 RU"       "3 RU"     "4 RU"       "5 RU"
           "6 RU"     "7 RU"       "8 RU"     "9 RU"       "10 RU"
           "11 RU"     "12 RU"
           )
        )


   
  (setq caster_b "0")
  (setq sidepanels_b "0")
  (setq scale_b "0")



  ;;----------------------dcl stuff-----------------------------
                                        ;load dialog
  (setq dcl_id (load_dialog "dialog_p.dcl"))

                                        ;test for dialog
  (if (not (new_dialog "dialog_p" dcl_id))
    (exit)
    )                                    ;if

                                          ; begin slide file code
  (setq    w (dimx_tile "smw")                ; get image tile width
        h (dimy_tile "smw")                ; get image tile height
        )

  (start_image "smw")                    ; start the image
  (slide_image 0 0 w h "smw")            ; use company logo
  (end_image)                            ; end image
                                        ; end slide file code
 
  (start_list "rack_h")
  (mapcar 'add_list rack_h)
  (end_list)
  (start_list "panel_h")
  (mapcar 'add_list panel_h)
  (end_list)

  (action_tile
    "accept"

    (strcat
      "(progn
                    (setq hght (get_tile \"rack_h\")
                          pnhght (get_tile \"panel_h\")
                          caster (get_tile \"caster_b\")
                          side_p (get_tile \"sidepanels_b\")
                          scale (get_tile \"scale_b\")
                          )"
      "(done_dialog) (setq click T)
                 )"
      )
                                        ;strcat
    )                                    ;action tile

  (action_tile
    "cancel"

    "(done_dialog)
             (setq click nil)"
    )                                    ;action_tile

  (start_dialog)
  (unload_dialog dcl_id)

  (if click
    (setq ans_lst
           (list
             (nth (atoi hght) rack_h)
             (nth (atoi pnhght) panel_h)
             (nth (atoi caster) caster_b)
             (nth (atoi side_p) sidepanels_b)
             (nth (atoi scale) scale_b)
             )
          )

                                        ; else
    (exit)
    )                                    ;if userclick
  )

Code: [Select]

dialog_p : dialog
{
label = "Equipment Rack Creation Center";
: row {
: boxed_column {                                // start boxed column
          label = "Rack Information";
          fixed_width = true;
         
: edit_box {                                    // starts edit box
          label = "Rack Tag:";
          key = "Rtag";
          edit_width = 4;
          edit_limit = 4;
          fixed_width = true;
          value = "R1";
          }                                     // ends edit box
       
: popup_list {                                  // starts popup_list
          label = "Rack Height:";
          key = "rack_h";          
          edit_width = 20;        
          }                                     // ends popup_list
         
: toggle {                                      // starts toggle button
          label = "Casters:";
          key = "caster_B";      
          value = "0" ;          
          fixed_width = true;
          }                                     // ends toggle button
         
: toggle {                                      // starts toggle button
          label = "Side Panels:";
          key = "sidepanels_B";  
          value = "0" ;          
          fixed_width = true;
          }                                     // ends toggle button
         
: toggle {                                      // starts toggle button
          label = "Scale:";
          key = "scale_B";          
          value = "0" ;          
          fixed_width = true;      
          }                                     // ends toggle button
: image {                                       // define image tile
         key = "smw" ;                          // give it a name
         fixed_height = true;                   // and a height
         fixed_width = true;                    // and now a width
         aspect_ratio = 1.0;
         }                                          // end image
     }                                          // end boxed row
     }
         
                                             // ends boxed column
             
: boxed_column {                                // starts boxed column
          label = "Panel Information";
          fixed_width = true;
         
: row {                                         // starts row

  : text {                                      //starts text
          key = "panelnum";
          label = "Panel #1";
          fixed_width = true;
          }                                     //ends text
          }                                     // ends boxed column
 
: popup_list {                                  // starts pop_up list
          label = "Panel Height:";
          key = "panel_h";
          edit_width = 19;
          }                                     // ends popup_list

: boxed_radio_column {                          //starts boxed radio column
          label = "Type of Panel";
          fixed_width = true;
         
  : radio_button {                              // starts radio button
          key = "columns1";
          label = "Full panel";
          }                                     // ends radio button
         
  : radio_button {                              //starts radio button
          key = "columns2";
          label = "2 way split panel";
          }                                     // ends radio button
         
  : radio_button {                              // starts radio button
          key = "columns3";
          label = "3 way split panel";
          }                                     // ends radio button
          }                                     // ends boxed radio column
          }                                     // ends boxed column
 
: row {                                         // starts row
   
  : boxed_radio_row {                           // starts box radio button row
 
    : toggle {                                  // starts toggle button
          is_enabled = false;
          key = "tr1";
          label = "1st line";
          fixed_width = true;
          }                                     // ends toggle button
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Left";
          key = "Txt1_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
       
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Center";
          key = "Txt2_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
       
 : edit_box {                                   // starts user text
          is_enabled = false;
          label = "Right";
          key = "Txt3_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
    }                                           // ends box radio button row
    }                                           // ends row

: row {                                         // starts row
   
  : boxed_radio_row {                           // starts box radio button row
 
    : toggle {                                  // starts toggle button
          is_enabled = false;
          key = "tr2";
          label = "2nd line";
          fixed_width = true;
          }
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Left";
          key = "Txt1_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
       
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Center";
          key = "Txt2_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Right";
          key = "Txt3_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
    }                                           // ends box radio button row
    }                                           // ends row

: row {                                         // starts row

  : boxed_radio_row {                           // starts box radio button row
 
    : toggle {                                  // starts toggle button
          is_enabled = false;
          key = "tr3";
          label = "3rd line";
          fixed_width = true;
          }                                     // ends toggle button
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Left";
          key = "Txt1_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Center";
          key = "Txt2_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Right";
          key = "Txt3_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
    }                                           // ends box radio button row  
    }                                           // ends row

: row {                                         // starts row

  : button {                                    // starts button
          label ="&Previous";
          key ="prev";
          fixed_width = true;
          }                                     // ends button
         
  : button {                                    // starts button
          label ="&Next";
          key ="next";
          fixed_width = true;
          }                                     // ends button
         
  : button {                                    // starts button
          label ="&Insert";
          key ="Insert";
          fixed_width = true;
          }                                     // ends button
         
  : cancel_button {                             // starts cancle button
          label = "&Cancel";
          fixed_width = true;      
          }                                     // ends cancle button
         

: paragraph {                                   // starts paragraph

  : text_part {                    // starts text
     label = "Designed and Created";      // text
     }                  // ends text

  : text_part {                    // starts text
     label = "By: xxxxx xxxxxxx - 2005";        // text
     
     }                                          // ends text
     }                                          // ends paragraph
     }                                          // end row
     
  : text_part {                    // starts text
     label = "www.theSwamp.org";           // text
     }                                          // ends text
     }                                          // ends dialog
TheSwamp.org  (serving the CAD community since 2003)

AVCAD

  • Guest
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #40 on: December 13, 2004, 01:23:12 PM »
Quote from: Mark Thomas
You're just to fast for CAB. :D

-AVCAD
couple things. after making those screen shots convert them to .jpg or .png, that makes them much smaller. see http://www.theswamp.org/screens/AVCAD/GUI2.png



Sorry about that I will be sure to do that next time.

I am currently looking at the posts and trying to incorporate it to what I have.

You guys seem to know this stuff very well. Hopefully I will get there some day.

I think I am getting the hand of the GUI system but the LISP for it is alot more complicated then Lisp's I have written before.

Thanks again for the help, and I will be posting what I have again later today.

AVCAD

  • Guest
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #41 on: December 13, 2004, 05:24:19 PM »
Didnt have much time today to work on it but.....

I cant get the slide file to load up in to it. There are 2 spots SLD files should be. The code reflects.

DCL:
Code: [Select]

dialog_p : dialog
{
label = "Equipment Rack Creation Center";       // label for GUI

// keeps next in the same row
: row {                                         // start row
// starts to rack information selection box
: boxed_column {                                // start boxed column
          label = "Rack Information";
          fixed_width = true;
         
: edit_box {                                    // starts edit box
          label = "Rack Tag:";
          key = "Rtag";
          edit_width = 4;
          edit_limit = 4;
          fixed_width = true;
          value = "R1";
          }                                     // ends edit box
       
: popup_list {                                  // starts popup_list
          label = "Rack Height:";
          key = "rack_h";          
          edit_width = 20;          
          }                                     // ends popup_list
         
: toggle {                                      // starts toggle button
          label = "Casters:";
          key = "caster_B";        
          value = "0" ;            
          fixed_width = true;
          }                                     // ends toggle button
         
: toggle {                                      // starts toggle button
          label = "Side Panels:";
          key = "sidepanels_B";    
          value = "0" ;            
          fixed_width = true;
          }                                     // ends toggle button
         
: toggle {                                      // starts toggle button
          label = "Scale:";
          key = "scale_B";          
          value = "0" ;            
          fixed_width = true;        
          }                                     // ends toggle button
          }
         
// This image is for the preview box
: boxed_column {
         alignment = centered;                  // center column
: image {                                       // define image tile
         alignment = centered;                  // center image file
         key = "rack_1" ;                       // give it a name
         fixed_height = true;                   // and a height
         fixed_width = true;                    // and now a width
         aspect_ratio = 1;                      // aspect of slide file
         }                                      // ends image
         
         }
         }
// end of the preview box code

// starts panel informations selections
: row {                                         // starts row
: boxed_column {                                // starts boxed column
          label = "Panel Information";
          fixed_width = true;
         
  : text {                                      //starts text
          key = "panelnum";
          label = "Panel #1";
          fixed_width = true;
          }                                     //ends text
           
: popup_list {                                  // starts pop_up list
          label = "Panel Height:";
          key = "panel_h";
          edit_width = 19;
          }                                     // ends popup_list
         
          }                                     // ends boxed column
          }                                     // end row

: boxed_radio_column {                          //starts boxed radio column
          label = "Type of Panel";
          fixed_width = true;
         
  : radio_button {                              // starts radio button
          key = "columns1";
          label = "Full panel";
          }                                     // ends radio button
         
  : radio_button {                              //starts radio button
          key = "columns2";
          label = "2 way split panel";
          }                                     // ends radio button
         
  : radio_button {                              // starts radio button
          key = "columns3";
          label = "3 way split panel";
          }                                     // ends radio button
         
          }                                     // ends boxed radio column
// ends panel informations selections

// starts radio buttons for panel text 1
: row {                                         // starts row
   
  : boxed_radio_row {                           // starts box radio button row
 
    : toggle {                                  // starts toggle button
          is_enabled = false;
          key = "tr1";
          label = "1st line";
          fixed_width = true;
          }                                     // ends toggle button
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Left";
          key = "Txt1_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text  
       
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Center";
          key = "Txt2_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
       
 : edit_box {                                   // starts user text
          is_enabled = false;
          label = "Right";
          key = "Txt3_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
    }                                           // ends box radio button row
    }                                           // ends row
// ends radio buttons for panel text 1

// starts radio buttons for panel text 2
: row {                                         // starts row
   
  : boxed_radio_row {                           // starts box radio button row
 
    : toggle {                                  // starts toggle button
          is_enabled = false;
          key = "tr2";
          label = "2nd line";
          fixed_width = true;
          }
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Left";
          key = "Txt1_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
       
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Center";
          key = "Txt2_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Right";
          key = "Txt3_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
    }                                           // ends box radio button row
    }                                           // ends row
// ends radio buttons for panel text 2

// starts radio buttons for panel text 3
: row {                                         // starts row

  : boxed_radio_row {                           // starts box radio button row
 
    : toggle {                                  // starts toggle button
          is_enabled = false;
          key = "tr3";
          label = "3rd line";
          fixed_width = true;
          }                                     // ends toggle button
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Left";
          key = "Txt1_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Center";
          key = "Txt2_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Right";
          key = "Txt3_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
    }                                           // ends box radio button row  
    }                                           // ends row
// ends radio buttons for panel text 3
   
// starts cancel, next, previous, insert buttons
: row {                                         // starts row

  : button {                                    // starts button
          label ="&Previous";
          key ="prev";
          fixed_width = true;
          }                                     // ends button
         
  : button {                                    // starts button
          label ="&Next";
          key ="next";
          fixed_width = true;
          }                                     // ends button
         
  : button {                                    // starts button
          label ="&Insert";
          key ="Insert";
          fixed_width = true;
          }                                     // ends button
         
  : cancel_button {                             // starts cancle button
          label = "&Cancel";
          fixed_width = true;      
          }                                     // ends cancel button
         
// ends cancel, next, previous, insert buttons
         
// starts the logo and paragraph
: boxed_row {
  : image {                                     // define image tile
     key = "smw" ; // give it a name
     fixed_height = true; // and a height
     fixed_width = true; // and now a width
     aspect_ratio = 1;                          // aspect ratio of image
     }                                          // end image
     }                                          // end boxed row
     
: paragraph {                                   // starts parapgraph

  : text_part {        // starts text
     label = "Designed and Created"; // text
     } // ends text

  : text_part {        // starts text
     label = "By: xxxxx xxxxxxx - 2005";        // text
     }                                          // ends text
     
     }                                          // ends paragraph
     }                                          // ends row
     
  : text_part {        // starts text
     label = "www.theSwamp.org";        // text
     }                                          // ends text
  // ends the logo and paragraph
 
     }                                          // ends dialog



LISP:
Code: [Select]

;; use this line to run program
;; (setq return (popup_rack))

(defun popup_rack (/ rack_h dcl_id hght click)

; start code: the list for drop down menus that the user sees
  (setq rack_h
        (list
          "25 Unit Rack"   "30 Unit Rack"
          "35 Unit Rack"   "40 Unit Rack"
          "45 Unit Rack"
          )
          )

    (setq panel_h
        (list
          "1 RU"   "2 RU"
          "3 RU"   "4 RU"
          "5 RU"   "6 RU"
 "7 RU"   "8 RU"
 "9 RU"   "10 RU"
 "11 RU"  "12 RU"
          )
          )
; end code: the list for drop down menus that the user sees

; start code: default values for toggle buttons
  (setq caster_b "0")
  (setq sidepanels_b "0")
  (setq scale_b "0")
; end code: default values for toggle buttons
   
  ;;----------------------dcl stuff-----------------------------
                                                ;load dialog
  (setq dcl_id (load_dialog "dialog_p.dcl"))

                                                ;test for dialog
  (if (not (new_dialog "dialog_p" dcl_id))
    (exit)
    )                                           ;if

; start code: slide files
  (start_image "smw")                           ; start the image
  (slide_image                                  ; use company logo
    0
    0
    (dimx_tile "smw")
    (dimy_tile "smw")
    "smw"
    )                                          
  (end_image)                                   ; end image

                                                ; begin slide file code - rack preview
  (start_image "rack_1")                        ; start the image
  (slide_image                                  ; use rack image
    0
    0
    (dimx_tile "rack_1")
    (dimy_tile "rack_1")
    "rack_1"
    )                                          
  (end_image)                                   ; end image
;; end code: slide files
                                       
  (start_list "rack_h")
  (mapcar 'add_list rack_h)
  (end_list)
  (start_list "panel_h")
  (mapcar 'add_list panel_h)
  (end_list)

  (action_tile
    "accept"

    (strcat
      "(progn
                    (setq hght (get_tile \"rack_h\")
                          pnhght (get_tile \"panel_h\")
                          caster (get_tile \"caster_b\")
                          side_p (get_tile \"sidepanels_b\")
                          scale (get_tile \"scale_b\")
                          )"
      "(done_dialog) (setq click T)
                 )"
      )
                                                ;strcat
    )                                           ;action tile

  (action_tile
    "cancel"

    "(done_dialog)
             (setq click nil)"
    )                                           ;action_tile

  (start_dialog)
  (unload_dialog dcl_id)

  (if click
    (setq ans_lst
           (list
             (nth (atoi hght) rack_h)
             (nth (atoi pnhght) panel_h)
             (nth (atoi caster) caster_b)
             (nth (atoi side_p) sidepanels_b)
             (nth (atoi scale) scale_b)
             )
          )

                                                ; else
    (exit)
    )                                           ;if userclick
  )



Thanks again. IF you could take a look at the SLD file sections. Try to get one to load cause I cant for some reason.

My slidefile names are

FOR THE LOGO:
SMW.sld

FOR THE RACK:
RACK_1.sld


THANKS!

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #42 on: December 14, 2004, 03:06:42 PM »
Code: [Select]
;; use this line to run program
;; (setq return (popup_rack))

(defun popup_rack (/ rack_h dcl_id hght click)

; start code: the list for drop down menus that the user sees
  (setq rack_h
        (list
          "25 Unit Rack"   "30 Unit Rack"
          "35 Unit Rack"   "40 Unit Rack"
          "45 Unit Rack"
          )
          )

    (setq panel_h
        (list
          "1 RU"   "2 RU"
          "3 RU"   "4 RU"
          "5 RU"   "6 RU"
     "7 RU"   "8 RU"
     "9 RU"   "10 RU"
     "11 RU"  "12 RU"
          )
          )
; end code: the list for drop down menus that the user sees

; start code: default values for toggle buttons
  (setq caster_b "0")
  (setq sidepanels_b "0")
  (setq scale_b "0")
; end code: default values for toggle buttons
   
  ;;----------------------dcl stuff-----------------------------
                                                ;load dialog
  (setq dcl_id (load_dialog "dialog_p.dcl"))

                                                ;test for dialog
  (if (not (new_dialog "dialog_p" dcl_id))
    (exit)
    )                                           ;if

; start code: slide files
  (start_image "smw")                           ; start the image
  (setq xx (dimx_tile "smw"))
  (setq yy (dimy_tile "smw"))
  (slide_image                                  ; use company logo
    0
    0
    xx
    yy
    "smw"
    )                                            
  (end_image)                                   ; end image

                                                ; begin slide file code - rack preview
  (start_image "rack")                        ; start the image
  (setq xx (dimx_tile "rack"))
  (setq yy (dimy_tile "rack"))
  (slide_image                                  ; use rack image
    0
    0
     xx
     yy
    "rack_1"
    )                                            
  (end_image)                                   ; end image
;; end code: slide files
                                       
  (start_list "rack_h")
  (mapcar 'add_list rack_h)
  (end_list)
  (start_list "panel_h")
  (mapcar 'add_list panel_h)
  (end_list)

  (action_tile
    "accept"

    (strcat
      "(progn
                    (setq hght (get_tile \"rack_h\")
                          pnhght (get_tile \"panel_h\")
                          caster (get_tile \"caster_b\")
                          side_p (get_tile \"sidepanels_b\")
                          scale (get_tile \"scale_b\")
                          )"
      "(done_dialog) (setq click T)
                 )"
      )
                                                ;strcat
    )                                           ;action tile

  (action_tile
    "cancel"

    "(done_dialog)
             (setq click nil)"
    )                                           ;action_tile

  (start_dialog)
  (unload_dialog dcl_id)

  (if click
    (setq ans_lst
           (list
             (nth (atoi hght) rack_h)
             (nth (atoi pnhght) panel_h)
             (nth (atoi caster) caster_b)
             (nth (atoi side_p) sidepanels_b)
             (nth (atoi scale) scale_b)
             )
          )

                                                ; else
    (exit)
    )                                           ;if userclick
  )


Code: [Select]
dialog_p : dialog
{
label = "Equipment Rack Creation Center";       // label for GUI

// keeps next in the same row
: row {                                         // start row
// starts to rack information selection box
: boxed_column {                                // start boxed column
          label = "Rack Information";
          fixed_width = true;
         
: edit_box {                                    // starts edit box
          label = "Rack Tag:";
          key = "Rtag";
          edit_width = 4;
          edit_limit = 4;
          fixed_width = true;
          value = "R1";
          }                                     // ends edit box
       
: popup_list {                                  // starts popup_list
          label = "Rack Height:";
          key = "rack_h";            
          edit_width = 20;          
          }                                     // ends popup_list
         
: toggle {                                      // starts toggle button
          label = "Casters:";
          key = "caster_B";        
          value = "0" ;            
          fixed_width = true;
          }                                     // ends toggle button
         
: toggle {                                      // starts toggle button
          label = "Side Panels:";
          key = "sidepanels_B";    
          value = "0" ;            
          fixed_width = true;
          }                                     // ends toggle button
         
: toggle {                                      // starts toggle button
          label = "Scale:";
          key = "scale_B";            
          value = "0" ;            
          fixed_width = true;        
          }                                     // ends toggle button
          }
         
// This image is for the preview box
: boxed_column {
         alignment = centered;                  // center column
: image {                                       // define image tile
         alignment = centered;                  // center image file
         key = "rack" ;                       // give it a name
         aspect_ratio = 1;                      // aspect of slide file
         width = 10;                    // and now a width
         }                                      // ends image
         
         }
         }
// end of the preview box code

// starts panel informations selections
: row {                                         // starts row
: boxed_column {                                // starts boxed column
          label = "Panel Information";
          fixed_width = true;
         
  : text {                                      //starts text
          key = "panelnum";
          label = "Panel #1";
          fixed_width = true;
          }                                     //ends text
           
: popup_list {                                  // starts pop_up list
          label = "Panel Height:";
          key = "panel_h";
          edit_width = 19;
          }                                     // ends popup_list
         
          }                                     // ends boxed column
          }                                     // end row

: boxed_radio_column {                          //starts boxed radio column
          label = "Type of Panel";
          fixed_width = true;
         
  : radio_button {                              // starts radio button
          key = "columns1";
          label = "Full panel";
          }                                     // ends radio button
         
  : radio_button {                              //starts radio button
          key = "columns2";
          label = "2 way split panel";
          }                                     // ends radio button
         
  : radio_button {                              // starts radio button
          key = "columns3";
          label = "3 way split panel";
          }                                     // ends radio button
         
          }                                     // ends boxed radio column
// ends panel informations selections

// starts radio buttons for panel text 1
: row {                                         // starts row
   
  : boxed_radio_row {                           // starts box radio button row
 
    : toggle {                                  // starts toggle button
          is_enabled = false;
          key = "tr1";
          label = "1st line";
          fixed_width = true;
          }                                     // ends toggle button
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Left";
          key = "Txt1_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text  
       
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Center";
          key = "Txt2_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
       
 : edit_box {                                   // starts user text
          is_enabled = false;
          label = "Right";
          key = "Txt3_1";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
    }                                           // ends box radio button row
    }                                           // ends row
// ends radio buttons for panel text 1

// starts radio buttons for panel text 2
: row {                                         // starts row
   
  : boxed_radio_row {                           // starts box radio button row
 
    : toggle {                                  // starts toggle button
          is_enabled = false;
          key = "tr2";
          label = "2nd line";
          fixed_width = true;
          }
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Left";
          key = "Txt1_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
       
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Center";
          key = "Txt2_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Right";
          key = "Txt3_2";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
    }                                           // ends box radio button row
    }                                           // ends row
// ends radio buttons for panel text 2

// starts radio buttons for panel text 3
: row {                                         // starts row

  : boxed_radio_row {                           // starts box radio button row
 
    : toggle {                                  // starts toggle button
          is_enabled = false;
          key = "tr3";
          label = "3rd line";
          fixed_width = true;
          }                                     // ends toggle button
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Left";
          key = "Txt1_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Center";
          key = "Txt2_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
: edit_box {                                    // starts user text
          is_enabled = false;
          label = "Right";
          key = "Txt3_3";
          edit_width = 12;
          edit_limit = 24;
          fixed_width = true;
          value = "";
          }                                     // ends user text
         
    }                                           // ends box radio button row    
    }                                           // ends row
// ends radio buttons for panel text 3
   
// starts cancel, next, previous, insert buttons
: row {                                         // starts row

  : button {                                    // starts button
          label ="&Previous";
          key ="prev";
          fixed_width = true;
          }                                     // ends button
         
  : button {                                    // starts button
          label ="&Next";
          key ="next";
          fixed_width = true;
          }                                     // ends button
         
  : button {                                    // starts button
          label ="&Insert";
          key ="Insert";
          fixed_width = true;
          }                                     // ends button
         
  : cancel_button {                             // starts cancle button
          label = "&Cancel";
          fixed_width = true;        
          }                                     // ends cancel button
         
// ends cancel, next, previous, insert buttons
         
// starts the logo and paragraph
: boxed_row {
  : image_button {                                     // define image tile
     key = "smw" ;            // give it a name
     color=-15;
     aspect_ratio = 1;                          // aspect ratio of image
     fixed_height=true;
     fixed_width=true;
     width = 4;         // and now a width
     }                                          // end image
     }                                          // end boxed row
     
: paragraph {                                   // starts parapgraph

  : text_part {                    // starts text
     label = "Designed and Created";      // text
     }                  // ends text

  : text_part {                    // starts text
     label = "By: xxxxx xxxxxxx - 2005";        // text
     }                                          // ends text
     
     }                                          // ends paragraph
     }                                          // ends row
     
  : text_part {                    // starts text
     label = "www.theSwamp.org";           // text
     }                                          // ends text
  // ends the logo and paragraph
 
     }                                          // ends dialog
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

AVCAD

  • Guest
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #43 on: December 15, 2004, 04:34:03 PM »
HAHA!!! Thanks CAB! I got the Slides to load up!!

I changed some the DCL code to better suite the images and what not.

I decided to zip up the files so we can download and work from the same thing instead of the coping and pasting.

http://www.theswamp.org/screens/AVCAD/ercc.zip

hopfully link will work....

I think what the problem was that you solved was the setq x (dimtile) functions I think "X" and "Y" were being repeated....is this all you changed or was there more that you changed? You changed it to "XX" and "YY"

I think we can start working on the LISP comde more now. I thing the DCL is pretty good. I am sure I might change some things along the way after I see how the program is working out.

for now....

Can we get the Preview image (rack image - on the right side) to change images when differant options are selected. for example...

when no toggle buttons are selected - rack_1
when Casters are selected - rack_2
when Sidepanels are selected - rack_3
when scale is selected - rack_4

Caster & side panels - rack_5
caster & scale - rack_6
caster, side panels, & scale - rack_7

Side panels, Scale - rack_8

"rack_#" is the image file name I have for them.

Do not worry about the Rack height having anythig to do with the slide. I just a visualy showing that they are selecting a rack with the following options.

If we can get this done it will be sweet! then we can move on once more!

Thanks again for all your help on this.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
HELP WITH A PROGRAM FOR CAD..PLEASE.
« Reply #44 on: December 15, 2004, 05:39:40 PM »
>>  HAHA!!! Thanks CAB! I got the Slides to load up!!
Good!!
>>  I changed some the DCL code to better suite the images and what not.
What ever works
>>>  I decided to zip up the files so we can download and work from
>>>   the same thing instead of the coping and pasting.
That will work better for viewing the thread
.

>>>  I think what the problem was that you solved was the setq x (dimtile)
>>>  functions I think "X" and "Y" were being repeated....is this all you changed
>>>  or was there more that you changed? You changed it to "XX" and "YY"
There is more, I moved the (dimx_tile "smw") , I think the dimx_tile must be
executed before the slide_image command.

Code: [Select]
 (start_image "smw")  
  (setq xx (dimx_tile "smw"))
  (setq yy (dimy_tile "smw"))
  (slide_image
    0
    0
    xx  <<=======<<<<  it was here
    yy
    "smw"
    )                                            
  (end_image)

 

>>>  Can we get the Preview image (rack image - on the right side) to change
>>>  images when differant options are selected. for example...
Yes, Here is the code I used to switch between two slides. It updates the buttons too
This is the button code
Code: [Select]
 (action_tile "rbNormal" "(set_style $key)")
  (action_tile "rbShadow" "(set_style $key)")

  This is the code that is executed when a button is clicked.
Code: [Select]
;;======================================================
;;           Dialog Box - Style Buttons                
;;======================================================
(defun set_style (key / x y active)
  (setq x (dimx_tile "rc_img")
        y (dimy_tile "rc_img")
  )
  (cond
    ((= key "rbNormal")
     (setq active      "rc_normal"
           cloud_style "Normal"
     )
    )
    ((= key "rbShadow")
     (setq active      "rc_shadow"
           cloud_style "Shadow"
     )
    )
    (t
     (if (= (get_tile "rbNormal") "1")
       (progn
         (setq active      "rc_shadow"
               cloud_style "Shadow"
         )
         (set_tile "rbShadow" "1")
       )
       (progn
         (setq active      "rc_normal"
               cloud_style "Normal"
         )
         (set_tile "rbNormal" "1")
       )
     )
    )
  )

  (start_image "rc_img")
  (fill_image 0 0 x y 0)
  (slide_image 0 0 x y active)
  (end_image)
) ; defun set_style
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.