Using FME to Write to ArcFM Geodatabases

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2015.x

Introduction

To use FME to write to an ArcFM enabled Esri Geodatabase, FME must check out both an Esri Geodatabase license and an ArcFM license. The FME Geodatabase writers automatically check-out an Esri Geodatabase license. However, you have to add a Python script to FME to check-out the Telvent ArcFM license.

 

Solution

This solution uses a startup Python script to obtain an ArcFM license. It was tested with ArcFM 9.3.1 with ArcGIS Desktop 9.3.1.

The error message "This operation requires a valid ArcFM License. Please contact Miner & Miner for details." indicates that you are trying to edit a feature class that has been converted to an ArcFM or ArcFM Designer feature without first checking out a license. Because ArcFM uses custom GeoObjects, it is necessary to check out an appropriate license before you make any edits. In ArcCatalog or ArcMap, this is handled for you by specifying a product in the ArcFM Desktop Administrator. In FME you need to configure FME to checkout the license

 

Prerequisites

Esri ArcGIS Desktop
Schneider Electric (was Telvent or Miner&Miner) ArcFM
Appropriate Esri & ArcFM licenses License check-out Python code (obtained from Schneider Electric ArcFM support)
A licensed copy of FME (Esri Edition or higher)

The license check-out sample code is available from Telvent support. It corresponds to the license code referred to in the ArcFM user documentation. In the ArcFM SDK documentation, navigate to ArcFM Solution Basics > Runtime Environment > Standalone Applications and License Manager. This page describes the functionality needed, along with code samples in C# and Visual Basic. At the time of writing, the equivalent Python code samples were only available from Schneider Electric ArcFM support.

Using Python is the simplest approach to checking out the ArcFM license. This is because it can be included in the FME Workbench Startup Python Script. This can be found on the FME Workbench navigation tree under Workspace Properties > Advanced > Startup Python Script.

 

Configuration Steps

1. Install PythonWin

PythonWin, amongst other features, allows python scripts to communicate with COM objects which is how the Python script accesses the ArcFM licensing interface. When prompted in the installer, associate PythonWin with the Python installed with ArcGIS (for ArcGIS 9.3, the python version is 2.5).

 

There are two options for downloading PythonWin:

Option 1) - Download it from SourceForge. Make sure the version of PythonWin matches the version installed with your ArcGIS installation.

Option 2) - Install it from the installation media provided with your ArcGIS.

2. Associate FME with ArcGIS’s version of Python
a. Go to Tools -> FME Options -> Runtime
b. Check 'Use Custom Python Interpreter' and point it to the python dll that might be found in the Windows\system32 folder or sometimes C:\Python26\ArcGIS10.0

3. Set the startup python script
a. Open your workspace
b. In the navigator window edit: Workspace Parameters -> Advanced -> Startup Python Script.
c. Paste in the Python script you have obtained from Telvent support or the code sample attached to this article (derived form the Telvent forum above).

4. Set the shutdown python script
In the navigator window edit: Workspace Parameters -> Advanced -> Shutdown Python Script.

5. Paste in the following Python:
cleanupArcFM()

It's important that the clean-up is done in the Shutdown Python so that the FME Geodatabase writer can write to the ArcFM Geodatabase while the ArcFM is checked-out. You should only use this clean-up call if you have defined the cleanupArcFM procedure in the Startup Python script.

Running an FME workspace with these two scripts should enable you to write to an ArcFM database using the FME Geodatabase writer.

 

Errors

You may get the error: "Unable to locate component MSVCR90.dll" This should be addressed in FME 2014 if you are using the Python manifest shipped with FME.

If the error persists then importing the arcpy libraries at the start of the python script may resolve the error:
import arcpy

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.