Put events on a timer?
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Put events on a timer?

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
Bob Quinn
Guest





Posted: Mon Dec 27, 2004 12:37 am    Post subject: Put events on a timer? Reply with quote

Is it possible to trigger an autolisp routine to activate
lets say, every 5 minutes? I have a progress tracking system I would like
to be able to call the update routine automatically. Thanks for your help :)

Back to top
Laurie Comerford
Guest





Posted: Mon Dec 27, 2004 1:00 am    Post subject: Re: Put events on a timer? Reply with quote

Hi Bob,

Could you put a reactor on the Autosave event ?

--


Laurie Comerford
CADApps
www.cadapps.com.au

"Bob Quinn" <rcm@eesc.com> wrote in message news:41cee8da$1_1@newsprd01...
Quote:
Is it possible to trigger an autolisp routine to activate
lets say, every 5 minutes? I have a progress tracking system I would like
to be able to call the update routine automatically. Thanks for your help
:)

Back to top
Kent Cooper, AIA
Guest





Posted: Mon Dec 27, 2004 6:56 pm    Post subject: Re: Put events on a timer? Reply with quote

Long before there was Autosave, we had the cancel buttons on our tablet
pucks programmed to cancel AND then check the drawing timer, and if it had
been running for more than some set time, offer to save the drawing. If you
said yes, it would reset the timer, and the Save tablet menu items also
reset it. Since we have lots of ordinary commands on tablet menu items
built to repeat automatically, everyone used cancel often enough that it
worked well as a surrogate autosave feature. And because it was tied to
cancel, it never interfered with any ongoing commands.

You could do that kind of thing if you use a puck with a cancel button. Or
is it possible to "redefine" cancel to do something like that? (Cancel
isn't a "command" of the same kind as others, so maybe it can't be
redefined, but maybe you can assign a modified function to the Escape key.)

--
Kent Cooper, AIA


"Bob Quinn" wrote...
Quote:
Is it possible to trigger an autolisp routine to activate
lets say, every 5 minutes? I have a progress tracking system I would like
to be able to call the update routine automatically. Thanks for your help
:)


Back to top
pablorico21
Guest





Posted: Mon Dec 27, 2004 8:40 pm    Post subject: Re: Put events on a timer? Reply with quote

You could use Visual Basic (not VBA), but you will need a Microsoft Visual Basic compiler(Microsoft Visual Studio). In Visual Basic we have timer object. It's just a way...
Back to top
Bill DeShawn
Guest





Posted: Tue Dec 28, 2004 1:56 am    Post subject: Re: Put events on a timer? Reply with quote

Why not just hit the save button on the drop-down menu. It does two cancels
before it saves.
^C^C_qsave
Why on earth do you need another piece of hardware? Move your wrist an inch
or so and use the one-click buttons that are available.
If you think you can't lose the puck, assign the macro above to a button.

If you want an automatic save, you could undefine MOVE and write a routine
for acad.lsp like this:
(command "undefine" "move")
(defun c:move ()
(command "_.undo" "_begin")
(command "_.move" )
(while (= (getvar "cmdactive") 1)) (command pause))
(command "_.undo "_end")
(command "_.qsave")
(princ)
)
(defun c:m () (c:move) (princ))
This way every time you exit a move command, you automatically save.

I didn't test the above code, so, if it's wrong, get some help. I'll help
you again, too.
--
Bill DeShawn
bdeshawn@nospamsterling.net
http://my.sterling.net~bdeshawn

"Kent Cooper, AIA" <kcooper@schwamarchitects.com> wrote in message
news:41d0146e_1@newsprd01...
Quote:
Long before there was Autosave, we had the cancel buttons on our tablet
pucks programmed to cancel AND then check the drawing timer, and if it had
been running for more than some set time, offer to save the drawing. If
you
said yes, it would reset the timer, and the Save tablet menu items also
reset it. Since we have lots of ordinary commands on tablet menu items
built to repeat automatically, everyone used cancel often enough that it
worked well as a surrogate autosave feature. And because it was tied to
cancel, it never interfered with any ongoing commands.

You could do that kind of thing if you use a puck with a cancel button.
Or
is it possible to "redefine" cancel to do something like that? (Cancel
isn't a "command" of the same kind as others, so maybe it can't be
redefined, but maybe you can assign a modified function to the Escape
key.)

--
Kent Cooper, AIA


"Bob Quinn" wrote...
Is it possible to trigger an autolisp routine to activate
lets say, every 5 minutes? I have a progress tracking system I would
like
to be able to call the update routine automatically. Thanks for your
help
:)

Back to top
Kent Cooper, AIA
Guest





Posted: Tue Dec 28, 2004 3:46 am    Post subject: Re: Put events on a timer? Reply with quote

Read it again. It wasn't really about saving at all (the original poster
mentioned a different kind of routine they want to activate), or about
canceling. I just gave my old save-check case as an example of a way to
trigger something based on elapsed time, which is what they were looking
for. My example used a menu item that invoked cancel as a trigger to check
the elapsed timer, and if it had gone past the specified time, to do
something (in my example, asking whether you want to save, and presumably in
the original poster's case, activating their routine). It's a feature we
used to use long ago (as I said, before there was Autosave), and we haven't
used it since Autosave came along. In fact, if the OP wanted to see the
code for it as a starting point to edit for invoking their routine, I don't
think I even have any copies of menu files old enough, so I'd have to try to
recall how it was actually done.

The problem I see for most people these days is that it was triggered by the
digitizer puck cancel button, and not many people use digitizers any more.
Those buttons can be programmed to do anything you want (just like any other
kind of menu item) -- the "standard" was to have one of them be Cancel, and
we just modified that to add the elapsed-timer check. I kind of assume the
Escape key can't be programmed, so maybe the tieing-it-to-Cancel approach
can't be used by mouse-people, unless, as you say, it's put into a button or
something. Maybe the Cancel item in the little context-popup menu-lets can
be programmed this way, but I'd bet most people are more likely to hit Esc
than to use those.

Personally, I wouldn't want to redefine any command to include saving,
because you can't easily undo the effects of a command that alters the
drawing file itself, rather than the stuff you have loaded in the drawing
editor. If you opened a drawing, worked in it for a while (including doing
some of whatever command you redefine to include saving), and then decide
you didn't want to keep any of what you had done, you couldn't just close or
quit and tell it you didn't want to save your changes, because it would
already have saved some of them. You'd have to undo repeatedly all the way
back, and then save again, if you wanted to restore the drawing to its
condition when you opened it.

That was the beauty of tieing our elapsed-time check to Cancel (it wasn't
invoked by any drawing or editing command), and having it not just
automatically save, but rather ask you whether you wanted to. But the OP
could certainly program such a timer-check item to just do their routine,
without asking or even notifying the user, if that's appropriate for their
purposes.
--
Kent Cooper, AIA


"Bill DeShawn" wrote...
Quote:
Why not just hit the save button on the drop-down menu. It does two
cancels
before it saves.
^C^C_qsave
Why on earth do you need another piece of hardware? Move your wrist an
inch
or so and use the one-click buttons that are available.
If you think you can't lose the puck, assign the macro above to a button.

If you want an automatic save, you could undefine MOVE and write a routine
for acad.lsp like this:
(command "undefine" "move")
(defun c:move ()
(command "_.undo" "_begin")
(command "_.move" )
(while (= (getvar "cmdactive") 1)) (command pause))
(command "_.undo "_end")
(command "_.qsave")
(princ)
)
(defun c:m () (c:move) (princ))
This way every time you exit a move command, you automatically save.

I didn't test the above code, so, if it's wrong, get some help. I'll help
you again, too.
--
Bill DeShawn

"Kent Cooper, AIA" wrote...
Long before there was Autosave, we had the cancel buttons on our tablet
pucks programmed to cancel AND then check the drawing timer, and if it
had
been running for more than some set time, offer to save the drawing. If
you
said yes, it would reset the timer, and the Save tablet menu items also
reset it. Since we have lots of ordinary commands on tablet menu items
built to repeat automatically, everyone used cancel often enough that it
worked well as a surrogate autosave feature. And because it was tied to
cancel, it never interfered with any ongoing commands.

You could do that kind of thing if you use a puck with a cancel button.
Or
is it possible to "redefine" cancel to do something like that? (Cancel
isn't a "command" of the same kind as others, so maybe it can't be
redefined, but maybe you can assign a modified function to the Escape
key.)
--
Kent Cooper, AIA

"Bob Quinn" wrote...
Is it possible to trigger an autolisp routine to activate
lets say, every 5 minutes? I have a progress tracking system I would
like
to be able to call the update routine automatically. Thanks for your
help
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB