TheSwamp

Code Red => .NET => Topic started by: nathanr on June 03, 2022, 01:15:35 PM

Title: Recreate SelectionFilter functionality using RealDWG
Post by: nathanr on June 03, 2022, 01:15:35 PM
I'm trying to find a block within a Point3d 'window' without using the Editor since it's a c#/RealDWG application.

I have a working sample using a SelectionFilter to find all INSERT then get the PromptSelectionResults from Editor.SelectCrossingWindow which I can then iterate through the results to find what I'm looking for.

I'm trying to recreate that since I'm using RealDwg and do not have access to SelectionFilter (or anything Editor).

Any direction is appreciated. Thanks!
Title: Re: Recreate SelectionFilter functionality using RealDWG
Post by: Hanauer on June 04, 2022, 06:58:29 AM
https://www.keanw.com/2013/01/filtering-lists-of-autocad-entities-using-linq.html (https://www.keanw.com/2013/01/filtering-lists-of-autocad-entities-using-linq.html)
Title: Re: Recreate SelectionFilter functionality using RealDWG
Post by: n.yuan on June 05, 2022, 09:59:54 AM
You simply loop through the Model/PaperSpace BlockTableRecord to find the entities in interest. If the entities' position matters (for example, they must be within a window/polygon), then you will need to do your own calculation to decide.