ScriptEditor Grasshopper not working

Hi,

What has happened with Scripteditor for Grasshopper Python?
Any code I copy paste freezes Rhino completely.

This is some basic math:

from math import cos, sin, pi

H0 = 9.145

V0 = 2.37

xV0 = 0.723

yH0 = 0.420

angle0 = 14.036

e0 = 0.03

# weight

W = 0.92

xW = 1.515

# left side:

H1 = H0

V1 = V0-W

xV1 = 2.313

yH1 = 0.739

angle1 = 8.422

# signs

s_0_H0 = 1

s_0_V0 = -1

s_0_x = -1

s_0_y = 1

s_W = 1

s_1_H1 = 1

s_1_V1 = -1

s_1_x = -1

s_1_y = 1

H0 = H0 * s_0_H0

V0 = V0 * s_0_V0

yH0 = yH0 * s_0_y

xV0 = xV0 * s_0_x

xW = xW * s_W

H1 = H1 * s_1_H1

V1 = V1 * s_1_V1

# cosine positive or negative is the same result

a0 = H0 * (yH0 + e0 * cos(angle0 * pi/180) * s_0_y)

a1 = V0 * (xV0 + e0 * sin(angle0 * pi/180) * s_0_x)

a2 = W*xW

A = a0 + a1 + a2

ab = H0*yH1

cd = V1*xV1

ae = H0*cos(angle1*(pi/180)) * s_1_y

cf = V1*sin(angle1*pi/180) * s_1_x

e = (A - ab - cd) / (ae + cf)

print(e) # 0.04323345363865652

FWIW I can paste into a script component, run it, and copy/paste to another one and run that on my system (edit: missed the mac tag, I’m on windows):

SystemInfo

Rhino 8 SR9 2024-6-25 (Rhino 8, 8.9.24177.13001, Git hash:master @ 3d838af33de7dbd3de7e738d7a7b923649d1eda5)
License type: Commercial, build 2024-06-25
License details: Cloud Zoo

Windows 11 (10.0.22631 SR0.0) or greater (Physical RAM: 32GB)
.NET 7.0.20

Computer platform: LAPTOP - Unplugged [26% battery remaining] ~18 minutes left

Hybrid graphics configuration.
Primary display: Intel(R) Iris(R) Xe Graphics (Intel) Memory: 1GB, Driver date: 11-7-2023 (M-D-Y).
> Integrated graphics device with 4 adapter port(s)
- Windows Main Display is laptop’s integrated screen or built-in port
Primary OpenGL: NVIDIA RTX 2000 Ada Generation Laptop GPU (NVidia) Memory: 8GB, Driver date: 6-26-2023 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 536.45
> Integrated accelerated graphics device (shares primary device ports)
- Video pass-through to primary display device

OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
Redraw scene when viewports are exposed: On
Graphics level being used: OpenGL 4.6 (primary GPU’s maximum)

Anti-alias mode: 8x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: High

Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 6-26-2023
Driver Version: 31.0.15.3645
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 8188 MB

Rhino plugins that do not ship with Rhino

Rhino plugins that ship with Rhino
C:\Program Files\Rhino 8\Plug-ins\Commands.rhp “Commands” 8.9.24177.13001
C:\Program Files\Rhino 8\Plug-ins\rdk.rhp “Renderer Development Kit”
C:\Program Files\Rhino 8\Plug-ins\RhinoRenderCycles.rhp “Rhino Render” 8.9.24177.13001
C:\Program Files\Rhino 8\Plug-ins\rdk_etoui.rhp “RDK_EtoUI” 8.9.24177.13001
C:\Program Files\Rhino 8\Plug-ins\NamedSnapshots.rhp “Snapshots”
C:\Program Files\Rhino 8\Plug-ins\MeshCommands.rhp “MeshCommands” 8.9.24177.13001
C:\Program Files\Rhino 8\Plug-ins\IronPython\RhinoDLR_Python.rhp “IronPython” 8.9.24177.13001
C:\Program Files\Rhino 8\Plug-ins\RhinoCycles.rhp “RhinoCycles” 8.9.24177.13001
C:\Program Files\Rhino 8\Plug-ins\Grasshopper\GrasshopperPlugin.rhp “Grasshopper” 8.9.24177.13001
C:\Program Files\Rhino 8\Plug-ins\Toolbars\Toolbars.rhp “Toolbars” 8.9.24177.13001
C:\Program Files\Rhino 8\Plug-ins\3dxrhino.rhp “3Dconnexion 3D Mouse”
C:\Program Files\Rhino 8\Plug-ins\Displacement.rhp “Displacement”
C:\Program Files\Rhino 8\Plug-ins\SectionTools.rhp “SectionTools”

1 Like

Thank you. No idea what happens on my system…

What’s the version of your Rhino?

Latest update, in the previous update it was the same.

Runs fine for me, when copying the code above and pasting it into a Python 3 component.

I’m currently running Rhino 8 (8.8.24170.13002, 2024-06-18) on macOS Sonoma 14.5.

1 Like

Thank you I will try to clean and reset my Python editor. I guess having one environment with various packages in Python can lead to this kind of trouble without Debug info. Thank you all for looking at this. :slight_smile:

2 Likes

After reset and reload script editor and even removing Rhino8 and installing again. The same error. No clue what is happening…

Even if I write something like this the whole rhino crashes:


@eirannejad Do you have any clue how to solve this?
This happens only in grasshopper.

@Petras_Vestartas Looking into this now. I am assuming you are testing on 8.9?

Yes, updates dont really help.

Weird. I can not replicate this at all. Would you be able to test this in 8.10 SRC?