Private Sub MoveRepresentation() Dim pMxDoc As IMxDocument Dim pMap As IMap Dim pFeatLayer As IFeatureLayer Dim pGeoFeatLayer As IGeoFeatureLayer Dim pRepRenderer As IRepresentationRenderer Dim pRepClass As IRepresentationClass Dim pFC As IFeatureClass Dim pRepRule As IRepresentationRule Dim pGeom As IGeometry Dim pPtCol As IPointCollection Dim pPt As IPoint Dim pFeat As IFeature Dim pDisp As IDisplayTransformation Dim i As Integer, lID As Long, lIndex As Long Dim pRep As IRepresentation Dim pMC As IMapContext Set pMxDoc = ThisDocument Set pMap = pMxDoc.FocusMap Set pFeatLayer = pMap.Layer(0) Set pFC = pFeatLayer.FeatureClass Set pGeoFeatLayer = pFeatLayer If TypeOf pGeoFeatLayer Is RepresentationRenderer Then Set pRepRenderer = pGeoFeatLayer.Renderer Set pRepClass = pRepRenderer.RepresentationClass End If Set pPt = New Point pPt.PutCoords 2216006.2, 393858.2 'Use map units Set pFeat = pFC.GetFeature(34599) 'Get a specific feature Set pMC = New MapContext Set pDisp = pMxDoc.ActiveView.ScreenDisplay.DisplayTransformation pMC.InitFromDisplay pDisp Set pRep = pRepClass.GetRepresentation(pFeat, pMC) Set pRep.Shape = pPt pRep.UpdateFeature pFeat.Store '** Refresh the TOC '** Draw the map pMxDoc.ActiveView.Refresh End Sub
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.