![]() ![]() ![]() Select the layer in the table of contents.Add a feature class to ArcMap and select some features.'Set the exclusion featureidset to that of the geofeaturelayer 'if the featureidset contains any of them. 'Loop through the selected feature's oids and check to see 'Loop through Entire feature layer's oids and Set pEntireSelSet = (Nothing, _ĮsriSelectionTypeHybrid, esriSelectionOptionNormal, Nothing) rstudioapi::selectionSet() : Set the contents of the users selection. 'Enumerate through the selectionsets to get the ids as there is no notion of a global cursor position rather, a cursor might. PSelectionset.Search Nothing, False, pSelFC 'set feature cursors for entire feature class and the selectionset Public Sub DisplayOnlySelectedFeatures(pGlayer As IGeoFeatureLayer _ 'Make certain that the layer is selected in the TOC Paste the following code into the code module.If you want to store the code in all your map documents, open the Normal.mxt ThisDocument code module instead. In the Project Explorer window, expand the Project folder, select ThisDocument, and right-click to select View Code.Ĭode in the Project's ThisDocument code module will only run in the current map document.In ArcMap, select Tools > Macros > Visual Basic Editor. Dim pSelSet As ISelectionSet provFSel.SelectionSet Dim provCursor As IFeatureCursor pSelSet.Search (spatialFilter, True, provCursor) Dim provFeature As IFeature provCursor.NextFeature A blue squiggle appears under provCursor inside Search () that says 'Variable 'provCursor' is passed by reference before it has been assigned a value. Dim pMxDoc As IMxDocument Dim pCountyLayer As IFeatureSelection Dim pCountySelection As ISelectionSet Dim pCount圜ursor As IFeatureCursor Dim pCounty As IFeature Set pMxDoc ThisDocument Set pCountyLayer (1) Set pCountySelection pCountyLayer.SelectionSet ' Create a cursor from the selected feature in Layer (1. ![]()
0 Comments
Leave a Reply. |