-
Notifications
You must be signed in to change notification settings - Fork 4
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
Remove the ability to create typed objects from the CreateCustom component #170
Remove the ability to create typed objects from the CreateCustom component #170
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excel_UI/UI/Callers/CreateCustom.cs
Outdated
|
||
List<string> props = inputs[0] as List<string>; | ||
List<object> values = inputs[1] as List<object>; | ||
if (props.Count == values.Count) | ||
{ | ||
for (int i = 0; i < props.Count; i++) | ||
Engine.Reflection.Modify.SetPropertyValue(obj, props[i], values[i]); | ||
obj.CustomData[InputParams[i].Name] = inputs[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work, it will always have an object with 2 CustomData properties of "Properties" (the list of of property keys) and "Values" (the list of objects). Expected behaviour is that the CustomData dictionary would be populated akin to CreateDictionary
and that properties that exist on the CustomObject
type (like Name
) be populated accordingly and not placed in CustomData
Thanks @awakeman . I'd suggest you take this PR over and make the changes needed. I've not touched the Excel toolkit in 2 years so you're definitely more fit for the job. |
OK, no problem. |
|
fixed, requires review by someone else
@adecler yeah, this should work. suggest @IsakNaslundBh should review. |
I have added a couple more reviewers in the hope that one of them can unlock this PR as it is been stale for a while now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, have run an old script and that looks fine, and have looked at the CreateCustom
function (component?) and no type is being asked for, so am happy with this 😄
NOTE: Depends on
BHoM/BHoM_UI#160
Additional comments
See BHoM/BHoM_UI#160 for more details