<?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: Export of multiple GBXML models in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/export-of-multiple-gbxml-models/m-p/12011838#M35755</link>
    <description>&lt;P&gt;Based on the code snippet provided, it appears that only R-values are manipulated and not the underlying model geometry. If that's the case, best to use Revit to export a single gbXML seed file. Then iterate over desired seed file parameters (like R-value) in an environment like Python which is excellent for large scale text operations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two utilities that would help with the route described above:&lt;/P&gt;&lt;P&gt;1. &lt;A href="https://microsoft.github.io/XmlNotepad/" target="_blank" rel="noopener"&gt;XmlNotepad&lt;/A&gt; (to build familiarity with gbXML structure and mechanization),&lt;/P&gt;&lt;P&gt;2. &lt;A href="https://xgbxml.readthedocs.io/en/latest/what_is_xgbxml.html" target="_blank" rel="noopener"&gt;xgbxml&lt;/A&gt; (Python library for gbXML parsing and manipulation).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Jake&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jun 2023 13:46:54 GMT</pubDate>
    <dc:creator>RIPENG</dc:creator>
    <dc:date>2023-06-05T13:46:54Z</dc:date>
    <item>
      <title>Export of multiple GBXML models</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-of-multiple-gbxml-models/m-p/9392003#M35752</link>
      <description>&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;For my Thesis work at my university I have to make a lot of different GBXML models (around 18000). No way I can do that without code.&lt;/P&gt;&lt;P&gt;This is what I came up with (I attached only a part of it; FloorR, WallsR, RoofR are lists to set R value of corresponding elements):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;####### Setting Enegry Analysis parameters  #############

opt=Analysis.EnergyAnalysisDetailModelOptions()
opt.EnergyModelType=Analysis.EnergyModelType.BuildingElement
opt.ExportMullions=False
opt.IncludeShadingSurfaces=False
opt.SimplifyCurtainSystems=True
opt.Tier=Analysis.EnergyAnalysisDetailModelTier.SecondLevelBoundaries



##### loop over all R-value combinations and create models    ####################

t=Transaction(doc,"R change")
c=Transaction(doc,"model creation")

for i in range(len(FloorR)):
		for j in range(len(WallsR)):
			for k in range(len(RoofR)):
				t.Start()
				Floor.Set(FloorR[i]/0.3048)  #R-value change for floor
				Wall.Set(WallsR[j]/0.3048)#R-value change for Walls
				Roof.Set(RoofR[k]/0.3048)#R-value change for roof
				t.Commit()
				t.Dispose()
				
				c.Start()
				model=Analysis.EnergyAnalysisDetailModel.Create(doc, opt)
				model.TransformModel()
				GBopt=GBXMLExportOptions()
				GBopt.ExportEnergyModelType=ExportEnergyModelType.BuildingElement
				doc.Export("C:\Users\Миша\Desktop\ASD","0"+","+str(0.2/FloorR[i])+","+str(0.3/WallsR[j])+","+str(0.3/RoofR[k]), GBopt)
				c.Commit()
                               &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This creates models, but I ran into a problem I dont fully understand: as the process continues, it slowes down and stops at about 170-175 created models. Apparently, comething is taking up the memory. I tried to doc.Delete(model) at the end of each 'for' loop, but it didnt help either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could be a solution?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Mar 2020 10:31:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-of-multiple-gbxml-models/m-p/9392003#M35752</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-22T10:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Export of multiple GBXML models</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-of-multiple-gbxml-models/m-p/9392164#M35753</link>
      <description>&lt;P&gt;The behaviour you describe is completely expected and as designed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revit is an end user product designed to be driven by a human being.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Human beings are not expected to sit down and create 18000 models in one sitting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you implement an external executable that drives Revit using the code you shared above and monitors progress as you export results from the models you create.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Whenever Revit starts slowing down, take note of how far you got in processing,&amp;nbsp;kill the process, restart Revit and continue from where you left off.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a common approach to programmatically drive processes in batch mode that were not designed for it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also search The Building Coder for further hints on batch processing Revit documents:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.google.com/search?q=batch+processing&amp;amp;as_sitesearch=thebuildingcoder.typepad.com" target="_blank"&gt;https://www.google.com/search?q=batch+processing&amp;amp;as_sitesearch=thebuildingcoder.typepad.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you could generate your 18000 models online using Forge and DA4R:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.55" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.55&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck and have fun with your thesis!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Mar 2020 14:09:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-of-multiple-gbxml-models/m-p/9392164#M35753</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-03-22T14:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Export of multiple GBXML models</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-of-multiple-gbxml-models/m-p/9392210#M35754</link>
      <description>&lt;P&gt;I'll try those out, thank you for your answer!&lt;/P&gt;</description>
      <pubDate>Sun, 22 Mar 2020 14:45:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-of-multiple-gbxml-models/m-p/9392210#M35754</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-22T14:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Export of multiple GBXML models</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-of-multiple-gbxml-models/m-p/12011838#M35755</link>
      <description>&lt;P&gt;Based on the code snippet provided, it appears that only R-values are manipulated and not the underlying model geometry. If that's the case, best to use Revit to export a single gbXML seed file. Then iterate over desired seed file parameters (like R-value) in an environment like Python which is excellent for large scale text operations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two utilities that would help with the route described above:&lt;/P&gt;&lt;P&gt;1. &lt;A href="https://microsoft.github.io/XmlNotepad/" target="_blank" rel="noopener"&gt;XmlNotepad&lt;/A&gt; (to build familiarity with gbXML structure and mechanization),&lt;/P&gt;&lt;P&gt;2. &lt;A href="https://xgbxml.readthedocs.io/en/latest/what_is_xgbxml.html" target="_blank" rel="noopener"&gt;xgbxml&lt;/A&gt; (Python library for gbXML parsing and manipulation).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Jake&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 13:46:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-of-multiple-gbxml-models/m-p/12011838#M35755</guid>
      <dc:creator>RIPENG</dc:creator>
      <dc:date>2023-06-05T13:46:54Z</dc:date>
    </item>
  </channel>
</rss>

