Passing Generic data as Input to the function in functioncall


#1

Hi!

I’m stuck in my code at the moment where I have the case that my Func<> in my BuildFunctionCall does rely on a generic type.

  var functionCall =
    AstFactory.BuildFunctionCall(
      new Func<List<object>, ConstructurInfo, object>(MyMethod),
      new List<AssociativeNode> ());

Lets assume that my component doesn’t have any inputs, which means that I get the list of objects and the ConstructorInfo internally/from user input on the node UI. But I have no clue how to pass this inputs to MyMethod.

Does anyone know how this is done?

Thanks


#2

It would be really good if someone from the dynamo team could give some input to this.
It would be very helpful

thanks


#3

Try to add a links to related posts and/or to reach someone proficient with the @ tool maybe…


#4

what kind of objects does your UI have? If it’s just primitives, you could use the methods provided by the AstFactory class to wrap them in a new List<AssociativeNode> input list and pass that to the function call of your method.


#5

My UI will be sending ConstructorInfo and MethodBase, as in the short “example” above. I haven’t tried out what would happens if a ConstructorInfo was passed to the node as an input, but if that would work, there must be of way of passing it from the UI.
This seems however very tricky to do, and if not possible then also very limiting. Who would be the right person to reach out to in the Dynamo team to get clearity about this?

Thanks