Not applicable
03-22-2020
03:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone!
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.
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):
####### 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()
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.
What could be a solution?
Thank you !
Solved! Go to Solution.