From d7d5abb7b42f8cffea19ba6bca4e5526a3fa12f2 Mon Sep 17 00:00:00 2001 From: AdrianaStanica <74306868+AdrianaStanica@users.noreply.github.com> Date: Tue, 26 Mar 2024 17:46:33 +0200 Subject: [PATCH] Fix CurtainPanel.ByElements bug (#3057) REVIT-219424 * fix the node to return the list of curtain panels in a curtain wall in cases when some curtain panels are doors or windows --- .version | 2 +- CHANGELOG.md | 3 +++ src/Libraries/RevitNodes/Elements/CurtainPanel.cs | 10 +++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.version b/.version index e9acb99e6..4655c9e99 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.6.12 \ No newline at end of file +0.6.13 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b5660c0f..62e01fbfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.6.13 +* Fix CurtainPanel.ByElements displaying invalid ElementIds when Curtain Panels have their types changed to a different wall + ## 0.6.12 * Fix CurtainPanel.ByElements failing to return when there is a door or window present in the curtain wall diff --git a/src/Libraries/RevitNodes/Elements/CurtainPanel.cs b/src/Libraries/RevitNodes/Elements/CurtainPanel.cs index a1cddce53..fe470aa37 100644 --- a/src/Libraries/RevitNodes/Elements/CurtainPanel.cs +++ b/src/Libraries/RevitNodes/Elements/CurtainPanel.cs @@ -380,7 +380,15 @@ public static CurtainPanel[] ByElement(Element hostingElement) var panel = DocumentManager.Instance.CurrentDBDocument.GetElement(idPanel); if (panel is Autodesk.Revit.DB.Panel) { - result.Add(CurtainPanel.FromExisting(panel as Autodesk.Revit.DB.Panel, true)); + ElementId hostPanelId = (panel as Panel).FindHostPanel(); + if (hostPanelId.IntegerValue != -1) + { + result.Add(null); + } + else + { + result.Add(CurtainPanel.FromExisting(panel as Autodesk.Revit.DB.Panel, true)); + } } else {