POST
|
Deat momobjk "Can you please submit the complete project here/ send me an email "i.md63@yahoo.com Thanks for your valuable time and considerations ,Regards Imran
... View more
04-23-2012
04:57 AM
|
0
|
0
|
427
|
POST
|
Dear Sandhya Yamarthi, Can you please tell me how to call the following code... using System.Runtime.InteropServices; namespace Project1 { class Class1 { [DllImport("kernel32.dll")] static extern void Sleep(uint dwMilliseconds); public void FlashFeature(IFeature Feature, IMxDocument MxDoc) { try { MxDoc.ActiveView.ScreenDisplay.StartDrawing(0, (short)(esriScreenCache.esriNoScreenCache)); switch (Feature.Shape.GeometryType) { case (esriGeometryType.esriGeometryPolyline): { FlashLine(MxDoc.ActiveView.ScreenDisplay, Feature.Shape); break; } case (esriGeometryType.esriGeometryPolygon): { FlashPolygon(MxDoc.ActiveView.ScreenDisplay, Feature.Shape); break; } case (esriGeometryType.esriGeometryPoint): { FlashPoint(MxDoc.ActiveView.ScreenDisplay, Feature.Shape); break; } } MxDoc.ActiveView.ScreenDisplay.FinishDrawing(); } catch (Exception Err) { MessageBox.Show("Error : " + Err.Message); } } public void FlashLine(IScreenDisplay Display, IGeometry Geometry) { ISimpleLineSymbol LineSymbol; ISymbol Symbol; IRgbColor RgbColor; try { LineSymbol = new SimpleLineSymbolClass(); LineSymbol.Width = 4; RgbColor = new RgbColorClass(); RgbColor.Green = 128; Symbol = (ISymbol)LineSymbol; Symbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen; Display.SetSymbol((ISymbol)(LineSymbol)); Display.DrawPolyline(Geometry); Sleep(300); Display.DrawPolyline(Geometry); } catch (Exception Err) { LogFile.WriteLog("Error at : " + Err.Message); } } public void FlashPolygon(IScreenDisplay Display, IGeometry Geometry) { ISimpleFillSymbol FillSymbol; ISymbol Symbol; IRgbColor RgbColor; try { FillSymbol = new SimpleFillSymbolClass(); FillSymbol.Outline = null; RgbColor = new RgbColorClass(); RgbColor.Green = 128; Symbol = (ISymbol)FillSymbol; Symbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen; Display.SetSymbol((ISymbol)(FillSymbol)); Display.DrawPolygon(Geometry); Sleep(300); Display.DrawPolygon(Geometry); } catch (Exception Err) { LogFile.WriteLog("Error at : " + Err.Message); } } public void FlashPoint(IScreenDisplay Display, IGeometry Geometry) { ISimpleMarkerSymbol MarkerSymbol; ISymbol Symbol; IRgbColor RgbColor; try { MarkerSymbol = new SimpleMarkerSymbolClass(); MarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle; RgbColor = new RgbColorClass(); RgbColor.Green = 128; Symbol = (ISymbol)MarkerSymbol; Symbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen; Display.SetSymbol((ISymbol)MarkerSymbol); Display.DrawPoint(Geometry); Sleep(300); Display.DrawPoint(Geometry); } catch (Exception Err) { LogFile.WriteLog("Error : " + Err.Message); } } } } I have already post my code.. Thanks for your valuable time and consideration... Waiting for your reply..
... View more
04-19-2012
06:06 AM
|
0
|
0
|
164
|
POST
|
can you please tell me the code to implement yours code in my project... public void WorkIdentify() { IMxDocument doc = ArcMap.Application.Document as IMxDocument; IActiveView activeView = doc.ActiveView; IPoint mouseLocation = GetScreenCoordinatesFromMapCoorindates(doc.CurrentLocation, activeView); System.Int32 x = (System.Int32) mouseLocation.X; System.Int32 y = (System.Int32) mouseLocation.Y; if (activeView == null) { return; } ESRI.ArcGIS.Carto.IMap map = activeView.FocusMap; ESRI.ArcGIS.CartoUI.IIdentifyDialog identifyDialog = new ESRI.ArcGIS.CartoUI.IdentifyDialogClass(); identifyDialog.Map = map; //Clear the dialog on each mouse click identifyDialog.ClearLayers(); ESRI.ArcGIS.Display.IScreenDisplay screenDisplay = activeView.ScreenDisplay; ESRI.ArcGIS.Display.IDisplay display = screenDisplay; // Implicit Cast identifyDialog.Display = display; ESRI.ArcGIS.CartoUI.IIdentifyDialogProps identifyDialogProps = (ESRI.ArcGIS.CartoUI.IIdentifyDialogProps)identifyDialog; // Explicit Cast ESRI.ArcGIS.Carto.IEnumLayer enumLayer = identifyDialogProps.Layers; enumLayer.Reset(); ESRI.ArcGIS.Carto.ILayer layer = enumLayer.Next(); // while (!(layer == null)) { identifyDialog.AddLayerIdentifyPoint(layer, x, y); layer = enumLayer.Next(); } identifyDialog.Show(); }
... View more
04-19-2012
03:34 AM
|
0
|
0
|
164
|
POST
|
hi frnd iam new to programming .. i want to show a pop up window to display the element attributes (same as map identify tool) . can anyone suggest some ideas here is my code for displaying the map in wpf. using System; using System.Windows; using System.Windows.Forms; using System.Drawing; using ESRI.ArcGIS.esriSystem; using ESRI.ArcGIS.Controls; using ESRI.ArcGIS.CadastralUI; using ESRI.ArcGIS.ParcelFabricTools; using ESRI.ArcGIS.ADF; using ESRI.ArcGIS.Editor; using ESRI.ArcGIS.EditorExt; using ESRI.ArcGIS.Geodatabase; using ESRI.ArcGIS.ArcMapUI; using ESRI.ArcGIS.Geometry; using ESRI.ArcGIS.Display; using System.Runtime.InteropServices; namespace MapHostedInWPF { public partial class Window1 : Window { AxMapControl mapControl; AxToolbarControl toolbarControl; AxTOCControl tocControl; public Window1() { InitializeComponent(); CreateMapControl(); } private void CreateMapControl() { mapControl = new AxMapControl(); mapHost.Child = mapControl; toolbarControl = new AxToolbarControl(); toolbarHost.Child = toolbarControl; tocControl = new AxTOCControl(); tocHost.Child = tocControl; } private void SetMapProperties() { mapControl.Dock = DockStyle.None; mapControl.BackColor = Color.FromArgb(233, 233, 233); } private void WireMapEvents() { mapControl.OnMouseMove += new IMapControlEvents2_Ax_OnMouseMoveEventHandler (mapControl_OnMouseMove); } private void mapControl_OnMouseMove(object sender, IMapControlEvents2_OnMouseMoveEvent e) { System.Console.WriteLine(e.mapX.ToString()); } private void Window_Loaded(object sender, RoutedEventArgs e) { try { SetMapProperties(); WireMapEvents(); mapControl.LoadMxFile("D:\\California\\California.mxd"); tocControl.SetBuddyControl(mapControl); toolbarControl.SetBuddyControl(mapControl); toolbarControl.AddItem("esriControls.ControlsOpenDocCommand"); toolbarControl.AddItem("esriControls.ControlsAddDataCommand"); toolbarControl.AddItem("esriControls.ControlsSaveAsDocCommand"); toolbarControl.AddItem("esriControls.ControlsMapNavigationToolbar"); toolbarControl.AddItem("esriControls.ControlsEditingToolbar"); toolbarControl.BackColor = Color.FromArgb(245, 245, 220); } catch (Exception ex) { System.Windows.MessageBox.Show(ex.Message); } } } }
... View more
04-19-2012
02:28 AM
|
0
|
0
|
164
|
POST
|
Hi... Iam using WPF to display the map(.mxd) from a folder.. For this iam using 3 windowsformhost 1 is for toolbar control 2 is for toc control 3 is for map control.. when iam try to add a code in the toolbar control iam getting the following error,, System.AccessViolationException Attempted to read or write protected memory. This is often an indication that other memory is corrupt. toolbarControl.AddItem("esriCadastralUI.CadastralEditorMenu");
... View more
04-05-2012
03:35 AM
|
0
|
0
|
566
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|