3

I'm using this this bit of code to execute a FME Workbench file through a Python script ...

import os
os.system("fme.exe P:\\Mapping\\Scripts\\FME\\Easements_ROW_Extract_From_CAD.fmw")

However, when I try using it as an ArcGIS script tool, ArcGIS tries to execute it using the Data Interop's fme.exe. I only have the stand alone version of FME. I tried using the full path to the fme.exe i'm trying to use, but that's not working ( the script runs without error, but nothing is produced). Any ideas on how to get this script to work, using the stand alone version of FME, as an ArcGIS script tool?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Dec 10, 2012 at 16:32

2 Answers 2

1

Not sure why the full path isn't working, unless you aren't escaping backslashes maybe? I would think the full path should work just fine. Maybe post that code as well. Another option would be to setup the path to fme.exe as an Environmental Variable, so add the path, something like C:\Program Files\FME\path\to\fme.exe as a environmental variable.

answered Dec 10, 2012 at 17:08
2
  • Using this ... "C:\\Program Files\\FME\\fme.exe P:\\Mapping\\Scripts\\FME\\Easements_ROW_Extract_From_CAD.fmw" Commented Dec 10, 2012 at 17:14
  • See this as well: gis.stackexchange.com/a/19141/65 Commented Dec 10, 2012 at 18:25
0

This worked for me. Apparently the os.system module is being replaced by the subprocess module. Here is the documentation.

import subprocess
subprocess.Popen(['C:\\Program Files\\FME\\fme.exe', 'P:\\Mapping\\Scripts\\FME\\Easements_ROW_Extract_From_CAD.fmw'])

This now works within an ArcGIS script tool.

answered Dec 12, 2012 at 0:31

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.