by Tyler Crain
Oct 7, 2017
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 rsimport 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!
Cancel
Setting Point Color Attributes Via Python Component
by Tyler Crain
Oct 7, 2017
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!