I am using rs.ProjectPointToSurface and it is returning a Rhino.Geometry.Point3d[] object.
It does not act like a list because object[0] causes an error.
It does not act like a Rhino.Geometry.Point3d object because object.X() causes an error. So it is completely unusable. This code used to work in version 7 but not is version 8.
Here is a chunk of code with an abundance of print statements:
That’s the workaround, but the real solution is that the method should output a real Python list like V7 did. There have been a number of instances of this happening in V8.
@Henry_Wede Would you mind sharing a file and script that replicates the problem? I am testing the script and file attached here in Rhino 8.11 SRC with no issues on macOS or Windows. Does this script throw errors on your machine?
No, your script and example project does not cause any errors.
My mistake for not including the program version - I should have done that. It is on Windows and the details are:
Version 8 SR9
(8.9.24194.18121, 2024-07-12)
Commercial
Honestly, moving scripts that worked in V7 to V8 was/is extremely painful. Very painful. We will be buying more Rhino licenses because it is part of the solutions we deliver, but I am in no hurry to change versions unless there is a strong reason for it. I don’t have time to apply bandages and then take them off and apply other ones. It is too much. We will stick with this version and my apologies if I reported a bug that has already been fixed.
I am sorry for the pain of converting python 2 files into python 3.
To avoid the pain, you should be able to run ALL your Rhino 7 IronPython scripts in Rhino 8 (IronPython) with no changes. To get the editor to see them as IronPython files either:
Change the file extension to .py2
Add #! python 2 as the first line of the script
Rhino 8 still ships IronPython and your existing scripts should run with no problems.