Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unpack parameters as Dictionary #344

Draft
wants to merge 20 commits into
base: dev
Choose a base branch
from
Draft
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
aee97d2
updates constructors and deprecates any unused code & functionality
clairekuang Oct 28, 2024
114356c
updates arcs and polycurves
clairekuang Oct 29, 2024
a400494
removes set only circle props
clairekuang Oct 29, 2024
47be734
updates box conversions
clairekuang Oct 30, 2024
eee9d17
Merge branch 'dev' into claire/cnx-687-purge-unused-classes-from-objects
clairekuang Oct 30, 2024
129395d
Merge branch 'dev' into claire/cnx-687-purge-unused-classes-from-objects
clairekuang Oct 30, 2024
6706def
fixes model curves and transforms
clairekuang Oct 31, 2024
232d859
Update ModelCurveToSpeckleTopLevelConverter.cs
clairekuang Nov 1, 2024
ff221a5
unpack parameters as Dictionnary
KatKatKateryna Nov 3, 2024
4595e35
Merge branch 'dev' into claire/cnx-687-purge-unused-classes-from-objects
clairekuang Nov 4, 2024
2d47837
Merge branch 'dev' into claire/cnx-687-purge-unused-classes-from-objects
clairekuang Nov 5, 2024
ad74743
bumps nugets
clairekuang Nov 5, 2024
a43332e
Merge branch 'claire/cnx-687-purge-unused-classes-from-objects' of ht…
clairekuang Nov 5, 2024
d65d53a
fixes package locks and arc
clairekuang Nov 5, 2024
ae08faa
updates rhino arc test
clairekuang Nov 5, 2024
bfc8807
Merge branch 'claire/cnx-687-purge-unused-classes-from-objects' into …
KatKatKateryna Nov 5, 2024
e8fede2
Merge branch 'dev' into claire_classes_ArcGIS_parameters
KatKatKateryna Nov 5, 2024
7d12302
add lists
KatKatKateryna Nov 5, 2024
9faedac
Merge branch 'dev' into claire_classes_ArcGIS_parameters
KatKatKateryna Nov 5, 2024
5343efc
refactor
KatKatKateryna Nov 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public List<FieldDescription> GetFieldsFromSpeckleLayer(VectorLayer target)
foreach (var baseObj in target)
{
// get all members by default, but only Dynamic ones from the basic geometry
Dictionary<string, object?> members = new();
Dictionary<string, object?> members = baseObj.GetMembers(DynamicBaseMemberType.Dynamic);
members["Speckle_ID"] = baseObj.id; // to use for unique color values

// leave out until we decide which properties to support on Receive
Expand Down Expand Up @@ -191,14 +191,56 @@ List<string> fieldAdded
// Currently we are not sending any rhino user strings.
// TODO: add support for attributes of type `Dictionary<string,object?>`
}
else if (field.Value is Dictionary<string, object?> attributeDict)
{
// only traverse Base if it's Rhino userStrings, or Revit parameter, or Base containing Revit parameters
//if (field.Key == "properties")
//{
foreach (KeyValuePair<string, object?> attributField in attributeDict)
{
if (
attributField.Value is Dictionary<string, object?>
|| attributField.Key == "applicationId"
|| attributField.Key == "id"
)
{
KeyValuePair<string, object?> newAttributField = new($"{field.Key}.{attributField.Key}", attributField.Value);
Func<Base, object?> functionAdded = x => (function(x) as Dictionary<string, object?>)?[attributField.Key];
TraverseAttributes(newAttributField, functionAdded, fieldsAndFunctions, fieldAdded);
}
else if (attributField.Value is IList attributeDictList)
{
int count = 0;
foreach (var attributeDictField in attributeDictList)
{
KeyValuePair<string, object?> newAttributeField = new($"{field.Key}[{count}]", attributeDictField);
Func<Base, object?> functionAdded = x => (function(x) as List<object?>)?[count];
TraverseAttributes(newAttributeField, functionAdded, fieldsAndFunctions, fieldAdded);
count += 1;
}
}
else
{
KeyValuePair<string, object?> newAttributeField =
new($"{field.Key}.{attributField.Key}", attributField.Value);
Func<Base, object?> functionAdded = x => (function(x) as Dictionary<string, object?>)?[attributField.Key];
TryAddField(newAttributeField, functionAdded, fieldsAndFunctions, fieldAdded);
}
}
//}
//else
//{
// for now, ignore all other properties of Dictionnary type
//}
}
else if (field.Value is IList attributeList)
{
int count = 0;
foreach (var attributField in attributeList)
foreach (var attributeField in attributeList)
{
KeyValuePair<string, object?> newAttributField = new($"{field.Key}[{count}]", attributField);
KeyValuePair<string, object?> newAttributeField = new($"{field.Key}[{count}]", attributeField);
Func<Base, object?> functionAdded = x => (function(x) as List<object?>)?[count];
TraverseAttributes(newAttributField, functionAdded, fieldsAndFunctions, fieldAdded);
TraverseAttributes(newAttributeField, functionAdded, fieldsAndFunctions, fieldAdded);
count += 1;
}
}
Expand Down
Loading