Tag Info

Hot answers tagged

3

The easiest way to loop through layers in ArcMap is to use IEnumLayer. You get a reference to that from IMap.Layers. http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001200000482000000 Then check the type and cast each raster layer returned by the enumerator to IRasterLayer. ...


3

I think you are asking for the username of a layer's SDE connection. You need to use IWorkspace and IPropertySet. Something like this: Dim pDataset As IDataset = the feature layer/raster layer you want the user name of Dim pWorkspace As IWorkspace = pDataset.Workspace Dim pPropertySet As IPropertySet = pWorkspace.ConnectionProperties Dim userName As String ...


3

Looks like this is what you are looking for: http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//0048000001s1000000 System.Threading.Thread.CurrentThread.CurrentUICulture


3

Arcobjects has two interfaces to join multiple FeatureClasses and (or) Tables: Query tables (IQueryDef) RelQueryTables The result of your join can be added to the map as a Layer if the result has a geometry column. Make sure to read this Page to check the differences of two and select the one that suites your needs


2

Late but here is a suggestion. You can call Trace Geometric Network geoprocessing tool from ArcObjects and you can pass any IFeatureLayer in it as flags or barriers. You should be able to create a point on selected water main using ICurve.QueryPoint and save this point to IFeatureLayer and use it as a flag. If you have some layer in your network which ...


2

In another, related but slightly different, post I provided an answer that may be of interest for python users trying to wrap their heads around the Esri ArcObjects help docs.. I came from the other side: I already knew ArcObjects long (long long) before I had even heard of python and thanks to posts like these I am able to include some critical ArcObjects ...


2

Changing text fields length needs an exclusive schema lock on the dataset. Exclusive schema locks—In contrast to shared schema locks, exclusive schema locks are controlled by the developer or ArcGIS application, such as ArcMap or ArcCatalog. An exclusive lock is used to lock a geodatabase dataset or object from use by others to make the necessary ...


2

Below is what I came up with - suggestions for making this better are welcomed: /// <summary> /// Gets the field value from the IObject. Checks for coded /// value domains, subtypes, or just the plain field value. /// </summary> /// <param name="obj">ESRI IObject</param> /// <param ...


2

Your code won't work. You loop the cursor until it finishes. At that point pFeature is Nothing. After that you try to access the OID value of pFeature, which is Nothing. If you only select a single building or only want the first building OID of any selection set don't loop the cursor, just get rid of the cursor loop. Then you should make sure you got ...


1

I think SDE_OBJECT_ID might be data type LONG. Have you tried pFeature.OID.ToString(), or whatever the conversion method in VBA is? Not sure if it might fix the issue. Just an idea.


1

Use a try catch to fetch error messages from the gp object. try { GP.Execute("Creation", parameters, null); } catch(exception ex) { Messagebox.Show(GP.GetMessages(<severity>)); }


1

Further to Dan's answer on enumerating layers... with the UID.Value of IRasterLayer (see example UIDs here) supplied to the get_layers function you don't need to check later that it is a raster layer you're playing with, however sometimes you need to use the UID for IDataLayer which will return feature layers and raster layers, so to check this use: if ...


1

What you are identifying in your image is a ToolPalette not a Button or Menu. So use the AddIn Wizard to create your Buttons that you want to see in the ToolPalette then create the ToolPalette and add the buttons by their ID. Below is some demonstration code to get you going. <ESRI.Configuration xmlns="http://schemas.esri.com/Desktop/AddIns" ...


1

According to the Help file image is not an attribute of a menu element. In fact I cannot think of any menu on the ArcMap interface that behaves in this manner, i.e. has an image instead of a word, despite being able to change it to an image via the customize mode. So it's not a property you can define in the config file. Now I may be wrong, others can ...


1

I believe what you're after is IPolycurve.Generalize. This will turn an arc into a series of straight segments approximating the line. This interface is implemented by both polygon and polyline. Use a simple buffer of a point (ITopologicalOperator.Buffer) for a circle (or create a circular arc circle with IConstructCircularArc.ConstructCircle) cast to ...


1

What you are looking for is the circumcircle of a triangle. The circumcircle of a triangle is the circle that passes through all three vertices of the triangle and is unique. Help Although I think you are not looking for the math behind, here, you can find the math to reach to center and radius of a circumcircle from three points (a triangle). The good ...


1

I haven't tested this but I don't there would be any problem. I suggest to simply test the code with two MessageBox: public class Tool1 : ESRI.ArcGIS.Desktop.AddIns.Tool { public Tool1() { } protected override void OnUpdate() { Enabled = ArcMap.Application != null; } protected override void OnMouseDown(MouseEventArgs ...


1

To expand on the comment by @Dan Jurgella... Don't forget to check the properties in the System.Globalization.CultureInfo class. There are static properties in that class, DefaultThreadCurrentCultureand DefaultThreadCurrentUICulture, which could help you. Also depending on what you're doing with languages, it probably wouldn't hurt to be familiar with the ...


1

I use interface IFeatureEdit (or IFeatureEdit2). If you use method Split from interface IFeatureEdit, it will splits your feature, you will get 2 features. All of them will be new feature. (I mean 2 new Object IDs). However, if you use interface IFeatureEdit2, with method SplitWithUpdate, it is advance. We can get 2 features, but one is old feature and ...


1

To "go through a designated folder, [and] locate all MXD files within the folder" is relatively easy with Python, and there is a Stack Overflow Q&A that describes some ways: http://stackoverflow.com/questions/3207219/how-to-list-all-files-of-a-directory-in-python However, the rest is much harder because ArcGIS Desktop 9.3 only had access to the ...


1

Ok, I got it to work by going hog-wild with ComReleaser objects. Basically, I scanned through my code, and anytime I found anything that was at all from ArcObjects, I attached a ComReleaser to manage it. Basically, I'm just doing manual memory management. At any rate, it does seem to release the file, so long as EVERYTHING is released (even if it doesn't ...


1

In order to debug ArcMap 10.3 Add-in with VS2013 in .Net 4.5. I had to attach VS2013 to ArcMap.exe process. This is kinda annoying but it is the only way I got it to work for now. I'm still confused on why this is happening. How to attach process Start ArcMap In VS2013, go to menu "DEBUG" -> "Attach to Process" Select "ArcMap.exe" and click on "Attach" ...


1

The first task here is to get the location of the pointer, you can get this from the events OnMouseDown and OnMouseMove, these will return the coordinates in screen coordinates and also map coordinates... depending on whether you want to click the map or zoom where the pointer currently is will decide which one you want to use. To zoom the map it should be ...



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