Skip to content

Commit f7ee255

Browse files
authored
Merge pull request #547 from specklesystems/dimitrie/cnx-1086-stuck-at-publish-when-trying-to-publish-not-supported-array
fix/feat: adds support for arrays (radial and linear) in revit
2 parents 4af9095 + 286a1c0 commit f7ee255

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/ElementUnpacker.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ private List<Element> UnpackElements(IEnumerable<Element> elements)
6464
var groupElements = g.GetMemberIds().Select(doc.GetElement);
6565
unpackedElements.AddRange(UnpackElements(groupElements));
6666
}
67+
else if (element is BaseArray baseArray)
68+
{
69+
var arrayElements = baseArray.GetCopiedMemberIds().Select(doc.GetElement);
70+
var originalElements = baseArray.GetOriginalMemberIds().Select(doc.GetElement);
71+
unpackedElements.AddRange(UnpackElements(arrayElements));
72+
unpackedElements.AddRange(UnpackElements(originalElements));
73+
}
6774
// UNPACK: Family instances (as they potentially have nested families inside)
6875
else if (element is FamilyInstance familyInstance)
6976
{

Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,6 @@ CancellationToken cancellationToken
6363
continue;
6464
}
6565

66-
if (!SupportedCategoriesUtils.IsSupportedCategory(el.Category))
67-
{
68-
results.Add(
69-
new(
70-
Status.WARNING,
71-
el.UniqueId,
72-
el.Category.Name,
73-
null,
74-
new SpeckleException($"Category {el.Category.Name} is not supported.")
75-
)
76-
);
77-
continue;
78-
}
79-
8066
revitElements.Add(el);
8167
}
8268

@@ -98,6 +84,20 @@ CancellationToken cancellationToken
9884
string sourceType = revitElement.GetType().Name;
9985
try
10086
{
87+
if (!SupportedCategoriesUtils.IsSupportedCategory(revitElement.Category))
88+
{
89+
results.Add(
90+
new(
91+
Status.WARNING,
92+
revitElement.UniqueId,
93+
revitElement.Category.Name,
94+
null,
95+
new SpeckleException($"Category {revitElement.Category.Name} is not supported.")
96+
)
97+
);
98+
continue;
99+
}
100+
101101
Base converted;
102102
if (sendConversionCache.TryGetValue(sendInfo.ProjectId, applicationId, out ObjectReference? value))
103103
{

0 commit comments

Comments
 (0)