Lot --> scatter(surface,3,uniform) { PutInstance } PutInstance --> s(.5,.5,.5) r(0,45,0) center(xz) i("builtin:cube") s(.001,.001,.001) center(xz) report("xpos", convert(x, scope, world, pos, 0,0,0)) report("ypos", convert(y, scope, world, pos, 0,0,0)) report("zpos", convert(z, scope, world, pos, 0,0,0))
from scripting import * # Get a CityEngine instance ce = CE() #globals instancePointList = [] # Called before the export start. def initExport(exportContextUUID): ctx = ScriptExportModelSettings(exportContextUUID) # Called for each shape before generation. def initModel(exportContextUUID, shapeUUID): ctx = ScriptExportModelSettings(exportContextUUID) shape = Shape(shapeUUID) # Called for each shape after generation. def finishModel(exportContextUUID, shapeUUID, modelUUID): ctx = ScriptExportModelSettings(exportContextUUID) shape = Shape(shapeUUID) model = Model(modelUUID) reports = model.getReports() fillList = [] # vector as list [x,y,z] if(model.getReports().has_key('xpos')): xPosArray = reports['xpos'] yPosArray = reports['ypos'] zPosArray = reports['zpos'] i=0 for o in xPosArray: fillList = [] fillList.append (xPosArray) fillList.append (yPosArray) fillList.append (zPosArray) print fillList instancePointList.append(fillList) i += 1 # Called after all shapes are generated. def finishExport(exportContextUUID): ctx = ScriptExportModelSettings(exportContextUUID) print instancePointList
## report instance ID report("asset", asset) ## scale and center scope //s(0.001,'1, 0.001) center(xz) s((scope.sx/scope.sx)/100,'1, (scope.sz/scope.sz)/100) center(xz) ## report (convert) position in world coords report("xpos", convert(x, scope, world, pos, 0,0,0)) report("ypos", convert(y, scope, world, pos, 0,0,0)) report("zpos", convert(z, scope, world, pos, 0,0,0))
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.