Tag Info

New answers tagged

0

As part of the port from 9.3 to 10.2, I needed to solve a related problem here: Workaround for AxMapControl painting issue (only problematic at certain screen resolutions)? One of the fixes I tried for that problem was anchoring the AxMapControl at all four points: top, bottom, left, and right - to try to force the control to repaint the map across the ...


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

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 ...


0

Take a look at the code below. Full code in git repository can be here: https://bitbucket.org/bugramovic/fme_arcobjects_interop_example PrintStream out = System.out; FMEWorkspaceFactory fmeWorkspaceFactory = new FMEWorkspaceFactory(); IPlugInWorkspaceHelper plugInWorkspaceHelper = fmeWorkspaceFactory.openWorkspace( pathToFdlFiles ); ...


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 ...


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 ...


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

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, ...


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 ...


0

Is this a Polygon x Point intersection? If so, your code seems correct. Your picture clearly shows a set of polygons (buildings, in yellowish) and another set of polygons (in red). It's not clear from your question, where the problem is. Is the polygon intersection failing? If that is the case (buffered points, which are in turn, polygons), your code is ...


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 ...


0

CrMackey I see some strange behavior, when I execute the script in another machine,it throws an error 'module' object has no attribute 'SdeWorkspaceFactory'. Whereas in another machine, it works fine. ArcGIS versions are same. Any clue? worskspace is set correctly.


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 ...


0

This doesn't answer your question directly, but may be helpful. Consider creating a timer that executes a method every X milliseconds. Then you can use this method to periodically check the properties of all kinds of objects, including the visibility of your dockable window. This way you can know if your window was closed. Below is some relevant code to ...


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 = ...


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

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.


0

Beginning ArcGIS for Desktop Development using .NET, a book by Pouria Amirian, helped me to get into ArcGIS/ArcMap application development. I think this is one of the best reference books for beginners to start with basic .NET concepts and tying them into ArcObjects. It comes up with sample C# codes and data sets.


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 ...


0

Hope this mignt help you -Getting into ESRI ArcGIS Add-in Development in .Net and ArcObjects


4

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


0

The IDatasetContainer interface lets you move datasets between feature datasets and workspaces—both objects implement the interface. It should only be used to move datasets between feature datasets and the workspace level within a single workspace, however; it cannot be used to transfer datasets from one workspace to another. If you situation doesn't fit ...


0

Old question I know, but it still ranks high on google and is still relevant. Esri has an unsupported add-in to arcmap called PerfQAnalyzer. It can measure the draw time for different layers, it also has a scripting feature and can be run in a standalone mode as well. ...


0

One additional answer that successfully removes joins created with the Join tool in ArcToolbox, or with the Joins and Relates menu item on the context menu of a layer, or with a Join that is created with an IDisplayRelationshipClass. This method is considerably slower than the RemoveAllJoins3 method I also posted. private void ...


0

I know I posted one answer, but I have a few alternatives to removing the joins that don't have code samples posted. This method successfully removes joins that are created with the Join tool in ArcToolbox, or with the Joins and Relates menu item on the context menu of a layer, or with a Join that is created with an IDisplayRelationshipClass. As in my answer ...


0

I know this is years late, but I struggled with this as well and, for me, Kirk's answer working successfully depended on how the join was created. I don't have enough rep to comment on Kirk's answer, but it threw an exception until I changed it to what's below. Namely, I switched sourceTable and destinationTable. I also had to add the ComReleaser for the ...


0

Geoprocessing tasks by definition generates a new shapefile or feature class. That's why you always give them a "out" parameter. They run mostly as blackboxes, without letting you to interfere in the middle. As other people suggested in the comments, one of the approaches is to open the feature class that was generated, after your command returns (if async) ...


0

Here are some troubleshooting steps: First, check to see if the published map service is cached or not. If the map service is cached, then you will need to update the cache in order to see the changes on the ArcGIS service. you will then need to create a script that will update the cache whenever new data is added to the raster database. If the map ...


1

To access the pixel data with IRaster2, IRasterCursor, and IPixelBlock3, et al: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_access_pixel_data_using_a_raster_cursor/00010000000t000000/ Looks like you could also use IRawBlocks and IRasterBandCollection: ...


1

@mashhour-darweish ,Try the below approach.The code is in C# style. It may be similar in Java too. Geoprocessor GP = new Geoprocessor(); GP.OverwriteOutput = true; Intersect IntersectDataset = new Intersect(); IntersectDataset.in_features = "(" + srcShapefilePath+"\\polygon.shp", "polygon.shp" + "; " + srcShapefilePath+"\\lines.shp" + ")"; ...


1

I don't have a "50 reputation" to comment yet so I have to comment like this: What is the licensed product of ArcGIS that you are running? ArcGIS Basic (formerly ArcView) cannot edit an SDE workspace so if that is what you are using that could be your problem. If you are using ArcEngine, verify the licensed product that you are initializing your ...



Top 50 recent answers are included