Iteration over non-sequence of type function

Hello all,
I’m trying to figure out a following problem. At first I write this
import rhinoscriptsyntax as rs

mesh = rs.GetObject(“Select mesh”, rs.filter.mesh)
points = rs.MeshVertices(mesh)

rs.EnableRedraw(False)

for p in points:
rs.AddSphere(p, r_point_sphere)

rs.EnableRedraw(True)

#geometry = ghdoc.Objects.Geometries

and became this error
Runtime error (NotImplementedException): The method or operation is not implemented.
Traceback:
line 3, in script
and after delet the ‘‘mesh = rs.GetObject(“Select mesh”, rs.filter.mesh)’’

Traceback:
line 6, in script
<img src=“https://global.discourse-cdn.com/mcneel/uploads/default/13919/915983fe6377b694.png” width=“690” height =“388”>
many thanks and best regards

Hi Marjan,

You are not supplying anything to your rs.MeshVertices function. It requires mesh guid.
Take a look this topic too, its intention was to comment on some common things RhinoPython to ghpython users do.
sphereFromPts.gh (7.8 KB)

Please attach your .gh files next time. Thank you.

thanks for your answer, i couldn’t solve the problem…unnamed.gh (9.4 KB)

Check the attached file.
unnamed2.gh (7.4 KB)

1 Like

many thanks…

hello, I wanna create my first name as a Python Script in Rhino grasshoper
define letters as combination of linear, quadratic, cubic curves (or mathematic formulas)
Minimum Requirements:
set objects (Sphere, Cylinder, Box, …) at curve points
Possible Parameters:
width and height of the letter, density of points, object to place
But I have a problem
could you plz help me

create my first name as a Python Script in Rhino.gh (3.6 KB) create my first name as a Python Script in Rhino.3dm (29.3 KB)

Hi Marjan,
You are using rs.GetObject function in ghpython. It can not be used without switching the documents. Assign value to “y” variable in a different way.
Check the attached file.

Additionally, it is always a better solution to add your geometry to a list/variable, then reference that list/variable to the ouputs parameter (geometry = spheres) instead of using all document geometry (geometry = ghdoc.Objects.Geometries). Again, please read this comment.
create my first name as a Python Script in Rhino2.gh (4.7 KB)

thanks Dear diordje,
but i want to make the shape by select the object from my rhino screen.
the important things is that i could write my name by python and grasshoper.
many thanks1.py (613 Bytes)

I fixed your syntax error in the previous post, but I am not sure what you are trying to do.
Populate your names’s curves with spheres, cylinders or boxes?

import rhinoscriptsyntax as rs

sphereRadius = 0.1
crvs = rs.GetObjects("pick up the name curves")
for crv in crvs:
    divPts = rs.DivideCurve(crv, 25)
    for pt in divPts:
        rs.AddSphere(pt,sphereRadius)
1 Like

thanks a lot