Grasshopper

algorithmic modeling for Rhino

Hello,

I keep getting errors that have to do with object types...I have to be missing some piece of information specific to GHPython or Rhinoscript... switching between List Access and Item Access has helped in the past...but again I must be missing something simple.

here is the code and error--attached are the def and (.3DM) file:

----------------------------------------------------------------------
import rhinoscriptsyntax as rs
import ghpythonlib.components as ghcomp

#print UV

pc = []
maxVecs = []
revVec = []
movedPts = []

pc = ghcomp.PrincipalCurvature(surface, UV)

maxVecs = pc[4]
frames = pc[0]



for vector in maxVecs:
#print vector
tempVec = rs.VectorReverse(vector)
revVec.append(tempVec)



for i in range(len(frames)):
#print frames[i]
print revVec[i]
tempPt = rs.MoveObject(frames[i],revVec[i])
#movedPts.append(tempPt)


vectors = revVec

--------------------------------------------------------------
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 1081, in TransformObjects, "C:\Users\Aaron\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\object.py"
line 396, in MoveObjects, "C:\Users\Aaron\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\object.py"
line 382, in MoveObject, "C:\Users\Aaron\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\object.py"
line 28, in script


Any help with understanding what's going on would be really helpful.

aaron

Views: 729

Attachments:

Replies to This Discussion

line 28 from the error log is this line of code:

tempPt = rs.MoveObject(frames[i],revVec[i])

As it says: MoveObject is intended for Objects that are identified by a GUID.

For a point to move, you just add the translation vector to the original point.

translation vector is revVec[i]...

in this case the add will work, but still would like to solve the GUID problems with understanding...thanks, Hannes.

Hello Aaron,

This is the same error as the one yesterday. GH objects are not guids. While rhinoscript is used to handle rhino objects (that is creating actual rhino geometry) Grasshopper is not. It has its own object types.

 

My suggestion. (popping up many times in this forum) SKIP rhinoscript while scripting within GH and use only Rhinocommon.

 

Best,

M.

Marios,

I see, same question produces different answer at a different time...very good...part of the path. 

I will switch to RhinoCommon and see if that magically makes the number of questions smaller and my ability to find answers a little better.

aaron

Trust me it will.

 

thanks for the resources. :)

 

M.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service