Loading error...

Loading error...

zph
Collaborator Collaborator
978 Views
2 Replies
Message 1 of 3

Loading error...

zph
Collaborator
Collaborator

Good day everyone.

 

I have been using my routine BUBREF for months now without error.  Recently, however, something weird is happening.

 

When I load the routine, using another routine that loads an entire list of routines, this happens:

 

Command: (c:LOADLISPS)

Command:
Command:
Command: BUBREF

 <N> Include "TO SH #"? [Y/N]: n

 <A> Type 1 or 2 starting letters: a

 <.> Pick an insertion point for: A

 <.> Pick an insertion point for: A

 <.> Pick an insertion point for: A

 <.> Pick an insertion point for: A


 3 cable reference bubbles inserted
 <!> Routine complete <!>

 

 

 

When I manually open up windows explorer, and drag n' drop the routine into AutoCAD, the routine runs correctly:

 

 

Command: (LOAD "C:/Users/HULLZP/Desktop/CUSTOM/BUBREF.lsp") INCREASE

Command:
Command:
Command: BUBREF

 <N> Include "TO SH #"? [Y/N]: n

 <A> Type 1 or 2 starting letters: a

 <.> Pick an insertion point for: A

 <.> Pick an insertion point for: B

 <.> Pick an insertion point for: C

 <.> Pick an insertion point for: D


 3 cable reference bubbles inserted
 <!> Routine complete <!>

 

There seems to be nothing "wrong" with the routine itself, but something seems inconsistant in the loading process within AutoCAD.  Any ideas on what might be happening here?

 

Thanks!

 

EDIT:  included the file as an attachment for those interested.

0 Likes
Accepted solutions (1)
979 Views
2 Replies
Replies (2)
Message 2 of 3

jdiala
Advocate
Advocate
Accepted solution

Try to put your sub functions in your main code and localized them. You probably have another function with the same name loaded after your sub functions has been loaded.

 

Also you are setting cmdecho to 0 and didn't set it back to 1 unless the program terminates with an error. 

 

 

(vl-load-com); put this outside your main, you don't need to load this each time you run your command

(defun c:bubref ( / adoc eFlag cntr lNames lCntr sList dList ssLines *error*
			toSH sL toSHp cIP sP eP sPx sPy ePx ePy PorE PorEx PorEy LS LC create increase adjust)
(defun *error*)
(defun create () ) (defun increase () ) (defun adjust () ) ;;your code .... (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
(vla-startundomark adoc) ;;your code ....
)

 

Message 3 of 3

zph
Collaborator
Collaborator

Thank you for your response, jdiala.

 

And thank you for pointing me in the right direction.  The function name "increase" was being overloaded by another routine.  I altered the function names to be unique and the issue is resolved.

 

Also, with regard to the error catching, I do my best to always end my routines within the error catch so (usually) your concern isn't an issue 🙂

 

Thanks again and have a good one!

 

~Z

0 Likes