If PICKADD = 1, then the SelectionAdded/Removed events
fire, but pass only the objects added to/removed from the
selection, so it really isn't a very good way to detect that the
pickfirst selection changed.
Additionally, if a command sets the pickfirst selection through
code, before it exits, the events may not fire either.
The point is that those two events are not for the purpose of
detecting that the pickfirst selection changed, the Document's
ImpliedSelectionChanged event is for that.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com
Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");
wrote in message news:6224881@discussion.autodesk.com...
Yeah, I see what you mean, for selecting objects during command interaction,
my mistake. The 'SelectionAdded' & 'SelectionRemoved' events will work in
this case. All you need is the pickfirst (implied) set. As you add/remove
objects to/from the pickfirst set, 'SelectionAdded' gets fired and passed
the number of objects, to the event handler, that are in the pickfirst set
('SelectionAddedEventArgs.AddedObjects.Count', as long as 'AddedObjects' is
not null, if it is then obviously the count is 0), and the properties
pallette displays or updates it's display of the properties of the selected
objects. So the emulation that 'arcticad' needs would react upon the
pickfirst set, based on his original post. I don't think he states anything
about selected objects during command interaction. When you start the 'MOVE'
or 'ROTATE' commands for example and select/deselect objects, nothing tells
the the properties pallette to update it's display of properties.
In your first reply I'm trying to understand how this relates to the
original posted problem:
"a selection in the context of a command that asks for a selection."
Seems a command would not be active in this case. If it was then emulation
of selecting an object and properties display updating wouldn't be needed.
I agree though, 'ImpliedSelectionChanged' is the way to go. It gives exactly
what is needed. It gets fired when you expect it to and you can get the
pickfirst selection within the handler: Editor.SelectImplied(). I did
originally consider the 'ImpliedSelectionChanged', but seeing that the event
args passed to the handler doesn't pass anything useful I overlooked it. You
can easily get the pickfirst set within the handler.
But, with regards the 'SelectionAdded' & 'SelectionRemoved' events, maybe
someone can explain why:
When you make an implied selection, the 'SelectionAdded' event gets fired,
obviously. Now with the objects still selected, when you move your mouse
over one of the selected objects, just move it over a selected object, the
'SelectionAdded' event gets fired multiple times again? There isn't even a
selection being made, the mouse is just sitting there. That seems very odd!