GetElement(id) returning null on existing id

GetElement(id) returning null on existing id

Anonymous
Not applicable
553 Views
1 Reply
Message 1 of 2

GetElement(id) returning null on existing id

Anonymous
Not applicable

We are calling app.ActiveUIDocument.Document.GetElement(id) where id is the Revit id for a textnote element. During debugging we confirm that the id exists in the document by selecting it inside the Revit app via the same id. The Revit app selects the right element, but the API call returns null. 

 

The same behaviour was found in Revit 2017-Revit 2020. 

Is there any other scenario where the method returns null when it exists ?

0 Likes
554 Views
1 Reply
Reply (1)
Message 2 of 2

TripleM-Dev.net
Advisor
Advisor

Hi,

 

I can't think of a scenario where an existing id can't be retrieved by GetElement.

How do you retrieve the ID in you're app?, post some of the code.

 

Maybe also see: API Docs: GetElement method 

 

- Michel

 

ps. You should post this in the Revit API Forum.

0 Likes