Helo!
How can I generate elements that have specific GUID?
Example - I have one ( or a lot of ) element and GUID(s) ( that I want ), I need element having that GUID.
If you are speaking about Element.UniqueId then the answer is no, those are generated by Revit.
Hi @ol2743,
Do you mean ElementId , UniqueId or version Guid.
I believe all the above are unique identifiers auto-generated and stored in an external database to uniquely select or retrieve an element when created.
There is way you could specify the above on your own and assign them manually to an element
What you think about it ?
https://jeremytammik.github.io/tbc/a/0567_extensible_storage.htm
You mean that you wish to generate a Revit BIM element and specify its unique id?
No, that is not possible.
If you are in a situation with such a requirement, there is a serious flaw in your workflow design and architecture.
Use some other identifier. If you need to define the identifier yourself, then do so.
You cannot expect Revit or any other software to generate a GUID according to your specification.
An example of generating and storing your own GUID to identify a project that could also be used for individual BIM elements is given by the named GUID storage for project identification:
https://thebuildingcoder.typepad.com/blog/2016/04/named-guid-storage-for-project-identification.html
We need it - for IFC export. That our workflow is that we have a master database, from which we need to generate and re-generate objects in Revit - but we would like that when exported to IFC, their GlobalId is set to something that we have generated in our own project, not newly assigned by Revit each case.
Well, sorry, you read all the unanimous answers above. You can easily program a workaround. You will not be able to force Revit to use the unique ids you need, but you can easily equip the building elements with the pre-existing ids in your own data structure and replace them in the IFC file or elsewhere along the processing pipeline. Be creative.
There is already a mechanism for keeping IFC GUID's consistent for elements between IFC exports from a Revit project.
https://forums.autodesk.com/t5/revit-api-forum/guid/m-p/10616955/highlight/true#M58275
If you need to recreate the elements in Revit then your need to repopulate the parameter used to store the GUID in relation to the above setting with the value you want it to be.
So if you are creating elements in Revit from data in this external database then just populate the parameter of that created element with what exists in your external database (removing same superseded item in Revit). Then when exported the IFC GUID will be generated from the parameter if the above setting is used for export.
Dear Thomas,
Wow, thank you very much for pointing out that super important feature and thread answer of yours. I was previously unaware of it. Sounds like an important step towards a viable solution to me.
Cheers,
Jeremy
Can't find what you're looking for? Ask the community or share your knowledge.