Ok. I cannot get this to work in Python.
No error whatsoever. And I get an IFC. But the values do not change.
And I also found some strange things with the Classificationsettings.
The exporter seems to remember old manually changed values. But I do not know how or where.
And they also do not show up when you manually want to change values.
Have you tried it Lukasz?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for the hint. I tried it in C#, however no success.... IFC exported, not error, just IfcClassification is missing.
I followed your advice - at the end we obviously provide serialized string to AddOption method. What is obvious, is that this string is the same as the one saved in Json file, exported from manual settings.
When exported manually, everything is fine.
Is it possible that this setting is saved in Revit Document, instead of being added to IFCExportOptions options ?
What do you think?
/Lukasz
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Lukasz,
The settings seems to be saved in the ExtensibleStorage (GUID 9a5a28c2-ddac-4828-8b8a-3ee97118017a). Beside some other UI settings for the IFC exporter. I think the exporter will read these values and use them while exporting.
So if this is true it is a part of the Project.
All the settings seem to be public and changeable. I tried but was not able to change these settings. Not sure why. Perhaps my knowledge of the ExtensibleStorage functionality.
Hi Lukasz.
I can confirm that it is possible to change the DataStorage. This will effect the export Classification Settings on export. However the Classification Description still has some issues. These issues are already there and are not related to what we are doing here.
By the way, it possible to create a new Type Text Project Parameter. Attach it to all relevant Categories. The value of this Type Parameter should be: {$this("Assembly Code")+":"+$this("Assembly Description")} Use the new created parameter as a reference for the Classification Parameter. This will create (at the moment) a new Classification with the correct settings. Check these links for more background info. https://github.com/Autodesk/revit-ifc/issues?q=is%3Aissue+is%3Aopen+classification https://www.bim42.com/2018/03/ifc-for-revit-2/ https://sourceforge.net/p/ifcexporter/wiki/Notes%20on%20parameter%20expression/
After some digging there are multiple things not working in the exporter as they should be. But we can get some things to work with multiple workarounds.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear all,
as in the title,
to add option for this IfcExportOption:
I can simple write:
options.AddOption("Export2DElements", "false");
but how can I programatically add Classification Settings, which in IfcExportOption .json look like this:
any help much appreciated,
Lukasz
Last edit: LWL 2023-10-18
I have not tested this at the moment.
But I found an interresting C# example online. Row 703
https://csharp.hotexamples.com/site/file?hash=0xccd9792b90d64b2dce3d80f89c71ab2db8c4d0a78f6825d843ec1bccf1990610
It seems a JSONstring should ? work in combination with "ClassificationSettings" or "ProjectAddress" as a Name in the IFCExportOptions .AddOption() method.
Ok. I cannot get this to work in Python.
No error whatsoever. And I get an IFC. But the values do not change.
And I also found some strange things with the Classificationsettings.
The exporter seems to remember old manually changed values. But I do not know how or where.
And they also do not show up when you manually want to change values.
Have you tried it Lukasz?
Hi Teun,
Thank you for the hint. I tried it in C#, however no success.... IFC exported, not error, just IfcClassification is missing.
I followed your advice - at the end we obviously provide serialized string to AddOption method. What is obvious, is that this string is the same as the one saved in Json file, exported from manual settings.
this is what I have:
When exported manually, everything is fine.
Is it possible that this setting is saved in Revit Document, instead of being added to IFCExportOptions options ?
What do you think?
/Lukasz
Hi Lukasz,
The settings seems to be saved in the ExtensibleStorage (GUID 9a5a28c2-ddac-4828-8b8a-3ee97118017a). Beside some other UI settings for the IFC exporter. I think the exporter will read these values and use them while exporting.
So if this is true it is a part of the Project.
All the settings seem to be public and changeable. I tried but was not able to change these settings. Not sure why. Perhaps my knowledge of the ExtensibleStorage functionality.
Last edit: Teun 2023-11-18
Hi Lukasz.
I can confirm that it is possible to change the DataStorage. This will effect the export Classification Settings on export. However the Classification Description still has some issues. These issues are already there and are not related to what we are doing here.
By the way, it possible to create a new Type Text Project Parameter. Attach it to all relevant Categories. The value of this Type Parameter should be: {$this("Assembly Code")+":"+$this("Assembly Description")} Use the new created parameter as a reference for the Classification Parameter. This will create (at the moment) a new Classification with the correct settings. Check these links for more background info.
https://github.com/Autodesk/revit-ifc/issues?q=is%3Aissue+is%3Aopen+classification
https://www.bim42.com/2018/03/ifc-for-revit-2/
https://sourceforge.net/p/ifcexporter/wiki/Notes%20on%20parameter%20expression/
After some digging there are multiple things not working in the exporter as they should be. But we can get some things to work with multiple workarounds.