Dec-11-2017, 10:01 PM
(This post was last modified: Dec-11-2017, 10:03 PM by Filthy_McNasty.)
I have a script that does the job but only for one file. Just to explain what`s going on here:
Is it possible to execute each file at the time and add specific time frame between two executions let's say 2 minute pause between them, because I can not run 2 or more conversions at the same time, it would crash Windows. If so, how to do it. I don`t have much Python experience so if you can help me directly with the code that would be fantastic.
Disregard this [font ...etc] stuff , NOT a part of the code, I cannot figure out how to delete that from the code, this is so confusing pasting code in here.
Thank you very much for your help!
import sys sys.path.append("C:\\Program Files\\FME\\fmeobjects\\python27") import fmeobjects runner = fmeobjects.FMEWorkspaceRunner() workspace = [font="Calibri",sans-serif]'C:\FME\Project_1.fmw'[/font] parameters = {} parameters['SourceDataset_ACAD'] =[font="Calibri",sans-serif]'C:\AutoCAD\Project_1.dwg'[/font] parameters['DestDataset_OGCKML'] =[font="Calibri",sans-serif]'C:\Maps_KMZ\Project_1.kmz' [/font] runner.runWithParameters(workspace, parameters) try: # Run Workspace with parameters set in above directory runner.runWithParameters(workspace, parameters) # or use promptRun to prompt for published parameters #runner.promptRun(workspace) except fmeobjects.FMEException as ex: # Print out FME Exception if workspace failed print ex.message else: #Tell user the workspace ran print('The Workspace is ran successfully'.format(workspace)) runner = NoneThis script executes FMW file that does conversion from AutoCAD DWG (C:\AutoCAD) to KMZ file and stores it in C:\Maps_KMZ folder. Now, I need to do the same thing for about 20-ish FME files that are in the same source folder.
Is it possible to execute each file at the time and add specific time frame between two executions let's say 2 minute pause between them, because I can not run 2 or more conversions at the same time, it would crash Windows. If so, how to do it. I don`t have much Python experience so if you can help me directly with the code that would be fantastic.
Disregard this [font ...etc] stuff , NOT a part of the code, I cannot figure out how to delete that from the code, this is so confusing pasting code in here.
Thank you very much for your help!