<?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 How to get properties generated selection sets in Navisworks API Forum</title>
    <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8449914#M3485</link>
    <description>&lt;P&gt;Hi !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that we can obtain the list of saved selections sets like this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;            Document doc = Autodesk.Navisworks.Api.Application.ActiveDocument;
            foreach (SavedItem saveditem in doc.SelectionSets.Value)
            { 
                 //
            }&lt;/PRE&gt;
&lt;P&gt;Is it possible to gets the generated selections sets by properties ? They are in Selection tree/Properties&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 336px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/578227i0B7684C7669F683F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Dec 2018 14:02:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-12-06T14:02:51Z</dc:date>
    <item>
      <title>How to get properties generated selection sets</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8449914#M3485</link>
      <description>&lt;P&gt;Hi !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that we can obtain the list of saved selections sets like this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;            Document doc = Autodesk.Navisworks.Api.Application.ActiveDocument;
            foreach (SavedItem saveditem in doc.SelectionSets.Value)
            { 
                 //
            }&lt;/PRE&gt;
&lt;P&gt;Is it possible to gets the generated selections sets by properties ? They are in Selection tree/Properties&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 336px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/578227i0B7684C7669F683F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 14:02:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8449914#M3485</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-06T14:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get properties generated selection sets</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8470241#M3486</link>
      <description>&lt;P&gt;Hello sounds like you are trying to accomplish something similar to what I am looking for... Here is my post also.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="search-sets-naming-from-a-property-value-for-each-value-found" href="https://forums.autodesk.com/t5/navisworks-api/search-sets-naming-from-a-property-value-for-each-value-found/td-p/8470196" target="_blank"&gt;https://forums.autodesk.com/t5/navisworks-api/search-sets-naming-from-a-property-value-for-each-value-found/td-p/8470196&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it appears that no one really responds to any posts in the API forum? I have not been getting any help myself on some posting I&amp;nbsp;had in the past week. Lets see if any body can give us some direction. Good luck..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jgarza&lt;/P&gt;</description>
      <pubDate>Sat, 15 Dec 2018 16:23:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8470241#M3486</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-15T16:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get properties generated selection sets</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8477482#M3487</link>
      <description>&lt;P&gt;The selectionset is different from the selectiontree.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;you want get&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;all of the category&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;property&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;You have to bring it from one model to another.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If the number of models is large, the speed is very slow.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;foreach(ModelItem model in doc.Models[0].RootItem.DescendantsAndSelf)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;foreach(PropertyCategory category in model.PropertyCategories)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;string categoryName = category.DisplayName;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;foreach(DataProperty property in category.Properties)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;string propertyName = property&amp;nbsp;.DisplayName;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 07:08:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8477482#M3487</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-19T07:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get properties generated selection sets</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8478016#M3488</link>
      <description>&lt;P&gt;Thanks for the information, but where I am getting confused is so I still need the create a search condition like this one below? And how does your snip it filter out for the Property Category and the Category name? This is what I was starting with below..&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;#region&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; Create and individual SearchSet For Tagged Instruments&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt; Search cwTagInst = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; Search();&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt; SearchCondition cwTagInstc = SearchCondition.HasPropertyByDisplayName(&lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"CADWorx"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;, &lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"Tag"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt; cwTagInst.SearchConditions.Add(cwTagInstc.DisplayStringContains(&lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"FE-10215"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;));&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;//set the selection to everything&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;cwTagInst.Selection.SelectAll();&lt;/P&gt;
&lt;P&gt;cwTagInst.Locations = SearchLocations.DescendantsAndSelf;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt; SavedItem cwTagInstItem = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; SelectionSet(cwTagInst);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt; cwTagInstItem.DisplayName = &lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"All Tagged Inst"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;/&lt;FONT color="#008000" face="Consolas" size="2"&gt;/add to the end&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;oSets.AddCopy(cwTagInstItem);&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;#endregion&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 12:03:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8478016#M3488</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-19T12:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get properties generated selection sets</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8479781#M3489</link>
      <description>&lt;P&gt;I don`t understand what you want to do.&lt;/P&gt;
&lt;P&gt;Do you want to know the search? or want to know the full property information?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 00:23:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8479781#M3489</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-20T00:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get properties generated selection sets</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8480550#M3490</link>
      <description>&lt;P&gt;Its basically going to be a little of both, I assume. I am still learning about the api myself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;I have to search the entire model for a specific&amp;nbsp;property tag value just like the sample code shows in a previous post. (ie. FE*)&lt;/LI&gt;
&lt;LI&gt;and for each tag it finds I then&amp;nbsp;to create a save search name to corresponds to the actual tag value after its found. (ie. FE-1000, FE-2015).&lt;/LI&gt;
&lt;LI&gt;Last I want a folder to be created that will store these search sets. (ie. folder name "FE's, and then list FE-1000, FE-2015 under the folder name and sort them) This will allow us to quickly find the items we are looking for instead of creating these saved search sets every time and to have consistent searches names and results.&lt;/LI&gt;
&lt;LI&gt;The ultimate goal is to call this plugin for use the same code in my automation process. To create these saved searches during the automation process, so when the nwf and nwd are generated they will be included already and users don't have to create any thing.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 12:01:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8480550#M3490</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-20T12:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get properties generated selection sets</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8482495#M3491</link>
      <description>&lt;P&gt;There are two ways to utilize Search and ModelItem.&lt;BR /&gt;In this case, you must use SelectionSet&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This is the sample code I used to create the SelectionSet.&lt;BR /&gt;You can put the SelectionSet in a FolderItem and add it to the root of the SelectionSet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/// CreateSearchSet&lt;/P&gt;
&lt;P&gt;Search s = new Search();&lt;/P&gt;
&lt;P&gt;s.Selection.SelectAll();&lt;/P&gt;
&lt;P&gt;search.Locations = SearchLoactions.DescendantsAndSelf;&lt;/P&gt;
&lt;P&gt;SearchCondition sc = new SearchCondition(new NamedConstant("CategoryDisplayName"),&lt;/P&gt;
&lt;P&gt;new NamedConstant("PropertyDisplayName"),&lt;/P&gt;
&lt;P&gt;SearchConditionOptions.IgnoreNames,&lt;/P&gt;
&lt;P&gt;SearchConditionComparison.Equal,&lt;/P&gt;
&lt;P&gt;new VariantData("SearchName"));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;search.SearchConditions.AddGroup(sc);&lt;/P&gt;
&lt;P&gt;SelectionSet ss = new SelectionSet(s);&lt;/P&gt;
&lt;P&gt;ss.DisplayName = "SelectionSetName")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//CreateFolder&lt;/P&gt;
&lt;P&gt;FolderItem fi = new FolderItem();&lt;/P&gt;
&lt;P&gt;fi.DisplayName = "FolderName";&lt;/P&gt;
&lt;P&gt;fi.Children.Add(ss);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//input SelectionSet&lt;/P&gt;
&lt;P&gt;doc.SelectionSets.AddCopy(fi);&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 01:52:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8482495#M3491</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-21T01:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to get properties generated selection sets</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8488213#M3492</link>
      <description>&lt;P&gt;Almost getting there...i don't see where to declare the search variable? i get the error "The name "search" does not exist in the current context." for the following 2 lines of code..&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; search.Locations = SearchLocations.DescendantsAndSelf;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; search.SearchConditions.AddGroup(sc);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All the code...&lt;/P&gt;
&lt;P&gt;#region&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Document oDoc = Autodesk.Navisworks.Api.Application.ActiveDocument;&lt;BR /&gt; &lt;BR /&gt; /// CreateSearchSet&lt;/P&gt;
&lt;P&gt;Search s = new Search();&lt;/P&gt;
&lt;P&gt;s.Selection.SelectAll();&lt;BR /&gt; &lt;BR /&gt; search.Locations = SearchLocations.DescendantsAndSelf;&lt;/P&gt;
&lt;P&gt;SearchCondition sc = new SearchCondition(new NamedConstant("CADWorx"),&lt;BR /&gt; //SearchCondition sc = new SearchCondition(new NamedConstant("CategoryDisplayName"),&lt;/P&gt;
&lt;P&gt;new NamedConstant("Tag"),&lt;BR /&gt; //new NamedConstant("PropertyDisplayName"),&lt;/P&gt;
&lt;P&gt;SearchConditionOptions.IgnoreNames,&lt;/P&gt;
&lt;P&gt;SearchConditionComparison.Equal,&lt;BR /&gt; //SearchConditionComparison.Equal,&lt;/P&gt;
&lt;P&gt;new VariantData("Test123"));&lt;/P&gt;
&lt;P&gt;search.SearchConditions.AddGroup(sc);&lt;/P&gt;
&lt;P&gt;SelectionSet ss = new SelectionSet(s);&lt;/P&gt;
&lt;P&gt;//ss.DisplayName = "SelectionSetName")&lt;BR /&gt; ss.DisplayName = ("Test");&lt;/P&gt;
&lt;P&gt;//CreateFolder&lt;/P&gt;
&lt;P&gt;FolderItem fi = new FolderItem();&lt;/P&gt;
&lt;P&gt;fi.DisplayName = "FE's";&lt;/P&gt;
&lt;P&gt;fi.Children.Add(ss);&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt; //input SelectionSet&lt;/P&gt;
&lt;P&gt;oDoc.SelectionSets.AddCopy(fi);&lt;/P&gt;
&lt;P&gt;#endregion&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2018 19:01:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8488213#M3492</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-26T19:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get properties generated selection sets</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8488556#M3493</link>
      <description>&lt;P&gt;line 2 is a typing error&lt;/P&gt;
&lt;P&gt;search.Locations -&amp;gt; s.Locations&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 01:06:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-get-properties-generated-selection-sets/m-p/8488556#M3493</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-27T01:06:13Z</dc:date>
    </item>
  </channel>
</rss>

