|
POST
|
Ok, the question is: how? I have added references to the MSVB 2008 project (ESRI.ArcGIS.ArcCatalog / ArcCatalogUI / DataSourcesFile and other) and when I write: Dim pGxDialog As ESRI.ArcGIS.CatalogUI.IGxDialog = New ESRI.ArcGIS.CatalogUI.GxDialog I get 'Type: ESRI.ArcGIS.CatalogUI.IGxDialog' is not defined'. What else is wrong? Regards, Jan ESRI.ArcGIS.CatalogUI.GxDialogClass();....used in C#..try to convert into VB.NET....
... View more
12-30-2010
12:51 AM
|
0
|
0
|
1114
|
|
POST
|
Hi all, Is it possible to use IGxDialog to browse for feature classes / shapefiles from ArcGIS 10 Add-in component? I wanted to migrate my code from a simple VB .net environment to the "ESRI Add-in" framework, but I'am missing IGxDialog functionality. Sample snippets offers Windows.Form for opening shapefiles... What about feature classes in a geodatabase then? Any ideas and help would be appreciated! Regards, Jan Yes you can use IGXdialog... http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/0015/0015000000qv000000.htm
... View more
12-30-2010
12:11 AM
|
0
|
0
|
1114
|
|
POST
|
thank you vakant for your help..i worked with this code before you posted and it worked pretty well protected void GridView2_SelectedIndexChanged(object sender, EventArgs e) { IMapFunctionality mf = Map1.GetFunctionality("Redlands") as IMapFunctionality; IGISResource gisresource = mf.Resource; string targetLayername = "Parcels"; // Create the query functionality IQueryFunctionality qfunc = gisresource.CreateFunctionality(typeof(IQueryFunctionality), null) as IQueryFunctionality; string[] lids; string[] lnames; qfunc.GetQueryableLayers(null, out lids, out lnames); int layer_index = 0; for (int i = 0; i < lnames.Length; i++) { if (lnames.ToLower() == targetLayername.ToLower()) { layer_index = i; break; } } // Create the spatial filter for the query ESRI.ArcGIS.ADF.Web.SpatialFilter spatialfilter = new ESRI.ArcGIS.ADF.Web.SpatialFilter(); spatialfilter.ReturnADFGeometries = true; spatialfilter.MaxRecords = 1000; spatialfilter.WhereClause = "OBJECTID= " + GridView2.SelectedRow.Cells[1].Text; spatialfilter.Geometry = Page.Session["Envelope"] as Envelope; String[] flds = qfunc.GetFields(null, lids[layer_index]); ESRI.ArcGIS.ADF.StringCollection scoll = new ESRI.ArcGIS.ADF.StringCollection(flds); spatialfilter.SubFields = scoll; DataTable dt; dt = qfunc.Query(null, lids[layer_index], spatialfilter); // *** Step 7.d.: Convert the data table returned from the query // *** and define symbology. GraphicsLayer resultsGraphicsLayer; resultsGraphicsLayer = ESRI.ArcGIS.ADF.Web.Converter.ToGraphicsLayer(dt, System.Drawing.Color.Red, System.Drawing.Color.Purple); Map1.Extent = resultsGraphicsLayer.FullExtent; // Apply a layer format to specify: // * how selected features appear // * field aliases // * visible fields // * primary display field // * attribute formatting // Retrieve the layer format for the active layer. ESRI.ArcGIS.ADF.Web.UI.WebControls.LayerFormat layerFormat = ESRI.ArcGIS.ADF.Web.UI.WebControls.LayerFormat.FromMapResourceManager( Map1.MapResourceManagerInstance, mf.Resource.Name, lids[layer_index]); // *** Step 7.e.: Apply the layer format of the active layer // *** to the feature graphics layer. layerFormat.Apply(resultsGraphicsLayer, true); ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapFunctionality graphicsFunctionality; graphicsFunctionality = (ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapFunctionality)Map1.GetFunctionality("Selection"); // If RenderOnClient is true, the Web-tier graphics layer will be rendered on the client using the // Web ADF JavaScript Library (GraphicFeatureGroup and GraphicFeatures). // The default and highlight renderer defined as part of the active layer's layer format will be used during // mouse over events on graphic features. Field and attribute display styles will be used to define the format of // map tip (callout) content. If false, it will be rendered as a map image in the Web-tier using GDI+ and // consolidated with other resource map images in the browser. Only layer format's default renderer will be used // to render features - map tips will not be generated and the highlight renderer will not be used. resultsGraphicsLayer.RenderOnClient = false; if (resultsGraphicsLayer.RenderOnClient) { // Use ADF JavaScript to change active tool in toolbar and map control on client. // This is optional. // The mouse mode is set to Pan after Web-tier graphics are rendered on the client. // This enables you to interact with map tips on graphic features without erroneously defining a new selection. // NOTE: You need to activate the select tool to make another selection. string jsToolbarItemDeactivate = @" var toolbar = Toolbars['{0}']; var currentToolField = $get(toolbar.currentToolField); currentToolField.value = ''; toolbar.selectTool(); toolbar.refreshGroup(); $find('{1}').set_mouseMode(ESRI.ADF.UI.MouseMode.Pan);"; Toolbar adfToolbar = (Toolbar)Map1.Page.FindControl("Toolbar1"); adfToolbar.CurrentTool = string.Empty; Map1.CurrentToolItem = null; jsToolbarItemDeactivate = string.Format(jsToolbarItemDeactivate, adfToolbar.ClientID, Map1.ClientID); ESRI.ArcGIS.ADF.Web.UI.WebControls.CallbackResult deactivateToolbarItemsCallbackResult = ESRI.ArcGIS.ADF.Web.UI.WebControls.CallbackResult.CreateJavaScript(jsToolbarItemDeactivate); Map1.CallbackResults.Add(deactivateToolbarItemsCallbackResult); // Remove the current graphics feature group associated with the last selection. This will guarantee that the // new graphics, attributes, and behaviors will be used. As a result, only one graphic feature group will reside // in the client to represent the selection set. if (graphicsFunctionality.GraphicsDataSet.Tables.Count > 0) { ESRI.ArcGIS.ADF.Web.Display.Graphics.GraphicsLayer oldFeatureGraphicsLayer = (ESRI.ArcGIS.ADF.Web.Display.Graphics.GraphicsLayer)graphicsFunctionality.GraphicsDataSet.Tables[0]; // Use the Map.GetGraphicsLayerClientID to get the id of the respective graphic feature group that represents // the Web-tier graphics layer. string removeGraphicsClientScript = string.Format(@" var glayer = $find('{0}'); var map = $find('{1}'); map.removeGraphic(glayer); glayer.dispose();", Map1.GetGraphicsLayerClientID(oldFeatureGraphicsLayer), Map1.ClientID); ESRI.ArcGIS.ADF.Web.UI.WebControls.CallbackResult cr = ESRI.ArcGIS.ADF.Web.UI.WebControls.CallbackResult.CreateJavaScript(removeGraphicsClientScript); Map1.CallbackResults.Add(cr); } } // Clear all contents of the graphic map functionality dataset graphicsFunctionality.GraphicsDataSet.Tables.Clear(); // *** Step 7.g.: Add the selection graphics layer to the resource graphicsFunctionality.GraphicsDataSet.Tables.Add(dt); // Set the transparency of the selection graphics resource map resource item ESRI.ArcGIS.ADF.Web.UI.WebControls.MapResourceItem selectionMapResourceItem = Map1.MapResourceManagerInstance.ResourceItems.Find(graphicsFunctionality.Resource.Name); selectionMapResourceItem.DisplaySettings.Transparency = 50; // *** Step 7.h.: Refresh the map resource Map1.RefreshResource(graphicsFunctionality.Resource.Name); Toc adfToc = Map1.Page.FindControl("Toc1") as Toc; adfToc.Refresh(); } } good work congrates...
... View more
12-28-2010
02:38 AM
|
0
|
0
|
787
|
|
POST
|
hello, iam selecting some parcels through an out-of the -box tool then displaying the selected feature(Parcels) with its attributes in a dataGV,i then want to select a specific row then zoom to the selected parcel( which is a row in this case) can any body help. thnx in advance. Dim sWhereclause As String sWhereclause = "" QueryDef pLayer, sWhereclause Dim pFeatureSelection As IFeatureSelection Set pFeatureSelection = pLayer Dim pQueryFilter As IQueryFilter Set pQueryFilter = New QueryFilter pQueryFilter.WhereClause = sWhereclause pFeatureSelection.SelectFeatures pQueryFilter, esriSelectionResultNew, False Application.Document.CommandBars.Find(arcid.Query_ZoomToSelected).Execute convert above code into C# and .. what you do is ...get selected item from gridview... and send into whereclause...
... View more
12-27-2010
08:05 PM
|
0
|
0
|
787
|
|
POST
|
Hi James- I tried your LoadOnlyMode method and set it in the correct spots as you suggested but it made no difference. Is there anyway I should be adding the data differently in my Do While loop? Should I be using IRowBuffer inside the Loop? Everything seems to be pointing to this loop as to why it's running so slow.. Please let me know any suggestions anyone. Many Thanks -Josh while (pRow2 != null); { //populate the row with values pRowBuff.set_Value((Int32)l_FCWell_ID, pRow2.get_Value((Int32)l_Well_ID)); pRowBuff.set_Value((Int32)l_FCSidetrack_Number, pRow2.get_Value((Int32)l_Sidetrack_Number)); pRowBuff.set_Value((Int32)l_FCAlternate_ID, pRow2.get_Value((Int32)l_Alternate_ID)); pRowBuff.set_Value((Int32)l_FCMeasured_Depth, pRow2.get_Value((Int32)l_Measured_Depth)); pRowBuff.set_Value((Int32)l_FCInclination, pRow2.get_Value((Int32)l_Inclination)); pRowBuff.set_Value((Int32)l_FCAzimuth, pRow2.get_Value((Int32)l_Azimuth)); pRowBuff.set_Value((Int32)l_FCE_W, pRow2.get_Value((Int32)l_E_W)); pRowBuff.set_Value((Int32)l_FCN_S, pRow2.get_Value((Int32)l_N_S)); pRowBuff.set_Value((Int32)l_FCTVD, pRow2.get_Value((Int32)l_TVD)); pRowBuff.set_Value((Int32)l_FCState_Plane_Easting, pRow2.get_Value((Int32)l_State_Plane_Easting)); pRowBuff.set_Value((Int32)l_FCState_Plane_Northing, pRow2.get_Value((Int32)l_State_Plane_Northing)); pRowBuff.set_Value((Int32)l_FCSub_Sea_TVD, pRow2.get_Value((Int32)l_Sub_Sea_TVD)); pCursor.InsertRow(pRowBuff); pRow2 = pTableCursor.NextRow(); } try something like that...
... View more
12-27-2010
07:29 PM
|
0
|
0
|
1138
|
|
POST
|
I have manually added a toolbar to a document and created a number of macros in VBA which are run from the toolbar. These work perfectly in 9.3.1 however in 10, the buttons show [Missing ...] and of course no longer work. We have been told that the only solution is to re-write the Macros in VB.NET - which is in the plans - however my understanding was that 10 should run VBA, even if it no longer supported. I would appreciate it if someone could suggest what is the problem here. The extra VBA module has been installed with ArcMap 10 and a licence provided by ESRI is being used. hi, http://help.arcgis.com/en/sdk/10.0/vba_desktop/ao_home.html
... View more
12-27-2010
07:11 PM
|
0
|
0
|
1573
|
|
POST
|
Hello, I hope I'm posting this in the correct forum, if not I'll move it accordingly. I would like to start developing an add-in to ArcGIS Desktop using my concurrent ArcInfo license, the SDK for .NET, and Visual studio 2008. I am able to create an ArcMap add-in project within VS2008, but when I start to add controls, I receive a message saying "This control requires an ArcGIS Engine Developer Kit license." I don't want to make a standalone application, but only an add-in to ArcMap. Am I able to use my current ArcInfo license to develop an add-in, or would I need to purchase an Engine Developer Kit license? Thanks, Andrew There are different steps you should basically follow.. 1) First VS2008 should be installed 2) Install ArcGIS Desktop and SDK .whatever...so.. I hope this helps you...
... View more
12-26-2010
06:51 PM
|
0
|
0
|
777
|
|
POST
|
dear all , i want to write code for arcgis engine in vb.net for mouse down on map control to select layer. thank you Hi, You are looking for select layer or Select features ?
... View more
12-26-2010
06:40 PM
|
0
|
0
|
537
|
|
POST
|
Venkat and Sherry, Thank you so much for responding to my thread. Everything you have said is true and is what I am currently doing. I was afraid I had something seriously wrong in my code. However, it appears the way I am selecting data is correct. Venka, I'm using your suggestion to make sure the layer is selectable, visible, editable. Sherry, I saw the IFeatureSelection example and implemented it pretty much as provided. But, what is weird is the first time I call my selection routine, via command button, it selects all the correct data and displays the selected data correctly in the attribute window. But then if I try a new selection sending it through the same code it selects the data but won't allow it to appear in the attribute window. I physically have to stop and restart ArcMap to get it to select and display the data in the attribute window. What I'm trying to do is select several different feature classes on the map programmatically, but also have those selected features appear in the attribute window. It is similar to using the select by rectangle and having the attribute window refresh itself each time a selection changes. Would either of you have time to confirm or test this behavior to see if you can reproduce it? Is there something else I need to do to refresh the attribute window? Greg Please send me the code so that we can work it out...
... View more
12-22-2010
06:55 PM
|
0
|
0
|
2363
|
|
POST
|
From my understanding basetool is used for COM-classes, not for Addins. But as I mentioned in my first post, I do have a Tool-class that listen to OnMouseDown events and activates the draw polygon function. This is tested and works fine, problems starts when I try to activate this Tool from the form buttons click event. Please note that by activate I don't mean drawing the polygons itself, but that the Tool starts to listen to OnMouseDown events. hi tell me your requirement so that i can guide you...whatever you thinking so right...basically component on component ...see if you want to get window form ..you need to write a component...please tell me your requirement ... so that i can guide you...is it your thought or client has specified ?
... View more
12-22-2010
02:46 AM
|
0
|
0
|
1014
|
|
POST
|
I have the same problem with SQL Server 2008 and Windows Server 2008 R2 please request help from those who have already solved Thanks Patricio Yumbillo Hi have checked sde log file..what it is saying ?
... View more
12-22-2010
01:11 AM
|
0
|
0
|
2429
|
|
POST
|
This might look like an easy question, but I have basically crawled through the entire forum and ArcObjects API, unable to find a solution. The only good example I have found was Use Custom Tool on Windows Form Snippet, but that works with COM-objects, not Add-ins. I have created an add-in with a toolbar and a button that activates a Windows Form. Inside the Form I have a button, that when triggered, enables users to draw a polygon inside the map (at least, that is the idea). The draw polygon functionality is a tool that is stored in the same add-in, but not shown on the toolbar, and its functionality is triggered via OnMouseDown event. Now, how do I call this tool from the Forms buttons click event? The draw polygon functionality can't be triggered right away, but must wait for another click event, so that the user is able to place the polygon right where he wants. Hi, For Drawing polygon you need mousedown event..In the form button how you can mousedownevent...What you do is use basetool...and make it as add-in component..I hope this helps you..if not please let me know...
... View more
12-22-2010
12:54 AM
|
0
|
0
|
1014
|
|
POST
|
Hello, How do I select several features from several different feature classes at one time? I know which features I want to select from within the separate feature classes. So, how do I put that together to perform a selection? Once I have all of the features selected do I need to do something special to get them to show up in the attribute editor window? I'm trying to select several different spatial objects and have each one appear in the attribute editor window like it does if I were to manually draw a selection rectangle around several objects on the map. Is this a BUG? Does anyone have any sample code that allows the programmatic selection of several spatial features and have those same features appear in the attribute editor window? Can anyone else reproduce this problem? Greg I think you suppose to switch on all layers as selectable ?
... View more
12-21-2010
07:58 PM
|
0
|
0
|
2363
|
|
POST
|
Below is the code I have been using. I stripped out all of the other form controls. I think I cast everything correctly and the problem was with the render. Thanks for taking a look at this. public partial class frmMain : Form { public frmMain() { InitializeComponent(); } //These hold the document and application references private IDocument _doc = null; private IApplication _app = null; //Point button code private void btnPointColor_Click(object sender, EventArgs e) { IMxDocument _mxDoc = (IMxDocument)_doc; //Cast as IMxDocument Interface IMap map = (IMap)_mxDoc.FocusMap; //cast _mxDoc as Carto IMap interface IGeoFeatureLayer gLayer = (IGeoFeatureLayer)map.get_Layer(2); //Cast map layer 3 as IGeoFeature layer //Set the new color for the point IRgbColor pColor = new RgbColorClass(); pColor.Red = 255; pColor.Green = 255; pColor.Blue = 0; //Point so we need a simple marker symbol ISimpleMarkerSymbol sMarker = new SimpleMarkerSymbol(); sMarker.Color = pColor; sMarker.Style = esriSimpleMarkerStyle.esriSMSDiamond; sMarker.Size = 20; //Need to render ISimpleRenderer sRender = new SimpleRenderer(); sRender.Symbol = (ISymbol)sMarker; gLayer.Renderer = sRender; //_mxDoc.UpdateContents(); IActiveView vActive = (IActiveView)map; vActive.Refresh(); } } Hi Please follow below steps.. 1) add basecommand class using System; using System.Drawing; using System.Runtime.InteropServices; using ESRI.ArcGIS.ADF.BaseClasses; using ESRI.ArcGIS.ADF.CATIDs; using ESRI.ArcGIS.Framework; using ESRI.ArcGIS.ArcMapUI; namespace PointRenderer { /// <summary> /// Summary description for ShowPoint. /// </summary> [Guid("797af0fa-03d9-4e41-8c61-1109e3aff787")] [ClassInterface(ClassInterfaceType.None)] [ProgId("PointRenderer.ShowPoint")] public sealed class ShowPoint : BaseCommand { #region COM Registration Function(s) [ComRegisterFunction()] [ComVisible(false)] static void RegisterFunction(Type registerType) { // Required for ArcGIS Component Category Registrar support ArcGISCategoryRegistration(registerType); // // TODO: Add any COM registration code here // } [ComUnregisterFunction()] [ComVisible(false)] static void UnregisterFunction(Type registerType) { // Required for ArcGIS Component Category Registrar support ArcGISCategoryUnregistration(registerType); // // TODO: Add any COM unregistration code here // } #region ArcGIS Component Category Registrar generated code /// <summary> /// Required method for ArcGIS Component Category registration - /// Do not modify the contents of this method with the code editor. /// </summary> private static void ArcGISCategoryRegistration(Type registerType) { string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID); MxCommands.Register(regKey); } /// <summary> /// Required method for ArcGIS Component Category unregistration - /// Do not modify the contents of this method with the code editor. /// </summary> private static void ArcGISCategoryUnregistration(Type registerType) { string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID); MxCommands.Unregister(regKey); } #endregion #endregion private IApplication m_application; public ShowPoint() { // // TODO: Define values for the public properties // base.m_category = "GIS_FORM"; //localizable text base.m_caption = "Render Point"; //localizable text base.m_message = "Render Point"; //localizable text base.m_toolTip = "Render Point"; //localizable text base.m_name = "Render Point"; //unique id, non-localizable (e.g. "MyCategory_ArcMapCommand") try { // // TODO: change bitmap name if necessary // string bitmapResourceName = GetType().Name + ".bmp"; base.m_bitmap = new Bitmap(GetType(), bitmapResourceName); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap"); } } #region Overriden Class Methods /// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { if (hook == null) return; m_application = hook as IApplication; //Disable if it is not ArcMap if (hook is IMxApplication) base.m_enabled = true; else base.m_enabled = false; // TODO: Add other initialization code } /// <summary> /// Occurs when this command is clicked /// </summary> public override void OnClick() { // TODO: Add ShowPoint.OnClick implementation PointRender _pointRender = new PointRender(m_application); _pointRender.ShowDialog(); } #endregion } } 2) Add Form using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using ESRI.ArcGIS.ArcMapUI; using ESRI.ArcGIS.Carto; using ESRI.ArcGIS.Framework; using ESRI.ArcGIS.Display; namespace PointRenderer { public partial class PointRender : Form { private IApplication pApp = null; public PointRender(IApplication pApp) { this.pApp = pApp; InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { IMxDocument pMxDoc = pApp.Document as IMxDocument; IMap pMap = pMxDoc.FocusMap; IGeoFeatureLayer pGeoFeatLayer; pGeoFeatLayer = pMap.get_Layer(0) as IGeoFeatureLayer; IRgbColor pRGB = new RgbColorClass(); pRGB.Red = 84; pRGB.Green = 156; pRGB.Blue = 227; ISimpleMarkerSymbol pSimpleMarkerSinboml = new SimpleMarkerSymbolClass(); pSimpleMarkerSinboml.Color = pRGB; pSimpleMarkerSinboml.Style = esriSimpleMarkerStyle.esriSMSDiamond; pSimpleMarkerSinboml.Size = 10; ISimpleRenderer pSimpleRender = new SimpleRendererClass(); pSimpleRender.Symbol = pSimpleMarkerSinboml as ISymbol; pGeoFeatLayer.Renderer = pSimpleRender as IFeatureRenderer; pMxDoc.UpdateContents(); pMxDoc.ActiveView.Refresh(); } catch (Exception exp) { } } } }
... View more
12-21-2010
07:52 PM
|
0
|
0
|
540
|
|
POST
|
hi! again i saw that example is for page control and map control. if i has map control1 for main map and map control2 is overview map can you show me coding thank you whatever the url i have given u that same ...please check it properly...In ArcEngine you dont have overview control.. you need to use map control as overview map...
... View more
12-21-2010
07:18 PM
|
0
|
0
|
924
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-09-2017 07:44 AM | |
| 2 | 01-12-2015 10:36 PM | |
| 1 | 01-15-2015 09:02 AM | |
| 2 | 09-29-2014 02:29 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|