|
POST
|
Hi Thomas, Interacting with a Map service layer is a bit different than if you were connecting to geodatabase objects directly. The primary issue you're running into is that no class implementing IMapServerSublayer also implements IFeatureSelection, which is why your cast fails. To query the Map service layer: Cast your desired sub-layer as an IFind object. Invoke its Find method with the desired parameters (see example code further down) Find returns an IArray of IFeatureFindData objects, which expose a Feature property of type IFeature. Use the IFeature.Shape attribute to zoom to the result! (see example code further down) // Query an IFind object "serviceLayer" string[] fieldName = new [] { "APN" }; IArray results = serviceLayer.Find(textBox1.Text, false, fieldName, null); ... // Zoom to the IFeatureFindData result object. IFeatureFindData result = results.get_Element(0) as IFeatureFindData; ArcMap.Document.ActiveView.Extent = result.Feature.Shape.Envelope; I hope this info gets you moving in the right direction.
... View more
08-18-2014
01:50 PM
|
0
|
2
|
705
|
|
POST
|
One last idea: have you tried using the IAppROT (running object table) interface from the GP tool to get a hook to ArcMap? Lack of #CODE formatting in the new forums is a bummer, but here is an example of AppROT usage: IAppROT appRot = new AppROTClass(); for (int i = 0; i < appRot.Count; i++) { if (appRot.Item.Name == "ArcMap") { IApplication arcMapApplication = appRotItem.Item as IApplication; } }
... View more
08-14-2014
01:01 PM
|
0
|
2
|
1603
|
|
POST
|
I follow you now. There are a few variations on the code used to obtain a reference to the IApplication singleton, but nothing fundamentally different. I am running 10.2.1 and both approaches work for getting a hook to the IApplication. Besides the ArcDesktop version difference, this code is running from an Add-In as opposed to a Tool. Does your custom tool implement the ITool interface, or is it derived from BaseTool?
... View more
08-12-2014
03:48 PM
|
0
|
4
|
1603
|
|
POST
|
I don't believe you should be creating an instance of an IApplication; you should be getting a hook to an existing instance (that represents ArcMap itself). Is your code inside of a custom ArcMap extension? If so, there should be an automatically generated ArcMap static class that exposes an Application property. Assuming this is true, the following code would work: IApplicaiton baseApp = ArcMap.Application;
... View more
08-12-2014
03:02 PM
|
0
|
6
|
1603
|
|
POST
|
Sebastian, Yes, it is still possible to debug an SOE. The error message you mention could be due to attaching to the wrong ArcSOC process. Be sure that the ArcSOC process "Type" is "Managed". Also, if you are running several different SOEs on multiple services, you can pinpoint which ArcSOC belongs to which services by opening Windows Task Manager and enabling the "Command Line" column. The "Command Line" column values will include the name of the services associated with a given ArcSOC.
... View more
07-24-2014
09:24 AM
|
0
|
0
|
1641
|
|
POST
|
I ran into this problem as well after upgrading to Arc 10.1. The ability to create or otherwise administer services with ArcObjects was effectively lost when the ability to make "local connections" to ArcGIS Server was removed. Like you, I also found that Python was the only option for automating the creation of Map Services, and that the time it takes to do so is considerably longer than with ArcObjects. One quick note regarding MSDHelper and its Open method: I believe this is intended to open an existing .msd file, not a map document (MXD). It is odd that ArcGIS Server is still using MSD files even though the documentation says they've been replaced with SDs: Starting at ArcGIS 10.1 for Server, Map Server Definition (.msd) files have been replaced with Service Definition Draft (.sddraft) and Service Definition (.sd) files. Please use the CreateMapSDDraft function instead. You can treat SD and MSD files as zip-archives and take a peek at the internal structure. I imagine it'd be possible to establish an SD "template" file and use it as a starting point for creating new services. This would save you from the hassle of invoking the time-consuming Python methods for creating SDDRAFT and SD files on the fly, but I'm not sure all the added complexity would be worth it.
... View more
07-01-2014
09:34 AM
|
0
|
0
|
1363
|
|
POST
|
Hi Mele, One option would be to consume the Geodata Service from your SOE using SOAP. Download the .NET SOAP Proxy Libraries and reference them in your SOE. Then work with a GeoDataServerProxy instance, setting up its connection properties (e.g. the URL of the Geodata service and any necessary credentials) before invoking the desired service methods.
... View more
07-01-2014
08:13 AM
|
0
|
1
|
516
|
|
POST
|
Kevin, Instead of deriving your custom toolbar from BaseToolbar in the ESRI.ArcGIS.ADF namespace, have you considered implementing the ICommandBar interface? Any custom tools/buttons/menus you want to add to it would need to implement the ICommand interface. Regarding the OnCreate event, the help documentation for ICommand says this: Commands are constructed once initially to get information about them, like the name, bitmap, etc and then they are destroyed. When the final, complete construction takes place, the OnCreate method gets called. OnCreate gets called only once, so you can rely on it to perform initialization of member variables. You can check for initialized member variables in the class destructor to find out if OnCreate has been called previously. Regarding "nested menus," the IToolPalette may be what you're looking for.
... View more
06-16-2014
11:42 AM
|
0
|
0
|
1255
|
|
POST
|
Hello Fridjof, In order to access and modify the "true" Caption, Tooltip, etc. of the button, you need to work with the ICommand object that is registered as part of your Add-In (as defined in its Config.esriaddinx). You can accomplish this by using the "ThisAddIn" class (an auto-generated helper class), and the "CommandBars" property of the current IDocument object. See the code below: ESRI.ArcGIS.esriSystem.UID uid = new ESRI.ArcGIS.esriSystem.UIDClass(); uid.Value = ThisAddIn.IDs.MyCustomButtom; ESRI.ArcGIS.Framework.ICommandItem commandItem = ArcMap.Application.Document.CommandBars.Find(uid); commandItem.Caption = "New Caption"; commandItem.Message = "New Message"; commandItem.Tooltip = "New Tooltip"; Changing the properties on the ICommand will update the button in ArcMap. Hope this helps!
... View more
06-13-2014
09:58 AM
|
0
|
0
|
594
|
|
POST
|
Hi Scott, I also noticed that "esriArcGISVersion102" is missing from ServiceCatalog.wsdl / SOAP.dll. I double-checked this against the "esriArcGISVersion" enumeration in ESRI.ArcGIS.System.dll and it is not defined there either: [ATTACH=CONFIG]32530[/ATTACH] So even if the WSDL / SOAP.dll were updated, the enumeration within the ArcObjects library would still be out of sync. All that aside, it is possible to query for the version using the ArcGIS Server Administrator Directory REST API. See the link below: http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Info/02r3000001z8000000/
... View more
03-26-2014
08:33 AM
|
0
|
0
|
842
|
|
POST
|
You can simply cast the IEnvelope object as an IArea, but keep in mind that the Envelope is the smallest rectangle that the geometry can fit inside. So the centroid of the Envelope will still resemble the point drawn in your original post's screenshot. You might want to try something like the method below:
private IPoint GetCentroid(IFeature feature)
{
IArea area = feature.Shape as IArea;
if (area == null)
return null; // Or throw an exception here, or handle other Geometry types that don't implement IArea, etc.
return area.Centroid;
}
... View more
03-10-2014
02:28 PM
|
0
|
0
|
651
|
|
POST
|
Does the Centroid property off the IArea interface give you a more accurate center? Envelope, GeoEllipse, GeoPolygon, Multipatch, Polygon, and Ring are all geometry types that implement IArea.
... View more
03-10-2014
12:53 PM
|
0
|
0
|
651
|
|
POST
|
Hi Tianyu, I may not be understanding your question correctly, but it sounds like it takes too long for the globe view to move between locations when you set the extent? You might be looking for the AnimationTime property off the IAGAnimationContainer interface:
ESRI.ArcGIS.GlobeCore.IGlobe pGlobe = axGlobeControl1.Globe;
ESRI.ArcGIS.Animation.IAGAnimationContainer animationContainer = pGlobe as ESRI.ArcGIS.Animation.IAGAnimationContainer;
// Values range from 1 to 10. 1 = "fast", 10 = "slow"
IStringArray stringArray = new StrArrayClass();
stringArray.Add("1");
animationContainer.AnimationTime = stringArray;
... View more
03-10-2014
09:48 AM
|
0
|
0
|
447
|
|
POST
|
I believe you are looking for the IToolPalette interface. "Tool palettes provide a compact way to group a related set of tools. The most recently used tool appears on the toolbar alongside a small drop-down button used to access other tools in the group. Like menus, tools that appear on tool palettes can come from built-in sources, add-in sources, or a combination of both." "To create a tool palette, you need to implement the ICommand inteface and the IToolPalette interface in your class code." Hope this points you in the right direction!
... View more
03-06-2014
08:10 AM
|
0
|
0
|
915
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-18-2015 01:41 PM | |
| 1 | 11-07-2014 11:58 AM | |
| 1 | 01-22-2015 08:01 AM | |
| 1 | 02-18-2015 08:18 AM | |
| 1 | 04-17-2015 03:14 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|