I have tried to run the script bellow and had this error
SCRIPT ON RhinoPython¹º¹ Primer not working Page 47
File “C:\Documents and Settings\Admin\Local Settings\Temp\TempScript.py”, line 3
source = “By Layer”, “By Object”, "By Parent"
SyntaxError: expected an indented block
import rhinoscriptsyntax as rs
def displayobjectattributes(object_id):
source = “By Layer”, “By Object”, "By Parent"
data = []
data.append( “Object attributes for :”+str(object_id) )
data.append( "Description: " + rs.ObjectDescription(object_id))
data.append( "Layer: " + rs.ObjectLayer(object_id))
#data.append( “LineType: " + rs.ObjectLineType(object_id))
#data.append( “LineTypeSource: " + rs.ObjectLineTypeSource(object_id))
data.append( “MaterialSource: " + str(rs.ObjectMaterialSource(object_id)))
name = rs.ObjectName(object_id)
if not name: data.append(””)
else: data.append(“Name: " + name)
groups = rs.ObjectGroups(object_id)
if groups:
for i,group in enumerate(groups):
data.append( “Group(%d): %s” % i+1, group )
else:
data.append(””)
s = ""
for line in data: s += line + "\n"
rs.EditBox(s, “Object attributes”, “RhinoPython”)
if name==“main”:
id = rs.GetObject()
displayobjectattributes(id)