My experience has been that as soon as a lisp routine is invoked,
either by means of a keyboard hotkey, or a pulldown menu, the UNDO
command becomes dysfunctional. The UNDO item under EDIT becomes
greyed out, and UNDo cannot be invoked by any means whatsoever. A
partial, but clumsy, remedy seems to be to save the drawing,
whereafter UNDO again works properly until a lisp routine is called
up.
This leaves me with the agonizing choice of abandoning hundreds of
hours of lisp programmes developed over almost twenty years, or
abandoning ZWCad. I think lisp development will win the
contest...unless of course R&D at ZW Cad pays attention to this
shortcoming.
Moral of the story is that ZWCAD and Autolisp may not be such good
friends as the salespeople would like us to believe.
> I'm using ZwCAD with my own lisp programs and I haven't deal yet
> with the bug you mentioned.
OK, how exactly do you start the lisp programs ? I start mine from
customised pulldown menus and keyboard hotkeys. This means they sit
and wait while the session is in progress. The longer the session
lasts, the more programmes sit and wait. I've never experienced any
hiccups in Autocad following the same procedure.
> I wonder if you are missusing the Undo command inside your lisp
> routines.
Nowhere in the lisp programs do I use the UNDO command. I assigned
UNDO to the U key in the ALIAS function inside ZWCAd
> I use initiallization and termination subs inside every routine, so I
> can set the original state of variables, layers, properties, etc. after
> a lisp ejecucion.
As far as possible I also try to reset everything, but I do not
think this should cause any problems. Just some irritation perhaps.
I may sit with a different UCS or angular units after lisp, but
notheing that cannot be reset quickly.
>
> Hi Hennie,
>
> which contact do you have to ZWCAD ? Are you user or do you sell
> ZWCAD ?
I am a user, migrating from Autocad.
> There will be a new update of ZWCAD on 30.07. and i think many bugs will
> be fixed. Maybe your problem could be included when it's pushed to the
> right people at ZWSOFT.
I sent my modified zwcad.lsp, and keyboard hot-keys which I use, to
support, but have not received any response.
I use a modified zwcad.lsp, which sets a few system variables and
loads a number of keyboard hotkeys.
> Hi Hennie,
> This is indeed a problem. I discovered it myself last week and will also
> send my feedback to ZwCAD support.
Thank you very much. I am convinced a request by a dealer carries
more weight than from a single user...the very reason why this
mailing list was started.
> They are usually very serious about
> solving bugs. This is a real serious one and you can count on me that I
> will make it very clear that it needs to be solved. We have hundreds of
> Lisp-routines for ZwCAD that we sell and support in The Netherlands and
> Belgium.
Indeed a serious problem. There must be hundreds if not thousands of
users who bring with them decades of in-house developed custom
lisps. If they have to choose between ZWCAd and custom programmes,
the choice is obvious.
> Best regards and please give them some time to solve it!
Like another user once said, at a tenth of the price something will
have to be sacrificed. As long as I know the problem is receiving
attention, a reasonable time is not much to ask. But if the problem
persists, a choice will eventually have to be made.
>
> Siem
> ZwCAD Distributor The Netherlands
Forgive me for expressing my utter disgust to the fact that a dealer
from the Netherlands lends his support to this problem while my own
dealer, who is subscribed to this list as well as the ZWCad forum,
just maintains a deadly silence.
> Hi Hennie,
>
> Instead of having all your lisp routine loaded on all at once with
> ZWCAD.lsp, try breaking them down to 1 file per routine, and
> placing them in a folder.
This is how I start some lisps - the "bigger" ones. The are fired
up by means of a pulldown menu, through a custom add-on menu file
which is loaded through the ZWcad custom feature.
Typically, the menu item looks like this:
[Parallel]^C^C(if(not c:forcepar)(load"c:/data/lisp/forcepar");+
(princ "Already loaded.."));forcepar
The routine FORCEPAR is to force a text string parallel to a line
or another text string.
> This way only the ones you need are loaded as
> you need them. I use autoload to run my routines which allows the
> computer to load the routine as i call on them and (if i understand it
> correctly) unloads them as soon as they are done.
Is "autoload" the same as "load" ? Sorry I am no hotshot lisp geek.
Problem is some of them define keyboard hotkeys where ALIAS falls
short. For instance, to draw a line it is quite sufficient to assign
the command LINE to the alias L. But, if you frequently draw lines
between nodes, its handy to have hotkeys like LNN (thats line node
node) do the job. That needs a small lisp which must be present
always. BTW I also tried invoking the hotkeys from outside the
keyboard lisp file, using LOAD.
Either way, the presence of lisp routines screws up the ZWcad UNDO
command.
> Hi, everybody
> I have submit to zwsoft the similar problem with UNDO in the lisp and
> have receive the following answer:
> As for the lisp problem you mentioned, I have made a sample of UNDO
> command according to your email, but the CRASH problem didn´t occur in
> my PC. Maybe I haven´t got your mind exactly, so I attached my sample,
> please check it. If it is different from yours, please send us your
> complete sample. Thanks.
The problem in this discussion is not the lisp code. It has to do
with the fact that a lisp program, while resident in program memory,
seems to prevent the UNDO command from working. In other words, if
one loads a lisp routine and executes it, then you cannot undo (or
redo) anything. The ZWcad command UNDO, either by typing UNDO, or
by pressing CtrlZ, or by using the EDIT pulldown menu, or by typing
U (if so defined as an alias) refuses to work. It matters not what
the lisp code consists of.
> Hi Hennie,
>
> I supposed this issue is not due to hot key nor aliases, but lisp
> command.
That is correct - my conclusion too.
> After debugging your lisp applications, I found that it is caused by
> the lisp function " c:LL( )".
> I simulated another lisp routine as
> follow:
>
>(defun c:LL( )
>(command "lengthen" "DY" )
> )
Just to get the right perspective: "debugging" normally means
removing mistakes. The lisp routine is a short, simple three liner
which adds a bit more speed and power to the lengthen command. There
is nothing wrong with the code as such, it is the PRESENCE of the
code, and others like it, that causes the problem.
In other words, changing the code will not solve anything.
> (BTW, you don´t have to set "U" as alias of UNDO. It has been
> defined by
> default.),
That is correct. But there are other aliases which I have been using
for 20 years, which are not the same as as the ZW default aliases.
Therefore, I defined my own .ica file, making use of the ZWcad
facility for custom aliases.
> Then I got to a conclusion: it's caused by the lisp function.
> I have forwarded this issue to our developers to solve.
Again, yes, that was my conclusion too. But again, for clarity, it
is not the lisp function that is at fault, but the PRESENCE of the
function, or any (maybe some) other functions as well. I can hardly
imagine a simpler function than the LL.lsp one.
> Thanks for
> your
> great effort for the enhancement of ZWCAD!
I gladly share two decades of cad customisation with others based on
the open source principle. However, there are people out there far
more knowledgable than I am. Some of them do contribute, but just
imagine what can be achieved if more people will contribute.
>
> Hennie,
>
> autoload is pretty much the same as load expect that it removes/
> unloads the routine from the memory once it has finished
> executing.
> The syntax use for this is:
>
> (autoload "forcepar" ' ("forcepar")
Maybe just add a ) at the end.....
Okay I tried tis, it works but does not solve the problem of the
dysfunctional UNDO command.
More on autoload from Autocad HELP file:
When you automatically load a command using the load or command
functions, the command's definition takes up memory whether or not
you actually use the command. The AutoLISP autoload function makes a
command available without loading the entire routine into memory.
Adding the following code to your acaddoc.lsp file automatically
loads the commands CMD1, CMD2, and CMD3 from the cmds.lsp file and
the NEWCMD command from the newcmd.lsp file.
(autoload "CMDS" '("CMD1" "CMD2" "CMD3"))
(autoload "NEWCMD" '("NEWCMD"))
Death to the bugs !!
> > > (autoload "forcepar" ' ("forcepar")
> >
> > Maybe just add a ) at the end.....
> >
> > Okay I tried tis, it works but does not solve the problem of the
> > dysfunctional UNDO command.
> >
>
> You're right it should read:
>
> (autoload "forcepar" ' ("forcepar"))
>
> Thanks for the correction.
I suppose everybody knows that LISP stands for List Processing.
Well you are all wrong.
It stands for Lost In Stupid Parenthesis
I don't have problems with my lisp in 2010.
William
(setq p1 (osnap (getpoint "\Pick intersection: ") "int"))
It works perfectly in 2009i, but crashes in 2010.
If the safety feature is omitted, namely:
(setq p1 (getpoint "\Pick point: ") )
it works in 2010, but it will now snap onto anything, even a void.
How do I work around this, other than to go back to 2009i. I need
the safety feature like I need oxygen.
> --
> You received this message because you are subscribed to the Google
> Groups "ZWCad Users" group. To post to this group, send email to
> zwcad...@googlegroups.com. To unsubscribe from this group, send
> email to zwcadusers+...@googlegroups.com. For more options,
> visit this group at http://groups.google.com/group/zwcadusers?hl=en.
>