algorithmic modeling for Rhino
Tags:
Grasshopper.Kernel.IGH_ActiveObject
Dim nn As String = owner.NickName
Dim cmp As GH_Component = DirectCast(owner, GH_Component)
Dim nn0 As String = cmp.Params.Input(0).NickName
Dim param As IGH_Param = DirectCast(someobjectyouknowforsureisaparameter, IGH_Param)
Hello,
is it possible to inherit the NickName of a param plugged in a custom component then? Do I still have to cast the input parameter where the param is plugged into and then cast it to an IGH_Param or am i just talking nonsense?
Thanks,
Odysseas
To get the names of the input components nickname:
'access the vb component
Dim cmp As GH_Component = DirectCast(owner, GH_Component)
'access the first parameter input of VB component
Dim param_0 As IGH_Param = DirectCast(cmp.Params.Input(0), IGH_Param)
'access the list of input components
Dim ighList As List (Of IGH_Param) = param_0.Sources
Dim inParam_0 As IGH_Param = DirectCast(ighList(0), IGH_Param)
'prints the nickName of the first input component
Print(inParam_0.NickName)
Hi Dirk,
sorry, is there a question? You don't need this btw:
Dim param_0 As IGH_Param = DirectCast(cmp.Params.Input(0), IGH_Param)
Params.Input is already a collection IGH_Param, so you don't have to cast them:
Dim param_0 As IGH_Param = cmp.Params.Input(0)
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by