<?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 Re: How to export Clash Test Results to HTML and XML using Navisworks API? in Navisworks API Forum</title>
    <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/9001075#M3215</link>
    <description>&lt;P&gt;Hello again!&lt;/P&gt;&lt;P&gt;I'm assuming "item paths" are the equivalent to Item 1 and Item 2 that appear as columns in HTML reports, right?&lt;/P&gt;&lt;P&gt;Do you know how to get its ElementID and Type values, as they appear in HTML reports given a&amp;nbsp;InwOclTestResult?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Sep 2019 11:53:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-09-02T11:53:31Z</dc:date>
    <item>
      <title>How to export Clash Test Results to HTML and XML using Navisworks API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/8924705#M3210</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Navis.PNG" style="width: 720px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/660072i5A1AEC9E6D0CD7CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Navis.PNG" alt="Navis.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Does&amp;nbsp;Navisworks API have predefined functions for exporting&amp;nbsp;Clash Test Results to HTML and XML?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 07:28:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/8924705#M3210</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-23T07:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to export Clash Test Results to HTML and XML using Navisworks API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/8982957#M3211</link>
      <description>&lt;P&gt;Hi, did you find a solution? I'm having the same problem... Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 06:31:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/8982957#M3211</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-23T06:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to export Clash Test Results to HTML and XML using Navisworks API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/8983167#M3212</link>
      <description>&lt;P&gt;It would seem that Navisworks API does not provide the functions for exporting to HTML and XML, but it does provide the means to extract all information about the clash result (Element IDs, paths, clash points and etc.) except for the clash image.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 08:41:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/8983167#M3212</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-23T08:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to export Clash Test Results to HTML and XML using Navisworks API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/8983200#M3213</link>
      <description>&lt;P&gt;That's what I thought... So, in order to run all the clash tests and create the reports I should do something like this, right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DocumentClash documentClash = DocumentExtensions.GetClash(Application.ActiveDocument);&lt;BR /&gt;DocumentClashTests oDCT = documentClash.TestsData;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;oDCT.TestsRunAllTests();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;foreach (ClashTest test in oDCT.Tests)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;//Create each report&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 08:56:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/8983200#M3213</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-23T08:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to export Clash Test Results to HTML and XML using Navisworks API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/8983230#M3214</link>
      <description>&lt;P&gt;I am personally using the Navisworks COM API because I couldn't figure out how to extract the item paths and IDs. But to Run the Clash Tests, yes your code is correct.&lt;/P&gt;&lt;PRE&gt;ComApi.InwOpState10 oState;
oState = ComApiBridge.ComApiBridge.State;
ComApi.InwOpClashElement m_clash = null;

foreach (ComApi.InwOclClashTest clashTest in m_clash.Tests()) {
    if (clashTest.results().Count &amp;lt;= 0) {
        continue;
    }

    foreach (ComApi.InwOclTestResult clashResult in clashTest.results()) {
       // do your thing
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 09:11:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/8983230#M3214</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-23T09:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to export Clash Test Results to HTML and XML using Navisworks API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/9001075#M3215</link>
      <description>&lt;P&gt;Hello again!&lt;/P&gt;&lt;P&gt;I'm assuming "item paths" are the equivalent to Item 1 and Item 2 that appear as columns in HTML reports, right?&lt;/P&gt;&lt;P&gt;Do you know how to get its ElementID and Type values, as they appear in HTML reports given a&amp;nbsp;InwOclTestResult?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 11:53:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/9001075#M3215</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-02T11:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to export Clash Test Results to HTML and XML using Navisworks API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/9002826#M3216</link>
      <description>&lt;P&gt;This code for Element IDs works for me, not sure if it will work for you:&lt;/P&gt;&lt;PRE&gt;private string getItem1ElementID(ComApi.InwOpState10 oState, ComApi.InwOclTestResult clashResult) {
	List &amp;lt; string &amp;gt; element_1_IDs = new List &amp;lt; string &amp;gt; ();
	List &amp;lt; string &amp;gt; element_1_junk = new List &amp;lt; string &amp;gt; ();
	string[] properties = {
		"LcOaNat64AttributeValue",
		"LcRevitPropertyElementName",
		"LcRevitPropertyElementType",
		"LcRevitPropertyElementFamily",
		"LcRevitPropertyElementCategory",
		"LcOaNat64AttributeValue"
	};

	foreach(ComApi.InwOaNode node in clashResult.Path1.Nodes()) {
		//System.Diagnostics.Debug.WriteLine("****************");
		foreach(ComApi.InwOaAttribute nodeAttr in node.Attributes()) {
			ComApi.InwOaPropertyVec pVec = oState.GetAttributeProperties(nodeAttr);

			foreach(ComApi.InwOaProperty nodeProp in pVec.Properties()) {
				String string_val = nodeProp.value as String;
				if (properties.Any(s = &amp;gt;s.Equals(nodeProp.name))) {
					//System.Diagnostics.Debug.WriteLine(nodeProp.name + ": " + string_val);
					element_1_junk.Add(string_val);
				}
			}
		}
	}

	int temp;
	element_1_IDs = element_1_junk.Where(x = &amp;gt;int.TryParse(x, out temp)).ToList();

	if (element_1_IDs.Count &amp;gt; 1) {
		return element_1_IDs[1];
	} else {
		return element_1_IDs[0];
	}

}


private string getItem2ElementID(ComApi.InwOpState10 oState, ComApi.InwOclTestResult clashResult) {
	List &amp;lt; string &amp;gt; element_2_IDs = new List &amp;lt; string &amp;gt; ();
	List &amp;lt; string &amp;gt; element_2_junk = new List &amp;lt; string &amp;gt; ();
	string[] properties = {
		"LcOaNat64AttributeValue",
		"LcRevitPropertyElementName",
		"LcRevitPropertyElementType",
		"LcRevitPropertyElementFamily",
		"LcRevitPropertyElementCategory",
		"LcOaNat64AttributeValue"
	};

	foreach(ComApi.InwOaNode node in clashResult.Path2.Nodes()) {
		//System.Diagnostics.Debug.WriteLine("****************");
		foreach(ComApi.InwOaAttribute nodeAttr in node.Attributes()) {
			ComApi.InwOaPropertyVec pVec = oState.GetAttributeProperties(nodeAttr);

			foreach(ComApi.InwOaProperty nodeProp in pVec.Properties()) {
				String string_val = nodeProp.value as String;
				if (properties.Any(s = &amp;gt;s.Equals(nodeProp.name))) {
					//System.Diagnostics.Debug.WriteLine(nodeProp.name + ": " + string_val);
					element_2_junk.Add(string_val);
				}
			}
		}
	}

	int temp;
	element_2_IDs = element_2_junk.Where(x = &amp;gt;int.TryParse(x, out temp)).ToList();

	if (element_2_IDs.Count &amp;gt; 1) {
		return element_2_IDs[1];
	} else {
		return element_2_IDs[0];
	}
}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;As for the Types and Names, you might as well extract them from the Item Paths?&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;// Item 1 Path
private string getItem1Path(ComApi.InwOclTestResult clashResult) {
	string Item1_Path = "";

	foreach(ComApi.InwOaNode node in clashResult.Path1.Nodes()) {
		string username_node = node.UserName;
		if (username_node.Length == 0) {
			username_node = node.ClassUserName + "_";
		}
		Item1_Path = Item1_Path + "-&amp;gt;" + username_node;
	}

	return Item1_Path;
}

// Item 2 Path
private string getItem2Path(ComApi.InwOclTestResult clashResult) {
	string Item2_Path = "";

	foreach(ComApi.InwOaNode node in clashResult.Path2.Nodes()) {
		string username_node = node.UserName;
		if (username_node.Length == 0) {
			username_node = node.ClassUserName + "_";
		}
		Item2_Path = Item2_Path + "-&amp;gt;" + username_node;
	}

	return Item2_Path;
}&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Sep 2019 10:25:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/9002826#M3216</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-03T10:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to export Clash Test Results to HTML and XML using Navisworks API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/9003368#M3217</link>
      <description>&lt;P&gt;Thank you for your answer. In the meanwhile I finally found how to get those values from a ClashResult (.NET):&lt;/P&gt;&lt;PRE&gt;Tuple&amp;lt;string, string&amp;gt; resultsItem2 = getIDAndTypeFromItem(clash.Item2);
...

private Tuple&amp;lt;string, string&amp;gt; getIDAndTypeFromItem(ModelItem item)
{
    PropertyCategoryCollection properties = item.PropertyCategories;

    string type = null;

    foreach (PropertyCategory propertyCategory in properties)
    {
           if (propertyCategory.DisplayName == "Item")
           {
                foreach (DataProperty prop in propertyCategory.Properties)
                {
                      if (prop.DisplayName == "Type")
                      {
                            type = prop.Value.ToDisplayString();
                            break;
                      }
                 }

                 if (type != null)
                 {
                        break;
                 }
          }
     }

     string id = null;
     if (item.Parent != null)
     {
          foreach (PropertyCategory propertyCategory in item.Parent.PropertyCategories)
          {
               if (propertyCategory.DisplayName == "Element ID")
               {
                   foreach (DataProperty prop in propertyCategory.Properties)
                   {
                        if (prop.DisplayName == "Value")
                        {
                             id = prop.Value.ToDisplayString();
                             break;
                        }
                   }

                    if (id != null)
                    {
                          break;
                    }
               }
           }
     }

     return new Tuple&amp;lt;string, string&amp;gt;(id, type);
}&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Sep 2019 13:58:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/9003368#M3217</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-03T13:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to export Clash Test Results to HTML and XML using Navisworks API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/9089254#M3218</link>
      <description>&lt;P&gt;If you still need to know how to export Clash Result Images, I made a post here:&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/navisworks-api/here-s-how-to-export-clash-result-images-using-navisworks-api/td-p/9089222" target="_blank"&gt;https://forums.autodesk.com/t5/navisworks-api/here-s-how-to-export-clash-result-images-using-navisworks-api/td-p/9089222&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 10:02:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/9089254#M3218</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-16T10:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to export Clash Test Results to HTML and XML using Navisworks API?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/9089261#M3219</link>
      <description>&lt;P&gt;I'll check it out, thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 10:06:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-export-clash-test-results-to-html-and-xml-using/m-p/9089261#M3219</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-16T10:06:49Z</dc:date>
    </item>
  </channel>
</rss>

