Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Search for items that have icon value "Geometry"

Anonymous

Search for items that have icon value "Geometry"

Anonymous
Not applicable

I am trying to collect Model Items from a file. So, if I use code below (for Type > "Mesh"), it works:

Search search = new Search();
search.Selection.SelectAll();
search.SearchConditions.Add(SearchCondition.HasPropertyByDisplayName("Item", "Type")
    .EqualValue(VariantData.FromDisplayString("Mesh")));

ModelItemCollection collection = search.FindAll(Application.ActiveDocument, false);

But, when I try to find items in the same way, changing only "Type" to "Icon" and "Mesh" to "Geometry", it gives me an empty collection. As example, I want to get something like this, but only using Search API:Снимок.JPG

 

I will be very grateful, if you can help me. Thanks in advance.

0 Likes
Reply
582 Views
1 Reply
Reply (1)

Anonymous
Not applicable

I have already tried it. It works... I hope I can help you solve the problem.

Search search = new Search();
search.Selection.SelectAll();
search.SearchConditions.Add(
SearchCondition.HasCategoryByName(PropertyCategoryNames.Geometry)
);
ModelItemCollection items =search.FindAll(Application.ActiveDocument,true);
Application.ActiveDocument.CurrentSelection.CopyFrom(items);