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

0 Members and 1 Guest are viewing this topic.

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.