Message 1 of 12
GetElement returning null for a MaterialNode.MaterialId
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I have a plugin which works fine in Revit2020 to Revit 2024. After upgrading to DotNet8 and recompiling for Revit 2025, I have the issue where GetElement is returning null for a MaterialNode.MaterialId.
For context, this code is running in an IExportContext class.
public void OnMaterial(MaterialNode node)
{
try
{
if (node.MaterialId != ElementId.InvalidElementId)
{
Element element = m_document.GetElement(node.MaterialId);
// ERROR - element is null in Revit 2025
How do I get this working in Revit 2025 please?
Thanks
Paul