Questions tagged [comtypes]

comtypes is a lightweight Python COM package, based on the ctypes FFI library.

Filter by
Sorted by
Tagged with
1
vote
1answer
209 views

Python, comtypes and ArcObjects: The specified product or version does not exist on this match this machine

Im trying to incorporate the Snippets Module on another machine running 10.3.1 I've sucessfully apdapted it to script that uses it with 10.5, along with the comtypes module. However, a machine running ...
2
votes
1answer
245 views

Using Python comtypes and ArcObjects to change dataframe background color in ArcMap?

I'm simply trying to programmatically change the background colour of a Dataframe in ArcMap. I followed the beginning of this solution to access ArcObjects in Python: import arcpy import os from ...
1
vote
0answers
96 views

Build network dataset using comtypes and arcpy [closed]

I am aware of the existence of this Build Network Dataset with python comtypes question. In fact, I used the same code. The error I am getting is different hence my posting of this new question. I am ...
3
votes
0answers
162 views

Adding layer with ArcObjects from Python script tool?

I would like to load an AFR file into a data frame in a currently open MXD and the IMap.AddLayer function is not working as expected if the data frame in which to load the AFR file is activate. And I ...
2
votes
2answers
469 views

Arcpy deselect layer in TOC

With python-addin-wizard I created a combobox which enables the user to select a specific ID of features in multiple featureclasses of the Table Of Content and then it zooms to the selected feature. ...
2
votes
0answers
39 views

Creating a Legend with arcpy and comtypes [duplicate]

I am relatively new working with python and arcobjects. Under normal limitations I know that you cannot create a Legend or any arcobject with arcpy.mapping. Is there a generic example of creating a ...
1
vote
1answer
628 views

ArcGIS 10 arcpy to add a WMS Service to MXD

I want to batch insert WMS layer to my arcmap MXD project with python/arcpy script. Some issues has been unanserwed, here my "state of art": ESRI IDEAS ESRI GeoNet community #1 ESRI GeoNet community ...
11
votes
1answer
441 views

Using Python to disable Scale map elements proportionally to changes in page size?

I am changing sources on MXDs in differents offices using ArcPy and ArcGIS 10.0. As observed here, the printer settings revert to the default printer when the instruction mxd.save() is sent. Losing ...
5
votes
1answer
480 views

Python and ArcObjects- Stand Alone open MXD

I wrote a Python function using comtypes to access ArcObjects to programmatically change the size of layer symbols in an MXD. The function works great in the Python window of ArcMap. However, I need ...
1
vote
0answers
62 views

Using SET methods when feature classes setup in GDB using python, comtypes, ArcObjects?

from snippetarcgis102 import CreateMXD,CType,NewObj import snippetarcgis102 import os snippetarcgis102.GetStandaloneModules() snippetarcgis102.InitStandalone() import comtypes.gen.esriCarto as ...
2
votes
2answers
151 views

How to make change to layer in ArcMap with python/ArcObjects?

In ArcMap 10.1 from the python window I am attempting to rotate a symbol for a point. After I run my code I can look at the symbol properties and the rotation expression is set on the symbol, however ...
2
votes
1answer
511 views

ArcObjects/Python: Add JPG to layout

I am attempting (and failing) to add an image to a map layout using ArcObjects via Python comtypes. I do need to run this outside of ArcMap (i.e. not in the ArcMap Python window). The basic idea is: ...
1
vote
1answer
2k views

Debugging 'module' object has no attribute 'SdeWorkspaceFactory'?

I am new to python, am debugging one of existing python code, where am facing an error "'module' object has no attribute 'SdeWorkspaceFactory". Earlier this code was working fine but suddenly does not ...
3
votes
2answers
518 views

Enabling snapping for OnLine method of ArcPy Python Add-In?

I am working on a Python Add-In using ArcGIS 10.2.2 where the user can draw lines and the Add-In will add dimension annotation showing length for each segment of the line that is drawn. I can get ...
6
votes
2answers
743 views

Build Network Dataset with python comtypes

I know this isn't possible in arcpy, so I thought I'd give it a stab using comtypes. I am trying to translate some of the VB.NET code to create a network dataset from the help docs: http://resources....
2
votes
0answers
832 views

Python comtypes and ArcObjects: Snippets GetApp() fails at 10.2

I have been experimenting with Python's comtypes module to access ArcObjects. We are still using ArcGIS 10.0 as we are in the process of upgrading our ArcGIS for Server to version 10.2.2. I am ...
2
votes
1answer
347 views

Adding a graphic line element to open mxd using python comtypes to access ArcObjects

I attended a pretty awesome demonstration from Jeffrey Barrette at the Esri UC a few weeks ago on creating dynamic tables in ArcMap. This functionality will greatly benefit the aviation department at ...
5
votes
1answer
2k views

ArcObjects SQL Server Connection not recognizing instance

I am trying to make a connection to a SQL Server database with SdeWorkspaceFactory. This is from my Windows 7 x64 Desktop to a Network database. If I use this: SDEWorkspace = NewObj(...
6
votes
2answers
3k views

ArcObjects + comtypes at 10.1 and newer

Has anyone played around with using ArcObjects in Python at version 10.1? I am having all sorts of problems, such as TypeErrors when wrapping the ESRI OLB modules and AttributeErrors when attempting ...
6
votes
3answers
3k views

Python, comtypes and ArcObjects: Error creating AppROT object

I am experimenting with comtypes and ArcObjects under Python 2.6.5 and ArcGIS 10 SP1. I'm using the pure Python method to wrap the ArcObjects OLBs described in this answer, but getting an error in the ...
132
votes
5answers
24k views

Accessing ArcObjects from Python?

I would like to be able to script some things that are not exposed via arcgisscripting or ArcPy. How do I access ArcObjects from Python?