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

Select nested entities

7 REPLIES 7
Reply
Message 1 of 8
pymote
2542 Views, 7 Replies

Select nested entities

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

7 REPLIES 7
Message 2 of 8
HJohn1
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. 

Message 3 of 8
jeff
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
Message 4 of 8
pymote
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.

Message 5 of 8
DiningPhilosopher
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 ?

Message 6 of 8
pymote
in reply to: DiningPhilosopher

The later, graphical entities

Message 7 of 8
Balaji_Ram
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

Message 8 of 8
DiningPhilosopher
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.

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