Namaste, Hola, Hi
Using the Code below I have created a Line geometry using Rubberbanding
public void DrawPolyline(ESRI.ArcGIS.Carto.IActiveView activeView)
{
if(activeView == null)
{
return;
}
ESRI.ArcGIS.Display.IScreenDisplay screenDisplay = activeView.ScreenDisplay;
screenDisplay.StartDrawing(screenDisplay.hDC, (System.Int16)ESRI.ArcGIS.Display.esriScreenCache.esriNoScreenCache); // Explicit Cast
ESRI.ArcGIS.Display.IRgbColor rgbColor = new ESRI.ArcGIS.Display.RgbColorClass();
rgbColor.Red = 255;
ESRI.ArcGIS.Display.IColor color = rgbColor; // Implicit Cast
ESRI.ArcGIS.Display.ISimpleLineSymbol simpleLineSymbol = new ESRI.ArcGIS.Display.SimpleLineSymbolClass();
simpleLineSymbol.Color = color;
ESRI.ArcGIS.Display.ISymbol symbol = (ESRI.ArcGIS.Display.ISymbol)simpleLineSymbol; // Explicit Cast
ESRI.ArcGIS.Display.IRubberBand rubberBand = new ESRI.ArcGIS.Display.RubberLineClass();
ESRI.ArcGIS.Geometry.IGeometry geometry = rubberBand.TrackNew(screenDisplay, symbol);
screenDisplay.SetSymbol(symbol);
screenDisplay.DrawPolyline(geometry);
screenDisplay.FinishDrawing();
}
After Drawing a Line geometry using Rubberband, I would like to save the "geometry" as a feature in a FeatureClass and create a Feature Layer and display the layer. I am facing trouble in creating feature class and saving a feature. Please help me with some sample Code .. I am badly waiting for some reply.
Thanks and Regards,
Pavan
Using the Code below I have created a Line geometry using Rubberbanding
public void DrawPolyline(ESRI.ArcGIS.Carto.IActiveView activeView)
{
if(activeView == null)
{
return;
}
ESRI.ArcGIS.Display.IScreenDisplay screenDisplay = activeView.ScreenDisplay;
screenDisplay.StartDrawing(screenDisplay.hDC, (System.Int16)ESRI.ArcGIS.Display.esriScreenCache.esriNoScreenCache); // Explicit Cast
ESRI.ArcGIS.Display.IRgbColor rgbColor = new ESRI.ArcGIS.Display.RgbColorClass();
rgbColor.Red = 255;
ESRI.ArcGIS.Display.IColor color = rgbColor; // Implicit Cast
ESRI.ArcGIS.Display.ISimpleLineSymbol simpleLineSymbol = new ESRI.ArcGIS.Display.SimpleLineSymbolClass();
simpleLineSymbol.Color = color;
ESRI.ArcGIS.Display.ISymbol symbol = (ESRI.ArcGIS.Display.ISymbol)simpleLineSymbol; // Explicit Cast
ESRI.ArcGIS.Display.IRubberBand rubberBand = new ESRI.ArcGIS.Display.RubberLineClass();
ESRI.ArcGIS.Geometry.IGeometry geometry = rubberBand.TrackNew(screenDisplay, symbol);
screenDisplay.SetSymbol(symbol);
screenDisplay.DrawPolyline(geometry);
screenDisplay.FinishDrawing();
}
After Drawing a Line geometry using Rubberband, I would like to save the "geometry" as a feature in a FeatureClass and create a Feature Layer and display the layer. I am facing trouble in creating feature class and saving a feature. Please help me with some sample Code .. I am badly waiting for some reply.
Thanks and Regards,
Pavan