<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic running Python against ArcGIS Engine in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/running-python-against-arcgis-engine/m-p/237925#M18493</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to run a very simple Export mapbook mxd's to pdf, while i'm using the ArcGIS Engine License in my C#.net application..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the problem is you cannot export mapbooks (from my what I've read on here) using ArcObjects,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;so i've written a .py script to be fired from my application...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it works fine in my development environment and on my development PC... uses the 64 bit python exe.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;when it comes to deploying it to a machine with a standalone Engine license, the script fails &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've trying a whole bunch of things including "import arcengine" at the top.... still no success&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any help would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tomas.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Set license used 
import arcengine

# import the required modules for the python script
import arcpy

# Script arguments - production
mxdloc = arcpy.GetParameterAsText(0)
outputfolder = arcpy.GetParameterAsText(1)
figprefix = arcpy.GetParameterAsText(2)

mxd = arcpy.mapping.MapDocument(mxdloc)
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
 mxd.dataDrivenPages.currentPageID = pageNum
 arcpy.mapping.ExportToPDF(mxd, outputfolder + figprefix + str(mxd.dataDrivenPages.pageRow.Figure_No) + ".pdf")
 arcpy.AddMessage("Exported: " + figprefix + str(mxd.dataDrivenPages.pageRow.Figure_No) + " to " + outputfolder)
del mxd
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jul 2013 01:19:32 GMT</pubDate>
    <dc:creator>TomaCasa</dc:creator>
    <dc:date>2013-07-18T01:19:32Z</dc:date>
    <item>
      <title>running Python against ArcGIS Engine</title>
      <link>https://community.esri.com/t5/python-questions/running-python-against-arcgis-engine/m-p/237925#M18493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to run a very simple Export mapbook mxd's to pdf, while i'm using the ArcGIS Engine License in my C#.net application..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the problem is you cannot export mapbooks (from my what I've read on here) using ArcObjects,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;so i've written a .py script to be fired from my application...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it works fine in my development environment and on my development PC... uses the 64 bit python exe.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;when it comes to deploying it to a machine with a standalone Engine license, the script fails &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've trying a whole bunch of things including "import arcengine" at the top.... still no success&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any help would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tomas.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Set license used 
import arcengine

# import the required modules for the python script
import arcpy

# Script arguments - production
mxdloc = arcpy.GetParameterAsText(0)
outputfolder = arcpy.GetParameterAsText(1)
figprefix = arcpy.GetParameterAsText(2)

mxd = arcpy.mapping.MapDocument(mxdloc)
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
 mxd.dataDrivenPages.currentPageID = pageNum
 arcpy.mapping.ExportToPDF(mxd, outputfolder + figprefix + str(mxd.dataDrivenPages.pageRow.Figure_No) + ".pdf")
 arcpy.AddMessage("Exported: " + figprefix + str(mxd.dataDrivenPages.pageRow.Figure_No) + " to " + outputfolder)
del mxd
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 01:19:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/running-python-against-arcgis-engine/m-p/237925#M18493</guid>
      <dc:creator>TomaCasa</dc:creator>
      <dc:date>2013-07-18T01:19:32Z</dc:date>
    </item>
  </channel>
</rss>

