Tag Info

Hot answers tagged

4

Try setting ActiveView (rather than FocusMap) to newMap: mxDocument.ActiveView = newMap


3

@dvdhns suggestions, are what you should do. However you don't need to write a xslt for html conversion because Esri has done this for your before. see this code snippet: import arcpy from arcpy import env env.workspace = "C:/data" #set local variables dir = arcpy.GetInstallInfo("desktop")["InstallDir"] xslt = dir + "Metadata/Stylesheets/ArcGIS.xsl" ...


3

No. You cannot directly export ESRI Feature Class metadata into PDF files. This is how I would attempt to do it using python, rather than ArcObjects: Use arcpy to export the metadata to xml files. Use python and xslt (xml style sheets) to format the xml files into something human readable, my recommendation is a simply formated txt or html file. Use a ...


3

You may get better help by changing the tags from arcpy to ArcObjects as this has nothing to do with arcpy, you are accessing ArcObjects using python's comtypes module. Regarding your error, you may need to reload all your ArcObjects Object Library files (*.olb) files. I was able to successfully get the IWorkspaceFactory2 pointer from your code: See ...


2

First note that IExportOperation interface doesn't export featureclasses or tables that containt a BloB field. So if a blob field exists in your featurelayer you should use "FeatureClassToFeatureClass" instead. In your question you mentioned you want to export each row to a shapefile but in your export path you set a path to a File Geodatabase! Here are ...


2

In your code you have: pWorkspaceName.PathName = "C:\\Users\\username\\Documents\\ArcGIS\\Default.gdb"; pWorkspaceName.WorkspaceFactoryProgID = "esriDataSourcesFile.ShapefileWorkspaceFactory"; As you have defined the path name to be a file geodatabase then the workspacefactory should be: pWorkspaceName.WorkspaceFactoryProgID = ...


2

The fist problem is it's not an add-in. public class PanDown : ICommand should read public class PanDown : ESRI.ArcGIS.Desktop.AddIns.Tool or public class PanDown : ESRI.ArcGIS.Desktop.AddIns.Button Have a good read of this and start again from scratch, ensuring that you select an add-in type for your project when you start in Visual Studio. There ...


2

This code snippet should add a new dataframe: IApplication app = default(IApplication); IMxDocument pMxDoc = default(IMxDocument); app = (IApplication)Hook; pMxDoc = (IMxDocument)My.ArcMap.Application.Document; //Create a new map IMap pMap = default(IMap); pMap = new Map(); pMap.Name = "My Map2"; //Create a new MapFrame and associate map with it ...


1

IContentsViewSelection should work for you. http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//000v00000064000000 This is VB, but you should get the idea... Dim pCVSel As IContentsViewSelection = My.ArcMap.Document.CurrentContentsView Then: pCVSel.SelectedItems.Count will give you the count of selected items in the TOC.


1

On A Form with a split container I added a Map Control docked in one panel and a toccontrol docked the other. I set the mapcontrol to be the buddycontrol of the toccontrol. and added a mouse down event to that has the following code. This works perfectly in ArcGIS 10.2.2, the map expands and contracts and changes the extent as expected. Basically what your ...


1

Here is the C# code to get the addin assembly folder: public static string AssemblyDirectory { get { string codeBase = Assembly.GetExecutingAssembly().CodeBase; UriBuilder uri = new UriBuilder(codeBase); string path = Uri.UnescapeDataString(uri.Path); return ...


1

From the ArcSDE Administration Command Reference: Beginning with ArcGIS 10.1, you must use a geoprocessing tool or Python script to create a geodatabase. For geodatabases in Oracle, SQL Server, and PostgreSQL, if you can use the default settings, use the Create Enterprise Geodatabase tool or a Python script that calls this tool. If you want to ...


1

I removed all the event handlers from my map control, thus effectively paring it back to the core ArcGIS functionality. The map painting issue disappeared. I then added the event handlers back in one-by-one to isolate the problem. The problem appears to be a bug in the ArcGIS control where if a map layer is inserted in the code for the OnExtentUpdated event ...


1

When the form is resized at run time, the PageLayoutControl and MapControl do not automatically resize. To resize the controls so that they always fill the extent of the form, anchor the controls to the form. If the PageLayoutControl or MapControl contains a lot of data, redrawing this data while the form is resized can be costly.To increase performance, ...


1

Try Isolating the problem. If you create a new form add a split control, drop a map control in to one side of it, then reference an mxd in the map control and run the form does the MapControl refresh properly? I tried this exact thing upon reading your question, and it works fine out of the box for me. If it does for you, you could start adding pieces of ...


1

Did you follow this set of best practices for multithreaded arcobjects code? Objects cannot cross thread boundaries and it appears that your code is doing so. Figure out the data source on the main UI thread and serialize the data source object to XML as recommended there.



Only top voted, non community-wiki answers of a minimum length are eligible