TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: AVCAD on December 03, 2004, 12:56:53 PM

Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 03, 2004, 12:56:53 PM
Ok..got a good one here.

I have only done Lisp before but I want to create a program within Autocad that will insert blocks..based on given user input.

It will consist of Drop down menus (with selections), and User input text.

now I know it will be harder then it sounds, cause the blocks I am refering to are for Equipment Rack design.

SO there will be a User input on: (DM = Drop down Menu)

Code: [Select]

Rack Height --> Multiple heights (DM)
Caster --------> Yes/No (DM)
Side Panels --> Yes/No (needs to coordinate with the Rack Height) (DM)
Scale ---------> Yes/no (need to coordinare with rack height) (DM)

*********************************************************

Then in a panel below the one above I would like an other section to become avaible...

For the Rack Panels...

Basically just

Code: [Select]

Rack Panels (from bottom to top)

Panel 1 ---->user text input       Panel Height ---->Multiple selections (DM)


Need Multiple of these depending on what Height is selected a differant amount will be available.

Now the the thing with the Panels are that some may be 1,2,3,4 panels in height. I already have blocks for all these but in a program it will need to know that if......

Panel 1 is 4 units high it will need to gray out panels 2,3,4 and panel 5 will be the next one availble.

I would also like an

OK Cancle and a Reset button

I am more than happy to create this but I will need help...and lots of it!

Who ever helps me will get credit and will be in the code and a get a copy of  the program...I will probably end up posting it on the site unless the people who help me do not want it to be.

I am a novice at the programming for, lower then that even...I know how to write Lisp and I have written some Drop down menus for cad but that is about it.

A starting point would be great!!

Email me or post in this forum.

Thanks.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: Mark on December 03, 2004, 01:03:47 PM
So you want one big dialog using DCL?
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: Dommy2Hotty on December 03, 2004, 01:12:51 PM
swapping menus would work too....forces the user to the next page based on his previous input...those work very well...
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 03, 2004, 02:22:01 PM
Quote from: Mark Thomas
So you want one big dialog using DCL?


I think DCL is correct..that it the codeing where you can use a GUI right...like a popup screen with menus and selections in it.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: Mark on December 03, 2004, 02:39:09 PM
Ok then, design your dialog in acad or some such showing how you want it laid out. Then we can start creating our dialog based on that.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CADaver on December 03, 2004, 02:50:41 PM
Quote from: Mark Thomas
Ok then, design your dialog in acad or some such showing how you want it laid out. Then we can start creating our dialog based on that.
This is one I want to watch.  I've hammered existing DCL fiules into submission before, but never tackled one from scratch.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 03, 2004, 03:25:32 PM
Quote from: Mark Thomas
Ok then, design your dialog in acad or some such showing how you want it laid out. Then we can start creating our dialog based on that.


On IT!!
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 03, 2004, 04:38:25 PM
ok i hopfully this works....

http://www.theswamp.org/screens/AVCAD/Drawing1-Model.plt.jpg


NUMBER OF PANELS SHOWN SHOULD BE LINKED TO HEIGHT OF RACK IN FIRST SELECTION.
51" RACK IS SELECTED ONLY 25 PANELS ARE AVAILBLE
60" RACK IS SELECTED ONLY 30 PANELS ARE AVAILBLE
68" RACK IS SELECTED ONLY 35 PANELS ARE AVAILBLE
77" RACK IS SELECTED ONLY 40 PANELS ARE AVAILBLE
84" RACK IS SELECTED ONLY 45 PANELS ARE AVAILBLE

HEIGHT OF PANEL SELECTIONS:
1 TO 30
1 TO 9 - 2 WAY SPLIT
1 TO 9 - 3 WAY SPLIT

TEXT INPUT SELECTIONS:
IF PANEL HEIGHT IS = 1 THEN 1 TEXT LINE AVAILBLE
IF PANEL HEIGHT IS = OR > 2 THEN 2 TEXT LINE AVAILBLE
IF PANEL HEIGHT IS = OR > 3 THEN 3 TEXT LINE AVAILBLE
IF PANEL HEIGHT IS = OR > 4 THEN 4 TEXT LINE AVAILBLE

TEXT INPUT SELECTIONS: FOR 2 WAY SPLIT PANELS
IF PANEL HEIGHT IS = 1 THEN 1 TEXT LINE AVAILBLE (LEFT,RIGHT)
IF PANEL HEIGHT IS = OR > 2 THEN 2 TEXT LINE AVAILBLE (LEFT,RIGHT)
IF PANEL HEIGHT IS = OR > 3 THEN 3 TEXT LINE AVAILBLE (LEFT,RIGHT)
IF PANEL HEIGHT IS = OR > 4 THEN 4 TEXT LINE AVAILBLE (LEFT,RIGHT)

TEXT INPUT SELECTIONS: FOR 3 WAY SPLIT PANELS
IF PANEL HEIGHT IS = 1 THEN 1 TEXT LINE AVAILBLE (LEFT,CENTER,RIGHT)
IF PANEL HEIGHT IS = OR > 2 THEN 2 TEXT LINE AVAILBLE (LEFT,CENTER,RIGHT)
IF PANEL HEIGHT IS = OR > 3 THEN 3 TEXT LINE AVAILBLE (LEFT,CENTER,RIGHT)
IF PANEL HEIGHT IS = OR > 4 THEN 4 TEXT LINE AVAILBLE (LEFT,CENTER,RIGHT)

Actual height of 1 panel is 1.75" for each panel >1 just multiply 1.75 by that number.

That may not matter cause I have blocks that are set up to be inserted for each of these heights. These Blocks have Attributes to them for the text. So each user input in the slot would have to be applied to the attribute in the block..unless there is another way.

This might be too much in now but I will be happy to repeat my self later.

I guess right now we need to get the GUI in place.

Thanks for the Help and Sorry for the CAPs it wrote it in ACAD first.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: Mark on December 03, 2004, 05:00:48 PM
Nice job!! that's a great starting point.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 03, 2004, 05:05:08 PM
Ok...so what is the next step...I really am new to this.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: Mark on December 03, 2004, 05:14:05 PM
The next step is writing the DCL code that makes up your dialog. Unfortunately, I'm off for the rest of the night. :D If you want browse throught the example code that comes with acad and checkout afralisp, Kenny has some nice examples and code that deals with dialog boxes.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: Crank on December 04, 2004, 08:51:23 AM
Quote from: AVCAD
Ok...so what is the next step...I really am new to this.

When I just started making dialogboxes, I used DCG (http://www.caddepot.com/programming/dcg2demo.zip).

It's very easy to use.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on December 04, 2004, 10:38:06 AM
AVCAD,
Because Mark is busy let me ask you a few questions and see if you Could you
upload a drawing with examples of each type of cabinet?
Not all of the possibilities but a 1,2,3 wide & 51" & 84".
Just to get an idea as to what they look like when done.
That would be very helpful so see where you are headed.

AS I looked at your drawing of the Dialog box I had these questions.

Code: [Select]
Rack Height
......... Choices [51 60 68 77 77 84] -> actual height of Rack

Casters
......... Option for casters  [Yes No]

Side Panels
......... Choice of split panels ?  [Yes No]
Is this option available for each if you have 2 or 3 panels?

Scale
.........  Allow user to scale the block [Yes No]
Do you enter a scale or have selections to pick from?

Height of Panel
......... Choices [1 2 3]

Text Input 1 panel
......... Text Label  *Center*  [Text input]  ??Max Length??  Caps Only??

Text Input 2 panel
......... Text Label  *Left*    [Text input]  ??Max Length??  Caps Only??
......... Text Label  *Right*   [Text input]  ??Max Length??  Caps Only??

Text Input 3 panel
......... Text Label  *Left*    [Text input]  ??Max Length??  Caps Only??
......... Text Label  *Center*  [Text input]  ??Max Length??  Caps Only??
......... Text Label  *Right*   [Text input]  ??Max Length??  Caps Only??


If you choose 68" Rack, do you enter 35 choices for Split Panel?
Or if you choose split panels, are they all split?

If you choose 2 panel, are they all 2 panel?

Sorry for the intrusion Mark, I'll get out of the way and follow along.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: Mark on December 04, 2004, 11:20:56 AM
>Sorry for the intrusion Mark, I'll get out of the way and follow along.
Not a problem CAB, feel free to join in. :D
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: Mark on December 06, 2004, 07:59:45 AM
Since this is going to be a large project let's create a directory just for it, then add that directory to the acad search file path. I called my new dir 'panels' and I stored it under c:\temp.

The first file I made in our new dir is called 'dialog_p.dcl', this will be the file that defines our dialog box, or GUI to the application. I should also mention that I'm working in the vlide to design the dialog, it's makes it very easy to view your dialog as you work on it.

The contents of our .dcl file looks like this;

Code: [Select]

dialog_p : dialog
{
label = "This our label (top of the dialog)";
ok_cancel;
}


let's take a look at it using the built-in viewer in the vlide. If you're in acad type in 'vlisp' or 'vlide', then open 'dialog_p.dcl', and finally, from the the 'tools' menu go to 'interface tools' then 'preview dcl in editor', you should see a dialog asking for a name to view. Ours is called 'dialog_p'. Assuming the code doesn't have any errors in it you should see a simple dialog with a title and two buttons, 'ok' and 'cancel'.

Now let's create the 'rack height' menu part of the dialog.
Code: [Select]

dialog_p : dialog
{
label = "This our label (top of the dialog)";
: popup_list {
             label = "Rack Height:";
             key = "rack_h";          // what the user selected
             value = "0" ;            // initial value
             edit_width = 30;         // fix the width (optional)
             }
ok_cancel;
}


Assuming the dcl code is error free you should see one drop down dialog that's empty. We now need to fill the list with rack heights, to do this we need some autolisp code.

I created a new file and called it popup_rack.lsp.
Code: [Select]

(defun popup_rack (/ rack_h_lst dcl_id hght click)

  ; the list the user sees
  (setq rack_h_lst
    (list
      "51 inch rack"
      "60 inch rack"
      "68 inch rack"
      "77 inch rack"
      "84 inch rack"
      )
    )

  ;;----------------------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_lst) (end_list)

  (action_tile "accept"

               (strcat
                 "(progn
                    (setq hght (get_tile \"rack_h\"))"
                    "(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 hght (nth (atoi hght) rack_h_lst))
    ; else
    (exit)
    );if userclick

  ;;-------------------dcl stuff--------------------------------
  )


Open this file in the vlide if it's not already, and load it into the current acad session by using the 'tools' menu go to 'load text in editor'. To run the code and test our dialog, from the 'visual lisp console' enter the following.

Code: [Select]

(setq return (popup_rack))


If all goes well you should now see a populated drop down menu. Now make a selection from that menu and click 'ok'. Our variable 'return' should equal the selected menu item. Mine looks like this.

Code: [Select]

(setq return (popup_rack))
"68 inch rack"



Next we'll take a look at the 'popup_rack.lsp' file and explore what it does.







Notes:
Please feel free to participate, correct or comment on any thing you see here.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on December 06, 2004, 08:08:07 AM
Very good explination Mark.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 06, 2004, 10:14:01 AM
WOW...lot to reply to on a Monday morning....

Let me get on the questions above from cab an dwork my way down....
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 06, 2004, 11:20:24 AM
ok here is the example of the rack.

http://www.theswamp.org/screens/AVCAD/RACK.jpg

Hope it is good enough if not I will post more.

This was an 85" rack. It has 45 Panel spaces.

They are 1.75" in height each (1 unit high) and they are 19" in length.

Text should be in all CAP'S. For now let the Charaters rest at the max. The Tags that will be in these shold be nothing more then...

DVD
AMP
VCR/DVD
CATV
SERVER

so I dont think it will be a problem.

Here is an example with the Side Panels and Rack Scales attached.

http://www.theswamp.org/screens/AVCAD/RACK1.jpg

******************

Side panels are not Split or even panels that reside inside the rack. They are actually a peice of equipment attached to the side of the rack to allow for ventalation and cable paths.

It would actually be a seperate vlock that gets attached to the rack. (see picture)

********************

Scale agian is seperate block attached to the rack. This block is for ease of counting Units heights. (see Picture)

********************

So those two yes/no options would be for the entire block. Selecting yes would attach those two or one block when you hit ok. Or I would like it to atleast.

If that doesnt clear that up I will try again.

****************************

I was mistaken in my post.

Quote

HEIGHT OF PANEL SELECTIONS:
1 TO 30
1 TO 9 - 2 WAY SPLIT
1 TO 9 - 3 WAY SPLIT


Should read:

HEIGHT OF PANEL SELECTIONS:
1 TO 12 - ALL HAVE FULL IN ADDITION TO FOLLOWING
1 TO 10 - 2 WAY SPLIT
1 TO 10 - 3 WAY SPLIT
11 TO 12 - ARE ONLY FULL NO SPLITS

***********************

So Height of Panel can go up to 12 ( 1 2 3 4 5 6 7 8 9 10 11 12 )

Within the Height of Panel Drop down it should have Multiple selections

1 - Full
1 - 2 way split
1 - 3 way split

2 - Full
2 - Full - 2 Line of text
2 - 2 way split
2 - 2 way split - 2 line of text
2 - 3 way split
2 - 3 way split - 2 line of text

3 - Full
3 - Full - 2 Line of text
3 - Full - 3 Line of text
3 - 2 way split
3 - 2 way split - 2 line of text
3 - 2 way split - 3 line of text
3 - 3 way split
3 - 3 way split - 2 line of text
3 - 3 way split - 3 line of text

(3 thru 12 will be the same)

I think we get the point there will be a lot of selections.

**************************

OK....Now when...lets say

3 - 2 way split - 3 line of text  ....... is selected

This would mean that there would be a:

Left and Right Text area availble with 3 line of text each

If

3 - Full - 3 Line of text  ....... is selected

this would mean that there would be:

1 text area availble with 3 lines of text

***************************************

Hope this helps.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 06, 2004, 11:48:01 AM
I changed the LSP file to this:

Code: [Select]

(defun popup_rack (/ rack_h_lst dcl_id hght click)

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

  ;;----------------------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_lst) (end_list)

  (action_tile "accept"

               (strcat
                 "(progn
                    (setq hght (get_tile \"rack_h\"))"
                    "(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 hght (nth (atoi hght) rack_h_lst))
    ; else
    (exit)
    );if userclick

  ;;-------------------dcl stuff--------------------------------
  )


Only reason being I think I would be more clear to but the Rack units instead of the Height of rack.

Also added this to the DCL file....

Code: [Select]

dialog_p : dialog
{
label = "Equipment Rack Creation Center";
: popup_list {
             label = "Rack Height:";
             key = "rack_h";          // what the user selected
             value = "0" ;            // initial value
             edit_width = 30;         // fix the width (optional)
             }
ok_cancel;
}


By they way this is great!!!

I didnt go to school to learn LSP or anything so doing it like this is awsome. I get to see the code be built and I can understand what is happening.

You might want to set thius up as a Tutorial or something after we are done.

Thanks alot for you help on this I really do appreciate it.

I will let Santa know to leave you a doughnut, maybe two!
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 06, 2004, 11:49:08 AM
oh ya...

I set my directories up the same way.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 06, 2004, 01:10:35 PM
OK..I did some work to try to understand what is going on..so here goes..

Code: [Select]

(defun popup_rack (/ rack_h_lst dcl_id hght click)

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

  ; the list the user sees
  (setq caster_h_lst
    (list
      "Yes"
      "No"
      )
    )
 
  ; the list the user sees
  (setq sidepanels_h_lst
    (list
      "Yes"
      "No"
      )
    )
 
  ;;----------------------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_lst) (end_list)

  (action_tile "accept"

               (strcat
                 "(progn
                    (setq hght (get_tile \"rack_h\"))"
                    "(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 hght (nth (atoi hght) rack_h_lst))
    ; else
    (exit)
    );if userclick

  ;;----------------------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 "caster_h") (mapcar 'add_list caster_h_lst) (end_list)

  (action_tile "accept"

               (strcat
                 "(progn
                    (setq hght (get_tile \"caster_h\"))"
                    "(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 hght (nth (atoi hght) rack_h_lst))
    ; else
    (exit)
    );if userclick

  ;;----------------------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 "sidepanels_h") (mapcar 'add_list sidepanels_h_lst) (end_list)

  (action_tile "accept"

               (strcat
                 "(progn
                    (setq hght (get_tile \"sidepanels_h\"))"
                    "(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 hght (nth (atoi hght) caster_h_lst))
    ; else
    (exit)
    );if userclick
 
  ;;-------------------dcl stuff--------------------------------
  )



Code: [Select]

dialog_p : dialog
{
label = "Equipment Rack Creation Center";
: popup_list {
             label = "Rack Height:";
             key = "rack_h";          // what the user selected
             value = "0" ;            // initial value
             edit_width = 30;         // fix the width (optional)
             }
: popup_list {
             label = "Casters:";
             key = "caster_h";        // what the user selected
             value = "1" ;            // initial value
             edit_width = 30;         // fix the width (optional)
             }
: popup_list {
             label = "Side Panels:";
             key = "sidepanels_h";    // what the user selected
             value = "1" ;            // initial value
             edit_width = 30;         // fix the width (optional)
             }            
ok_cancel;
}


OK those are the 2 new files I have worked with.

They work but I have to hit OK to go to the next step. Is there a way to just like has and AUTO OK when the drop down in selected?

for this top section atleast?
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: Mark on December 06, 2004, 01:46:04 PM
You're getting there. :D
try this out.
Code: [Select]


(defun popup_rack (/ rack_h_lst dcl_id hght click)

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

  ; the list the user sees
  (setq caster_h_lst
        (list
          "Yes"
          "No"
          )
        )

  (setq sidepanels_h_lst
        (list
          "Yes"
          "No"
          )
        )

  ;;----------------------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_lst) (end_list)
  (start_list "caster_h") (mapcar 'add_list caster_h_lst) (end_list)
  (start_list "sidepanels_h") (mapcar 'add_list sidepanels_h_lst) (end_list)

  (action_tile "accept"

               (strcat
                 "(progn
                    (setq hght (get_tile \"rack_h\")
                          caster (get_tile \"caster_h\")
                          side_p (get_tile \"sidepanels_h\")
                          )"
                    "(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_lst)
          (nth (atoi caster) caster_h_lst)
          (nth (atoi side_p) sidepanels_h_lst)
          )
        )
  ; else
  (exit)
  );if userclick
)
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on December 06, 2004, 02:45:36 PM
AVCAD
have you considered chack boxes for the Yes/No Items? Like This:
Code: [Select]
dialog_p : dialog
{
label = "Equipment Rack Creation Center";
: 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;
             }              
ok_cancel;
}


Code: [Select]
(defun c:test() (popup_rack))
(defun popup_rack (/ rack_h_lst dcl_id hght click)

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

 
  (setq caster_h "1") ; "1" = YES
  (setq sidepanels_h "1")

  ;;----------------------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_lst) (end_list)
  (action_tile "caster_h" "(setq caster_h $value)" )
  (action_tile  "sidepanels_h" "(setq sidepanels_h $value)" )

  (action_tile "accept"

               (strcat
                 "(progn
                    (setq hght (get_tile \"rack_h\")
                          caster (get_tile \"caster_h\")
                          side_p (get_tile \"sidepanels_h\")
                          )"
                    "(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_lst)
          )
        )
  ; else
  (exit)
  );if userclick
  (princ)
)
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 06, 2004, 04:41:18 PM
Alright, I took both your advises.

I didnt think about check boxes at first but seems like a good idea.

here is what I did.

Basically I used the code that Mark so gracefully shortened for me. Thanks!

and used CAB's check box code and out them together where I thought and it actually worked!

use this to run it:
Code: [Select]

(setq return (popup_rack))


lsp:
Code: [Select]

  (defun popup_rack (/ rack_h_lst dcl_id hght click)

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

  ; the list the user sees
  (setq caster_h "0") ; "1" = YES
  (setq sidepanels_h "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_lst) (end_list)
  (start_list "caster_h") (mapcar 'add_list caster_h_lst) (end_list)
  (start_list "sidepanels_h") (mapcar 'add_list sidepanels_h_lst) (end_list)

  (action_tile "accept"

               (strcat
                 "(progn
                    (setq hght (get_tile \"rack_h\")
                          caster (get_tile \"caster_h\")
                          side_p (get_tile \"sidepanels_h\")
                          )"
                    "(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_lst)
          (nth (atoi caster) caster_h_lst)
          (nth (atoi side_p) sidepanels_h_lst)
          )
        )
  ; else
  (exit)
  );if userclick
)


DCL:
Code: [Select]

dialog_p : dialog
{
label = "Equipment Rack Creation Center";
: 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;
             }              
ok_cancel;
}


I will add some more on to these but I want to post it jsut in case there was something I missed.

OH ya...is there away to have the Check box on the right side not the left. so that the Text lines up with each other?

Thanks again guys.

had to edit the code above for some reason the copy and paste didnt take everything....
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 06, 2004, 05:08:24 PM
OK after further review....

I notice if the box IS checked it returns a "NO"

IF it is checked should it not return a "YES"

Meaning yes i do want it?

How do you change this? The code looks right to me. "0" is false which is usually "NO"

and "1" should be true usually "YES" right?

This is going to take while.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: Mark on December 06, 2004, 05:54:29 PM
Look it up in the docs, what do they say about the check box.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: Mark on December 07, 2004, 07:33:45 AM
Study this for a bit.

Code: [Select]

(defun popup_rack (/ rack_h_lst dcl_id hght click)

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

  ;;----------------------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_lst) (end_list)

  ;(setq caster_h "0")
  (set_tile "caster_h" "0"); sets the initial value of the check box

  ;(setq sidepanels_h "1"); can also be done like this, using a variable
  (set_tile "sidepanels_h" "1"); sets the initial value of the check box

  (action_tile "accept"

      (strcat
"(progn
   (setq hght (get_tile \"rack_h\")
 caster (get_tile \"caster_h\")
 side_p (get_tile \"sidepanels_h\")
 )"
   "(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_lst)
 caster
 side_p
 )
)
  ; else
  (exit)
  );if userclick
)


Code: [Select]

dialog_p : dialog
{
label = "Equipment Rack Creation Center";
: popup_list {
             label = "Rack Height:";
             key = "rack_h";          // what the user selected
             value = "0" ;            // initial value
             edit_width = 30;         // fix the width (optional)
             }
:row {
             height = 3;
             label = "Selection";
             
             
: toggle {
             label = "Casters:";
             key = "caster_h";        // what the user selected
             fixed_width = true;
             }
: toggle {
             label = "Side Panels:";
             key = "sidepanels_h";    // what the user selected
             fixed_width = true;
             }
         }
ok_cancel;
}
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 08, 2004, 12:17:37 PM
Havent forgetten about this I have a been a little bussy at work. But I have also been looking at helpfiles and what not trying to understand some of this stuff.

Mainly how to start the next section of buttons and how to link them to the to section. but I havent figured it out yet. I will try to post what I have and maybe we can talk about how the next section will be. And how to accomplish it.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: Mark on December 08, 2004, 12:28:44 PM
Sounds good. I'm a little busy myself so if you don't get a quick response don't be surprised.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: PDJ on December 08, 2004, 12:39:07 PM
Sorry to jump into this thread so late but, have you by chance checked out http://www.chatsworth.com and looked at the package they offer for free?? It does an excellent job on thier racks and even has where you can put components in the racks with a pull down menu.  All dialogue box driven too.  Might be worth a look, if for nothing else, a really good starting point for modification purposes..
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB 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";
    }
  }


}

}
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD 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!!!
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: PDJ 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.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD 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.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD 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?
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD 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.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB 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
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD 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.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB 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  
}
 // ------------------------
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: Mark 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
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD 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.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD 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!
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB 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
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD 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.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB 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
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 20, 2004, 01:35:02 PM
I havent forgotten about you guys!!! I am just pretty busy at work latley. I will be getting back to this.

Thanks for the Help!
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 22, 2004, 01:14:44 PM
CAB (or anyone),

I tried to incorporate that code but I dont really understand it hence I have not gotten it to work. Can you post a working code or try to explain to me what I need to do to get it to work?

Thanks,
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on December 22, 2004, 03:54:37 PM
AVCAD
Here is the updated lisp & DCL file.
ercc.zip (http://theswamp.org/lilly_pond/cab/ercc.zip?nossi=1)

Please remove the smw.sld from the future zip file or better yet reduce it's size.
Also add the other rack_n.sld files to the zip.

I cleaned up the lisp a bit but did not add code for the panel information.
Be careful with key names in the DCL file as they are case sensitive.
You had "caster_b" in the lisp & "caster_B" in the DCL. They are not the same.
These should replace your existing lisp & dcl files.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 22, 2004, 05:54:19 PM
Good god, You guys are awsome at this stuff...

It worked! They way you re-organized the code helped me out a lot I sort of understand better how it works..the more i look at it the more start to understand it..Thanks!!

Now if the Pervious and next button and the insert button could actualy work, that would be great!

Previous and next are for the differant panels..I am sure you get the just of what I want here..If not I will explain more. Take a break guys!! I am !!! Hard year ending work is getting to me!

Merry Christmas and a Happy New year to everyone!!

I will probably get back to this after the new year....

here is the working files....

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

Oh ya how do you decrease the file size of a SLD....or is there a differant type of file I can use???

Thanks!
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on December 23, 2004, 10:42:22 AM
ercc3 (http://theswamp.org/lilly_pond/cab/ercc3.zip?nossi=1)
Well I added code to handle Prev & Next.
I wish I had some time to explain it but it sometimes takes more time to explain that to do it.
I'm kinda busy right now so this will have to do. Just read through the code.

There are no rules implemented yet. Like clicking the 'Full Panel' button should dim the text
for center & right, so only Left could be entered.
Also there is code missing that limits the rack height as far as max panels.

Note, I revised the smw.sld file so save your old one if you extract this one.
It is much smaller in size.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 27, 2004, 02:45:47 PM
Hope guys had a great Xmas holiday!!!

Now its back to work!!!  :x

CAB - how did you reduce the Slide file image size...I noticed that he image looks differant. Is that cause they size was reduced?

For ease we will use the smaller SLD, for design and such. I have the larger on my end for the finial.

I changed some of the code...fixed the Preview Images so the correct SLD's are previewed depending on the check box selection...and removed the 4th line of the user input text (I believe I got all the code that pertained to it also).

Here is the file:

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

There are still few items that need to be coded for the GUI...

1. Panel information: Is there away to have the Panel #'2 linked to the selection of the Rack Height.....so that if 25 Unit rack is selected there would only be 25 panels availble ( change the code for this one)....but if 45 Unit Rack is selected then there would be 45 panels availble, and so on for the other choices.

2. Related to #1: the Panel Height: is there a way of having that control the Panel #. So that if 1 RU is selected clicking the next button would bring up Panel #2 (as it does already)...But if say there 4 RU was selected then clicking the next button would bring up panel #5....(1+4=5), and so on for the rest of the selections. Reason being is that if the RU is 4 then the panel will take up panels 1,2,3 & 4 and the next availble panel for a new peice of equipment would be 5. This would need to work on all the levels...for example

Panel #1 - 1 RU
Panel #2 - 4 RU
Panel #3 - taken by panel#2
Panel #4 - taken by panel#2
Panel #5 - taken by panel#2
panel #6 - 2 RU
Panel #7 - taken by panel#6

If that doesnt explain it I will try again.

3. Type of Panel: there are 3 radio buttons here...each one needs to represent a differant set of options.....so if the Full Panel is selected then that panel will only have the Center text availble in the Text to display section. If 2 way is selected then the Left and Right shoul dbe availble and if 3 way is selected then all 3 need to availble.

4. Relevant to #2:

TEXT INPUT SELECTIONS:
IF PANEL HEIGHT IS = 1 THEN 1 TEXT LINE AVAILBLE
IF PANEL HEIGHT IS = OR > 2 THEN 2 TEXT LINE AVAILBLE
IF PANEL HEIGHT IS = OR > 3 THEN 3 TEXT LINE AVAILBLE
IF PANEL HEIGHT IS = OR > 4 THEN 4 TEXT LINE AVAILBLE

TEXT INPUT SELECTIONS: FOR 2 WAY SPLIT PANELS
IF PANEL HEIGHT IS = 1 THEN 1 TEXT LINE AVAILBLE (LEFT,RIGHT)
IF PANEL HEIGHT IS = OR > 2 THEN 2 TEXT LINE AVAILBLE (LEFT,RIGHT)
IF PANEL HEIGHT IS = OR > 3 THEN 3 TEXT LINE AVAILBLE (LEFT,RIGHT)
IF PANEL HEIGHT IS = OR > 4 THEN 4 TEXT LINE AVAILBLE (LEFT,RIGHT)

TEXT INPUT SELECTIONS: FOR 3 WAY SPLIT PANELS
IF PANEL HEIGHT IS = 1 THEN 1 TEXT LINE AVAILBLE (LEFT,CENTER,RIGHT)
IF PANEL HEIGHT IS = OR > 2 THEN 2 TEXT LINE AVAILBLE (LEFT,CENTER,RIGHT)
IF PANEL HEIGHT IS = OR > 3 THEN 3 TEXT LINE AVAILBLE (LEFT,CENTER,RIGHT)
IF PANEL HEIGHT IS = OR > 4 THEN 4 TEXT LINE AVAILBLE (LEFT,CENTER,RIGHT)

Actual height of 1 panel is 1.75" for each panel >1 just multiply 1.75 by that number

Sorry for the caps I copied it from a post I posted at the beginning of this thread.

I think that is it....I know its a lot of work though...Hopfully it will go smoothly..... :D

Thanks again...and happy holidays (their not over yet!)
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on December 27, 2004, 07:13:00 PM
|->CAB - how did you reduce the Slide file image size...I noticed that he image
|->looks different. Is that cause they size was reduced?
I redrew the slide & used less objects & a simple hatch.

|->For ease we will use the smaller SLD, for design and such. I have the larger on
|->my end for the finial.
Good idea

|->I changed some of the code...fixed the Preview Images so the correct SLD's are
|->previewed depending on the check box selection...and removed the 4th line of the
|->user input text (I believe I got all the code that pertained to it also).
Not sure what code you changed.
preview slides look good now.
Why did you remove the 4th line of text? as you just posted there is a 4th line of
text allowed, right?



|->There are still few items that need to be coded for the GUI...

Added code to dim some choices as selections are made.
1. added code to set max number of panels.
2. added code to dim rows & columns. I did it different as far as the columns go
Left for one column, Left & Center for 2 Columns, etc.


The set up at this point is that a group of Ru's make up a Page. When you use next
you are on page 2 but it could be RU 2 or any number over that which was allocated
to the first Page.
I have not tested the Max Ru's to see if it needs more work.
Out of time & energy.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on December 28, 2004, 09:24:45 AM
ercc5 (http://theswamp.org/lilly_pond/cab/ercc5.zip?nossi=1)
Ok, I revised the logic and the columns work as you requested.
I also revised the slides to display a little larger.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 28, 2004, 09:47:56 AM
Quote

|->I changed some of the code...fixed the Preview Images so the correct SLD's are
|->previewed depending on the check box selection...and removed the 4th line of the
|->user input text (I believe I got all the code that pertained to it also).
Not sure what code you changed.
preview slides look good now.
Why did you remove the 4th line of text? as you just posted there is a 4th line of
text allowed, right?


Yes I originially posted that but after I reviewed by blocks and such there really is no reason to have 4 lines on these. The discription very rearly even go past 2 lines.

I changed this section:

Code: [Select]

(get_tiles); gets variables set in DCL

  (cond
    ((and (= caster "1") (= scale "1") (= side_p "1"))
     (setq slide "rack_5")
    )
    ((and (= caster "1") (= side_p "1"))
     (setq slide "rack_4")
    )
    ((and (= caster "1") (= scale "1"))
     (setq slide "rack_3")
    )
    ((= caster "1")
     (setq slide "rack_2")
    )
    ((and (= side_p "1") (= scale "1"))
     (setq slide "rack_8")
    )
    ((= side_p "1")
     (setq slide "rack_7")
    )
    ((= scale "1")
     (setq slide "rack_6")
    )
    (t ; none checked
     (setq slide "rack_1")
    )
  )

  (start_image "rack")
  (fill_image 0 0 x y 0)
  (slide_image 0 -30 x y slide)
  (end_image) ; end image
) ; defun set_slide


I basically just had to rearrange the numbers...Also the

(slide_image 0 -30 x y slide)

The -30 part moves the slides up a bit to better center the image in the preview box.

I havent looked at the new files yet, but i will I too am out of energy expecially after the holiday's.

Thanks or getting to this so quickly though, I actually didnt expect anyone to follow up for a couple of days.

You guys rock!
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on December 28, 2004, 09:59:42 AM
Yes I changed the slide order, but did not see the -30.
I added it to the current code but the file I posted does not have it.

I'll remove the 4th text line.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on December 28, 2004, 10:12:42 AM
I looked at the new ercc5 files and they lookk good...is there a differant program you use for making Slide files? I just use Mslide command in ACAD...

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

I changed little things like the -30 in the previous post...

Where is says Panle information under that is says page# I changed it to Panel #....

You can leave the 4th line in there its not a big deal...I didnt remove it from the code on this one.

little changes here and there...not much...but you should probably replace your files with these. well the only changes were in the LSP file.

The buttons work great exactlly what I was looking for!

The Panels were going up to 26 for all the differant rack units. In the code I change the p-max to 24 (not 25)....I guess since 0 is actually 1 then the p-max needs to be -1 from the actual max panels allowed.

the p-max isnt set for each rack...25, 30, 40,45....is there away of doing this?

and the panels need to be coded for a mathmatical equation i guess...so that if 2RU is selected when you hit next it will jump to 2 above that number ( panel 1 = 2RU *next* panel 3 (no panel 2 casue panel 1 is taking up that spot))

god its early! and I am sleepy!
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on December 28, 2004, 04:48:34 PM
ercc7 (http://theswamp.org/lilly_pond/cab/ercc7.zip?nossi=1)
Here is one that honers the max height & once you go to the next panel you can not
change the cabinet height. Also added a the number of unused Rack units.

Here is my take on the Panel question.
Each 'Panel' has 1 to 12 RU's [Rack Units]
Each cabinet can have a set number of Rack units 1.78 high. [25, 30, 35, 40, 45]
The number of panels is determined by the max RU's & the sizes of the panels.
In one of the examples you posted the cabinet was 45 RU's high and had 14 panels.
The largest panel had 11 rack units and 4 lines of text.
 
This is the way I understood the Panels.
So when you hit the next button you are looking at the next panel and it starts
at the next unused Rack Unit which may be 2 to 13 depending on how many you allocated
to the first panel.
Do you find it necessary to keep track of which Rack unit you are at?
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on January 03, 2005, 04:45:54 PM
ok, Thanks again CAB. I will answer the question. And let me appologize now for the book that will follow.  :shock:

All of the Rack heights that are listed in the code are the correct numbers. the 25, 30, 35, 40, 45 rack heights are the actually number of "panels" that each should have.

Rack units or RU's is just a way of designating the height of a rack in the industry.

The height of each rack unit is actaually 1.75" this is the actual size. This is also the size of the blocks that will be used in this program. SO....

Rack Height:

25 = 25ru's
30 = 30ru's
35 = 35ru's
40 = 40ru's
45 = 45ru's

any combination of numbers that can add up to those numbers are the amount of Panels that can be in a rack.

A "panel" is basically just another name for the Rack units. But a panel can be 1-12 ru's in height.....I know its confusing...so...the least amount of panels that can be in a rack with the height being 25 is:

(2) 12 RU's and (1) 1 RU panel = 3 total panels

the most Panels in a rack with the height of 25 is:

(25) 1 RU = 25 total panels

anything can be added together that will create the rack height number is the amount of panels that can be in that rack.

For example:
2+4+2+3+5+6+1+2 = 25 total RU's = 8 total panels

9+4+6+6 = 25 total RU's = 4 total panels

5+6+8+1+1+3+1 = 25 total RU's = 7 total panels

Each RU is basically stacked ontop of each other. so by saying Panel #1 is 3 RU's you are actually saying that Panel #1 is basically (3) 1 RU's on top of eachother....but, they are combined and not seperate peices of equipment.

Typically a VCR in a Rack is 1 RU, same for a DVD player...this means there would be a VCR in one panel and then a DVD in the next panel. if you were putting in a (tower) CPU in a rack you need more RU's cause of the size so maybe it would be 10 RU's for a CPU a 1 RU for the keyboard and mouse and 11 RU's for a monitor (ofcourse depending on the size).

So that would mean that the 10 RU's are one panel the 1 RU is one panel and the 11 RU's is one panel....and if you are using a 30 unit rack you still have 8 RU's left....that are blank or are for future expansion for network devices and such.

The name panel doesnt mean that there is actually something there, there might be 1 RU panel that is blank or there might be a 12 RU panel that is blank but these still need to be accounted for when desiging a rack.

Quote

This is the way I understood the Panels.
So when you hit the next button you are looking at the next panel and it starts
at the next unused Rack Unit which may be 2 to 13 depending on how many you allocated
to the first panel.


Somewhat correct...it should be "So when you hit the next button you are looking at the next panel and it starts
at the next unused Rack Unit which may be 2 to 13 depending on how many you allocated to the previous panel."

Quote

Do you find it necessary to keep track of which Rack unit you are at?


If by Rack unit you mean Panel #, then yes..but this is already accomplished....so I am assuming you mean "RACK" as whole, the caseing and the panels included...then this would be No. Once the the set up is completed and you hit Insert the process will be done and if there is another "Rack" that is needed then the ercc will be ran again.

I hope that clearified this alittle more. If not please let me know.

Now, As I played with new files...here is what I noticed.

The RU balance is great I like it...but it updates immediatly...can it update after you hit next? I was a little confused when I first saw this cause I thought the numbers were adding up wrong but in fact they are correct. What was confusing me was that the balance was always -1 of the rack height when first selected not realizing that 1 RU was being selected already. Maybe if the selection block was blank instead of haveing the 1 RU being the default selection. I tried to just add a "" in the list but it would still subtract 1 form the balance.

Also, can the RU's be linked to the Panel # (what you have called out as Page #)...so that if for example:

Panel #1 = 3 RU's hitting the next button would jump to the next availbe panel. In this case it would be Panel # (page #) 4

Also the Panel #'s (again what you have as Page #) needs to stop at the correct number of units. For some reason they all go 1 past the limit. I tried to fixed this by changing the p-max to 24 instead of 25 but I am not sure this is a correct fix.

I really hope this all made sense....I think it did...atleast in my head it did.. :?

Uh...I think I just hurt my head!
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on January 03, 2005, 11:53:56 PM
ercc8 (http://theswamp.org/lilly_pond/cab/ercc8.zip?nossi=1)

I understand, no time right now but here is an example of how you can draw the racks.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: whdjr on January 04, 2005, 10:22:31 AM
Quote from: AVCAD
Uh...I think I just hurt my head!

Probably because you guys have hit this prog around so much that its starting to hit back. :D
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on January 04, 2005, 10:27:11 AM
So that's where those unexplained bruises on my head are coming from. :shock:
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on January 04, 2005, 04:50:36 PM
seeign as you started this part here are the blocks that I currently use. I use these via Drop down menu's right now.

If you actually look at the files there is a method to their naming

http://www.theswamp.org/lilly_pond/avcad/Blocks.zip

x##p#-#.dwg

X = nothing really :-) (good system huh...)

## = how many units the RU is....It can be a single #

p = just means panel

# = this number is only present if the panel is a 2 or 3 way split...if number is not present it is not a split.

-# = this number is how many text lines

I have all these written in to a menu file that I can update for the directory they will be in if that will help. I have them...right now....in C:\temp\ercc\blocks\rack units\

The Racks are in there too they are also included with the zip file...methode to the naming of those are as follows:

Rack = just the empty

rc = rack and casters

rcsc = rack , casters, scale

rcsp = rack, casters, sidepanels

rcspsc = rack, casters, sidepanel, scale

rsc = rack and scale

rscsp = rack, scale, sidepanel

rsp = rack, sidepanel

These are the same for all the rack heights....25,30,35,40,45....they are located in

c:\temp\ercc\blocks\Racks\## units\      (## = respected unit height of rack)

let me know if you would like me to post the menu file these are already used in. maybe it would help if you saw they way they are used already to uderstand what they do.....

Thanks....so is that why my eyes are buldging out of my head!!  :shock:
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on January 04, 2005, 04:54:32 PM
I noticed that these blocks may confuse you...

they dont all abide by the if it is mor ethen 4 RU's they have 4 lines of text or what not...

These are how the blocks are if they need to be changed its not that bog of a deal I can change them and add the lines of text to make them correct.

If this required before we get started on this then so be it, just let me know.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on January 04, 2005, 04:58:49 PM
You posted two sets for 40 & 45 & I have them.
I just don't care for blocks ( you have 40+ ) when you can just draw them.
Just me, I guess.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on January 05, 2005, 11:42:34 AM
I did not know that you can set this up to draw everything. I thought it would be easier to use the blocks that have already been created for this.

to each his own i guess.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on January 12, 2005, 10:19:24 AM
AH...I have not forgotten about this, I am just swamped at work right now.

Actually I dont even rememeber where we left off..... :?
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on January 12, 2005, 11:27:13 AM
Same here, it will be a few more days before I can look at it again.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on January 18, 2005, 10:38:51 AM
GOD work is so busy lately!!!! Some day I will get back to this.....ERRRR

We were so getting so close!  :cry:
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on January 26, 2005, 04:19:06 PM
Ok I got some time today to look at this again. Please download this file and use these files to replace the ones you have.

http://www.theswamp.org/lilly_pond/avcad/ercc9.zip?nossi=1

When you load it up in VLisp the Image at the bottom (Company Logo) will probably not load casue the code is se to a file you probably dont have.

I did change code in this version so please use these files. I got the Casters to be drawn...the tag was wrong...it wast "casters" when it should have been "caster". Once I changed that, it was tring to execute a Fillet command but it wouldnt complete it. I tried to get it to complete but I could not so I now just bypass the command.

I also changed the Background color (fill color) of the preview box.

I changed the placement of the text on the scale to better center the text.

I also added code to create a layer for the Rack to be drawn on and then reload the users previous layer to the current, once the ercc program was complete

I also added code to create a seperate text style for the text in the scale for the rack. This code also reloads the users previous textstyle to the current, once the ercc program was complete.

Ya had some time today... :)
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on January 26, 2005, 08:45:06 PM
Tinkered with it a bit.
Tagged my changes & added panel dividers.
Now do you want to tackle the text in the panels?

ercc10 (http://ttp://theswamp.org/lilly_pond/avcad/ercc10.zip?nossi=1)
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on January 27, 2005, 10:16:41 AM
Looks great! I think all we need is a few minor things and the text placements.

Once the remaining RU's hit "0" can we make the program stop allowing the use to hit the next button. But allow them to go backwards and change the other RU's, just incase they screw up and realize that they counted wrong, and maybe they have to reduce Panel #3 from 6RU's to 3RU's which would open up 3 more RU's to use...make any sense??

And when the RU's are selected to be Split 2 or 3 way they need to be drawn that way. I will post a sample of what I mean.

Here a jpeg that kind of shows what i mean....

http://www.theswamp.org/lilly_pond/avcad/sample.jpg?nossi=1

Notice how they are split in to 2 or 3 sections. It also shows how the text should layout.

Thanks!
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on January 27, 2005, 12:51:58 PM
Added text with no width error checking, did not test all combinations.
How would you code the limit on the NEXT button?

ercc11 (http://theswamp.org/lilly_pond/avcad/ercc11.zip?nossi=1)
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on January 27, 2005, 04:56:03 PM
Just from a quick glance on the version 11, I changed

Code: [Select]

((= txtlines 1)
       (setq y-lst (list (- (cadr row_center) 0.875)))


to...

Code: [Select]

((= txtlines 1)
       (setq y-lst (list (- (cadr row_center) 0.4375)))


this centers the text better when using the 1 RU text

I also noticed that the text come out...flipped when using mor ethen 1 line

try using a 2 RU unit and use 2 lines of center text...the second line come out on top and the 1st line is on the bottom....it needs to be flipped...the first line shoul dbe on the top and then the 2nd then the 3rd and so on.

I tried to find the code for it but I couldnt make it out.

How would I code the Next button...I am not that good but I can try, might take me awhile..
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on January 27, 2005, 10:47:08 PM
added ver 12 to your folder.
Revised text formating & added Dim for PREV NEXT buttons,
but there is a bug in the next code, still thinking about it.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on January 28, 2005, 10:11:11 AM
Uploaded lucky version 13.
Fixed, I think the Prev Next problem.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on January 28, 2005, 12:51:24 PM
Luck number 13!!

It is working greating great.....

http://www.theswamp.org/lilly_pond/avcad/ercc13.1.zip?nossi=1

please download form the link and check my changes and load it up and test it out to see why i made the changes. I tagged all my changes in the LSP file.

I made some changes...just text positioning and, and some default DCL options.

There are 2 things...

1. rtag - can this text be placed at the top of the rack (above the casing) at the center. This is the racks designation, if there is one. I changed the DCL file to default to a blank box so the user has the option of putting the text in, instead of it automatically being there.

2. on the split units (2 way split and 3 way split) can there be a line drawn to split the units.

 - on the 2 way split the line should be in the middle
 - on the 3 way split the line should be eqaul distance from each other

I figured the dimension to be.

 - 2 way split - from left endpoint of unit = 9.5"

 - 3 way split - from left endpoint of unit = 1st line = 6.3125"
            = 1st line - 6.3125" (6-5/16")
            = 2nd line - 12.625" (1'-11/16")

After this I think we will be done. A finial check of course...

I do have a question though....lol...I just thought about this today....

how hard would it be to not have a drop down for the rack height....right now there are options of 25,30,35,40,45....

These are not always the case some custom jobs have racks with height 21, 24,44...etc.

Would it be hard to incorporate a text box that the user can input in the rack hight..so if the rack is custom he can just type in...lets just say 32 for the rack height??

If not, dont worry about it...we have worked hard on this already, If its too hard or too much code has to be changed....then they will have to just deal with it!!  :lol:

Thanks a lot for the help with this.

You were right about the drawing option instead of using blocks...seems much easier! I would have never thought of it.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on January 28, 2005, 03:16:14 PM
Uploaded 13.2
Did not address the optional RU entry.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on February 01, 2005, 11:36:49 AM
Alright....i try and try and I guess I am still not getting somethign in this...I tried to finish off the code by implenting the lines being drawn verticaly to split the panels....

[2 way split] and [3 way split]

I really screwe up the whole program and had to reload the back up copies...

This is the last thing needs tp be done on this. Everything works great other than that. Maybe someday we will revist this to make the Optional Rack Height work, but now this is a great. I just need the vertical lines to be drawn and we are done.

I did how ever add a few more hieght options that will hopefully satisfy the people using this.

I posted the new files here: I omitted my attemt at the split panel stuff cause...well it didnt work and really screwed with the whole program... :(

http://www.theswamp.org/lilly_pond/avcad/ercc13.3.zip?nossi=1
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on February 01, 2005, 06:53:25 PM
I forgot that was in the specs :)
I added the vertical lines, revised your rack_h list loader, & set the ru list to start at 10, you can still get to 3. 8)
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on February 02, 2005, 11:39:22 AM
I Love you.... :oops:

 :D

You rock...  :dood:

Look its randy moss    :moon:
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on February 02, 2005, 11:47:24 AM
You're quite welcome. :D
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: AVCAD on February 02, 2005, 12:19:10 PM
Tested the version...

Worked great. Only thing was the new rack_h code wasnt working for me.

If I selected say a 20 rack unit high rack it would only draw a 10 but the correct amount of panels would show up.

http://www.theswamp.org/lilly_pond/avcad/ercc13.5.zip?nossi=1

I changed the code back to the way I had done it. It seems to work with tests I ran on it. Maybe the problem was just on my side, but it works with all the differant sizes of rack heights now. I am not saying yours was wrong it jsut didnt work when I loaded it, and this was the first thing I tried to attempt a fix. and it worked.

I know it looks ugly...the rack_h code that is...but once I protect it on this end so no other CAD use can change except me it really wont matter.

Feel free to distribute or what ever, I wouldnt mind having some credit but whatever. I would like to see how many people end up using it.

Great work CAB, I would have never been able to finish this with out you.

Email me or something if you have any ideas on what to do with this program...distribute it to other or what not, I know some site give awards for new and usful lisp routins. Just a thought. I think it will be very usfull, atleast in my industry. Audio/visual and Telecommunications.

Again thank you for all the help.

I believe my email is on my profile but if its not I will post it or add it.
Title: HELP WITH A PROGRAM FOR CAD..PLEASE.
Post by: CAB on February 02, 2005, 01:04:53 PM
Corrected the bug, 13.6
The routine is yours to do with what you want.
I don't work i that area, it was just a diversion for me.
Hope you enjoy it. :)