|
POST
|
The size of a standard toolbar button is a user setting in ArcMap. If you want something larger than that then you can create your own custom toolbar control by implementing ICommand and IToolbarControl and creating a UserControl using the standard Form button. I don't use add-ins so I'm not sure if there is an add-in equivalent to that.
... View more
10-01-2013
05:18 AM
|
0
|
0
|
1922
|
|
POST
|
It's the same thing regardless of workspace type. Call IWorkspace.Dataset (or DatasetNames) and pass in esriDTFeatureClass. To get feature classes that reside in feature datasets, call .Dataset and pass in esriDTFeatureDataset. You'll then need to loop through each feature dataset's Subsets enum.
... View more
09-26-2013
12:01 PM
|
0
|
0
|
628
|
|
POST
|
RouteEventSource is a non-creatable coclass, not an interface. All interfaces in the ArcObjects model have a name that begins with "I".
... View more
09-26-2013
06:05 AM
|
0
|
0
|
733
|
|
POST
|
When Visual Studio compiles your ESRI components, it registers them in the ESRI component categories. In order to do this, it must have write access to the system registry. You have a couple of options - run Visual Studio as an administrator every time you start it up or turn off UAC on your machine. If you're registering your component via Add from File on the Customize dialog in ArcMap (not the optimal way of doing it if you're actively developing) then ArcMap must be running as an administrator (or turn off UAC). This will not impact your users. When your application is deployed, the Windows installer will kick off the registration. Of course, it must be running with elevated privileges but that is standard. Installing software is a task that should only be performed by an administrator. The only way around all of this is to rewrite your application as an addin. Addins do not require admin privileges to deploy.
... View more
09-25-2013
05:29 AM
|
0
|
0
|
1908
|
|
POST
|
There isn't any way to do this through ArcObjects because a layer doesn't have any kind of "parent" property. You can, however, create your own custom class that has a parent property and use it to build a lookup index of some type.
... View more
09-24-2013
05:56 AM
|
0
|
0
|
2644
|
|
POST
|
You've got something going wrong somewhere. Check that spatial reference to make sure it's UTM. Here is a quick VBA macro I wrote that shows how it should work. It creates the UTM spatial reference then uses the MGRS conversion interface to set the coordinates using the MGRS values. This gives you the coordinates in UTM. It then projects those coordinates back the geographic coordinates. Sub test()
Dim factory As ISpatialReferenceFactory3
Set factory = New SpatialReferenceEnvironment
Dim sr As ISpatialReference
Set sr = factory.CreateProjectedCoordinateSystem(esriSRProjCS_WGS1984UTM_14N)
Dim pt As IPoint
Set pt = New Point
Set pt.SpatialReference = sr
Dim conv As IConversionMGRS
Set conv = pt
conv.PutCoordsFromMGRS "14SND5623735757", esriMGRSMode_USNG
' returns 556237, 3835757
MsgBox pt.X & vbCrLf & pt.Y
Dim sr2 As ISpatialReference
Dim proj As IProjectedCoordinateSystem
Set proj = sr
Set sr2 = proj.GeographicCoordinateSystem
pt.Project sr2
' returns -98.386, 34.662
MsgBox pt.X & vbCrLf & pt.Y
End Sub
... View more
09-20-2013
06:23 AM
|
0
|
0
|
2592
|
|
POST
|
Is there a reason why you're doing the projection? Why not assign the utm spatial reference to the point at the start? pnt.SpatialReference = utmSpatialReference; IConversionMGRS convertpnt = pnt as IConversionMGRS; convertpnt.PutCoordsFromMGRS(MGRSValue, esriMGRSModeEnum.esriMGRSMode_USNG);
... View more
09-20-2013
05:22 AM
|
0
|
0
|
2592
|
|
POST
|
The IGraphicsContainerEvents interface has the event you're looking for. You may not be able to prevent the actual delete from taking place but you can probably just add the element back.
... View more
09-05-2013
06:01 AM
|
0
|
0
|
640
|
|
POST
|
I think you'll find that things will be much easier if you simply write a custom tool for this. That's how the system is designed.
... View more
09-03-2013
07:36 AM
|
0
|
0
|
1221
|
|
POST
|
If I'm understanding this right then what you're wanting to do is call a custom tool you've already written from a menu instead of a toolbar. When a custom tool is on an ArcMap toolbar, ArcMap handles activating that tool for you when the button is clicked. When you call it from a menu, then you have to handle the activation yourself. If your custom tool is on a toolbar, then all you need to do is call IDocument.CommandBars.Find to get that instance of the tool and set it to be the current tool using IApplication.CurrentTool. If your custom tool is not already on a toolbar then you will need to create a new instance of the tool class, call ICommand.OnCreate and then set it to be the current tool using IApplication.CurrentTool.
... View more
09-02-2013
06:32 AM
|
0
|
0
|
1221
|
|
POST
|
Yes, you can implement IPersistVariant on your extension class.
... View more
08-27-2013
04:58 AM
|
0
|
0
|
711
|
|
POST
|
That's not the same thing exactly. When you start VS, are you right-clicking the exe or shortcut and choosing Run As Administrator? If you have UAC turned on you will need to do this even if you are a local admin or VS will not be able to register your components properly. You can tell that VS has been started as admin if Microsoft Visual Studio (Administrator) appears in the title bar. If UAC is turned off, then this is not necessary. As far as I know, ArcMap loads whatever extensions are registered no matter what account is used to kick it off. If your extension isn't present, then that usually means it isn't registered. If you simply compile without starting the debugger does your extension show up under ESRI Mx Extensions in Categories.exe? If so, remove it and compile again to see if it comes back.
... View more
08-26-2013
11:37 AM
|
0
|
0
|
812
|
|
POST
|
The enumeration will hold objects of type IGroupLayer. You can then QI over to ICompositeLayer without any problem since a group layer is also a composite layer. You should be able to use the id for ICompositeLayer if you want but you'll have to look it up in the system registry.
... View more
08-26-2013
10:22 AM
|
0
|
0
|
1924
|
|
POST
|
Are you running Visual Studio as an administrator? I have to do this on several of our dev boxes when UAC has not been turned off.
... View more
08-26-2013
10:18 AM
|
0
|
0
|
812
|
|
POST
|
There's another way to do this that doesn't require recursion. Use IMap.Layers and pass in the id for IGroupLayer. This will return an enumeration of all group layers in the TOC. From there, just loop through and delete the ones that are empty. The id for IGroupLayer is {EDAD6644-1810-11D1-86AE-0000F8751720}.
... View more
08-26-2013
10:11 AM
|
0
|
0
|
1924
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-20-2014 05:29 AM | |
| 1 | 02-01-2011 04:18 AM | |
| 1 | 02-04-2011 04:15 AM | |
| 1 | 01-17-2014 03:57 AM | |
| 1 | 10-07-2010 07:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|