Tag Info

Hot answers tagged

3

Below is some code in VBA that shows how to set the extent of the viewer window to the current map. The key interface is IMapInsetWindow which gives you access to the IMapInset2 and it's read/write properties. Public Sub updateMapView() ' Get map document Dim pMXDoc As IMxDocument Set pMXDoc = ThisDocument ' Get Map Dim pMap As IMap ...


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

These types of questions almost invariably get closed as "primarily opinion-based", but I will say that it's going to be much more difficult and take much more time to learn ArcObjects than Runtime, especially when you take into consideration that in either case you will also have to learn a new programming language and framework (e.g. C# and .NET). ...


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


2

To find the name of the dataset as stored in the database use IDataset.BrowseName. IDataset.Name will give you the layer name as it is named in ArcMap. You should also test that the layer can be cast to IDataset: If TypeOf currentLayer Is IDataset Then... Things like group layers don't implement IDataset, and will cause an error.


1

I believe what you're looking for can be for found in the SDE_XML_DOC# tables stored as ArcSDE XML (CLOB in Oracle in this case). Here's an example of the workflow for a feature class called "SDE.Test": SELECT NAME, DEFINITION, DOCUMENTATION FROM SDE.GDB_ITEMS WHERE NAME = 'SDE.Test'; NAME DEFINITION DOCUMENTATION SDE.Test 61 ...


1

Custom snap agents only apply to the classic snapping environment. You can choose the snapping environment through the editor options dialog or by setting the IEditProperties4.ClassicSnapping property.


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

These are the steps I followed multiple times to get addins working in versions of visual studio other than 2010, using the 10.2.2 arcobjects sdk. My guess is this would probably work with 10.1 as well. Install the version of visual studio you wish to use Install visual studio 2010 and ArcMap 10.2.2 (requirements for arcobjects 10.2.2) Install ArcObjects ...


1

Per @blah238 suggustion, This python code lists all Relashionship classes within a geodatabase and put them in a unique list (relClasses): inGDB = r"D:\mygeodatabase.gdb" env.workspace = inGDB #################Getting all Tables and Feature Classes########### fcs = [] #root of workspace for item in arcpy.ListFeatureClasses("*"): fcs.append(item) for item ...



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