I’m looking to test out a .DYN that will receive a list of GUIDs and then select those Revit model elements.
I currently have a test project set up with three pieces of MEP Fabrication Pipework geometry. I am looking to retrieve the GUID from these three pieces of geometry to use for testing.
I continue to receive an “Unhandled Exception Error” Message, I am not sure as to why
I’ve realized that the above script does not do what I am looking for. I am looking to extract the GUID from a Revit Element. The same GUID Value that will match up with the GUID value that can be extracted from AutoCAD.
I am importing AutoCAD geometry into Revit and am looking to extract the GlobalUniqueID from the Revit Content. I am having a rough time with this one.
Are you referring to an IFC GUID? The UniqueId of a Revit element is Revit-specific and not globally unique. When you import the data from AutoCAD is there a GUID parameter which you can see in Revit?
I’m not sure if this can be accomplished as Revit does not use GUIDs. I haven’t used much AutoCAD so I don’t know where to approach it from that end. I have used a bit of Civil3D to create property sets using formulas (examples here) to carry over additional data that isn’t typically included in an IFC export. However, if you are not using IFC, this approach may not work for you.
The file includes an elbow and a table that contains the elbow’s Globally Unique ID.
And I am looking to extract the same value from the same content in Revit (after I import the content into Revit.) Should I be looking into IFC GUID? I suppose I just always assumed it was something totally unrelated. I’m not at all sure how it works.
Also, for what it is worth, I am running AutoCAD 2019, Revit 2019, and Dynamo 2.0.3.8811
Hello @aaronrumple! I would also like to get the GUID of a revit element. I am trying this python script but it does not seem to be working. Is this script correct above? Please advise.
element_lists = UnwrapElement(IN[0])
uniqueid_lists = []
for element_list in element_lists:
uniqueid_temp = []
for element in element_list:
uniqueid_temp.append(element.UniqueId)
uniqueid_lists.append(uniqueid_temp)
OUT = uniqueid_lists
This can (and should) be done with a recursive function, but I would need to do a refresher on recursion first.
A recursive function would be able to handle any level of nesting (e.g. if you have a single element, list of elements, or list of list of elements, etc.). If one were to provide a list of elements with a 3rd level of nesting to the above code, it would also fail.
However, I would like to point out that the above code gets the UniqueId of each element. The UniqueId is not globally unique, which has been discussed on the Revit API forum. If you are trying to get an IFC Guid, the above code doesn’t do that.