GetSelection from user with some entities already selected

GetSelection from user with some entities already selected

Anonymous
Not applicable
1,150 Views
5 Replies
Message 1 of 6

GetSelection from user with some entities already selected

Anonymous
Not applicable
Hallo,
I need to get a selection of entities from the user, as with the editor.GetSelection() method, but I want some entities to be already selected when the user starts selecting, so he/she can de-select them. I managed to do this with ActiveX, but I can't find a way to achieve this using the managed wrappers. I don't know if Utils.SelectObjects() can be of any use, cause I can't find any documentation on it.
Could anyone help, please?

Thanks

using AutoCAD 2007 (or earlier if possible)
0 Likes
1,151 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
How did you do it with ActiveX?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6387136@discussion.autodesk.com...
Hallo,
I need to get a selection of entities from the user, as with the
editor.GetSelection() method, but I want some entities to be already selected
when the user starts selecting, so he/she can de-select them. I managed to do
this with ActiveX, but I can't find a way to achieve this using the managed
wrappers. I don't know if Utils.SelectObjects() can be of any use, cause I can't
find any documentation on it.
Could anyone help, please?

Thanks

using AutoCAD 2007 (or earlier if possible)
0 Likes
Message 3 of 6

Anonymous
Not applicable
Using
SelectionSet sSet = .... // create a new selection set
sSet.AddItems(oldEntities); // where oldEntities is AcadEntity[] with the entities to be pre-selected.
sSet.SelectOnScreen(...); // get user input
0 Likes
Message 4 of 6

Anonymous
Not applicable
I don't see any obvious way to do that in ObjectARX.

If the Editor's SelectionAdded event fires before the
first selection is made by the user, that would be the
only way it could be done.

In any case, if you can't get that to work, then I would
just use the ActiveX API to get the selection, and then
use the Editor's SelectPrevious() method to get the
resulting selection as a managed SelectionSEt.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6387416@discussion.autodesk.com...
Using
SelectionSet sSet = .... // create a new selection set
sSet.AddItems(oldEntities); // where oldEntities is AcadEntity[] with the
entities to be pre-selected.
sSet.SelectOnScreen(...); // get user input
0 Likes
Message 5 of 6

Anonymous
Not applicable
Thanks for the advice. I'll use the ActiveX API for the selection.

In fact, I may port the whole project to using ActiveX, since I need my main program to run outside AutoCAD's process and the method described in "Interfacing an external COM application with a .NET module in-process to AutoCAD (redux)" by K. Walmsley gives me a hell of problems.
0 Likes
Message 6 of 6

Anonymous
Not applicable
I'm sorry, but I was wrong. The AddItems method adds the supplied entities to the selection set, but the user can not de-select them.
And I thought I had tested it. It seems I have to make my tests more thorough.
0 Likes