Skip to content

Commit

Permalink
Sort group proxies by object count (#43)
Browse files Browse the repository at this point in the history
* Sort group proxies by object count

* fix name
  • Loading branch information
oguzhankoral authored Jul 18, 2024
1 parent 7fad22b commit 59fc2a4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@ private HostObjectBuilderResult BakeObjects(
// Stage 3: Group
if (groupProxies is not null)
{
foreach (GroupProxy groupProxy in groupProxies)
foreach (GroupProxy groupProxy in groupProxies.OrderBy(g => g.objects.Count))
{
var appIds = groupProxy.objects.SelectMany(oldObjId => applicationIdMap[oldObjId]).Select(id => new Guid(id));
RhinoDoc.ActiveDoc.Groups.Add(appIds);
var index = RhinoDoc.ActiveDoc.Groups.Add(appIds);
var addedGroup = RhinoDoc.ActiveDoc.Groups.FindIndex(index);
addedGroup.Name = groupProxy.name;
}
}

Expand Down

0 comments on commit 59fc2a4

Please sign in to comment.