Skip to content

Commit

Permalink
Recognise distinction between openings and panels based on their obje…
Browse files Browse the repository at this point in the history
…cttype number
  • Loading branch information
GCRA101 committed Jan 20, 2025
1 parent 3b8b40c commit 9119e2f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Etabs_Adapter/CRUD/Read/_Read.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ public Dictionary<Type, List<string>> SelectedElements()

m_model.SelectObj.GetSelected(ref numItems, ref objectTypes, ref objectIds);

// Replace Panels' type numbers with Openings' type numbers

for (int i=0; i<numItems; i++)
{
if (objectTypes[i]==5)
{
bool isOpening=false;
m_model.AreaObj.GetOpening(objectIds[i], ref isOpening);
if (isOpening) objectTypes[i] = 8;
}
}

Dictionary<int, List<string>> dict = objectTypes.Distinct().ToDictionary(x => x, x => new List<string>());

for (int i = 0; i < numItems; i++)
Expand All @@ -146,6 +158,8 @@ public Dictionary<Type, List<string>> SelectedElements()
return null;
case 7: // Link Object
return typeof(RigidLink);
case 8: // Opening Object (not api-native)
return typeof(Opening);
default:
return null;
}
Expand Down

0 comments on commit 9119e2f

Please # to comment.