.NET

Reply
Active Member
pymote
Posts: 9
Registered: ‎03-22-2012
Message 1 of 8 (552 Views)

Select nested entities

552 Views, 7 Replies
01-03-2013 01:19 AM

Hi,

I select all entities via Editor.SelectAll() method, but the nested entities (inside Blocks) are missing. Do I have to resolve them by iterating through all blocks afterwards or is there a PromptSelectionOption that can be set?

I don't want the user to select the entities, instead I loop through the whole drawing.

Matthias

Distinguished Contributor
HJohn1
Posts: 170
Registered: ‎09-26-2008
Message 2 of 8 (531 Views)

Re: Select nested entities

01-03-2013 09:52 AM in reply to: pymote

If you are only interested in working with the BlockReferences or Inserts on a Layout, you could use SelectionFilters to select only those you want without going thru the entire Layout. 

Valued Mentor
jeff
Posts: 330
Registered: ‎05-12-2009
Message 3 of 8 (518 Views)

Re: Select nested entities

01-03-2013 12:15 PM in reply to: pymote

Have you searched for PromptNestedEntityOptions & PromptNestedEntityResult?

 

The nested entites are not missing you are just selecting objects that are a transformed representation of the containers of those objects.

 

If selecting Blockreferences returned the entites in the definition and you use Select.All() and had 200 blockreferences from the same BlockTableRecord then you would have 200 copies of the same ObjectId for each entity in the definition, or if selecting a polyline retuned all the vertexs, etc.....

 

Not sure what you are trying to accomplish but iterating through the returned ids you could create a collection and check if its ObjectClass points to a BlockReference and add the DynamicBlockTableRecord Id to the collection if it does not already contain it then do whatever needed to enities in definition.

 

 

 

You can also find your answers @ TheSwamp
Active Member
pymote
Posts: 9
Registered: ‎03-22-2012
Message 4 of 8 (462 Views)

Re: Select nested entities

01-20-2013 11:00 PM in reply to: jeff

Sorry for not beeing clear. I currently select entities by specifying certain criterias by predicates (using PredicateBuilder). In the first step I build a query like this: "Select all entities of type  'Circle' with XData 'MyEntitiyID' an layer 'L' ". And then I process this query with a method that iterates through all entities (via Editor.selectAll as start input) and check if the predicate matches. I want to iterate through all entities, but with Editor.selectAll I don't get the nested ones. I hope this makes it more clear.

Again: I don't want to prompt the user for selecting entities. The user starts specific commands that uses specific selection predicates.

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 5 of 8 (437 Views)

Re: Select nested entities

01-21-2013 05:35 PM in reply to: pymote

What do you mean by nested entities?  

 

Are you speaking of attributes of block references, or graphical entities (like lines, circles, polylines, etc.) that make up the graphical representation of each block reference ?

Active Member
pymote
Posts: 9
Registered: ‎03-22-2012
Message 6 of 8 (420 Views)

Re: Select nested entities

01-22-2013 05:25 AM in reply to: DiningPhilosopher

The later, graphical entities

ADN Support Specialist
Balaji_Ram
Posts: 701
Registered: ‎03-21-2011
Message 7 of 8 (372 Views)

Re: Select nested entities

02-01-2013 04:19 AM in reply to: pymote

Hi,

 

The acedSSGet method does not work with the combination of "nested" and "all" options. It is the same with the .Net selection methods.

 

You may try exploding the block references that you have obtained using SelectAll and then iterate through the DBObjectCollection to do the processing that you want. The exploded entities can then be discarded as they are not database resident.  



Balaji
Developer Technical Services
Autodesk Developer Network

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 8 of 8 (361 Views)

Re: Select nested entities

02-01-2013 08:04 AM in reply to: pymote

A BlockReference does not contain its own set of nested entities. The entities you see that make up the geometry of a BlockReference are the entities in the block's definition (BlockTableRecord), transformed to the coordinate system of the block reference.

 

If you need to work with the entities for a given Block, transformed into the coordinate system of a given BlockReference, you can explode the BlockReference, and use the resulting copies of the entities from the block's definition, which are transformed to the BlockReference's coordinate system, and then Dispose() them without adding them to the database.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

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