3

I'm trying to achieve a scenario like below image when a row selected in Grid, the selected row's feature should be visible next to winform window Expecting Scenario

But in my case, I'm stuck with a selected feature is back of grid form, the code so far I worked

private void zm2Feat(IFeature pFeat, IMap pMap)
        {
            IActiveView pActVw = (IActiveView)pMap; IEnvelope pEnv = null;
            try
            {
                //zoom to feat
                IPoint pPnt = (IGeometry)pFeat.ShapeCopy as IPoint;
                HIlightFeatures(pFeat.ShapeCopy, pMap);
                IPoint pnewPnt = new PointClass(); pnewPnt.X = pPnt.X + 50; pnewPnt.Y = pPnt.Y;
                ITopologicalOperator pTopoOp = (ITopologicalOperator)pnewPnt;
                IGeometry newGeom = pTopoOp.Buffer(50);
                pEnv = newGeom.Envelope;  pActVw.Extent = pEnv;
               clsGeneralFunctions.pMap.MapScale = 1000;
                pActVw.Refresh();
            }
            catch (Exception)
            {
                throw;
            }
        }

How can I move selected feature next to winform window?

0

with the same code, I just made changes in this line and it worked

IPoint pnewPnt = new PointClass(); pnewPnt.X = pPnt.X -300; pnewPnt.Y = pPnt.Y;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.