.NET

Reply
Mentor
MarkPendergraft
Posts: 375
Registered: ‎06-27-2005
Message 1 of 7 (178 Views)

SelectionSet from SelectionSet?

178 Views, 6 Replies
10-04-2006 02:43 PM
Hi everybody.
Is there a way to build a selectionset that filters another selectionset. Maybe i'm going about this the wrong way.

basically i have created a command that either runs on the currently selected objects, or asks the user to select objects (if none were selected already).

now, the only thing that i can't figure out, is whether i can build a selectionset from the implied selectionset.

i can get the objects that were selected when the command was run, but i would like to filter the selectionset to only contain items that i want to use in the sub. I would like to turn this into a generalized function for all of my programs.

I have a workaround in place (if typeof ent is polyline then....)
And i don't want to use the COM interface.....cause i'm snobby like that. :smileyhappy:

if it can't be done, oh well, but i just thought i would ask.

Thanks guys.
Mentor
MarkPendergraft
Posts: 375
Registered: ‎06-27-2005
Message 2 of 7 (178 Views)

Re: SelectionSet from SelectionSet?

10-05-2006 02:35 PM in reply to: MarkPendergraft
well, i ended up building an array, iterating through and filtering it. So, i guess i answered my own question. I still appreciate feedback of course, but this is the method i'm going to use, unless something better comes along.
Thanks.
Contributor
supec
Posts: 19
Registered: ‎11-01-2006
Message 3 of 7 (178 Views)

Re: SelectionSet from SelectionSet?

10-05-2007 07:47 AM in reply to: MarkPendergraft
Does anybody know solution? I have same problem, iteration isn't solution for me, I have way too much blocks in the drawing...

I want to apply selectionfilter (filter by name of block) or something on OBJECTID Array, which I have obtained by manual selection of blocks in drawing.
Mentor
MarkPendergraft
Posts: 375
Registered: ‎06-27-2005
Message 4 of 7 (178 Views)

Re: SelectionSet from SelectionSet?

10-08-2007 12:32 PM in reply to: MarkPendergraft
I don't quite understand your issue. perhaps you could explain your situation in a little more detail.
*Tony Tanzillo
Message 5 of 7 (178 Views)

Re: SelectionSet from SelectionSet?

10-08-2007 12:46 PM in reply to: MarkPendergraft
If you want to get all insertions of one or more
blocks, one way is to call GetBlockReferenceIds()
on the BlockTableRecord.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5741724@discussion.autodesk.com...
Does anybody know solution? I have same problem, iteration isn't solution for me, I have way too much blocks in the drawing...

I want to apply selectionfilter (filter by name of block) or something on OBJECTID Array, which I have obtained by manual selection of blocks in drawing.
Contributor
supec
Posts: 19
Registered: ‎11-01-2006
Message 6 of 7 (178 Views)

Re: SelectionSet from SelectionSet?

10-15-2007 01:24 PM in reply to: MarkPendergraft
For example:
There are 100 blocks named "stamp" in the drawing. this "stamp" looks like rectangle and each of them have bloks "blocksToFill" inside of it (within extents of it).
1. I prompt user to select SOME of these "stamps" and "blocksToFill" to load them into objectId[] - done by selectionfilter (filtering blocks only)
2. now I want to somehow get objectIdStamps[] from original objectId[] - how to do it???
I walked aroud the thing - I prompted a user to select a window, which I use later more times in:
PromptSelectionResult oAcadSelectionResultStamps = ed.SelectWindow(startPt,endPt,oAcadSelectionFilterStamps)
*Tony Tanzillo
Message 7 of 7 (178 Views)

Re: SelectionSet from SelectionSet?

10-15-2007 04:13 PM in reply to: MarkPendergraft
A minor screw-up in the managed API was that the
SelectPrevious() method isn't overloaded to take a
selection filter to apply to the previous selection set.

That's possible using the native acedSSGet() and
LISP (ssget) functions, but was overlooked in the
managed wrapper API.

You will need to scan the array and pull out what you
need.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5750239@discussion.autodesk.com...
For example:
There are 100 blocks named "stamp" in the drawing. this "stamp" looks like rectangle and each of them have bloks "blocksToFill" inside of it (within extents of it).
1. I prompt user to select SOME of these "stamps" and "blocksToFill" to load them into objectId[] - done by selectionfilter (filtering blocks only)
2. now I want to somehow get objectIdStamps[] from original objectId[] - how to do it???
I walked aroud the thing - I prompted a user to select a window, which I use later more times in:
PromptSelectionResult oAcadSelectionResultStamps = ed.SelectWindow(startPt,endPt,oAcadSelectionFilterStamps)
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.