BHoM / BHoM_UI

GNU Lesser General Public License v3.0
9 stars 5 forks source link

CreateObject component: The order of the inputs depends on the sequence we select/deselect them #156

Closed epignatelli closed 4 years ago

epignatelli commented 4 years ago

Description:

How to replicate:

  1. Checkout this branch https://github.com/BHoM/BHoM_UI/pull/152 and compile the code accordingly
  2. Open Grasshopper
  3. Create a CreateObject component
  4. Select the oM.Structure.Elements.Bar constructor by object initializer
  5. Right click, and use the Add/Remove Inputs functionality
  6. Remove the StartNode property
  7. Re-add the StartNode property
  8. Note that it appears at the bottom now.

Expected behaviour:

I think we can use the index of the element in the properties list of the object, in conjunction with the AddInput method to place the input correctly.

if IndexOfProperty < InputParams.Length 
  Add it to the right place (Grasshopper should take care of shifting the rest of them)
  OnBHoMUpdates()
else
   Add it to the end of the list
adecler commented 4 years ago

I was aware of it but didn't see that as a problem. It can even have its applications as it gives more control to the user. I guess the line between feature and bug can sometimes be thin.

Happy to go either way.

al-fisher commented 4 years ago

Hmmm... I think unless we give the user complete control - i.e. can easily inject or drag properties up and down to curate their own list (which I think is quite a way beyond scope of current UI incarnation) - then maybe more intuitive to have constant list order actually.

And also - this wIll help users across shared scripts also.

Thinking nowI wonder if the parameter order on component and list order in Add/Remove should be the same as the argument order in the method signature in the original create method selection also. With the additional (FragmentSet etc.) always as the end. Nice to have this clear consistency across all - so method will always look familiar

adecler commented 4 years ago

This will be fixed once the PR on the UI refactoring is merged: https://github.com/BHoM/BHoM_UI/pull/297