Hey,
I am trying to export an IFC file as IFCzip. But i cant seem to get the settings right for a zip file.
My current script i modified from the Genius Loci Package:
# Proposed by Nicklas Verdier Østergaard, nvo@niras.dk
# https://github.com/pzurek/ifcexporter/blob/master/IFCExporterUI/Source/IFCExportConfiguration.cs
# Revised by Alban de Chasteigner
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
def tolist(obj1):
if hasattr(obj1, "__iter__"):
return obj1
else:
return [obj1]
folder = UnwrapElement(IN[0])
name = tolist(UnwrapElement(IN[1]))
view = tolist(UnwrapElement(IN[2]))
fileversion = IN[3]
wallandcolumnsplitting = IN[4]
exportbasequantities = IN[5]
Projectorigin = IN[6]
if isinstance(IN[7], list):
inputdoc = IN[7]
else:
inputdoc = [IN[7]]
# Inputdoc : Part of script by Andreas Dieckmann
if inputdoc[0] == None:
doc = DocumentManager.Instance.CurrentDBDocument
elif inputdoc[0].GetType().ToString() == "Autodesk.Revit.DB.Document":
doc = inputdoc[0]
else:
doc = DocumentManager.Instance.CurrentDBDocument
t = Transaction(doc, 'export')
t.Start()
result = []
for i, v in enumerate(view):
options = IFCExportOptions()
# if fileversion != None:
# options.FileVersion = fileversion
if fileversion == "IFC4":
options.FileVersion = IFCVersion.IFC4
if fileversion == "IFC4RV":
options.FileVersion = IFCVersion.IFC4RV
if fileversion == "IFC4DTV":
options.FileVersion = IFCVersion.IFC4DTV
if fileversion == "IFC2x2":
options.FileVersion = IFCVersion.IFC2x2
if fileversion == "IFC2x3":
options.FileVersion = IFCVersion.IFC2x3
if fileversion == "IFC2x3CV2":
options.FileVersion = IFCVersion.IFC2x3CV2
if fileversion == "IFC2x3BFM":
options.FileVersion = IFCVersion.IFC2x3BFM
if fileversion == "IFC2x3FM":
options.FileVersion = IFCVersion.IFC2x3FM
if fileversion == "IFCBCA":
options.FileVersion = IFCVersion.IFCBCA
if fileversion == "IFCCOBIE":
options.FileVersion = IFCVersion.IFCCOBIE
if fileversion == "":
options.FileVersion = IFCVersion.Default
options.WallAndColumnSplitting = wallandcolumnsplitting
options.FilterViewId = v.Id
options.AddOption("ExportBaseQuantities", "true");
options.AddOption("SplitWallsAndColumns", "false");
options.AddOption("ExportInternalRevitPropertySets", "true");
options.AddOption("ExportIFCCommonPropertySets", "true");
options.AddOption("Export2DElements", "true");
options.AddOption("VisibleElementsOfCurrentView", "true");
options.AddOption("Use2DRoomBoundaryForVolume", "false");
options.AddOption("UseFamilyAndTypeNameForReference", "true");
options.AddOption("ExportPartsAsBuildingElements", "false");
options.AddOption("ExportSolidModelRep", "false");
options.AddOption("ExportSchedulesAsPsets", "false");
options.AddOption("ExportUserDefinedPsets", "true");
options.AddOption("ExportUserDefinedPsetsFileName", "P:/Revit/14_IFC/HEK Revit ILS_OenE Propertyset.txt")
options.AddOption("ExportUserDefinedParameterMapping", "false");
options.AddOption("ExportUserDefinedParameterMappingFileName", "");
options.AddOption("ExportBoundingBox", "false");
options.AddOption("IncludeSiteElevation", "false");
options.AddOption("UseActiveViewGeometry", "true");
options.AddOption("ExportSpecificSchedules", "false");
options.AddOption("TessellationLevelOfDetail", "0.5");
options.AddOption("UseOnlyTriangulation", "false");
options.AddOption("StoreIFCGUID", "false");
options.AddOption("ExportRoomsInView", "false");
options.AddOption("ExportLinkedFiles", "false");
options.AddOption("ActiveViewId", "-1");
options.AddOption("ExcludeFilter", "");
options.AddOption("COBieCompanyInfo", "");
options.AddOption("COBieProjectInfo", "");
options.AddOption("IncludeSteelElements", "true");
options.AddOption("UseTypeNameOnlyForIfcType", "false");
options.AddOption("UseVisibleRevitNameAsEntityName", "true");
options.AddOption("GeoRefCRSName", "");
options.AddOption("GeoRefCRSDesc", "");
options.AddOption("GeoRefEPSGCode", "");
options.AddOption("GeoRefGeodeticDatum", "");
options.AddOption("GeoRefMapUnit", "");
options.AddOption("IsBuiltIn", "false");
options.AddOption("IsInSession", "false");
# IFCVersion Version = (IFCVersion) Enum.Parse( typeof(IFCVersion), UnwrapElement(IN[3]), true );
# x.FileVersion = IFCVersion.IFC2x3CV2
c = doc.Export(folder, name[i], options)
result.append(c)
t.Commit()
if fileversion == "":
OUT = "Default settings used"
else:
OUT = 'Success'
Is there some API documentation about AddOption?