Changes not applied gbXML export via Python script


I found a Python script on the web which allows to automatically export gbXML file from Revit using Dynamo and added some custom feature which include call to a webservice for gbXML parsing.
It works great unless some changes are not applied to the export file.

I have a Revit model with some spaces (arround 100).
I did a first export then I noticed that a few spaces had a wrong space type.
Went back to Revit, applied the modifications needed and relaunched the dynamo script.
The result is the same as before, the space types are not modified in the gbXML feed.

I have also tried to delete the space and recreate it => result is the same
Add more spaces => the new one are not in the gbXML feed.

If I do the process manually: R / Export / gbXML / choose spaces : it works.

Any ideas on how to fix that?

Thanks a lot.

I’m no expert on this, but I think people will want to see your Python script.


#Import Lib externes à Revit
import sys
sys.path.append(r’C:\Program Files (x86)\IronPython 2.7\DLLs’)
sys.path.append(r’C:\Program Files (x86)\IronPython 2.7\Lib’)

#Lib qui permet d'ouvrir le navigateur web et donc charger le webservice pour parser le fichier gbXML
import webbrowser

#Libs Revit
import clr
from Autodesk.DesignScript.Geometry import *
import clr

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

from Autodesk.Revit.DB import *

#Récupère les variables passée en arguemnts 
folder = IN[0]
filename = IN[1]
complete = folder+'\\'+filename+'.xml'

optionsenergy = Analysis.EnergyAnalysisDetailModelOptions()

#Choose between final or secondlevel boundaries for export
#optionsenergy.Tier = Analysis.EnergyAnalysisDetailModelTier.Final
optionsenergy.Tier = Analysis.EnergyAnalysisDetailModelTier.SecondLevelBoundaries

model = Analysis.EnergyAnalysisDetailModel.Create(doc,optionsenergy)

options = GBXMLExportOptions()
#buildingelement supposedly only works with massExport
#options.ExportEnergyModelType = ExportEnergyModelType.BuildingElement

options.ExportEnergyModelType = ExportEnergyModelType.SpatialElement


#Appel le script de parsing gbXML'http://localhost/tfe/backend/gbxml_parser.php?file=' + complete, new=2)

#Variable de sortie
OUT = 0
1 Like

Any ideas on this?