Author Topic: Selection and GRRead Reactors?  (Read 2884 times)

0 Members and 1 Guest are viewing this topic.

Xander

  • Guest
Selection and GRRead Reactors?
« 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

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Selection and GRRead Reactors?
« Reply #1 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, this option seems to be unavailable. So my guess is it's not possible.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Xander

  • Guest
Re: Selection and GRRead Reactors?
« Reply #2 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.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Selection and GRRead Reactors?
« Reply #3 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?
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Selection and GRRead Reactors?
« Reply #4 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.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Selection and GRRead Reactors?
« Reply #5 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!
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Xander

  • Guest
Re: Selection and GRRead Reactors?
« Reply #6 on: September 05, 2011, 06:22:56 PM »
Thanks irneb and Lee. I will have a play this weekend.

Xander