Hi guys,
Is it possible to get type of the GH object without casting to specific type as below:
foreach (IGH_DocumentObject obj in GrasshopperDocument.Objects)
{
var slider = obj as Grasshopper.Kernel.Special.GH_NumberSlider;
}
Thanks,
Dmitriy
Hi guys,
Is it possible to get type of the GH object without casting to specific type as below:
foreach (IGH_DocumentObject obj in GrasshopperDocument.Objects)
{
var slider = obj as Grasshopper.Kernel.Special.GH_NumberSlider;
}
Thanks,
Dmitriy
foreach (var obj in GrasshopperDocument.Objects)
Type type = obj.GetType();
Or you can use the is keyword:
foreach (var obj in GrasshopperDocument.Objects)
if (obj is Grasshopper.Kernel.Special.GH_NumberSlider)
// do something?
thx!