Author Topic: Need Help on Lisp & DCL  (Read 6722 times)

0 Members and 1 Guest are viewing this topic.

laison

  • Guest
Need Help on Lisp & DCL
« on: October 29, 2010, 07:28:50 PM »
I have this lisp & dcl file that I want to modify. I want to know if it has to be totally redone are that it can be used.

What I want to do is have the lisp file pull up this dcl file. When selecting the image it would trigger a selected script file that will insert a string or an assembly of valves are whatever user has selected.

I have created about 20 different scripts.   I also have the slides and slide library along with the text file.

Thank you



LISP FILE:

Code: [Select]
;;PASSEM.LSP Written by: UD
(defun C:PASSEM( / P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13
                               #TOP #BOT A1 D1 D2 S1 E1 E2)
  (setq Dat (load_dialog (strcat #MENUDIR "ASSEMBLY.DCL")))
  (if (not (new_dialog "ASM01" Dat)) (exit))
  (setq H (dimy_tile "I01"))
  (setq W (dimx_tile "I01"))
  
  (setq CNT 0)
  (repeat 30
    (setq CNT (+ CNT 1))
    (if (< CNT 10)
       (start_image (strcat "I0" (itoa CNT)))
       (start_image (strcat "I" (itoa CNT)))
    )
    (if (< CNT 10)
      (slide_image 0 0 W H (strcat #MENUDIR "ASM(ASM0" (itoa CNT) ")"))
      (slide_image 0 0 W H (strcat #MENUDIR "ASM(ASM" (itoa CNT) ")"))
    )
    (end_image)
  )



;;  (mode_tile "I16" 1)
  (mode_tile "accept" 1)
  (action_tile "accept" "(done_dialog 1)")
  (action_tile "cancel" "(done_dialog 0)")
  (setq Ok (start_dialog))
  (unload_dialog Dat)
  (if (= OK 1)
    (assembly ASM)
  )
  (princ)
)
  


DCL FILE:


Code: [Select]
ASM01 : dialog {
    value = "Select Piping Assembly";
    spacer;
    : column {
        fixed_width = true;
        fixed_height = true;
        width = 120;
        height = 34;
        aspect_ratio = 1.0;
        : row {
            : image_button {
                key = "I01";
                color = 250;
                action = "(setq ASM \"ASSEM01\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Std. Flanged Pair Assembly\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I02";
                color = 250;
                action = "(setq ASM \"ASSEM02\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Flanged Gate Valve Assembly\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I03";
                color = 250;
                action = "(setq ASM \"ASSEM03\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Flanged Ball Valve Assembly\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I04";
                color = 250;
                action = "(setq ASM \"ASSEM04\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Flanged Check Valve Assembly\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I05";
                color = 250;
                action = "(setq ASM \"ASSEM05\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Flanged Plug Valve Assembly\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I06";
                color = 250;
                action = "(setq ASM \"ASSEM06\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Flanged Globe Valve Assembly\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
        }
        : row {
            : image_button {
                key = "I07";
                color = 250;
                action = "(setq ASM \"ASSEM07\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Std. Flange & Blind Assembly\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I08";
                color = 250;
                action = "(setq ASM \"ASSEM08\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Common SWxSC Vent/drain Assembly\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I09";
                color = 250;
                action = "(setq ASM \"ASSEM09\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Gasket and RFWN Flange Assembly\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I10";
                color = 250;
                action = "(setq ASM \"ASSEM10\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Weldolet, RFWN Flange and Gasket Assembly\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I11";
                color = 250;
                action = "(setq ASM \"ASSEM11\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Gasket, WN Flange, Pipe, WN Flange, Gasket, Assembly\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I12";
                color = 250;
                action = "(setq ASM \"ASSEM12\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Gasket, WN Flange, Pipe, Assembly\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
        }
        : row {
            : image_button {
                key = "I13";
                color = 250;
                action = "(setq ASM \"ASSEM13\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Gasket, Slip-on Flange, Pipe, Slip-on Flange, Gasket, Assembly\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I14";
                color = 250;
                action = "(setq ASM \"ASSEM14\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Gasket, Slip-on Flange, Pipe, Assembly\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I15";
                color = 250;
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I16";
                color = 250;
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I17";
                color = 250;
                action = "(setq ASM \"ASSEM17\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Common Vent/Drain Assembly, Threaded\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I18";
                color = 250;
                action = "(setq ASM \"ASSEM18\") (mode_tile \"accept\" 0) (set_tile \"AEC\" \"Common Vent/Drain Assembly, Threaded, For Small Bore Piping\")";
                horizontal_margin = none;
                vertical_margin = none;
            }
        }
        : row {
            : image_button {
                key = "I19";
                color = 250;
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I20";
                color = 250;
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I21";
                color = 250;
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I22";
                color = 250;
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I23";
                color = 250;
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I24";
                color = 250;
                horizontal_margin = none;
                vertical_margin = none;
            }
          }
        : row {
            : image_button {
                key = "I25";
                color = 250;
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I26";
                color = 250;
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I27";
                color = 250;
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I28";
                color = 250;
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I29";
                color = 250;
                horizontal_margin = none;
                vertical_margin = none;
            }
            : image_button {
                key = "I30";
                color = 250;
                horizontal_margin = none;
                vertical_margin = none;
            }
          }
        }
        : text {
          label = "                      ";
          key = "AEC";
    }
    ok_cancel_help_info;
    : row {
     : text {
         key   = "AUT";
         label = "Written by: UD";
         alignment = left;
     }
     : button {
         label = "?";
         key = "Q";
         width  = 1;
         fixed_width  = true;
         alignment    = right;
     }
    }
}


<edit: code tags added>
  
« Last Edit: October 29, 2010, 07:44:03 PM by CAB »

Lee Mac

  • Seagull
  • Posts: 12910
  • London, England
Re: Need Help on Lisp & DCL
« Reply #1 on: October 29, 2010, 07:37:06 PM »
Firstly, read this  :-)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Need Help on Lisp & DCL
« Reply #2 on: October 29, 2010, 07:46:05 PM »
You can use them for other list as well to preserve the formatting.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

laison

  • Guest
Re: Need Help on Lisp & DCL
« Reply #3 on: October 30, 2010, 12:16:02 PM »
When I run it a will get an

“; error: bad argument type: stringp nil”

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Need Help on Lisp & DCL
« Reply #4 on: October 30, 2010, 04:57:35 PM »
Here is a quick revision of your code. (NOT TESTED)
Without slides I can't test. Too much trouble to recreate them.

<edit: old code removed, see attachments in another post. CAB>
« Last Edit: October 31, 2010, 05:40:27 PM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

laison

  • Guest
Re: Need Help on Lisp & DCL
« Reply #5 on: October 31, 2010, 12:53:18 AM »
I tried the revised code but I am still getting the same error message. I have added the slides, library, text file, lisp & dcl files.

Also I have included a snapshot on what I am trying to accomplish. I am curious on one thing. After seeing what I am trying to accomplish I am wondering if script files would be be needed to do this along with lisp and dcl.




roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Need Help on Lisp & DCL
« Reply #6 on: October 31, 2010, 08:00:04 AM »
@ laison :
If I test the original code there are 2 problems:
1.
#MENUDIR is not initialized. So using this code:
Code: [Select]
(strcat #MENUDIR ...)Causes an error.
2.
There is no function assembly
Code: [Select]
  (if (= OK 1)
    (assembly ASM)
  )

CAB's code for the dcl contains an error in line 3.
Old:
Code: [Select]
                action = "(setq ASM (strcat \"ASSEM\" (substr key$ 2)) (mode_tile \"accept\" 0) (set_tile \"AEC\" (lookup key$))";New:
Code: [Select]
                action = "(setq ASM (strcat \"ASSEM\" (substr $key 2))) (mode_tile \"accept\" 0) (set_tile \"AEC\" (cond ((lookup $key)) (\"\")))";
On a more principal level I would advise against the combination of tile actions programmed in lisp files, tile actions programmed in dcl files and script files.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Need Help on Lisp & DCL
« Reply #7 on: October 31, 2010, 10:36:36 AM »
Thanks Roy but there were a few more errors.
Corrected routines attached.

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

laison

  • Guest
Re: Need Help on Lisp & DCL
« Reply #8 on: October 31, 2010, 02:33:51 PM »
I just tried the routine. There is progress I think.

I got these error messages:

Error: in dialog file
"C:\Program Files\AutoCAD 2004\Support\Assemblies\ASSEM", line 15:

missing semicolon.

Error: in dialog file
"C:\Program Files\AutoCAD 2004\Support\Assemblies\ASSEM", line 15:

syntax error.

Symbol: "(setq ASM "ASSEM01")(mode_tile"accept"0)(set_tile "Assemblies"

"._Assembly01".

Error: in dialog file
"C:\Program Files\AutoCAD 2004\Support\Assemblies\ASSEM", line 15:

newline in string constant.



CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Need Help on Lisp & DCL
« Reply #9 on: October 31, 2010, 02:47:17 PM »
Laison,
Did you try my DCL?

Those errors are not from my DCL. I eliminated this (mode_tile"accept"0)
among other changes.



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

laison

  • Guest
Re: Need Help on Lisp & DCL
« Reply #10 on: October 31, 2010, 03:00:56 PM »
yes, I saved them and tried them and that is when I recieved the error messages.

laison

  • Guest
Re: Need Help on Lisp & DCL
« Reply #11 on: October 31, 2010, 03:04:05 PM »
I am not getting that far. The dcl will appear. I am getting these errors before the dcl is activated

laison

  • Guest
Re: Need Help on Lisp & DCL
« Reply #12 on: October 31, 2010, 03:06:01 PM »
oops, I meant will not that the dcl will not appear.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Need Help on Lisp & DCL
« Reply #13 on: October 31, 2010, 05:21:18 PM »
You are not loading the correct DCL.

Let's try this another way. I attached a renamed version that will only load the renamed version.

Note that this line is hard coded in the lisp.
Code: [Select]
(setq #MENUDIR  "C:\Program Files\AutoCAD 2004\Support\Assemblies\ASSEM")  ; debug
PS  I added Help & Info functions which need to be edited by you.
« Last Edit: October 31, 2010, 05:39:18 PM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

laison

  • Guest
Re: Need Help on Lisp & DCL
« Reply #14 on: October 31, 2010, 07:31:09 PM »
Cab

I just downloaded and tried the passem-cab & assembly-cab files.

I got this:

; error: quit / exit abort

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Need Help on Lisp & DCL
« Reply #15 on: October 31, 2010, 07:48:16 PM »
Did you revise the code to suit your configuration ??

What line did the code error on ?? (loaded from the VLIDE)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

laison

  • Guest
Re: Need Help on Lisp & DCL
« Reply #16 on: October 31, 2010, 08:36:24 PM »
Kerry-

I am now recieving a "; error: quit / exit abort" from the passem-cab & assembly-cab files.

On the previous revised version I waw getting the following:

Error: in dialog file
"C:\Program Files\AutoCAD 2004\Support\Assemblies\ASSEM", line 15:

missing semicolon.

Error: in dialog file
"C:\Program Files\AutoCAD 2004\Support\Assemblies\ASSEM", line 15:

syntax error.

Symbol: "(setq ASM "ASSEM01")(mode_tile"accept"0)(set_tile "Assemblies"

"._Assembly01".

Error: in dialog file
"C:\Program Files\AutoCAD 2004\Support\Assemblies\ASSEM", line 15:

newline in string constant.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Need Help on Lisp & DCL
« Reply #17 on: October 31, 2010, 09:14:22 PM »
Did you revise the code to suit your configuration ??

What line did the code error on ?? (loaded from the VLIDE)

Kerry-

I am now recieving a "; error: quit / exit abort" from the passem-cab & assembly-cab files.

On the previous revised version I waw getting the following:

< .. snip .. >

I was referring ONLY to CAB's code since you said there was an error with it.
I don't have time ( or the slides etc) to check, but if you answer the questions relating to CAB's code finding the cause of the problem may be easier.

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Need Help on Lisp & DCL
« Reply #18 on: October 31, 2010, 09:49:43 PM »
Try this version and post what you get at the command prompt.

Thanks

Code: [Select]
;;PASSEM.LSP Written by: UD
(defun C:PASSEM( / P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13
                               #TOP #BOT A1 D1 D2 S1 E1 E2 *error*)
(defun *error* (msg)
  (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
      (princ (strcat "\n** Error: " msg " **")))
  (vl-bt)
  (princ)
)
  (setq debugCAB t)
  (if (= *usermode* "CAB")   ; debug
    (setq #MENUDIR  "")
    (setq #MENUDIR  "C:\Program Files\AutoCAD 2004\Support\Assemblies\ASSEM")
  )
  (defun lookup (idx / tmp)
    (setq tmp
    (cadr (assoc idx
         '(("I00" nil)
           ("I01" "Std. Flanged Pair Assembly")
           ("I02" "Flanged Gate Valve Assembly")
           ("I03" "Flanged Ball Valve Assembly")
           ("I04" "Flanged Check Valve Assembly")
           ("I05" "Flanged Plug Valve Assembly")
           ("I06" "Flanged Globe Valve Assembly")
           ("I07" "Std. Flange & Blind Assembly")
           ("I08" "Common SWxSC Vent/drain Assembly")
           ("I09" "Gasket and RFWN Flange Assembly")
           ("I10" "Weldolet, RFWN Flange and Gasket Assembly")
           ("I11" "Gasket, WN Flange, Pipe, WN Flange, Gasket, Assembly")
           ("I12" "Gasket, WN Flange, Pipe, Assembly")
           ("I13" "Gasket, Slip-on Flange, Pipe, Slip-on Flange, Gasket, Assembly")
           ("I14" "Gasket, Slip-on Flange, Pipe, Assembly")
           ("I15" "")
           ("I16" "")
           ("I17" "Common Vent/Drain Assembly, Threaded")
           ("I18" "Common Vent/Drain Assembly, Threaded, For Small Bore Piping")
          )
    )))
    (if tmp tmp "") ; always return a string
  )
 
  (defun assm_help ()
    (alert
      (strcat
        "PasSem.lsp                                      (c) 2010 Laison\n"
        "Please report any problems you may have to Laison\n"
        )
    )
  ) ;end defun help
 
  (defun assm_info ()
    (alert
      (strcat
        "PasSem.lsp Version1.0 10.30.2010 (c) 2010 Laison\n"
        ""
        )
    )
  ) ;end defun help

 
  (and debugCAB (princ "\nLoading DCL file"))
  (setq Dat (load_dialog (strcat #MENUDIR "ASSEMBLY-CAB.DCL")))
  (and debugCAB (princ "\nLoading dialog"))
  (if (not (new_dialog "ASM01" Dat)) (exit))
  (and debugCAB (princ "\nPrepairing slides"))
  (setq H (dimy_tile "I01"))
  (setq W (dimx_tile "I01"))
 
  (setq CNT 0)
  (repeat 30
    (setq CNT (+ CNT 1)
          suf (itoa cnt))
    (if (< CNT 10) (setq suf (strcat "0" suf)))
    (start_image (strcat "I" suf))
    (slide_image 0 0 W H (strcat #MENUDIR "ASM(ASM" suf ")"))
    (end_image)
  )

  (action_tile "help" "(assm_help)")
  (action_tile "info" "(assm_info)")
  (action_tile "accept" "(done_dialog 1)")
  (action_tile "cancel" "(done_dialog 0)")
 
  (and debugCAB (princ "\nStarting dialog"))

  (setq Ok (start_dialog))
  (unload_dialog Dat)
  (and debugCAB (princ "\nDialog closed ok"))
  (if (= OK 1)
    (assembly ASM)
  )
  (princ)
)
« Last Edit: October 31, 2010, 09:59:26 PM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

laison

  • Guest
Re: Need Help on Lisp & DCL
« Reply #19 on: October 31, 2010, 11:29:00 PM »
Cab
This is what I got:


Loading DCL file
Loading dialog
Backtrace:
[0.46] (VL-BT)
[1.42] (*ERROR* "quit / exit abort")
[2.37] (_call-err-hook #<SUBR @05f791b8 *ERROR*> "quit / exit abort")
[3.31] (sys-error "quit / exit abort")
:ERROR-BREAK.26 nil
[4.23] (EXIT)
[5.19] (C:PASSEM)
[6.15] (#<SUBR @05f79258 -rts_top->)
[7.12] (#<SUBR @05eb0334 veval-str-body> "(C:PASSEM)" T #<FILE internal>)
:CALLBACK-ENTRY.6 (:CALLBACK-ENTRY)
:ARQ-SUBR-CALLBACK.3 (nil 0)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Need Help on Lisp & DCL
« Reply #20 on: November 01, 2010, 12:01:49 AM »
OK a little more error checking.
Code: [Select]
;;PASSEM.LSP Written by: UD
(defun C:PASSEM (/ P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 #TOP #BOT A1 D1 D2 S1 E1 E2
                 dcl# *error*)
  (defun *error* (msg)
    (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
        (princ (strcat "\n** Error: " msg " **"))
    )
    (vl-bt)
    (princ)
  )
  (setq debugCAB t)
  (if (= *usermode* "CAB")              ; debug
    (setq #MENUDIR "")
    (setq #MENUDIR "C:\Program Files\AutoCAD 2004\Support\Assemblies\ASSEM")
  )
  (defun lookup (idx / tmp)
    (setq tmp
           (cadr
             (assoc idx
                    '(("I00" nil)
                      ("I01" "Std. Flanged Pair Assembly")
                      ("I02" "Flanged Gate Valve Assembly")
                      ("I03" "Flanged Ball Valve Assembly")
                      ("I04" "Flanged Check Valve Assembly")
                      ("I05" "Flanged Plug Valve Assembly")
                      ("I06" "Flanged Globe Valve Assembly")
                      ("I07" "Std. Flange & Blind Assembly")
                      ("I08" "Common SWxSC Vent/drain Assembly")
                      ("I09" "Gasket and RFWN Flange Assembly")
                      ("I10" "Weldolet, RFWN Flange and Gasket Assembly")
                      ("I11" "Gasket, WN Flange, Pipe, WN Flange, Gasket, Assembly")
                      ("I12" "Gasket, WN Flange, Pipe, Assembly")
                      ("I13" "Gasket, Slip-on Flange, Pipe, Slip-on Flange, Gasket, Assembly")
                      ("I14" "Gasket, Slip-on Flange, Pipe, Assembly")
                      ("I15" "")
                      ("I16" "")
                      ("I17" "Common Vent/Drain Assembly, Threaded")
                      ("I18" "Common Vent/Drain Assembly, Threaded, For Small Bore Piping")
                     )
             )
           )
    )
    (if tmp  tmp  "" )          ; always return a string
  )

  (defun assm_help ()
    (alert
      (strcat
        "PasSem.lsp                                      (c) 2010 Laison\n"
        "Please report any problems you may have to Laison\n"
      )
    )
  )                                     ;end defun help

  (defun assm_info ()
    (alert
      (strcat
        "PasSem.lsp Version1.0 10.30.2010 (c) 2010 Laison\n"
        ""
      )
    )
  )                                     ;end defun help


  (and debugCAB (princ "\nLoading DCL file"))

  (setq dclfile (strcat #MENUDIR "ASSEMBLY-CAB.DCL"))
  (cond
    ((not (findfile dclfile))
     (prompt (strcat "\nCannot find " dclfile "."))
    )
    ((< (setq dcl# (load_dialog dclfile)) 0) ; Error
     (prompt (strcat "\nCannot load " dclfile "."))
    )
    ((not (new_dialog "ASM01" dcl#))    ; Error
     (prompt (strcat "\nProblem with " dclfile "."))
    )
    (t                                  ; No DCL problems: fire it up
     (and debugCAB (princ "\nPrepairing slides"))
     (setq H (dimy_tile "I01"))
     (setq W (dimx_tile "I01"))

     (setq CNT 0)
     (repeat 30
       (setq CNT (+ CNT 1)
             suf (itoa cnt)
       )
       (if (< CNT 10)
         (setq suf (strcat "0" suf))
       )
       (start_image (strcat "I" suf))
       (slide_image 0 0 W H (strcat #MENUDIR "ASM(ASM" suf ")"))
       (end_image)
     )

     (action_tile "help" "(assm_help)")
     (action_tile "info" "(assm_info)")
     (action_tile "accept" "(done_dialog 1)")
     (action_tile "cancel" "(done_dialog 0)")

     (and debugCAB (princ "\nStarting dialog"))

     (setq Ok (start_dialog))
     (unload_dialog dcl#)
     (and debugCAB (princ "\nDialog closed ok"))
     (if (= OK 1)
       (assembly ASM)
     )

    )                                   ; end cond T
  )                                     ; end cond

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

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Need Help on Lisp & DCL
« Reply #21 on: November 01, 2010, 01:31:12 AM »

laison 

Are you loading the code from the VLide ?? Can you do so.

In the VLide,  select the debug Menu and please toggle on Break On Error

then when you get an error,
In the VLIDE
Select Debug Menu -> Last Break Source ..

This should highlight the line/lines the error is on.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

laison

  • Guest
Re: Need Help on Lisp & DCL
« Reply #22 on: November 01, 2010, 09:37:10 PM »
Cab

I just ran it through Vlide. I attached a file that has the highlighted parts.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Need Help on Lisp & DCL
« Reply #23 on: November 01, 2010, 10:10:27 PM »

Which line goes it error at. ??
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

laison

  • Guest
Re: Need Help on Lisp & DCL
« Reply #24 on: November 01, 2010, 10:20:29 PM »
This is what I am getting now:

Command: passem

Loading DCL file
Cannot find C:Program FilesAutoCAD 2004SupportAssembliesASSEMASSEMBLY-CAB.DCL.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Need Help on Lisp & DCL
« Reply #25 on: November 01, 2010, 10:29:16 PM »
change this

(setq #MENUDIR "C:\Program Files\AutoCAD 2004\Support\Assemblies\ASSEM")


to this

(setq #MENUDIR "C:\\Program Files\\AutoCAD 2004\\Support\\Assemblies\\ASSEM\\")


BUT ...


use the folder name address to YOUR files
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

laison

  • Guest
Re: Need Help on Lisp & DCL
« Reply #26 on: November 01, 2010, 10:43:46 PM »
Nice try but no cigar......

Loading DCL file
Cannot find C:\Program Files\AutoCAD
2004\Support\Assemblies\ASSEM\ASSEMBLY-CAB.DCL


CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Need Help on Lisp & DCL
« Reply #27 on: November 01, 2010, 11:11:27 PM »
OK try this:

Code: [Select]
(setq #MENUDIR "C:/Program Files/AutoCAD 2004/Support/Assemblies/ASSEM/")
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

laison

  • Guest
Re: Need Help on Lisp & DCL
« Reply #28 on: November 01, 2010, 11:19:04 PM »
I looked at the line that you just me and played with it.

    (setq #MENUDIR "C:\\Users\\Laison\\My Documents\\Slides\\")

The dcl box finally appeared...........



CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Need Help on Lisp & DCL
« Reply #29 on: November 01, 2010, 11:30:27 PM »
Oh good 8-)

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