rhexter

Python export from Console

Discussion created by rhexter on Apr 12, 2012
Latest reply on Apr 27, 2012 by MBuehler-esristaff
I'm a little puzzled,

I'm trying to run a simple export from the the console that will:
1) run the export script I have
2) log output to a file (I'm tired of going to the log window and manually having to tell it to save a log file to a specific location that i can read more comfortably in an IDE after each export)

Currently looks like this:


def export():
    """
    Initiate an export
    Use the script export settings
    """
    settings = ScriptExportModelSettings()
    
    settings.getMiscOptionsBatchBehavior("OVERWRITE")
    settings.setMiscOptionsWriteExportLog(True) 
    
    
    settings.setMiscOptionsScript("exportInstances.py")

    ce.export(ce.selection(), settings, False )



If I comment out, settings.setMiscOptionsWriteExportLog(True) and  settings.getMiscOptionsBatchBehavior("OVERWRITE") ,
it all springs into life and runs the export. Great! (It exports a text File that of instance locations as per your examples)

If they are there, nothing happens..

So:
1) this is confusing behaviour?
2) how do i specify where a log file is to be dumped?
3) where is a log file dumped if nothing is specified? (I guess the default is next to whereever the output from the export is, but its unclear since this is a script based export)

Outcomes