Jump to content

Recommended Posts

Posted

Well I'm back again. I have created an acaddoc.lsp file (see attached) with my lisps listed to load. The first 8 or so load and run fine but then no more load. I have attached the file from the startup of cad but there are no lines indicating which lisp may be interupting it. What else could i try to move on??

 

Thanks

acaddoc.lsp

AutoCAD Startup.txt

  • Replies 26
  • Created
  • Last Reply

Top Posters In This Topic

  • woodman78

    12

  • Lee Mac

    8

  • rkmcswain

    5

  • NBC

    1

Posted

There is nothing wrong with the "acaddoc.lsp" file.

It loads fine here.

Of course I don't have any of the files it's trying to load, but I put a call at the very end to load a file that I do have and the file loaded just fine.

Posted

I guess the only option I could think of would be to truncate the list of loadings lisps (bit of a mouthful, that !) i.e. do the first one, check it is loaded, etc. then add the next one, check they load; and so on until you find the one that is not loading.

Posted

Thanks,

 

I have gone down through the acaddoc to see what runs and what doesn't. The first one i hit was the file attached below. This is a lisp that someone here helped me with to create a backup folder and copy the drawing out to the folder. This ran fine in 2007 but now even when i load it with appload and run it nothing happens. The command line just returns another blank command line. It has loaded but seems not to run. There are no errors listed.

 

Could someone have a look and tell me is there something I need to change for 2010?

 

Thanks.

Bckup.lsp

Posted

The only thing that would cause you to receive a loading error (apart from missing file etc), is if there are incorrect LISP statements that are evaluated outside of the main function definition (defun).

 

After looking at the Bckup.lsp that you attached, this does not seem to be the case.

Posted
Thanks,

 

I have gone down through the acaddoc to see what runs and what doesn't. The first one i hit was the file attached below. This is a lisp that someone here helped me with to create a backup folder and copy the drawing out to the folder. This ran fine in 2007 but now even when i load it with appload and run it nothing happens. The command line just returns another blank command line. It has loaded but seems not to run. There are no errors listed.

 

I'm assuming that this thread is no longer about the "Acaddoc.lsp" now...?

 

Could someone have a look and tell me is there something I need to change for 2010?

 

Thanks.

 

It runs fine here in 2010.

 

To test on your system....

Open the VLIDE, load the file, then load the code from inside the VLIDE.

Now run it. Any unhandled errors should stop the VLIDE, then you can view the "error trace" to see where the code stopped.

Posted

R.K.

 

I am going through the lsp's systematically and isolating which one's are preventing the acaddoc.lsp from continuing to load. I get the following error when one of my lisps loads. Do you know what the problem is?

 

Type bglegend to start program.; error: AutoCAD variable setting rejected:

"cmdecho" nil

I attach the lisp and dcl.

bglegend.lsp

bglegend.dcl

Posted

Sounds like something is trying to set CMDECHO to nil, but there is no call like that in the lisp code you posted.

Posted

R.K.

I have gone through the files listed in the acaddoc and found the first one that mentions cmdecho. Here it is. It sets a variable to cmdecho and then resets it at the end. Do I need to remove that line altogether???

Posted

There is nothing in that code that is outside of a function definition (defun), and hence will run upon loading - so that does not appear to be the problem code.

 

You need to look for code that lies outside of a function definition (defun), that will be evaluated upon loading. :)

Posted

There are some of my lisps greyed out in the window in appload that are not in the contents. They are not in the cui:lisp files either. Can i remove these and go through the lisps in the acaddoc file one by one? If so how do i remove them.

Posted

Perhaps the easiest thing would be to just load each LISP manually through the VLIDE, and you should be able to spot the problem.

Posted

LeeMac, is there some kind of way of finding errors in vlide??

 

How do I go about it?

Posted
LeeMac, is there some kind of way of finding errors in vlide??

 

How do I go about it?

 

Open the VLIDE.

Open your lisp file.

Load it using the controls in the VLIDE.

Run the code in AutoCAD.

If there is an error, switch back to the VLIDE and check the error trace log.

 

You can also put breakpoints in the code (use F9), and then progress through the code one line at a time using (F5).

  • 3 weeks later...
Posted

I'm not very familiar with vlide so please bear with me.

 

I open the lisp in vlide.

It is loaded in CAD using acaddoc.lsp.....do I need to stop this from happening.

Do i run the lisp from vlide or do I just switch back to Cad and type the commane name.

Do I then go to Window/Trace to find any errors???

 

Thanks

Posted

Just load it again using the VLIDE.

If there is an error, you should see the result in the VL console.

Then go to View>Error Trace to find the location if it isn't obvious.

Posted

Thanks Rick,

 

I got this error when I ran this lisp. What does it mean??

AutoCAD command: (nil)

AutoCAD command: (nil)

AutoCAD command: (nil)

...............

LOG Error trace

...............

:ERROR-BREAK

[2] (SETVAR "cmdpblightho" 1)

[3] (ETRAP "bad argument type: stringp nil")

:ERROR-BREAK

[5] (STRCAT "CCC_PL_" nil)

[6] (OUTPUT)

[7] (VARIABLE)

[8] (POPUP_MF)

[9] (C:BG)

:CALLBACK-ENTRY

:ARQ-SUBR-CALLBACK

...............

Backtrace is out of date

...............

 

 

;//////////////////////////////////////////////////////////////////////////
;
; Start-Up Function
;
(defun C:BG ()
 (POPUP_MF)
 (princ)
)
;
;//////////////////////////////////////////////////////////////////////////
;
; Main Function
;
(defun POPUP_MF (/ SIZE$ SIZE SUCE  SUOM  SUSM SUAB SUAD MIDPT PLEN
                  PT01  PT02 a b COLR)
 (setq SUCE (getvar "cmdecho"))
 (setq SUOM (getvar "orthomode"))
 (setq SUSM (getvar "osmode"))
 (setq SUAB (getvar "angbase"))
 (setq SUAD (getvar "angdir"))
 (setq SUCL (getvar "clayer"))
 (setq SUCR (getvar "cecolor"))
 (setq temperr *error*)
 (setq *error* ETRAP)
 (setq S1_list
  '("Proposed 180 PE 4 A" "Proposed 180 PE 4 B"
    "Proposed 150 PE 19 A" "Proposed 150 PE 19 B"
     "Proposed 125 PE 4 A"  "Proposed 125 PE 4 B"
     "Proposed 90 PE 4 A"  "Proposed 90 PE 4 B"
     "Proposed 63 PE 4 A"  "Proposed 63 PE 4 B"
     "--------------------------"
     "Existing 180 PE 4"  "Existing 150 PE 19"
     "Existing 125 PE 4"  "Existing 90 PE 4"
     "Existing 63 PE 4"
   )
 )
 (setq dcl_id (load_dialog "BG.dcl"))
 (if
   (not
     (new_dialog "BG" dcl_id)
   )
   (progn
     (ALERT "Can not find your dcl file")
     (exit)
   )
 )
 (start_list "S1")
 (mapcar 'add_list S1_list)
 (end_list)
 (if SIZE:DEF
   (set_tile "S1" (itoa SIZE:DEF))
 )
 (action_tile "cancel"
  "(done_dialog)(setq userclick nil)"
 )
 (action_tile "accept"
   (strcat
    "(progn
     (setq S:IZE (atoi (get_tile \"S1\")) SIZE:DEF S:IZE)"
    "(done_dialog)(setq userclick T))"
   )
 )
 (start_dialog)
 (unload_dialog dcl_id)
 (if userclick
   (VARIABLE)
 )
 (princ)
)
;
;//////////////////////////////////////////////////////////////////////////
;
; Variable Function
;
(defun VARIABLE ()
 (progn 
   (setq SIZE$ (fix S:IZE))
   (setq SIZE$ (nth S:IZE S1_list))
   (cond
     ((= SIZE$ "Proposed 180 PE 4 A")(setq SIZE$ "PROPOSED_BordGais_180_PE_4_A")(setq LTYP "180PE4A")(setq COLR "177,12,228"))
     ((= SIZE$ "Proposed 180 PE 4 B")(setq SIZE$ "PROPOSED_BordGais_180_PE_4_B")(setq LTYP "180PE4B")(setq COLR "177,12,228"))
     ((= SIZE$ "Proposed 150 PE 19 A")(setq SIZE$ "PROPOSED_BordGais_150_PE_19_A")(setq LTYP "150PE19A")(setq COLR "177,12,228"))
     ((= SIZE$ "Proposed 150 PE 19 B")(setq SIZE$ "PROPOSED_BordGais_150_PE_19_B")(setq LTYP "150PE19B")(setq COLR "177,12,228"))
     ((= SIZE$ "Proposed 125 PE 4 A")(setq SIZE$  "PROPOSED_BordGais_125_PE_4_A")(setq LTYP "125PE4A")(setq COLR "177,12,228"))
     ((= SIZE$ "Proposed 125 PE 4 B")(setq SIZE$  "PROPOSED_BordGais_125_PE_4_B")(setq LTYP "125PE4B")(setq COLR "177,12,228"))
     ((= SIZE$ "Proposed 90 PE 4 A")(setq SIZE$  "PROPOSED_BordGais_90_PE_4_A")(setq LTYP "90PE4A")(setq COLR "177,12,228"))
     ((= SIZE$ "Proposed 90 PE 4 B")(setq SIZE$  "PROPOSED_BordGais_90_PE_4_B")(setq LTYP "90PE4B")(setq COLR "177,12,228"))
     ((= SIZE$ "Proposed 63 PE 4 A")(setq SIZE$  "PROPOSED_BordGais_63_PE_4_A")(setq LTYP "63PE4A")(setq COLR "177,12,228"))
     ((= SIZE$ "Proposed 63 PE 4 B")(setq SIZE$  "PROPOSED_BordGais_63_PE_4_B")(setq LTYP "63PE4B")(setq COLR "177,12,228"))
     ((= SIZE$ "Existing 180 PE 4")(setq SIZE$  "EXISTING_BordGais_180_PE_4")(setq LTYP "180PE4A")(setq COLR "204,81,5"))
     ((= SIZE$ "Existing 150 PE 19")(setq SIZE$  "EXISTING_BordGais_150_PE_19")(setq LTYP "150PE19A")(setq COLR "204,81,5"))
     ((= SIZE$ "Existing 125 PE 4")(setq SIZE$  "EXISTING_BordGais_125_PE_4")(setq LTYP "125PE4A")(setq COLR "204,81,5"))
     ((= SIZE$ "Existing 90 PE 4")(setq SIZE$  "EXISTING_BordGais_90_PE_4")(setq LTYP "90PE4A")(setq COLR "204,81,5"))
     ((= SIZE$ "Existing 63 PE 4")(setq SIZE$  "EXISTING_BordGais_63_PE_4")(setq LTYP "63PE4A")(setq COLR "204,81,5"))
   )
 )
 (setq SIZE SIZE$) 
 (OUTPUT)
 (princ)
)
;
;//////////////////////////////////////////////////////////////////////////
;
; Output Function
;
(defun OUTPUT ()
 (setq a (strcat "CCC_BG_"LTYP)
       b (strcat "CCC_SERVICES_"SIZE)
 )
 (if
   (not
     (tblsearch "LTYPE" a)
   )
   (command "_.-linetype" "_l" a "CCC_BordGais.lin" "")
 )
 (command "_.-layer" "_N" b "_M" b "_L" a b "_C" "_T" COLR b "_LW" "0.3" b "" )
 (command "_-color"  "bylayer")
 (command "._-linetype"  "s"  "bylayer" "")
 (setvar "angbase" 0.0000)
 (setvar "angdir"  0)
 (setvar "orthomode" 0)
 (setvar "osmode"    16383)
 (setq PT01 (getpoint "\nEnter the line start point:"))
 (while
   (/= nil
     (setq PT02 (getpoint pt01 "\nEnter the line end point:"))
   )
   (setvar "osmode" 0)
   (command "_.pline" PT01 PT02 "")
   (setq PT01 PT02)
   (setvar "osmode" 16383)
 )
 (setq *error* temperr)
 (setvar "cmdecho"   SUCE)
 (setvar "orthomode" SUOM)
 (setvar "osmode"    SUSM)
 (setvar "angbase"   SUAB)
 (setvar "angdir"    SUAD)
 (setvar "clayer"    SUCL)
 (setvar "cecolor"    SUCR)
 (princ)
)
;
;//////////////////////////////////////////////////////////////////////////
;
; Error Trap Function
;
(defun ETRAP (errmsg)
 (command nil nil nil)
 (if
   (not
     (member errmsg '("console break" "Function Cancelled"))
   )
   (princ (strcat "\nError:" errmsg))
 )
 (setvar "cmdecho"   SUCE)
 (setvar "orthomode" SUOM)
 (setvar "osmode"    SUSM)
 (setvar "angbase"   SUAB)
 (setvar "angdir"    SUAD)
 (princ "\nError, Restoring Variables.")
 (terpri)
 (setq *error* temperr)
 (princ)
)
;
;//////////////////////////////////////////////////////////////////////////

 

The error Setvar [2] seems to point to a variable that doesn't exist in this lisp???

Posted

It looks like number [5] is causing the error, something similar appears at the top of the the OUTPUT function.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...