In c# we can find inputs param with “this.Component.Params.Input.Sources” etc.
Is it possible to do the same thing with any other component? (not only the script component itself)
To count its inputs/sources to “go back” even more in the canva…
(in the attached definition I show 2 “methods”, it should be easy to understand… what I did wrong? >_< )
Also, how can I “copy” or manage a whole data tree from a “Data” component to another.
(Referring to attached file) Like copying the content of “DataABC” to “Data123” and internalizing it.
I think for single parameters you can keep going on with Sources, e.g.
Where it becomes more tricky is when you hit an output parameter of a component and want to keep going on further upstream, as you have to find the component which owns this parameter, then go through its input parameters again… But somehow looks to me as if this wasn’t exposed publicly or if a IGH_Param just doesn’t know which component it is owned by?
sounds you are trying to find a workaround for a workaround for a workaround. What’s your actual problem?
You can always loop through all components on the canvas for yourself and compare nicknames or other properties. Unless your definition has more than 10000 components, this is not even bad performing.
If you want to optimise this by going upstream, you need to this recursively.
Internalisation: As @gankeyu said, its not well documented on how to internalise data, at least I cannot remember doing this. You can however “serialise” data. I never did this through a script component, but you might search the forum on how to do this with custom components, since I can’t remember the exact workflow.
(If i move fast it get far enough to detach)
I can found some properties of a not-linked param, like its nickname… but I cant know if it already have input sources and such.
Here is why I wanted “Input.Sources” of a component found by guid.
Ah cool, works, no idea what this would be useful for, but works
var paramA = this.Component.Params.Input.Sources;
A = paramA.NickName;
var paramB = paramA.Sources;
B = paramB.NickName;
var compC = paramB.Attributes.GetTopLevel.DocObject as IGH_Component;
C = compC.NickName;
var paramD = compC.Params.Input.Sources;
D = paramD.NickName;
I’m trying to build up what I wanted but new stuff from you guys overflow my programmin skill
I didn’t understand Keyu Gan’s reply at first, now you made it idiot-proof.
Thank you guys! This is exactly what I was searching for.
I’ll keep this updated.
Yest, that’s great, it works.
But still I havent managed to get "Params.Input etc " to work for a component that is not the c# itself or something linked to it (or linked to something linked to it, etc)
I mean, a completely unlinked/unwired component.
The “this.GrasshopperDocument.FindComponent” function give always a broke object where "Params.Input etc " doesn’t work… or maybe i’m feeding it wrong Guids.