use the following code to select objects on layer, layername contains #, selectionresult ERROR
TypedValue[] tvs = new TypedValue[]
{
new TypedValue((int)DxfCode.Operator, "<and"),
new TypedValue((int)DxfCode.LayerName, layerName ),
new TypedValue((int)DxfCode.Operator, "and>")
};
SelectionFilter filter = new SelectionFilter(tvs);
ObjectId[] objIds;
PromptSelectionResult psr = doc.Editor.SelectAll(filter);
please anyone can help
Thank you
Solved! Go to Solution.
Solved by _gile. Go to Solution.
Hi,
Selection filters use wildcard patterns and # is wildcard charater.
You have to prefix the # with a reverse quote (`#) in the filter pattern.
layerName.Replace("#", "`#")
PS : using special characters in layer names, block names, ... is not a good practice.
Can't find what you're looking for? Ask the community or share your knowledge.