Message 1 of 2
API IFC Export with shared parameters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello there,
i have a functioning c# plugin for revit 2024 that creates in ifc (2x3CV2 )file via IFCExportOptions and sends it to an adress.
In this progess i struggle to include shared parameters in the ifc.
I have a shared parameters .txt file and allready set up ifc configuration but i dont find a method of accesing these.
An additional challenge is that i would like to export special groups of shared parameters also when they have no value. So to speak the parameters are untouched and have no value yet. Until now i need to first set a value to them to export.
Any resources or tips fo this case?
IFCExportOptions ifcOptions = new IFCExportOptions
{
FileVersion = IFCVersion.IFC2x3CV2, // IFC Schema in Zukunft ifc4x3/ifc4 testen
ExportBaseQuantities = true, // Basis-Mengen exportieren
};
string exportDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "IFC_Exports");
Directory.CreateDirectory(exportDirectory); // Ensure directory exists
string fileName = $"{ifcFileName}.ifc";
string exportPath = Path.Combine(exportDirectory, fileName);
using (Transaction trans = new Transaction(doc, "Export IFC"))
{
trans.Start();
doc.Export(exportDirectory, fileName, ifcOptions);
trans.Commit();
}
Revit 2024, .Net 4.8
Thank You