Select to view content in your preferred language

Create a grid of guides using python scripting

197
0
12-09-2024 06:20 AM

Create a grid of guides using python scripting

Since CityEngine 2024.0 guides are scene objects. This also means you can work with guides using the Python Scripting Interface for example to create a guide grid with specific size:

from scripting import *

# get a CityEngine instance
ce = CE()

def createGrid(count, xOffset, yOffset, layerName = "Guide Grid"):
    guideLayer = ce.addGuideLayer(layerName)
    for i in xrange(0, count):
        ce.createGuide(guideLayer, [i*xOffset,0,0,i*xOffset,0,(count-1)*yOffset])
        ce.createGuide(guideLayer, [(count-1)*xOffset,0,i*yOffset,0,0,i*yOffset])

if __name__ == '__main__':
    createGrid(5, 20, 20)
JonasObertuefer_0-1733754166845.png

 

Version history
Last update:
‎12-09-2024 07:49 AM
Updated by:
Contributors