@Anonymous @jeremytammik
The IFCExportOptions relies on the IFCExportConfiguration class which unfortunately is not described in the Revit API.
First we define our document and we create an instance of the IFCExportOptions class.
Document doc;
IFCExportOptions IFCExportOptions = new IFCExportOptions();
Then, import the reference of the IFCExportUI. This is located at the
"C:\Program Files\Autodesk\Revit 2020\AddIns\IFCExporterUI\IFCExportUI.dll"
You can now configure the extended IFC Options which are not described in the Revit API but are described in the IFC Export Revit addin using the IFCExportConfiguration class.
First create an instance of the IFC Export Configuration Class.
BIM.IFC.Export.UI.IFCExportConfiguration myIFCExportConfiguration = BIM.IFC.Export.UI.IFCExportConfiguration.CreateDefaultConfiguration();
Then add the required settings in this IFCExportConfiguration. Here I added only the "Export only element visible in view" setting shown at the image below.

myIFCExportConfiguration.VisibleElementsOfCurrentView = true;
We can also apply any other setting that exist in the IFCExportConfiguration class and which are equivalent to the IFC Export User Interface.

Then, we need to pass the options from the IFCExportConfiguration to the IFCExportOptions. Here we need to define a ElementId which refers to a 3D view. however, this is only used is the IFCExportConfiguration.visibleElementsOfCurrentView is set to true. If we don't want to define a 3D view we can also set this to null.
ElementId ExportViewId = null;
myIFCExportConfiguration.UpdateOptions(IFCExportOptions, ExportViewId);
Last but not least we define the Directory for the export and we process the export procedure.
string Directory = @"c:\"
doc.Export(Directory, doc, IFCExportOptions);
Below the whole code alltogether.
//Define Document
Document doc;
//Create an Instance of the IFC Export Class
IFCExportOptions IFCExportOptions = new IFCExportOptions();
//Apply the IFC Export Setting (Those are equivalent to the Export Setting in the IFC Export User Interface)
myIFCExportConfiguration.VisibleElementsOfCurrentView = true;
//Create an instance of the IFC Export Configuration Class
BIM.IFC.Export.UI.IFCExportConfiguration myIFCExportConfiguration = BIM.IFC.Export.UI.IFCExportConfiguration.CreateDefaultConfiguration();
//Define the of a 3d view to export
ElementId ExportViewId = null;
//Pass the setting of the myIFCExportConfiguration to the IFCExportOptions
myIFCExportConfiguration.UpdateOptions(IFCExportOptions, ExportViewId);
//Define the output Directory for the IFC Export
string Directory = @"c:\"
//Process the IFC Export
doc.Export(Directory, doc, IFCExportOptions);
I hope the above are useful. Let me know if anyone has any comment.
Best,
Alex