I’m trying to convert all polysurfaces to blocks for export to sketchup but the code exits with error “iteration over non-sequence of type Guid”.
import rhinoscriptsyntax as rs import System.Guid #objs = rs.GetObjects("Select Objects") #, filter = rs.filter.surface) objs = rs.ObjectsByType(16, False) print("Types", type(objs), type(objs), objs == System.Guid, objs == str) for obj in objs: point = (0, 0, 0) # rs.GetPoint("Block base point") #objGuid = rs.coerceguid(obj) #print("type GUID: ", type(ogjGuid), objGuid == System.Guid) #objList = list(obj) block = rs.AddBlock(obj, point, None, True) rs.InsertBlock(block, point)
The script works when passing
objs as a list of Guids (without for loop) to the
addBlock function, turning all polysurfaces into a single block. The
addblock definition actually says that the function takes an array as first parameter but trying to put the Guid into list within the for loop ends also with error “Guid is not iterable”
Hints are much appreciated, thanks.
rhino for mac 5.5