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

Complex Selection Filter

1 REPLY 1
Reply
Message 1 of 2
a.hajihasani
109 Views, 1 Reply

Complex Selection Filter

Hi every body. I need to create complex selection filter, to do this operation at runtime: "Select all entities on a specific layer, of any type, but POLYLINES and LWPOLYLINES. I've wrote as below, but I get error. Any one can help? I'll apreciate that.

TypedValue[] tvals = new TypedValue[7];
tvals[0] = new TypedValue((int)DxfCode.Operator, "<not");
tvals[1] = new TypedValue((int)DxfCode.Start, "LWPOLYLINE");
tvals[2] = new TypedValue((int)DxfCode.Start, "POLYLINE");
tvals[3] = new TypedValue((int)DxfCode.Operator, "not>");
tvals[4] = new TypedValue((int)DxfCode.Operator, "<and");
tvals[5] = new TypedValue((int)DxfCode.LayerName, "Major_Contour_Line");
tvals[6] = new TypedValue((int)DxfCode.Operator, "and>");
SelectionFilter selfil = new SelectionFilter(tvals);
PromptSelectionResult selres = editor.SelectAll(selfil);

 

1 REPLY 1
Message 2 of 2
_gile
in reply to: a.hajihasani

Hi,

When specifying multiple criteria in a selection file, the AND is implicit.

Strings in selection filters can include wild-card patterns.

            var filter = new SelectionFilter(new[]
            {
                new TypedValue(0, "~*polyline"),
                new TypedValue(8, "Major_Contour_Line")
            });


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