I want to creating custom component with variable number of inputs, but after searching the forum, none on this. I tried to implement in ghpython, but seems the input number is not as that in C#:
haha I 've saw your this nice answer days before and downloaded the clean sample!
Thanks a lot for your prompt reply. In fact I’m working on research and the main practice is on matlab and python(for data exchange and visualization), that’s why I haven’t any knowledge on C#. So for primary modify of data structure, the ghpython is enough, until now… The C# learning curve is sooo…
So @piac can this function work on ghpython? Is there some more deep tutorial on python beyond this?
By the look of the link, it should be possible, you just have to translate my example to python. Well I would still suggest for you to do your data structure stuff in C# though. If you get stuck down the road you can always post in the Dev group and we can help.
Probably Giulio developed that workflow specially thinking on how to help Butterfly and Honeybee compile the plugin in a more robust way.
@rawitscher-torres Thank you so much for your patience. The only thing is I have no knowledge in C#, so I installed the Visual studio, and try my best typping things like the C# example, and many question rises:
and no Error message, but after compiling, still can’t add variable input.
Definitly know there must be some silly operation, forgive me
I do know that if I don’t compile the script, this component can run very well regardless of efficiency. But so curious of all this amazing function.
I think to upload my script is necessary.This is a tiny component to ‘juxtapose’ trees and remain their structure, which is very helpful for my data processing. TreeAdding.gh (4.3 KB)
In C#, the component class inherits GH_Component and IGH_VariableParameterComponent.
While you can do that in python:
I do not know what the [VariableParameterComponent] would refer to to get it to work.
Going into component base, you only get the following:
from GhPython.Assemblies import DotNetCompiledComponent as dotnetcompiledcomponent
from GhPython.Assemblies import ExecutingComponent as executingcomponent
For which the only reference is a 6 year old repository and seems to be missing the code.
So I don’t think we have any way of implementing the interface.
You are soooo nice! Now it’s time for me to learn line by line carefully! And thank you @rawitscher-torres. Now can wait for the great python developers’ explain how the python method. Hope they have spare time developing WIP