Weird error: InstantiateT() cannot be called if T is an abstract type

I’ve not seen this error before, but it pops up sometimes. It doesnt affect the running of the script, so im guessing its a UI error?

Having the same error pops up every time when I initiate GH after installing the SR22 update.

Hi - could you please run the Rhino SystemInfo command and copy-paste the result here?
-wim

1 Like

Hi Wim,

here it is:

Rhino 6 SR22 2020-1-28 (Rhino 6, 6.22.20028.13281, Git hash:master @ 379871ece695dc096e83826f08b429db8ca2e7f5)
License type: Commercial, build 2020-01-28
License details: LAN Zoo Network Node

Windows 10.0 SR0.0 or greater (Physical RAM: 32Gb)
Machine name: LDNLT5CD9073W0B

Non-hybrid graphics.
Primary display and OpenGL: NVIDIA Quadro P1000 (NVidia) Memory: 4GB, Driver date: 6-3-2019 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 431.02

Secondary graphics devices.
DisplayLink USB Device (Unknown) Memory: 0MB, Driver date: 3-1-2019 (M-D-Y).
DisplayLink USB Device (Unknown) Memory: 0MB, Driver date: 3-1-2019 (M-D-Y).

OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
Redraw scene when viewports are exposed: On

Anti-alias mode: 4x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: Height

Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 6-3-2019
Driver Version: 26.21.14.3102
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 4 GB

Rhino plugins
C:\Program Files\Rhino 6\Plug-ins\Commands.rhp “Commands” 6.22.20028.13281
C:\Program Files\Rhino 6\Plug-ins\WebBrowser.rhp “WebBrowser”
C:\Program Files\Rhino 6\Plug-ins\rdk.rhp “Renderer Development Kit”
C:\Program Files\Rhino 6\Plug-ins\RhinoScript.rhp “RhinoScript”
C:\Program Files\Rhino 6\Plug-ins\AnimationTools.rhp “AnimationTools”
C:\Program Files\Rhino 6\Plug-ins\IdleProcessor.rhp “IdleProcessor”
C:\Program Files\Rhino 6\Plug-ins\Tibidabo\Tibidabo.rhp “Tibidabo”
C:\Users\Pei-Chin.lin\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\Speckle Rhino Plugin (512d9705-6f92-49ca-a606-d6d5c1ac6aa2)\SpeckleWinR6.rhp “Speckle Rhino” 1.6.8.709
C:\Program Files\Rhino 6\Plug-ins\rdk_etoui.rhp “RDK_EtoUI” 6.22.20028.13281
C:\Program Files\Rhino 6\Plug-ins\rdk_ui.rhp “Renderer Development Kit UI”
C:\Program Files\Rhino 6\Plug-ins\NamedSnapshots.rhp “Snapshots”
C:\Program Files\Rhino 6\Plug-ins\Alerter.rhp “Alerter”
C:\Program Files\Rhino 6\Plug-ins\IronPython\RhinoDLR_Python.rhp “IronPython” 6.22.20028.13281
C:\Users\Pei-Chin.lin\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\Lumion LiveSync for Rhino (839d6175-32d1-4ffe-a0a4-b7fb43cf0ff5)\2019.6.17.913\Lumion\Rhino 6.0\LumionPlugin.rhp “Lumion LiveSync for Rhino”
C:\Program Files\Rhino 6\Plug-ins\RhinoCycles.rhp “RhinoCycles” 6.22.20028.13281
C:\Program Files\Rhino 6\Plug-ins\Tibidabo\VisualARQ.rhp “VisualARQ”
C:\Program Files\Rhino 6\Plug-ins\Grasshopper\GrasshopperPlugin.rhp “Grasshopper” 6.22.20028.13281
C:\Program Files\Rhino 6\Plug-ins\Toolbars\Toolbars.rhp “Toolbars” 6.22.20028.13281
C:\Program Files\Rhino 6\Plug-ins\3dxrhino.rhp “3Dconnexion 3D Mouse”
C:\Program Files\Chaos Group\V-Ray\V-Ray for Rhinoceros 6\VRayForRhino.rhp “V-Ray for Rhino”
C:\Program Files\Rhino 6\Plug-ins\Displacement.rhp “Displacement”
C:\Users\Pei-Chin.lin\AppData\Roaming\McNeel\Rhinoceros\packages\6.0\ColorPicker\6.0.0\ColorPicker.rhp “ColorPicker”
C:\Users\Pei-Chin.lin\AppData\Roaming\McNeel\Rhinoceros\packages\6.0\iris\0.6.6\Iris.WinR6.rhp “Iris” 1.0.0.0
C:\Users\Pei-Chin.lin\AppData\Roaming\McNeel\Rhinoceros\packages\6.0\PanelingTools\2018.12.17+906\PanelingTools.rhp “PanelingTools”
C:\Users\Pei-Chin.lin\AppData\Roaming\McNeel\Rhinoceros\packages\6.0\rhino-render-next\0.0.2\RhinoRenderNext.rhp “Rhino Render Next” 0.0.2.0

Hi Pei Chin - what happens when you launch Rhino in safe mode and then launch Grasshopper without loading any definition? Does that also throw up that error?
-wim

Hi Pei Chin - also see this post by @Dani_Abalde:


-wim

Many thanks Wim,
Tried uninstalling plus-ins through CLI tool via Yak.
Problem solved after uninstalling “samplepy_axes” plug-in.
Hope this help others with the same problem.

Pei Chin

2 Likes

was your “samplepy_axes” a ghpy plugin ?
I wonder if this error is related to ghpy.

Yes, I have the same suspect.
I’ve tested several different plug-ins which contains ghpy file would cause the same error.

@piac Hi there, we have some users in our computer who are using ghpy to compile components and have met this error. Although its not breaking workflows, it is lowering confidence in our components. Do you know whether this is related to ‘how’ ghpy is compiled, or where we might go to resolve this?

This error means, that at some point Grasshopper tries to initiate an interface by reflection mechanism. But obviously you can only instantiate concrete classes, and not abstract classes or interfaces. If reflection is used this error only occurs on runtime. I’m guessing someone is creating interface definitions at a place where only concrete implementation should be created…

Thank you

Hi @yun.sung

I doubt this has to do something directly with Ghpy. Ghpy files are supposed to contain only GH_Component-derived classes, and not Param-derived classes. However, I cannot know what code is executing here, and basically anything that can be done in C# can also be done in IronPython.

I’d look for places where you try to override right-click behavior? Maybe. You’ll need to provide a repeatable code sample for me to be able to reproduce and help.

Do you, by any chance, have a complex inheritance mechanism for some components or parameters?

Thanks,

Giulio


Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

I tried to use the simplest example only one line rs.AddLine(x,y) and compile .ghpy still shows this error, so obviously this is a .ghpy bug…please check.

Can you provide the pre-compiled python component script here?

it’s just rs.AddLine(x,y)…

from ghpythonlib.componentbase import executingcomponent as component
import Grasshopper, GhPython
import System
import Rhino
import rhinoscriptsyntax as rs

class MyComponent(component):

def RunScript(self, x, y):
    a = rs.AddLine(x,y)
    
    # return outputs if you have them; here I try it for you:
    return a

try a = Rhino.Geometry.Line(x,y) instead.

(Make sure you import Rhino before that)