TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Xander on September 04, 2011, 08:34:56 PM

Title: Selection and GRRead Reactors?
Post by: Xander on September 04, 2011, 08:34:56 PM
I've been investigating reactors recently and an idea has nailed itself into my memory... :ugly:

Is it possible to add a reactor to an entity or multiple entities (i.e. entities that are selected at the same time) that detects when selected and then listens for a particular key press?

VLR-Modified only fires when modified which is not quite what I'm after, polling for the selection is not worth the gain, and the number of times these entities will be selected doesn't warrant a mouse reactor.

Xander
Title: Re: Selection and GRRead Reactors?
Post by: irneb on September 05, 2011, 02:51:01 AM
What exactly do you want to achieve? Perhaps using a reactor isn't necessarily the best option?

I'm not sure it's possible to place a modified reactor on the document's selection sets collection - which would be the logical place, if possible.

Doing a bit of checking in the ObjectARX help, it seems that there's something in the AcEditorReactor class called pickfirstModified. But then looking at the VL equivalent vlr-editor-reactor (http://docs.autodesk.com/ACD/2011/ENU/filesALR/WS1a9193826455f5ff1a32d8d10ebc6b7ccc-67b0.htm), this option seems to be unavailable. So my guess is it's not possible.
Title: Re: Selection and GRRead Reactors?
Post by: Xander on September 05, 2011, 05:48:19 AM
I'm hoping to be able to implement a structural member swap (UB, UC, RHS, SHS, etc), by using the tab key to cycle through the profile types. I've got it running through a separate method, but it requires the users to run it first, which is becoming a pain.

Tis' but a dream.
Title: Re: Selection and GRRead Reactors?
Post by: irneb on September 05, 2011, 06:54:31 AM
No I don't think that is possible  :x . Could you perhaps assign something like the tab key to run your code anyway (as a keyboard shortcut in CUI, though probably not the Tab key in isolation) ... then your code needs to check the active selection set for the relevant object types, cycling through each option, if none of the required types are selected then do nothing?
Title: Re: Selection and GRRead Reactors?
Post by: Lee Mac on September 05, 2011, 06:55:36 AM
You can monitor user selections using a vlr-miscellaneous-reactor triggered on the :vlr-pickfirstmodified event, perhaps this will help you towards your goal.
Title: Re: Selection and GRRead Reactors?
Post by: irneb on September 05, 2011, 07:40:29 AM
You can monitor user selections using a vlr-miscellaneous-reactor triggered on the :vlr-pickfirstmodified event, perhaps this will help you towards your goal.
Awesome! Forgot about that! While looking into ARX & DotNet I "saw" the similarities to the vl* functions in lisp, and forgot to check where those similarities ended!  :ugly:

Thanks Lee!
Title: Re: Selection and GRRead Reactors?
Post by: Xander on September 05, 2011, 06:22:56 PM
Thanks irneb and Lee. I will have a play this weekend.

Xander