TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: sandwichcake on February 23, 2012, 10:18:01 AM

Title: !Slingshot and copyclip problem
Post by: sandwichcake on February 23, 2012, 10:18:01 AM
Hi Swamp,
I work for an electrical consultant using autocad LT 2004 with !Slingshot to allow us to run custom autoLISP.
A few years ago, a system was started for everyone to use, to enforce standards and provide useful functions. I've been tasked with finishing/maintaining the large amount of incomplete and badly documented code left by a previous employee. No one else is familiar with the code.

The major problem I've been having is that sometimes !Slingshot/autocad will just 'forget' how to run lisp. Entering a lisp command gives "; error: no function definition:"
Trying to run a custom function just returns the function name.

Example:
(C:SPGRID is one of our custom lisp functions)
Code: [Select]
Command: (command)
; error: no function definition: COMMAND
Command: spgrid
C:SPGRID
Command:

I have figured out that this always happens after copying something from the drawing to the clipboard, whether via copyclip, copybase, or ctrl+c.
Any help would be much appreciated. I don't even know where to begin with this one. I can't seem to find any evidence online that anyone else has had this problem.

Thanks!
Title: Re: !Slingshot and copyclip problem
Post by: sandwichcake on February 23, 2012, 10:22:55 AM
Oh, I should add that the problem is specific to the drawing that is open. If multiple drawings are open, only the one I copied from loses lisp functionality. Closing and re-opening the dwg fixes the problem (until I copy again)
Title: Re: !Slingshot and copyclip problem
Post by: andrew_nao on February 27, 2012, 09:00:15 AM
Hi Swamp,
I work for an electrical consultant using autocad LT 2004 with !Slingshot to allow us to run custom autoLISP.
A few years ago, a system was started for everyone to use, to enforce standards and provide useful functions. I've been tasked with finishing/maintaining the large amount of incomplete and badly documented code left by a previous employee. No one else is familiar with the code.

The major problem I've been having is that sometimes !Slingshot/autocad will just 'forget' how to run lisp. Entering a lisp command gives "; error: no function definition:"
Trying to run a custom function just returns the function name.

Example:
(C:SPGRID is one of our custom lisp functions)
Code: [Select]
Command: (command)
; error: no function definition: COMMAND
Command: spgrid
C:SPGRID
Command:

I have figured out that this always happens after copying something from the drawing to the clipboard, whether via copyclip, copybase, or ctrl+c.
Any help would be much appreciated. I don't even know where to begin with this one. I can't seem to find any evidence online that anyone else has had this problem.

Thanks!

Example:
(C:SPGRID is one of our custom lisp functions)

Code: [Select]
Command: (command)   <--TAKE THIS OUT

; error: no function definition: COMMAND
Command: spgrid
C:SPGRID
Command:


take out the (command) that is the function its looking for.

im assuming the previous coder was trying to put in a custom cancel command before running the new code.
Title: Re: !Slingshot and copyclip problem
Post by: sandwichcake on February 27, 2012, 09:16:39 AM
Huh? Maybe I didn't explan well, that was the text from the command prompt. I included it to show what happens when trying to run lisp commands (in that example, the 'command' command).

The return should have been:
*Cancel*
COMMAND

instead of:
; error: no function definition: COMMAND
Title: Re: !Slingshot and copyclip problem
Post by: Lee Mac on February 27, 2012, 09:21:54 AM
The return should have been:
*Cancel*
COMMAND

No, it should be:

Code: [Select]
Command: (command)
*Cancel*

Command: nil
Title: Re: !Slingshot and copyclip problem
Post by: sandwichcake on February 27, 2012, 09:29:18 AM
Hmm, I guess you're right Lee, command should always return nil.

The return I showed was what happens on my machine before trying to copyclip. I wonder if that could be related
Title: Re: !Slingshot and copyclip problem
Post by: andrew_nao on February 27, 2012, 11:22:45 AM
in the case you posted, (command) is considered a function.
this code would have to be loaded first before the function is called.
since its not loaded before the function call, it cant find it and thats what you get a no function definition error
Title: Re: !Slingshot and copyclip problem
Post by: sandwichcake on February 27, 2012, 12:57:04 PM
Let me clarify. When I boot up !slingshot, everything works, including (command) or any lisp functions I've written (which get loaded on startup).
But, after I copy an entity, typing lisp functions in the commandline no longer works (giving "; error: no function definition:" then the function name (ex. (COMMAND)).

If I try to run one of my custom lisp functions (for example, SPGRID - but the same happens with any other custom function) - it doesn't run, and the function name w/ C: is returned (so for the example, that would be C:SPGRID).

Except for the way it returns the function name, it's almost as if all lisp functions get unloaded when copyclip is run.
Title: Re: !Slingshot and copyclip problem
Post by: hmspe on February 27, 2012, 07:49:36 PM
This is off topic, but I suggest you consider getting newer software.  LT2004 was one of the better releases (IMO) and !Slingshot was a good and interesting program, but to the best of my knowledge !Slingshot disappeared when DRCAUTO went away.  You can buy Bricscad Classic for $395, or any of several other similar programs, and have much more capability.  You'll also have support from the manufacturer and product updates and fixes, something neither LT22004 nor !Slingshot has.
Title: Re: !Slingshot and copyclip problem
Post by: cmwade77 on February 27, 2012, 07:56:16 PM
This is off topic, but I suggest you consider getting newer software.  LT2004 was one of the better releases (IMO) and !Slingshot was a good and interesting program, but to the best of my knowledge !Slingshot disappeared when DRCAUTO went away.  You can buy Bricscad Classic for $395, or any of several other similar programs, and have much more capability.  You'll also have support from the manufacturer and product updates and fixes, something neither LT22004 nor !Slingshot has.
!Slingshot still exists at: http://www.cad.com.au/drcauto/%21slingshot-max/%21slingshot-max.htm#overview

That being said, you may want to consider alternatives. To me, AutoCAD is become bloated with 1/2 finished features as of late.