Get Ifc GUID without "backwritting" it?

i have still a issue with this IFC_GUID.

i deleted all my Guids, because it is dangerous to have it stored as a string in elements!
(copy and editing)

is the guid not a “hidden” Parameter ?

because i cleaned all guids and now i cant get this guid anymore,

is it not the same as the Revit ID ? i mean not editable…

grafik

i don`t want to “backwrite” my guids as editable string! thats helirous!

i want just to get the guids?
https://forum.dynamobim.com/t/get-ifcguid-how/93711/4

KR

Andreas

I don’t believe Revit natively stores an IFC Guid until it first generates an IFC, and can only store it in the default exposed parameter from there, as opposed to behind the scenes like the Revit Element Id and GUID.

Having said that you could consider writing a pairs file with element Ids and IFC guids that you can run in future after an IFC export to make sure any wiped values are able to be reinstated based on the matching element Ids (which users cannot change) before the next time you export.

2 Likes

Gavin in 100% correct here. GUIDs are generated on export or import.

If memory serves the IFC GUIDs are derivative from the element GUIDs when exporting, and are pulled from the IFC file itself on import (which is why they need to be overwritable - the import rules here). If you need to ‘track’ the IFC GUID over time you can generate the GUID and build an extensible storage schema to tie the two together over time (which would ensure that IFC GUIDs were tied to element GUIDs), but I would not recommend adding a 3rd data source (the RVT, the IFC, and the pairs file) unless you have to. In the ‘have to’ situations, I recommend utilizing the element GUID instead of element ID.

3 Likes

I am fairly certain (99.9%) that as of Revit 2023 IfcGuids are generated as soon as an element is created in Revit - no IFC export required whatsoever.
In previous versions it was/is also possible to programmatically store IfcGuids in elements without exporting to IFC. You would first create the relevant GUID with one of the methods in the ExporterIFCUtils class and then use the AddValueString method from the same class (AddValueString Method) to write the parameter value to the element. This will either overwrite an existing IfcGuid parameter value or add that parameter to the element if it doesn’t exist yet.
If you run a script like that before exporting you are going to have consistent stable IfcGuids even if your users feel like editing them between exports… :wink:

3 Likes