Grasshopper

algorithmic modeling for Rhino

I am having some trouble modifying attributes on a point object from the python editor. All the back and forth between rhinoscript and rhino common has me a little lost I think. The following code produced an error when it gets to the 'ObjectColor': 

"Runtime error (ArgumentTypeException): expected RhinoDoc, got GrasshopperDocument"

import rhinoscriptsyntax as rs
import Rhino.Geometry as rg

def ptGrid():
    #define output grid as a list
    gridDimX = x
    gridDimY = x

    #loop to define X limits
    for i in range(gridDimX):
        #loop to define Y limits
        for j in range(gridDimY):

            #Create a point at i, j

            gridPt = rs.AddPoint( (i,j,0) )

            rs.ObjectColor(gridPt, [0,0,0])


            #Append Point to Output
            zero.append(gridPt)

Thanks in advance if you can steer me in the right direction!

Views: 373

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service