TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Pepe on December 15, 2008, 12:53:42 PM

Title: Could it be possible to write reactors using Autolisp?
Post by: Pepe on December 15, 2008, 12:53:42 PM
I mean, not only reactors, but functions able to stand by stealthily (it's the right word?) wainting for events. And if so, how?
Title: Re: Could it be possible to write reactors using Autolisp?
Post by: CAB on December 15, 2008, 01:19:11 PM
Pepe there are many lisp reactor examples here at the swamp. :)
http://www.theswamp.org/index.php?topic=26380.0
Title: Re: Could it be possible to write reactors using Autolisp?
Post by: Pepe on December 15, 2008, 02:26:59 PM
Thank you for answer, CAB.

I think I was misunderstood (probably my poor, rusty english). I know I can use reactors in Autolisp, but I mean if I can write new types of reactors using Autolisp (not using 'VLR-s').

As far as I know, reactors are stand by functions waiting steathily (I insist  :roll:, It's that the right word?) for events, and I only can use Autolisp for 'one target' (I just can't find them another name :oops:) applications. So, lets suppose I want to write a new reactor that fires only if, let's say, anyother variable than the ones controlled by VLR-SYSVAR-REACTOR, changes, or a stealth function written in Autolisp that beeps if it's 12 o'clock while i'm working with autocad.
Title: Re: Could it be possible to write reactors using Autolisp?
Post by: CAB on December 15, 2008, 02:42:28 PM
All you have to work with are the built in reactors.
You can get creative with the reactors you have to work with & do most things.
You may have more options with other programing languages line NET but I'm not familiar enough to
comment on them.

For an alarm clock you could use a combinations of reactors which look up the time on each call
to them. The same can be true for a variable that is not watched by the VLR-SYSVAR-REACTOR.
The potential to slow down ACAD is there but if you function were small and fast it would work.
You just have to use your imagination to find a solution.  :-)