Okay, so being on the trial I can not access the export functions to try them out ( a key part of my evaluation) 😞
Please contact your local Esri office and ask for a time-limited full version for evaluation.http://www.esri.com/about-esri/locations.html
sel=ce.selection()[0] #gives me a shape 'sel'
sel.getReports()['asset'] #suggests that the Shape object returned has a getReports method that generates a dictionary, no?
...
model=Model(modelUUID)
Can Model be used within the city Engine python script Console?
Is 'modelUUID' the equivalent of the 'shapeUUID' that I can return from my shape I generate within the City Engine?
getReports() ONLY works on models in the script-based exporter context. There is no way to access reports via Python without the script-based exporter callback functions.
Question
I find no mention of using Class instances in the APi docmentation, is this possible, being a standard part of python?
Question
Am i able to use Class Instances that contain more complex data structures within the global scope of these export scripts?
-----
Question
I assume you are using module based globals within the exportInstances.py script examples to pass data from one function to another?
i.e. one catalogs as the exporter iterates through shapes in the scene and the other uses the data gathered and runs the finishExport() after the export process has completed
from finishModel() to finishExport()
The easiest way to share data during the export context is to use globals in the callback script. You can use custom classes for this if desired.Example.
class MyClass:
n = 0
c = MyClass
def initModel(exportContextUUID, shapeUUID):
ctx = ScriptExportModelSettings(exportContextUUID)
shape = Shape(shapeUUID)
global c
c.n = c.n+1
print c.n
I assume that finishModel() is always run before finishExport()?
The script-based export callback functions are executed in the following order:
# Called before the export start.
def initExport(exportContextUUID):
# Called for each shape before generation.
def initModel(exportContextUUID, shapeUUID):
# Called for each shape after generation.
def finishModel(exportContextUUID, shapeUUID, modelUUID):
# Called after all shapes are generated.
def finishExport(exportContextUUID):
Question
Am I able to run both and fbx export for unique geometry as well as handle instances as described above in one export step or is is a case of having to run multiple export steps to extract specific data from the scene at each export step?
There seems to be a word missing in the question. (run both ... and fbx export). Could your reformulate this question?
SUggestion/Comment
How do I tear off windows? this is very annoying everything being docked?
pick and drag the tab of a window outside the main window. Note that Editor windows (Scene, CGA Editor, Python Editor) can not be detached.
Are you going to be moving this to be more pythonic ie object orientated?
When the Python API was first introduced, it was designed to work it in a similar way to CGA scripts. Therefore simple function calls were preferred over OO concepts. With the growing feature set of the Python API we might need to reconsider that decision for future releases.