Is this a RPK of the Building_From_OpenStreetMap.cga rule? This rule requires some object attributes of type float to work correctly:
"building__levels", "roof__height", "roof__direction", "building__levels__underground", "building__min_level", "min_heigh"
In python you can check the type of an attribute with type() and then cast to a certain type as required with float() or str(). In case of the OSM id you probably want to remove the decimals before converting it to a string, this can be done by first casting it to int()
def initExport(exportContextOID):
ctx = ScriptExportModelSettings(exportContextOID)
shapes = ce.getObjectsFrom(ce.selection, ce.isShape)
for s in shapes:
osmId = ce.getAttribute(s, "osm_id")
ce.setName(s, str(int(osmId)))
You can ofc also directly set/get object attributes for many objects using python, without using an export script:
shapes = ce.getObjectsFrom(ce.selection, ce.isShape)
ce.setAttribute(shapes, 'myName', 'myValue')
How to work with python in CityEngine is explained in this tutorial:
Cheers,
Jonas