Grasshopper

algorithmic modeling for Rhino

Hey all,  

There is something wrong with the way that I am doing this, but I can't figure it out...extra eyes please.

Took this simple fragment from some other code I am writing, which is erroring and I can't see why...it's got to be a simple solution!!  

line 9 is where I call SurfaceClosestPoint

import rhinoscriptsyntax as rs

cpoints = []
cpoints = points
cp = rs.SurfaceClosestPoint(surface, cpoints[0])

Runtime error (TypeErrorException): Parameter must be a Guid or string representing a Guid
Traceback:
line 468, in coerceguid, "C:\Users\Aaron\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py"
line 465, in coerceguid, "C:\Users\Aaron\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py"
line 547, in coercesurface, "C:\Users\Aaron\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py"
line 1564, in SurfaceClosestPoint, "C:\Users\Aaron\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\surface.py"
line 9, in script

Views: 1772

Replies to This Discussion

Hi,

what are you feeding into points? rhino geometry or gh created geometry. 

Try to switch your hint as ghdoc to see what happens

Best,

M.

Marios,

I'm feeding gh points (from a curve divide) into the ghpython component type hinted as Point3D with List Access enabled (although switching to Item Access doesn't change the error).

Changing the type hint to ghdoc doesn't modify the error and No Type hint doesn't change anything either.

im a beginner at python but i think whats happening is your overwriting your list rather than adding your points to it...maybe try :

cpoints = []
cpoints.append (points)
cp = rs.SurfaceClosestPoint(surface, cpoints[0])

Well,

I seems to work for me mate. Makes sure both inputs are ghdoc. first one list and the second one item.

Best,

M.

Ok...here is the most basic version of the script and the Rhino Surface (.3DM)

If I change the second input to List Access, I get results, but they are not properly output as a UV point or even a list of (u,v,w)..instead it is broken into two items in a list--missing the third, "w" value.

Thanks again for your help.

Attachments:

in the component

import rhinoscriptsyntax as rs
#this is the u,v
uv = rs.SurfaceClosestPoint(surface, points[0])
u=uv[0]
v = uv[1]
cp= rs.EvaluateSurface(surface,u,v)

Best,

M.

Attachments:
Cool!

thanks!

aaron

Hey Guys, 

I am getting the same mistake, the only difference is that I imput GH created geometry only, I Know there are a lot of topics related to this in the forum, but I haven't had any luck on getting on the right track. I am trying to write a very simple script to extend a list of lines to a list of surfaces. Attached is my file

Thank you in advance!

Attachments:

Hi Nicolas

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service