I am exporting gbXML files using the Revit API. This seems to be using the Revit energy settings. Revit breaks up the wall the window is located within by creating a wall the same size as the window and then creates a mesh around it (see picture). When I translate the gbXML file to an EnergyPlus Idf file and run the analysis, EnergyPlus throws an error because the window is the same size as the wall it is located within.
When I use the Revit gbXML export dialog and export Room/Space volumes this is not the case. It export the window located within the wall as drawn in Revit.
I do however want to use the API to export. Am I getting it wrong somewhere and is there a work around or is this a bug?
Dear Jaco,
Happy New Year to you!
Thank you for your query.
Yes, that does sound strange.
Could you provide a minimal reproducible case for me to pass on to the development team for further analysis?
The onewindow sample model looks like a good place to start, and you apparently already have to code to run the gbxml export on that.
In order to understand exactly what you mean and be able to research possible reasons for the discrepancy between the observed and expected behaviour, they require:
http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b
Thank you!
Best regards,
Jeremy
Hi Jeremy
Happy New Year to you as well and thank you for the reply
The script I am using is a Dynamo Zero Touch library. I have attached a zip file with the Visual Studio Solution, Dynamo Script and Revit file. A further description below:
A short exact description of what you are trying to achieve
Export gbXML file from Revit via Dynamo. Translate the file to and Idf file. Run file within Dynamo. Get results and feed it back into HVAC design within Revit.
The behaviour you observe versus what you expect, and why this is a problem.
The RevitAPI uses the energy settings to export the gbXML file. Revit creates a wall the same size as a window and then divides the rest of the wall into a mesh around it. The problem is that the wall and the window is the exact same size and when Eplus runs the idf file it troughs and error. This can be seen in the gbXML file where the opening coordinates and the wall coordinates hosting the opening is exactly the same. This is also the case when a gbXML file is exported out of Revit with the Export Dialogue box using "Use Energy Settings". I would expect the wall with the window not to be broken up as is the case when exporting using the "Use Room/Space Volumes" setting
A complete yet minimal Revit sample model to run a test in.
See attached.
A complete yet minimal macro embedded in the sample model or Visual Studio solution with add-in manifest that can be compiled, loaded, run and debugged with a single click to analyse its behaviour live in the sample model.
See attached Visual Studio Solution
Detailed step-by-step instructions for reproducing the issue, e.g. which element to pick, what command to launch etc.
See attached Dynamo Script.
Regards
Jaco Kemp
Dear Jaco,
Thank you for your update, appreciation and reproducible case.
I logged the issue REVIT-106442 [API driven gbXML export creates wrong size window] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software. Please make a note of this number for future reference.
You are welcome to request an update on the status of this issue or to provide additional information on it at any time quoting this change request number.
This issue is important to me. What can I do to help?
This issue needs to be assessed by our engineering team, and prioritised against all other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:
This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.
Best regards,
Jeremy
Hi Jeremy,
Thank you for your assistance.
Impact on your application and/or your development.
At the moment this is in the experimental phase to be implemented once it is shown to be more affective to the overall mechanical design process than using IES/Design Builder outside of Revit/Dynamo work flow.
The number of users affected.
None
The potential revenue impact to you.
At the moment none
The potential revenue impact to Autodesk.
No opinion
Realistic timescale over which a fix would help you.
1 to 2 months
Regards
Jaco
Dear Jaco,
Thank you for your update and business case, which I added to the developement issue REVIT-106442 [API driven gbXML export creates wrong size window] for you.
Cheers,
Jeremy
Jaco,
You can use the API to use the spaces export method to export the gbXML file (not sure if you want to use this, or you are specifically trying to use the energy settings method.) You first need to setup your energy model settings then create the energy model. Then you can export the gbXML file. See example code below.
'define the energy model options Dim EmOpt As New EnergyAnalysisDetailModelOptions EmOpt.EnergyModelType = EnergyModelType.SpatialElement EmOpt.ExportMullions = False EmOpt.IncludeShadingSurfaces = True EmOpt.SimplifyCurtainSystems = True 'create the energy analysis (modifies model, wrapped in tx) Using tx As New Transaction(doc) tx.Start("Create Internal E-Model") Dim Em As EnergyAnalysisDetailModel = EnergyAnalysisDetailModel.Create(doc, EmOpt) tx.Commit() End Using 'set the gbXML options Dim gbxmlOpt As New GBXMLExportOptions gbxmlOpt.ExportEnergyModelType = ExportEnergyModelType.SpatialElement 'export the gbXML file doc.Export(folder, doc.Title, gbxmlOpt)
Hi Devon,
Thank you for the example. It works for exporting spaces and don't have the same problem as exporting surfaces. This will do for now. For completeness I have included the C# code of your solution.
public static string RevitToGbXMLSpaces(string projectLocation) { //define the energy model options var EmOpt = new EnergyAnalysisDetailModelOptions(); EmOpt.EnergyModelType = EnergyModelType.SpatialElement; EmOpt.ExportMullions = true; EmOpt.IncludeShadingSurfaces = true; EmOpt.SimplifyCurtainSystems = true; //create the energy analysis (modifies model, wrapped in tx) Document doc = DocumentManager.Instance.CurrentDBDocument; using (Transaction tx = new Transaction(doc)) { tx.Start("Create Internal E-Model"); EnergyAnalysisDetailModel.Create(doc, EmOpt); tx.Commit(); } //set the gbXML options var gbxmlOpt = new GBXMLExportOptions() { ExportEnergyModelType = ExportEnergyModelType.SpatialElement }; //export the gbXML file string fileName = "temp"; doc.Export(projectLocation, fileName, gbxmlOpt); return projectLocation + "\\" + fileName + ".xml"; }
Many thanks to Devon for the solution and Jaco for the confirmation that it works!
I summarised the conversation and added some background info on The Building Coder:
http://thebuildingcoder.typepad.com/blog/2017/01/family-category-and-two-energy-model-types.html#3
Cheers,
Jeremy
glad that helped! It took me more than a few tries to get it all to work out how I wanted it. But pretty nice to have users export using the settings you want. Cheers.
Thanks for the extra background Jeremy.
Hello everyone,
Sorry to revive a thread which has been solved more than one year ago, however the solution you provided is not working for me as I am programming in python.
I am using pyRevit to program functions in python and when I use the code you presented above I get the following error:
EnergyAnalysisDetailModelOptions.ExportMullions = False Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: static property 'ExportMullions' of 'EnergyAnalysisDetailModelOptions' can only be assigned to through a type, not an instance
If I understand this correctly, I am having a problem due to the type of variable in my code. However, python does not allow the declaration of variables. How can I make the statement to become a type and not an instance?
Any idea how I can get past this issue without moving on to another language?
A nice example of Python EnergyAnalysisDetailModelOptions admin is located here. Snippet is below:
####### 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
-Jake
Can't find what you're looking for? Ask the community or share your knowledge.