Hi, I’m new here.
I’m trying to write a python script in grasshopper that will taking in a surface, rebuild it and then:
- Enable the surface’s control points / grip points
- Access and edit individual grip points.
- Replace those points, updating the surface and disabling the points again.
Here is the Code:
import rhinoscriptsyntax as rs
#Enable Surface Grips (Control Points)
Modify_Surface = rs.EnableObjectGrips(Surface_In, True)
#Function Definition To Move Grip Point (Control Point)
def Change_Point_Location(Surface, Index, Move_X, Move_Y, Move_Z):
Point = rs.ObjectGripLocation(Surface, Index)
Point[0] += Move_X
Point[1] += Move_Y
Point[2] += Move_Z
rs.rs.ObjectGripLocation(Surface, Index, Point)
#Change Points
Change_Point_Location(Modify_Surface, 0 , 10, 10 , 10)
#Disable Surface Grips (Control Points)
Modify_Surface = rs.EnableObjectGrips(Surface_In, False)
Surface_Out = Modify_Surface
I have an issue when calling the function at #Change Points as I get a GUID error:
Runtime error (TypeErrorException): Parameter must be a Guid or string representing a Guid
Traceback:
line 890, in coerceguid, “C:\Users\xxx\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py”
line 1062, in coercerhinoobject, “C:\Users\xxxx\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py”
line 195, in ObjectGripLocation, “C:\Users\xxxx\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\grips.py”
line 11, in Change_Point_Location, “”
line 18, in script


