<?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 Store energy model somewhere in the revit file in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/store-energy-model-somewhere-in-the-revit-file/m-p/8887220#M41298</link>
    <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the&amp;nbsp;Analysis from the DB library to get the energy model so I can run some calculations from that model. For anyone interested, this is the piece of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;EmOpt = EnergyAnalysisDetailModelOptions()
    EmOpt.IncludeShadingSurfaces = False
    EmOpt.ExportMullions = False
    EmOpt.Tier = EnergyAnalysisDetailModelTier.SecondLevelBoundaries
    EmOpt.EnergyModelType = EnergyModelType.SpatialElement

    tx = Transaction(doc)
    tx.Start('create model')
    model = EnergyAnalysisDetailModel.Create(doc,EmOpt)
    tx.Commit()&lt;/PRE&gt;&lt;P&gt;My problem is that, for large models, it is annoying to have to run this function each time i run the code, even if no changes have been made to the model.&lt;/P&gt;&lt;P&gt;So the question is: is there a way to calculate and store the energy model somewhere in the revit file and access it any time I need to get info from it?&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Pedro&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2019 08:26:12 GMT</pubDate>
    <dc:creator>pedromz5GA9B</dc:creator>
    <dc:date>2019-07-03T08:26:12Z</dc:date>
    <item>
      <title>Store energy model somewhere in the revit file</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/store-energy-model-somewhere-in-the-revit-file/m-p/8887220#M41298</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the&amp;nbsp;Analysis from the DB library to get the energy model so I can run some calculations from that model. For anyone interested, this is the piece of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;EmOpt = EnergyAnalysisDetailModelOptions()
    EmOpt.IncludeShadingSurfaces = False
    EmOpt.ExportMullions = False
    EmOpt.Tier = EnergyAnalysisDetailModelTier.SecondLevelBoundaries
    EmOpt.EnergyModelType = EnergyModelType.SpatialElement

    tx = Transaction(doc)
    tx.Start('create model')
    model = EnergyAnalysisDetailModel.Create(doc,EmOpt)
    tx.Commit()&lt;/PRE&gt;&lt;P&gt;My problem is that, for large models, it is annoying to have to run this function each time i run the code, even if no changes have been made to the model.&lt;/P&gt;&lt;P&gt;So the question is: is there a way to calculate and store the energy model somewhere in the revit file and access it any time I need to get info from it?&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Pedro&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 08:26:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/store-energy-model-somewhere-in-the-revit-file/m-p/8887220#M41298</guid>
      <dc:creator>pedromz5GA9B</dc:creator>
      <dc:date>2019-07-03T08:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Store energy model somewhere in the revit file</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/store-energy-model-somewhere-in-the-revit-file/m-p/8887977#M41299</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what about the static method EnergyAnalysisDetailModel.GetMainEnergyAnalysisDetailModel(Document doc) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since the EnergyAnalysisDetailModel is just an Element, it is already stored in the project file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 13:27:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/store-energy-model-somewhere-in-the-revit-file/m-p/8887977#M41299</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2019-07-03T13:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Store energy model somewhere in the revit file</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/store-energy-model-somewhere-in-the-revit-file/m-p/8888108#M41300</link>
      <description>&lt;P&gt;The&amp;nbsp;EnergyModelType.SpatialElement is never stored, since this option is only available for export. The energy model in Revit which Revitalizer refers to is always EnergyModelType.BuildingElement.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 14:10:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/store-energy-model-somewhere-in-the-revit-file/m-p/8888108#M41300</guid>
      <dc:creator>cwaluga</dc:creator>
      <dc:date>2019-07-03T14:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Store energy model somewhere in the revit file</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/store-energy-model-somewhere-in-the-revit-file/m-p/8897566#M41301</link>
      <description>&lt;P&gt;There was a really easy and simple solution for my question. It turns out that the model is indeed stored in the revit file. From the EnergyAnalysisDetailModel class:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If there is already a persistent EnergyAnalysisDetailModel element in the document, the API can generate other independent energy models, but they will not be affected by the actions the user takes in the UI. The EnergyAnalysisDetailModel will remain in the document until it is discarded (either by the actions of the user, or by a call to Document.Delete()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In other words, if the model already exists, it can be accessed through the function GetMainEnergyAnalysisDetailModel(). If it does not exist, then it should be generated through the EnergyAnalysisDetailModel.Create. Keep in mind that the model is only stored if there are no models available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the replies.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 07:10:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/store-energy-model-somewhere-in-the-revit-file/m-p/8897566#M41301</guid>
      <dc:creator>pedromz5GA9B</dc:creator>
      <dc:date>2019-07-09T07:10:03Z</dc:date>
    </item>
  </channel>
</rss>

