+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Senior Member
    Computer Details
    BLOACH85's Computer Details
    Operating System:
    Windows XP Pro.
    Computer:
    HP xw4600 Workstation
    CPU:
    Core 2 Duo
    RAM:
    3.48 GB
    Graphics:
    NVIDIA Quadro FX 570
    Primary Storage:
    227 GB
    Monitor:
    ViewSonic VA2226w LCD (x2)
    Using
    AutoCAD 2009
    Join Date
    Sep 2008
    Location
    Whats left of Salem, Alabama
    Posts
    136

    Question Programming DCL and Lisp?

    I need to know if anyone has or can point me in the right direction of a pdf file for dialog boxes. Once you have the dialog box done how do you program it into a lisp routine to do exactly what you want. Does it all appear as a condition? Setting variables? I just cant really find enough info on what i need. We have a lisp that will do calculations based on user input but the input will need to be taken either in decimal form or feet and inches and display in feet and inches.

    Just sittin here fishin.....waitin on a bite.

    Bloach

  2. #2
    Senior Member uddfl's Avatar
    Using
    AutoCAD 2008
    Join Date
    Oct 2008
    Posts
    312

    Default

    Someone made this really nice DCL demo a while ago. The dialog box has a "Show code" option where you can see the actions that correspond to each tile. I hope it helps.

    http://discussion.autodesk.com/forum...demo06V2.2.zip
    "AS IS" AND WITH ALL FAULTS.

  3. #3
    Senior Member
    Computer Details
    BLOACH85's Computer Details
    Operating System:
    Windows XP Pro.
    Computer:
    HP xw4600 Workstation
    CPU:
    Core 2 Duo
    RAM:
    3.48 GB
    Graphics:
    NVIDIA Quadro FX 570
    Primary Storage:
    227 GB
    Monitor:
    ViewSonic VA2226w LCD (x2)
    Using
    AutoCAD 2009
    Join Date
    Sep 2008
    Location
    Whats left of Salem, Alabama
    Posts
    136

    Default Thanks

    Hey i appreciate this I should be able to get most of what i need from here but if not i will be back with more questions count on it!

  4. #4
    Senior Member uddfl's Avatar
    Using
    AutoCAD 2008
    Join Date
    Oct 2008
    Posts
    312

    Default

    You're welcome and by all means do come back with more.
    "AS IS" AND WITH ALL FAULTS.

  5. #5
    Senior Member
    Computer Details
    BLOACH85's Computer Details
    Operating System:
    Windows XP Pro.
    Computer:
    HP xw4600 Workstation
    CPU:
    Core 2 Duo
    RAM:
    3.48 GB
    Graphics:
    NVIDIA Quadro FX 570
    Primary Storage:
    227 GB
    Monitor:
    ViewSonic VA2226w LCD (x2)
    Using
    AutoCAD 2009
    Join Date
    Sep 2008
    Location
    Whats left of Salem, Alabama
    Posts
    136

    Default

    So are you pretty good with dcl? I might need some simpler advice on the easy (thats what i think!) task im working on.

  6. #6
    Senior Member uddfl's Avatar
    Using
    AutoCAD 2008
    Join Date
    Oct 2008
    Posts
    312

    Default

    Quote Originally Posted by BLOACH85 View Post
    So are you pretty good with dcl? I might need some simpler advice on the easy (thats what i think!) task im working on.
    No, I'm not good with DCL, I just know the basics. Anytime I need something, I steal it from existing code.

    I'm a keyboard-and-command-line user (old skool). But hopefully others here are good at DCL.
    "AS IS" AND WITH ALL FAULTS.

  7. #7
    Senior Member
    Computer Details
    BLOACH85's Computer Details
    Operating System:
    Windows XP Pro.
    Computer:
    HP xw4600 Workstation
    CPU:
    Core 2 Duo
    RAM:
    3.48 GB
    Graphics:
    NVIDIA Quadro FX 570
    Primary Storage:
    227 GB
    Monitor:
    ViewSonic VA2226w LCD (x2)
    Using
    AutoCAD 2009
    Join Date
    Sep 2008
    Location
    Whats left of Salem, Alabama
    Posts
    136

    Default

    Well there is nothing wrong with that. It would be my philosophy aslo if i wasnt such a dang perfectionist. Its a curse and a blessing

  8. #8
    Forum Deity
    Using
    AutoCAD 2009
    Join Date
    Oct 2008
    Posts
    2,112

    Default

    BLOACH85

    The following link has a great DCL section that is explained exceptionally well.


    http://www.afralisp.net/

    Give it a shot.

    The Buzzard

  9. #9
    Forum Deity
    Using
    AutoCAD 2009
    Join Date
    Oct 2008
    Posts
    2,112

    Default

    Registered forum members do not see this ad.

    Also, If you need some help with your dialog, I will be glad to assist you.
    Displayed is a Cable Tray Fill Calculator I put together. Maybe this is along the same lines of what you want.

    The DCL
    Code:
    ///////////////////////////////////////////////////////////////////////////////////////
    ctf : dialog {
          label = "Cable Tray Fill Calculations.";
          : boxed_column {
            label = "Input:";
            : edit_box {
              label = "Cable Diameter:";
              key = "CD1";
              edit_width = 5;
            }
            : edit_box {
              label = "Tray Load Depth:";
              key = "LD1";
              edit_width = 5;
            }
            : edit_box {
              label = "Tray Inside Width:";
              key = "TW1";
              edit_width = 5;
            }
            : edit_box {
              label = "Tray Fill Percentage:";
              key = "FP1";
              edit_width = 5;
            }
            : spacer { height = 1;
            }
          }
          : row {
            : button {
              label = "Calculate";
              key = "calc";
              width = 12;
              fixed_width = true;
            }
            : spacer { width = 45;
            }
            : button {
              label = "Reset";
              key = "default";
              width = 12;
              fixed_width = true;
            }
          }
          : boxed_column {
            label = "Output:";
            : row {
              : text {
                label = "Tray Cross Sectional Area - Sq.In. =";
                width = 40.5;
              }
              : text {
                key = TA1;
                width = 0;
              }
            }
            : row {
              : text {
                label = "Fill Percent Area - Sq.In. =";
                width = 40.5;
              }
              : text {
                key = FA1;
                width = 0;
              }
            }
            : row {
              : text {
                label = "Cable Cross Sectional Area - Sq.In. =";
                width = 40.5;
              }
              : text {
                key = CA1;
                width = 0;
              }
            }
            : row {
              : text {
                label = "Cable Quantity =";
                width = 48;
              }
              : text {
                key = CQ1;
                width = 0;
              }
              : spacer { height = 1;
              }
            }
          }
          : row {
            : spacer { width = 45;
            }
            : button {
              label = "Cancel";
              key = "cancel";
              width = 12;
              fixed_width = true;
              mnemonic = "C";
              is_cancel = true;
            }
          }
        }
    ///////////////////////////////////////////////////////////////////////////////////////
    The Program
    Code:
    ;;;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ;;; Function - Cable Tray Fill Calculations.                               ;Describe function
     
    (defun C:CTF (/ CD LD TW FP CA TA FA CQ)                                   ;Define function, Declare local variables
      (setq dcl_id (load_dialog "ctf.dcl"))                                    ;Load dialog                                   
      (if (not (new_dialog "ctf" dcl_id))                                      ;Startof if, Start of not, Test for dialog, End of not
          (exit))                                                              ;Dialog not found then exit, End of if
      (set_tile "CD1" "0.25")                                                  ;Set the default cable diameter to 0.25"               INPUT
      (set_tile "LD1" "3.0")                                                   ;Set the default cable tray load depth to 3.0"         INPUT
      (set_tile "TW1" "12.0")                                                  ;Set the default cable tray width to 12.0"             INPUT
      (set_tile "FP1" "50")                                                    ;Set the default cable tray fill percentage 50%        INPUT
      (set_tile "TA1" "0")                                                     ;Set the default cable tray cross sectional area to 0  OUTPUT
      (set_tile "FA1" "0")                                                     ;Set the default cable tray fill area to 0             OUTPUT
      (set_tile "CA1" "0")                                                     ;Set the default cable cross sectional area to 0       OUTPUT
      (set_tile "CQ1" "0")                                                     ;Set the default cable quantity to 0                   OUTPUT
     
      (action_tile "calc"                                                      ;When Calculate button is pressed
     "(CALC)")                                                                 ;GOTO CALC function
      (action_tile "default"                                                   ;When Reset button is pressed
     "(RESET)")                                                                ;GOTO RESET function
      (action_tile "cancel"                                                    ;When Cancel button is pressed
     "(done_dialog)")                                                          ;Close the dialog
      (start_dialog)                                                           ;Start dialog
    )                                                                          ;End of define function
    ;;;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ;;; Reset Function - Resets All Inputs & Outputs                           ;Describe function
    (defun RESET ()                                                            ;Define function
      (set_tile "CD1" "0")                                                     ;After RESET button is pressed, Set cable diameter to 0                  INPUT
      (set_tile "LD1" "0")                                                     ;After RESET button is pressed, Set cable tray load depth to 0           INPUT
      (set_tile "TW1" "0")                                                     ;After RESET button is pressed, Set cable tray width to 0                INPUT
      (set_tile "FP1" "50")                                                    ;After RESET button is pressed, Set cable tray fill percentage to 50%    INPUT
      (set_tile "TA1" "0")                                                     ;After RESET button is pressed, Set cable tray cross sectional area to 0 OUTPUT
      (set_tile "FA1" "0")                                                     ;After RESET button is pressed, Set cable tray fill area to 0            OUTPUT
      (set_tile "CA1" "0")                                                     ;After RESET button is pressed, Set cable cross sectional area to 0      OUTPUT
      (set_tile "CQ1" "0")                                                     ;After RESET button is pressed, Set cable quantity to 0                  OUTPUT
    )                                                                          ;End of define function
    ;;;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ;;; Calculation Function - Calculate All Inputs & Constants                ;Describe function
    (defun CALC ()                                                             ;Define function
      (setq CD (atof (get_tile "CD1")))                                        ;Convert cable diameter string to real
      (setq LD (atof (get_tile "LD1")))                                        ;Convert cable tray load depth string to real
      (setq TW (atof (get_tile "TW1")))                                        ;Convert cable tray width string to real
      (setq FP (atof (get_tile "FP1")))                                        ;Convert cable tray fill percentage string to real
      (setq CA (* (* CD CD) (/ pi 4)))                                         ;Calculate cable area, Cable diameter square mulitplied by pi divided by 4
      (setq TA (* TW LD))                                                      ;Calculate cable tray area, Cable tray width mulitplied by cable tray load depth
      (setq FA (* (/ FP 100) (* TW LD)))                                       ;Calculate cable fill area, Cable tray fill percentage divided by 100 mulitplied by cable tray width multiplied by cable tray load depth
      (setq CQ (/ FA CA))                                                      ;Calculate cable quantity, Cable tray area divided by cable area
      (OUTPUT)                                                                 ;GOTO OUTPUT function
    )                                                                          ;End of define function
    ;;;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ;;; Output Function - Take All Calculations & Place In Dialog              ;Describe function
    (defun OUTPUT ()                                                           ;Define function
      (set_tile "FA1" (rtos FA 2 2))                                           ;Get cable tray fill area calculation, Place in dialog key FA1
      (set_tile "TA1" (rtos TA 2 2))                                           ;Get cable tray area calculation, Place in dialog key TA1
      (set_tile "CA1" (rtos CA 2 2))                                           ;Get cable area calculation, Place in dialog key CA1
      (set_tile "CQ1" (rtos CQ 2 2))                                           ;Get cable quantity calculation, Place in dialog key CQ1
    )                                                                          ;End of define function
    ;;;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    I hope this will help. I can provide additional assistance.

    The Buzzard
    Last edited by The Buzzard; 6th Feb 2009 at 10:31 pm.

Similar Threads

  1. Want to learn Lisp Programming
    By roven.aravind in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 17th Apr 2008, 02:36 pm
  2. CNC programming
    By Cad Sponge in forum Autodesk Inventor
    Replies: 6
    Last Post: 10th Feb 2008, 03:26 am
  3. CAD+DOS+programming.
    By bone in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 3rd Jul 2006, 10:52 am
  4. new to programming
    By domepizzle in forum AutoCAD Beginners' Area
    Replies: 1
    Last Post: 9th Jul 2005, 12:17 pm
  5. lisp programming
    By REIVAX in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 16th Apr 2003, 08:41 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts