In python 2, if I want to get the optional output, I could use the strongbox in the clr module like:
Idcs = clr.StrongBox[Array[int]]()
dist = rg.Intersect.Intersection.MeshRay(mesh, ray, Idcs)
But in python 3, I get the error:
AttributeError: module 'clr' has no attribute 'StrongBox'
Is there a work around solution to get the optional outputs in Python 3?
jeremy5
(Jeremy)
2
This:
import Rhino.Geometry as rg
import System
import clr
Idcs = clr.StrongBox[System.Array[int]]()
mesh = rg.Mesh()
ray = rg.Ray3d()
dist = rg.Intersect.Intersection.MeshRay(mesh, ray, Idcs)
doesn’t seem to throw an error…
Regards
Jeremy
Hi @jeremy5,
Sorry for the late reply. Maybe this is my local issue then.
I’m using the latest Rhino 8 build with its default python 3.9 package.
Not sure if it is normal for the clr module to lose something.
Nevermind I’ll work with python 2 for this specific function. Thanks!
jeremy5
(Jeremy)
4
I’m running Rhino SRC 8.5.24065.13001, 2024-03-05, which loads Python 3.9.10
OK, I guess this is the reason then.