create_gbXML

xgbxml.xgbxml.create_gbXML(id=None, engine=None, temperatureUnit='C', lengthUnit='Meters', areaUnit='SquareMeters', volumeUnit='CubicMeters', useSIUnitsForResults=True, version='6.01', SurfaceReferenceLocation=None)[source]

Returns a root gbXML element for a new, blank gbXML file.

The keyword arguments for this function set the XML attributes of the newly created gbXML element. See the gbXML schema for details of these attributes..

Return type:

xgbxml.xgbxml.gbXML (subclass of lxml.etree._Element)

Note

The returned object is a subclass of lxml.Element, not an lxml.ElementTree.

To access the ElementTree of the returned gbXML element, the lxml method getroottree() can be used. This is needed to save the gbXML file using the ElementTree write() method.

Code Example

import xgbxml
gbxml=xgbxml.create_gbXML()
tree=gbxml.getroottree()
tree.write('new_gbxml_file.xml')