import rhinoscriptsyntax as rs
import scriptcontext
import Rhino
if ACTIVE:
for i in range(len(GEO)):
scriptcontext.doc = ghdoc
GEO_id = GEO[i]
doc_object = rs.coercerhinoobject(GEO_id)
attributes = doc_object.Attributes
geometry = doc_object.Geometry
scriptcontext.doc = Rhino.RhinoDoc.ActiveDoc
rhino_obj = scriptcontext.doc.Objects.Add(geometry, attributes)
rs.ObjectColor(rhino_obj, color[i])
mat_id = rs.AddMaterialToObject(rhino_obj)
rs.MaterialColor(mat_id, color[i])
"运行时错误(TypeErrorException):'颜色'对象是不可取消的 追溯: 第23行,脚本"
我不知道为什么" ObjectColor"是无法编写的,我已经多次将它与python API相匹配。我没有看到我应该做的事情吗?