<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SearchBox SearchOptions in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914261#M169812</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;does anyone know the secrets behind SearchOptions?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="c_hoppen_1-1721732372186.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1389859i18D9A9A3F1BF2764/image-size/medium?v=v2&amp;amp;px=400" role="button" title="c_hoppen_1-1721732372186.png" alt="c_hoppen_1-1721732372186.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Christoph&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jul 2024 11:10:39 GMT</pubDate>
    <dc:creator>c_hoppen</dc:creator>
    <dc:date>2024-07-23T11:10:39Z</dc:date>
    <item>
      <title>SearchBox SearchOptions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914261#M169812</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;does anyone know the secrets behind SearchOptions?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="c_hoppen_1-1721732372186.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1389859i18D9A9A3F1BF2764/image-size/medium?v=v2&amp;amp;px=400" role="button" title="c_hoppen_1-1721732372186.png" alt="c_hoppen_1-1721732372186.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Christoph&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 11:10:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914261#M169812</guid>
      <dc:creator>c_hoppen</dc:creator>
      <dc:date>2024-07-23T11:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: SearchBox SearchOptions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914284#M169813</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1701763"&gt;@c_hoppen&lt;/a&gt;.&amp;nbsp; I have not tried it yet, but since there is a property for&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=SearchBox_SearchFilter" target="_blank" rel="noopener"&gt;SearchBox.SearchFilter&lt;/A&gt;, and it is ReadOnly, and there is the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=SearchBox_SearchText" target="_blank" rel="noopener"&gt;SearchBox.SearchText&lt;/A&gt;&amp;nbsp;property, which is also ReadOnly, then it would make sense for that 'SearchOptions' optional input to be a variation of the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=SearchBoxFilterEnum" target="_blank" rel="noopener"&gt;SearchBoxFilterEnum&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 11:25:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914284#M169813</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-07-23T11:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: SearchBox SearchOptions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914323#M169816</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;I was hoping that further filter options would allow me to filter the results more precisely.&lt;/P&gt;&lt;P&gt;For example: Searching "gk" but only in Author.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="c_hoppen_0-1721734735582.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1389878i5AFCA94B04BEC311/image-size/medium?v=v2&amp;amp;px=400" role="button" title="c_hoppen_0-1721734735582.png" alt="c_hoppen_0-1721734735582.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Would be cool to have a fast solution for this task.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Christoph&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 11:47:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914323#M169816</guid>
      <dc:creator>c_hoppen</dc:creator>
      <dc:date>2024-07-23T11:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: SearchBox SearchOptions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914375#M169818</link>
      <description>&lt;P&gt;Usually, if we can not do it manually, then we can not do it by code either.&amp;nbsp; When I click on the search icon at the top of my model browser tree, I get something that looks like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WCrihfield_0-1721735890430.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1389889i42E35B9E340C711D/image-size/large?v=v2&amp;amp;px=999" role="button" title="WCrihfield_0-1721735890430.png" alt="WCrihfield_0-1721735890430.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;There are 3 icons under the search box.&amp;nbsp; The second and third icons coincide with those two filters within the SearchBoxFilterEnum.&amp;nbsp; The icon on the far left looks like a greyed out funnel until one or more of those other two are selected, then it looks like an 'X'.&amp;nbsp; Then when you click the 'X', that clears any 'filters' that were selected before.&lt;/P&gt;
&lt;P&gt;I agree that it would be pretty nice if that Search functionality were more dynamic / powerful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to find only the assembly components which have "gk" as the value of their 'Author' iProperty, then you will likely need to do so with an iLogic rule (or similar).&amp;nbsp; Another way to see them might be to open the BOM, and include a column for that iProperty, so you can see which ones have that value.&amp;nbsp; The rows could likely be sorted by the values in that column also.&amp;nbsp; If you would like to go the iLogic rule route, and would like some help with that, just let us know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 12:04:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914375#M169818</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-07-23T12:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: SearchBox SearchOptions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914548#M169827</link>
      <description>&lt;P&gt;By now you can't add or delete a BOM row comfortably by code. And I don't want to mess up the BOM when it is exported to any management systems.&lt;/P&gt;&lt;P&gt;Looping through the assembly with checking iProperties against any search value is EXTREMLY slow the first time an assembly is opened. I have just done a test and it took 17 seconds for 10000 occurrences.&amp;nbsp;Strangely enough, all further searches take less than half a second. It seems that Inventor caches the iProperties on the first access.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 13:16:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914548#M169827</guid>
      <dc:creator>c_hoppen</dc:creator>
      <dc:date>2024-07-23T13:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: SearchBox SearchOptions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914611#M169829</link>
      <description>&lt;P&gt;I think the initial difference between first run and subsequent runs is due to most of those referenced documents only being 'initiated' (happens automatically when you open things like assembly or drawing) rather than fully loaded (opened, even if not visibly) in Inventor's session memory.&amp;nbsp; The individual iProperty values themselves should not be held in memory, but some stuff definitely is.&amp;nbsp; I have heard that using Apprentice can be faster, when just accessing iProperties, but that can only be used from something like a standalone EXE (not iLogic rules, VBA macros, or add-ins).&amp;nbsp; There are likely ways to reduce the run time some required by the search, but with that many occurrences, the main thing I would recommend is iterating the referenced documents instead of components, if that's not what you already did.&amp;nbsp; And maybe use &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=Documents_OpenWithOptions" target="_blank" rel="noopener"&gt;OpenWithOptions&lt;/A&gt;, instead of the regular &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=Documents_Open" target="_blank" rel="noopener"&gt;Open&lt;/A&gt; method, and setting '&lt;SPAN&gt;SkipAllUnresolvedFiles&lt;/SPAN&gt;' to True, and '&lt;SPAN&gt;ExpressModeBehavior' to 'OpenExpress', or maybe even opening it in a ModelState in which the most stuff is suppressed may help&lt;/SPAN&gt;.&amp;nbsp; Using Inventor API code instead of iLogic API code (which runs extra code behind the scenes) may help also.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 13:41:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914611#M169829</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-07-23T13:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: SearchBox SearchOptions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914744#M169837</link>
      <description>&lt;P&gt;It's getting stranger and stranger...&amp;nbsp;&lt;/P&gt;&lt;P&gt;With my test assembly (2650 files &amp;amp; 10000 Occurrences), the following code takes about 1.5 seconds. &lt;STRONG&gt;Always&lt;/STRONG&gt;.&amp;nbsp;The assembly is already open.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;ComponentOccurrences occs = assmDoc.ComponentDefinition.Occurrences;
foreach (Document document in assmDoc.AllReferencedDocuments)
{
    if (IsMatching(document, sd))
    {
        ComponentOccurrencesEnumerator leafOccs = occs.get_AllReferencedOccurrences(document);
        foreach (ComponentOccurrence occ in leafOccs)
        {
            oCol.Add(occ);
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;Traversing the assembly occurrences leads to the same result:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;foreach (ComponentOccurrence occ in assmDoc.ComponentDefinition.Occurrences)
{
    if (IsMatching(occ.Definition.Document as Document, sd))
        oCol.Add(occ);
    if (occ.SubOccurrences.Count &amp;gt; 0)
        TraverseAssembly(occ.SubOccurrences, sd, oCol);
}
......
private static void TraverseAssembly(ComponentOccurrencesEnumerator subOccurrences, SearchDefinition sd, ObjectCollection oCol)
{
    foreach(ComponentOccurrence occ in subOccurrences)
    {
        if (IsMatching(occ.Definition.Document as Document, sd))
            oCol.Add(occ);
        if (occ.SubOccurrences.Count &amp;gt; 0)
            TraverseAssembly(occ.SubOccurrences, sd, oCol);
    }
}&lt;/LI-CODE&gt;&lt;P&gt;But it takes 17 seconds for the first call, and a quick glance for subsequent calls ( &amp;lt; 500 mSec).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 14:27:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/searchbox-searchoptions/m-p/12914744#M169837</guid>
      <dc:creator>c_hoppen</dc:creator>
      <dc:date>2024-07-23T14:27:55Z</dc:date>
    </item>
  </channel>
</rss>

