GH python: Error importing ghpythonlib.components


#1

I get this error trying to run the python script from this file (mesh edge finder.gh) (here the discussion):

Runtime error (IndexOutOfRangeException): index out of range: 0
Traceback:
line 117, in __build_module, "C:\Users\jimbo\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\ghpythonlib\components.py"
line 126, in , "C:\Users\jimbo\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\ghpythonlib\components.py"
line 1, in script

Even a script with this single line

import ghpythonlib.components as ghcomp

produces an error. Importing rhinoscriptsyntax works fine. Any hints how to solve this?

Thanks,
David


#2

Hey lemberski!
I have the same problem here !


(Giulio Piacentino) #3

Hi David

sorry nobody checked this thread and answered it earlier. I missed it. It seems it’s still relevant.

This seems to be a problem in the components module – and I am not an expert in that module, so I would need some help tracking it down.

Are you having access to Rhino WIP? The components module was slightly changed, and maybe it will work there. Please perform a test on Rhino WIP.

As I am not seeing the issue, I believe this has to do with a third-party add-on you have installed on your machine, but which I do not.

The only sure way to rule that out, is to move all your third-party libraries, excluding GhPython, on a memory stick, and removing the memory stick. Then, restarting Rhino & GH.

If this fixes it, then they can be added one by one, till the problematic one is found. I suppose components that do timer, looping and similar concepts might cause problems with this library, but I do not know for sure.

Please let me know how that goes.

Giulio

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


#4

Hi Guilio,

I have the latest WIP installed (6.0.16152.9051, 05/31/2016), same problem here. With the method you described I nailed it down to one plugin which seems to cause the error: Vipers
http://www.food4rhino.com/project/tangchi?etx (attached as zip).
Can you repeat the error on your machine?

Cheers,
David

vipers_by_tc20160119.zip (323 KB)


(Giulio Piacentino) #5

I’m sorry, I do not have Viper installed.
My suggestion would be to contact its developer for information.

Thanks

Giulio

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


(Giulio Piacentino) #6

I am working with the developer of Vipers to resolve this issue.
We think we can get this to work in a next release.

Giulio

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


#7

Hi @piac,

The fix for GHPython component being “compatible” with Vipers component has been released as a part of Rhino WIP Grasshopper?
There was a user today who reported this issue again with Vipers component on Rhino 5 and GHPython 0.6.0.3.


(Giulio Piacentino) #8

The fix is in Rhino WIP @djordje . There is no plan for an update of GhPython for v5 at the moment.


#10

Thank you for the reply Giulio!