Tag Info

New answers tagged

0

Follow up question semi-related to this question.... I must open a bunch (50 per week) of mxd's and 'Clear' the Coordinate system from the data-frame to make sure my students have all of their data projected in the same 'space'. I do this by hand, over and over and over, by... -Right Clicking the Data Frame -Coordinate System Tab -Click on the Globe ...


1

Success! For tables other than the FeatureLayer, you have to do the following: Create a StandaloneTableClass, set the Table property, you may now access and setup any properties you like from the IFieldInfo interface. After that you have to add the StandaloneTable to the map by casting IMap to IStandaloneTableCollection. ITable = ...// Create your ...


2

I am going to write this in VB.Net since that is what I know, and hopefully you can figure out the C# way to do it: To find all the layers, use IEnumLayer interface: Dim pEnumLayer As IEnumLayer = My.ArcMap.Document.ActiveView.FocusMap.Layers(Nothing, True) The second argument determines if this drills down into composite layers. To get the layer from ...


0

KK was quick on the trigger while I was in progress with similar. KK's answer assumes each part is linear (consisting only of a start and end vertex). This answer is similar but does not make that assumption, but otherwise has the same limitation that it assumes that there are no misordered or flipped parts. /// <summary> /// Test ...


1

This is an update to my old answer. The following tests ok for polylines that have gaps between their paths and are not oriented. Updated again to keep gaps that are larger than tolerance, and sort the resulting multipart polylines. The key concept is to create a Directed Graph (Digraph) of the polyline. A hash function is used to assign node IDs points ...


0

I've not done much with labelling with ArcObjects so this may not be relevant or you have tried it already? Have you tried setting IAnnotateLayerProperties.DisplayAnnotation Property?


0

I was able to achieve it by following - IEnumStyleGalleryItem enumStyleGalleryItem = styleGallery.get_Items("Marker Symbols", filePath, null); enumStyleGalleryItem.Reset(); IStyleGalleryItem styleItem = enumStyleGalleryItem.Next(); IGeoFeatureLayer geoFeatureLayer = (IGeoFeatureLayer)pointsFeatureLayer; ISymbol symbol; IUniqueValueRenderer ...


0

I don't think this is possible. Certainly not with shapefiles. The IFieldEdit documentation itself states: The IFieldEdit interface is used when creating new fields. You should not use it to modify fields, for that purpose use IClassSchemaEdit. and the Editable property in both IFieldEdit and IFieldEdit2 (which superceded it) both state (emphasis ...


1

I always recommend to check for null values when you are geting features from feature classes, feature class from feature layers, etc. That will prevent you this type of errors, and in the future will be easier to find bugs. Dim pFLayer As IFeatureLayer pFLayer = pMap.Layer(layerNum) Dim featureClass As ESRI.ArcGIS.Geodatabase.IFeatureClass = ...


2

GetFeature() is a method of IFeatureClass, not IFeatureLayer. Change this: Dim feature as IFeature = pFLayer.GetFeature(1) to this: Dim feature as IFeature = pFLayer.FeatureClass.GetFeature(1) Looks like you're creating a featureclass object but not using it.


0

You will need to track the current active view and unhook the old active view (required|optional ?) and hook the new active view whenever it changes. Note that ViewRefreshed is not called every time the view is actually redrawn, but it does seem to be called whenever the code explicitly calls Refresh or PartialRefresh and when the redraw toolbar button you ...


0

If you are trying to rename the field STR_NAME to STREET, ArcObjects does not allow you to do that. You will have to create the field STREET, copy the data from STR_NAME into it, then delete STR_NAME.


2

It seems you get can get or set the current tool using iApplication.CurrentTool property. See here. Whether or not this works for custom tools I'm unsure.


1

Looks like you want to listen for attribute window events. Seems you can access them from this interface: iAttributeWindowEvents There is an 'onDeactivate' event that you'll want to listen for to trigger your next section of code. There should be plenty of code samples around showing how to listen for events in ArcObjects.net.


0

You need to reference My.ArcMap.Application.Document. Code snippet is in VB, but will produce the map layer count. Dim mxdoc As IMxDocument Dim pMap As IMap mxdoc = CType(My.ArcMap.Application.Document, IMxDocument) pMap = mxdoc.ActiveView.FocusMap Dim layerCount As Integer = pMap.LayerCount MessageBox.Show("Layer Count = " & layerCount.ToString)


0

First of all,let me apologize if my post had any misleading,maybe it implied that SDE does not apply Uncommitted read for its transaction isolation level.As I found using SQLServer profiler(after a lot of traces),I found even SDE applies "Commited Read" when query to its repository,but using profiler,I didn't find any command issued by SDE related to ...


3

Stopping users from adding invalid values is really the task of a Geodatabase domain. Shapefiles do not support domains. I would strongly suggest you explore these options first as they can be set through ArcMap or ArcCatalog and do not require any programming with ArcObjects. It's also good Geodatabase design if you assign domains to fields. But you do not ...


0

I was able to achieve results as following: UID uidDockWin = new UID(); uidDockWin.Value = "esriEditor.AttributeWindow"; ESRI.ArcGIS.Editor.AttributeWindow attWin = editor.FindExtension(uidDockWin) as AttributeWindow; attWin.Visible = true;


0

The description of IFieldInfo3.Readonly Property says, Setting the value to true will make the field read only in clients such as the ArcMap editor attribute window. This property only applies to clients that choose to implement it. So I think you can only restrict the user only after the feature class is added to map as a layer.


0

There is the event IActiveViewEvents.ViewRefreshed.


0

You probably just need to use the IActiveView.Refresh method to achieve what you're looking for. You can get the active view from the MxDocument.ActiveView property. The help/snippets should lead you the rest of the way.


2

I googled "arcobjects add north arrow". The very first search result is a C# snippet: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//00490000004w000000


0

I have never used that interface so a good find indeed! But I'm still not convinced the dialog is exposed... An alternative is to open up and display the selectbylocation geo-processing tool? The following VBA code opens the Calculate Field tool but it gives the basic syntax for populating parameters and opening up the interface. Public Sub ...


2

I was able to achieve results as following: public void SaveProject() { UID uid = new UIDClass(); //uid.Value = "{119591DB-0255-11D2-8D20-080009EE4E51}"; uid.Value = "esriArcMapUI.MxFileMenuItem"; uid.SubType = 3; ICommandItem item = ArcMap.Application.Document.CommandBars.Find(uid, false); item.Execute(); } Appreciate your help.


0

In 10.2 you would probably be able to use IMapServerRESTLayer. I haven't tried it myself as I'm stuck with 10.0. In 10.0 we wrote our own layer type using the plug-in datasource framework: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Plug_in_data_sources/000100000003000000/ It's a lot of work and you probably only want to ...


-1

My understanding is you now need a key from Microsoft to complete this task. Here is the link to request a key and explanation on how it works once you get the key, it includes instructions for online use. You need to install an update as well. The link to this is above as well.


1

you sure obtain IApplication/IMxApplication hook somehow in your code then you can obtain IMxDocument pointer and then cast it to IMapDocument: IMxDocument ipMxDoc=(IMxApplication)ipApp; //Suppose ipApp has been obtained via hook passed in OnCreate method of ICommand interface IMapDocument ipMapDoc=(IMapDocument)ipMxDoc; ipMapDoc.SaveAs(fileName); ...


3

You will want to create a ToolControl button that allows you to click on a map as opposed to a button which does something when you click on it. Then grab the point, create a spatialfilter and query your polygon layer, this returns a Feature object which you can return the various address components and populate some form that you created. The bold words ...


1

Works with this using System; using System.Collections.Generic; using System.Linq; using System.Text; using ESRI.ArcGIS.Geodatabase; using ESRI.ArcGIS.esriSystem; namespace SDEtest { class Program { static void Main(string[] args) { ESRI.ArcGIS.RuntimeManager.BindLicense(ESRI.ArcGIS.ProductCode.EngineOrDesktop); ...


3

The IFeatureClass Interface exposes the AliasName.



Top 50 recent answers are included