Engine中在地图上画线,并将其存入Mxd文档中,可以选中查询其属性值,有没有什么好的办法呢?
ILineElement pLineElement = new LineElementClass();
ISimpleLineSymbol pSimpleFillSymbol = new SimpleLineSymbolClass();
ESRI.ArcGIS.Geometry.IPolyline pPolyline = new ESRI.ArcGIS.Geometry.PolylineClass();
IRubberBand pRubberBand = new RubberLineClass();
pPolyline = (ESRI.ArcGIS.Geometry.IPolyline)pRubberBand.TrackNew(axMapControl1.ActiveView.ScreenDisplay, null);
pSimpleFillSymbol.Color = bf.getRGB(78, 0, 150);
pSimpleFillSymbol.Width = 1;
pSimpleFillSymbol.Style = esriSimpleLineStyle.esriSLSSolid;
IElement pElement = (IElement)pLineElement;
pElement.Geometry = pPolyline;
pLineElement.Symbol = pSimpleFillSymbol;
IGraphicsContainer pGraphicsContainer = (IGraphicsContainer)axMapControl1.Map;
pGraphicsContainer.AddElement((IElement)pLineElement, 0);
axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);我现在这种做法现实了在地图上画线,可是这个线是图片型的,没办法在Mxd文档上查询其属性值
ISimpleLineSymbol pSimpleFillSymbol = new SimpleLineSymbolClass();
ESRI.ArcGIS.Geometry.IPolyline pPolyline = new ESRI.ArcGIS.Geometry.PolylineClass();
IRubberBand pRubberBand = new RubberLineClass();
pPolyline = (ESRI.ArcGIS.Geometry.IPolyline)pRubberBand.TrackNew(axMapControl1.ActiveView.ScreenDisplay, null);
pSimpleFillSymbol.Color = bf.getRGB(78, 0, 150);
pSimpleFillSymbol.Width = 1;
pSimpleFillSymbol.Style = esriSimpleLineStyle.esriSLSSolid;
IElement pElement = (IElement)pLineElement;
pElement.Geometry = pPolyline;
pLineElement.Symbol = pSimpleFillSymbol;
IGraphicsContainer pGraphicsContainer = (IGraphicsContainer)axMapControl1.Map;
pGraphicsContainer.AddElement((IElement)pLineElement, 0);
axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);我现在这种做法现实了在地图上画线,可是这个线是图片型的,没办法在Mxd文档上查询其属性值
3 个回复
朱新颖
赞同来自: why小飞 、xiaosi9524
Element是无法添加属性的。
why小飞
赞同来自:
xiaosi9524 - GISER
赞同来自:
要回复问题请先登录或注册
发起人
相关问题
问题状态
—— 扫技术支持中心微信服务号!
—— 让GIS知乎问答随时随地!