.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GetSelection from user with some entities already selected

5 REPLIES 5
Reply
Message 1 of 6
pavlos.katsonis
634 Views, 5 Replies

GetSelection from user with some entities already selected

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)
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: pavlos.katsonis

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)
Message 3 of 6

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
Message 4 of 6
Anonymous
in reply to: pavlos.katsonis

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
Message 5 of 6

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.
Message 6 of 6

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost