Hi All,
Does anyone know of a way to ignore XREF's when doing a Editor.SelectAll?
The reason I ask is purely based on efficiency. I am searching on polylines and circles in the current database, but don't care about any xref'd databases. Sometimes this can take a little while if there are quite a few xref'd drawings.
This is the code I'm using:
TypedValue[] types = new TypedValue[] { new TypedValue((int)DxfCode.Start, "LWPOLYLINE,CIRCLE") }; PromptSelectionResult selectionRes = ed.SelectAll(new SelectionFilter(types));
Thanks for any help,
Chris.
Unfortunately no, not directly through your selection filter, unless all of your external references are on a specific layer, etc. which you could exclude using (-4, "<NOT"), etc.
Instead, consider iterating the resultant ObjectIds, testing for ObjectId.ObjectClass.Name == "AcDbBlockReference", and then subsequently test for XrefStatus in order to exclude from your procedure(s).
HTH
"How we think determines what we do, and what we do determines what we get."
Wouldn't the filter value "CIRCLE,LWPOLYLINE" is good enough to only select circle and polyline, and exclude anything else, including Xref, which is an "INSERT" (BlockReference)?
Have you run your code? Did it not only select circles and polylines in the current drawing database, but also select those in the Xrefed drawing (I do not think so)?
Norman Yuan
There does seem to be a bit of confusion between the first question asked, and the code, etc.
"How we think determines what we do, and what we do determines what we get."
Appologies, I cannot repeat the issue. Originally inserting the XREF's dramatically slowed down the editor selection, and removing them much improved it, I can't even blame a network related slow-down. As norman.yuan quite rightly stated, the filter value doesn't include any of the nested entities within the blocks. I've thoroughly tested it and cannot repeat it.
Sorry guys, it's been a long week.