Autodesk.Revit.DB.ElementId to Autodesk.Revit.DB.Element


#1

Hi

I have Autodesk.Revit.DB.ElementId - its Id of the parameter

Are the exist way to convert

Autodesk.Revit.DB.ElementId to Autodesk.Revit.DB.Element


p.s.

for example

doc.GetElement(Autodesk.Revit.DB.ElementId) - get me Revit.Element but i need to get Autodesk.Revit.DB…

and

doc.GetElement(Autodesk.Revit.DB.ElementId).ToRevitType() - not work too


#2

I believe the “ToRevitType() and ToProtoType()” calls are for geometry conversion. Have you tried UnwrapElement(doc.GetElement(Autodesk.Revit.DB.ElementId))? I’m not certain that will solve your problem.

Unwrapping

From https://www.linkedin.com/pulse/revitdynamo-what-does-unwrapelement-do-exactly-ron-allen/ :

Wrapped Elements are located in the Revit.Elements namespace. All wrapped Elements extend the Revit.Elements.Element abstract class. This class provides a public property InternalElementwhich contains a reference to the underlying RevitAPI Element, of type Autodesk.Revit.DB.Element. Alternatively, Dynamo provides a convenience function UnwrapElement(element) function that accepts wrapped Elements or arbitrarily nested lists of wrapped Elements. If passed a non-Element it will simply return the object unmodified.


#3

Archilab has a node for this. Check the code in that package for info.


#4

Its a good news :slightly_smiling_face:

but i cant find it…


#5

Select.ByElementId I believe is the name.