阅读:1752回复:1
只显示选种的要素<P>想在ARCENGIEN中做一个与ARCMAP中的对图层选种的要素导出为图层,但是图层并没有另存为文件的那种.</P> <P>或是对某个图层只显示选种的要素,其他不显示.谁有什么好办法.谢谢</P> |
|
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>
|
|
|