IFCExportConfigurationsMap AddSavedConfigurations not working

IFCExportConfigurationsMap AddSavedConfigurations not working

david_rock
Enthusiast Enthusiast
894 Views
3 Replies
Message 1 of 4

IFCExportConfigurationsMap AddSavedConfigurations not working

david_rock
Enthusiast
Enthusiast

Hello,

I'm trying to add the IFC Export configurations to my IFC Exporter add on.

However when I use the following code the Saved Configurations are not added.

Using 'C:\Program Files\Autodesk\Revit 2018\AddIns\IFCExporterUI\IFCExportUI.dll' > Not shown at all.

Using 'C:\ProgramData\Autodesk\ApplicationPlugins\IFC 2018.bundle\Contents\2018\IFCExportUIOverride.dll' > Only shown once the File Export IFC command is initialised.

 

            Dim configurationsMap As IFCExportConfigurationsMap = New IFCExportConfigurationsMap()
            configurationsMap.Add(IFCExportConfiguration.GetInSession)
            configurationsMap.AddBuiltInConfigurations()
            configurationsMap.AddSavedConfigurations()

Any ideas why this is and what I can add to my code to initialise/force the Saved Configurations to display?

Kind Regards

David

 

0 Likes
895 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk

Nope, sorry.

 

All the real IFC experts are discussing the nitty-gritty stuff in the open source Revit IFC forum, so you might have better luck there:

 

https://sourceforge.net/p/ifcexporter/discussion/general

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 4

svein.horve
Contributor
Contributor

Hi,

 

I was having the same issue and then found this dated post, so for anyone having the same issue I found a solution.

 

"AddSavedConfigurations()" seems to be using a static property in "IFCCommandOverrideApplication" called "TheDocument" to load the stored configurations. This property doesn't get set until "OnIFCExport()" is called.

 

Because it's a private property I used reflection to set this property before calling AddSavedConfigurations():

 

var t = typeof(IFCCommandOverrideApplication);
t.GetProperty("TheDocument").SetValue(null, doc);

 

 

Message 4 of 4

formlabKHCQN
Community Visitor
Community Visitor

Thank you! That was very helpful

0 Likes