<?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: Energy Analysis - BuildingElement in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/energy-analysis-buildingelement/m-p/7003667#M59146</link>
    <description>&lt;P&gt;Honestly, I've already tried it in every single way possible and I'm still getting the same results. I got it working using alternative ways to extract the geometry and intersection classes to get where these analytical results are coming from, but I'd like to use the class&amp;nbsp;EnergyAnalysisSurface and its properties because the information should be&amp;nbsp;already there and increase my application's performance.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;using (Transaction t = new Transaction(doc, "Create Energy Analysis"))
{
	try
	{
		t.Start();
		EnergyDataSettings energySettings = EnergyDataSettings.GetFromDocument(doc);
		energySettings.AnalysisType = AnalysisMode.ConceptualMassesAndBuildingElements;

		// Collect space and surface data from the building's analytical thermal model
		EnergyAnalysisDetailModelOptions options = new EnergyAnalysisDetailModelOptions();
		options.Tier = EnergyAnalysisDetailModelTier.Final; // include constructions, schedules, and non-graphical data in the computation of the energy analysis model
		options.EnergyModelType = EnergyModelType.BuildingElement;   // Energy model based on rooms or spaces

		EnergyAnalysisDetailModel eadm = EnergyAnalysisDetailModel.Create(doc, options); // Create a new energy analysis detailed model from the physical model
		IList&amp;lt;EnergyAnalysisSpace&amp;gt; spaces = eadm.GetAnalyticalSpaces();
		StringBuilder builder = new StringBuilder();
		builder.AppendLine("Spaces: " + spaces.Count);
		foreach (EnergyAnalysisSpace space in spaces)
		{
			SpatialElement spatialElement = doc.GetElement(space.CADObjectUniqueId) as SpatialElement;
			ElementId spatialElementId = spatialElement == null ? ElementId.InvalidElementId : spatialElement.Id;
			builder.AppendLine("   &amp;gt;&amp;gt;&amp;gt; " + space.SpaceName + " related to " + spatialElementId);
			IList&amp;lt;EnergyAnalysisSurface&amp;gt; surfaces = space.GetAnalyticalSurfaces();
			builder.AppendLine("       has " + surfaces.Count + " surfaces.");
			foreach (EnergyAnalysisSurface surface in surfaces)
			{
				builder.AppendLine("+++ Surface from " + surface.OriginatingElementDescription);
			}
		}
		TaskDialog.Show("EAM", builder.ToString());

		t.Commit();
	}
	catch (Autodesk.Revit.Exceptions.ArgumentException ex)
	{
		logger.Error("Error refreshing: ", ex);
		t.RollBack();
	}
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2017 19:26:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-04-07T19:26:42Z</dc:date>
    <item>
      <title>Energy Analysis - BuildingElement</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/energy-analysis-buildingelement/m-p/7003200#M59144</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like a bug in the Revit API, I'm trying to get analytical surfaces using building elements instead of spatial elements and it doesn't matter the configuration I'm using in the classes EnergyAnalysisDetailModel / EnergyDataSettings it always returns with no information there as you can see on the image bellow, if someone has any idea what's going on there please let me know. Thanks.&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="ea.PNG" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/342459i0C2FE601B55B9BDB/image-size/large?v=v2&amp;amp;px=999" role="button" title="ea.PNG" alt="ea.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 16:04:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/energy-analysis-buildingelement/m-p/7003200#M59144</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-07T16:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Energy Analysis - BuildingElement</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/energy-analysis-buildingelement/m-p/7003381#M59145</link>
      <description>&lt;P&gt;We get such result when we don't cast the parameter in the correct way. so try casting it back in a different way, may be you can extract points or curves out of it. or share a snap shot of the code so we can try to solve.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, Ibrahim Naeem&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 17:08:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/energy-analysis-buildingelement/m-p/7003381#M59145</guid>
      <dc:creator>IbrahimNaeem</dc:creator>
      <dc:date>2017-04-07T17:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Energy Analysis - BuildingElement</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/energy-analysis-buildingelement/m-p/7003667#M59146</link>
      <description>&lt;P&gt;Honestly, I've already tried it in every single way possible and I'm still getting the same results. I got it working using alternative ways to extract the geometry and intersection classes to get where these analytical results are coming from, but I'd like to use the class&amp;nbsp;EnergyAnalysisSurface and its properties because the information should be&amp;nbsp;already there and increase my application's performance.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;using (Transaction t = new Transaction(doc, "Create Energy Analysis"))
{
	try
	{
		t.Start();
		EnergyDataSettings energySettings = EnergyDataSettings.GetFromDocument(doc);
		energySettings.AnalysisType = AnalysisMode.ConceptualMassesAndBuildingElements;

		// Collect space and surface data from the building's analytical thermal model
		EnergyAnalysisDetailModelOptions options = new EnergyAnalysisDetailModelOptions();
		options.Tier = EnergyAnalysisDetailModelTier.Final; // include constructions, schedules, and non-graphical data in the computation of the energy analysis model
		options.EnergyModelType = EnergyModelType.BuildingElement;   // Energy model based on rooms or spaces

		EnergyAnalysisDetailModel eadm = EnergyAnalysisDetailModel.Create(doc, options); // Create a new energy analysis detailed model from the physical model
		IList&amp;lt;EnergyAnalysisSpace&amp;gt; spaces = eadm.GetAnalyticalSpaces();
		StringBuilder builder = new StringBuilder();
		builder.AppendLine("Spaces: " + spaces.Count);
		foreach (EnergyAnalysisSpace space in spaces)
		{
			SpatialElement spatialElement = doc.GetElement(space.CADObjectUniqueId) as SpatialElement;
			ElementId spatialElementId = spatialElement == null ? ElementId.InvalidElementId : spatialElement.Id;
			builder.AppendLine("   &amp;gt;&amp;gt;&amp;gt; " + space.SpaceName + " related to " + spatialElementId);
			IList&amp;lt;EnergyAnalysisSurface&amp;gt; surfaces = space.GetAnalyticalSurfaces();
			builder.AppendLine("       has " + surfaces.Count + " surfaces.");
			foreach (EnergyAnalysisSurface surface in surfaces)
			{
				builder.AppendLine("+++ Surface from " + surface.OriginatingElementDescription);
			}
		}
		TaskDialog.Show("EAM", builder.ToString());

		t.Commit();
	}
	catch (Autodesk.Revit.Exceptions.ArgumentException ex)
	{
		logger.Error("Error refreshing: ", ex);
		t.RollBack();
	}
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 19:26:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/energy-analysis-buildingelement/m-p/7003667#M59146</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-07T19:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Energy Analysis - BuildingElement</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/energy-analysis-buildingelement/m-p/9222476#M59147</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see your question has been unanswered since then, I have the same problem with Revit 2019 and 2020. Have you managed to find a way to access to the EnergyAnalysisSurface property? I am looking for the CadObjectUniqueId one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Samir&lt;/P&gt;</description>
      <pubDate>Sat, 28 Dec 2019 14:46:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/energy-analysis-buildingelement/m-p/9222476#M59147</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-28T14:46:22Z</dc:date>
    </item>
  </channel>
</rss>

