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

SelectionFilter without selecting

1 REPLY 1
SOLVED
Reply
Message 1 of 2
SRSDS
373 Views, 1 Reply

SelectionFilter without selecting

Is there a way to filter entities without actually "selecting" them.

ed.SelectAll(filter) causes the filtered selection to be selected I try to modify the previous selection.

Like "SELECT P", "MOVE P", "COPY P".

I really only want the filter to collect data, not select them. 

1 REPLY 1
Message 2 of 2
_gile
in reply to: SRSDS

Hi,

Simply iterate through the BlockTableRecord(s) in which you want to get entities and filter the entities accordin to your criterias.

This process is not slower than a SelectAll (which, internally, does the same).

Example to get all circles on layer "Foo" which radius is lower than 10.0

modelSpace
.Cast<ObjectId>()
.Where(id => id.ObjectClass.DxfName == "CIRCLE")
.Select(id => (Circle)id.GetObject(OpenMode.ForRead))
.Where(c => c.Layer == "Foo" && c.Radius < 10.0);


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report