hehui
路人甲
路人甲
  • 注册日期2003-09-26
  • 发帖数82
  • QQ
  • 铜币588枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1596回复:1

只显示选种的要素

楼主#
更多 发布于:2007-03-13 15:42
 
<P>想在ARCENGIEN中做一个与ARCMAP中的对图层选种的要素导出为图层,但是图层并没有另存为文件的那种.</P>
<P>或是对某个图层只显示选种的要素,其他不显示.谁有什么好办法.谢谢</P>
喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15945
  • QQ554730525
  • 铜币25337枚
  • 威望15352点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2007-03-14 15:20
<H1>IFeatureLayerDefinition Example</H1><PRE><PRE><PRE><PRE><P>' Get a reference to the first layer in the map</P><P><BR>  Dim pMxDoc As IMxDocument<BR>  Set pMxDoc = ThisDocument<BR>  Dim pMap As IMap<BR>  Set pMap = pMxDoc.FocusMap<BR>  Dim pFLayer As IFeatureLayer<BR>  Set pFLayer = pMap.Layer(0)</P><P>' Set the definition query of the layer<BR>  Dim pFLDef As IFeatureLayerDefinition<BR>  Set pFLDef = pFLayer ' QI from the FeatureLayer<BR>  pFLDef.DefinitionExpression = "SUB_REGION = 'Pacific'"    ' set the definition expression<BR>  pMxDoc.ActiveView.Refresh                                 ' refresh the map<BR>  <BR>' Make a selection on the Layer</P><P><BR>  Dim pQueryFilter As IQueryFilter<BR>  Set pQueryFilter = New QueryFilter<BR>  pQueryFilter.WhereClause = "Pop2000 > 5000000"            ' set the query filter<BR>  Dim pFSel As IFeatureSelection<BR>  Set pFSel = pFLayer<BR>  pMxDoc.ActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing<BR>  pFSel.SelectFeatures pQueryFilter, esriSelectionResultNew, False           ' apply the selection<BR></P><P>  pMxDoc.ActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing   ' refresh the selection</P><P>' Create a new selection layer using the current selection</P><P>  Dim pSelFLayer As IFeatureLayer<BR>  Set pSelFLayer = pFLDef.CreateSelectionLayer("Selection_Layer", True, vbNullString, vbNullString)<BR>  pFSel.Clear                ' clear selection on original layer<BR>  pMap.AddLayer pSelFLayer   ' add new layer to the map</P></PRE></PRE></PRE></PRE>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部