Find elements in Revit based on the elements exported in DWF

By Joe Ye

Issue

We are trying to find elements in  Revit based on the exported DWF via the GUID in the DWF export. I cannot find any elements using this, how can we find the elements using the GUID from the exported DWF ?

 

Solution

The element GUID in DWF is different from the same element’s GUID in Revit. So it is not possible to retrieve the element in Revit according to the GUID obtained from DWF file.
However, each element in the exported DWF file has the property Id. We can use this Id value to retrieve element in Revit.Here is the pseudo-code.

// the argument idFromDWF is obtained from dwf file.        ElementId id = new ElementId(idFromDWF);        Element elem = doc.get_Element(id);

Comments

One response to “Find elements in Revit based on the elements exported in DWF”

  1. You can also use ExportUtils::GetExportId to get the GUID used in the DWF from the element Id.

Leave a Reply to MaxenceCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading