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

Selection Filter to ignore XREF

4 REPLIES 4
Reply
Message 1 of 5
chris.mills
1105 Views, 4 Replies

Selection Filter to ignore XREF

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.

4 REPLIES 4
Message 2 of 5
BlackBox_
in reply to: chris.mills

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."

Message 3 of 5
norman.yuan
in reply to: chris.mills

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

Drive CAD With Code

EESignature

Message 4 of 5
BlackBox_
in reply to: 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."

Message 5 of 5
chris.mills
in reply to: chris.mills

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.

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