' pojmenovat FD a FA ' prvni shp prutocneho profilu a druhy filled grid theView = av.GetActiveDoc theDisplay = theView.GetDisplay theGridTheme = theView.GetActiveThemes.Get(1) theGrid = theGridTheme.GetGrid theBody = theView.GetActiveThemes.Get(0) theFTab = theBody.GetFTab theShape = theFTab.FindField("Shape") zaznam = theFTab.REturnValue(theShape, 0) 'thePoint = theDisplay.ReturnUserPoint mPoint = MultiPoint.Make({zaznam}) theSrcGrid = theGrid.ExtractByPoints(mPoint,Prj.MakeNull,FALSE) theFlowDir = theView.FindTheme("FD").GetGrid theAccum = theView.FindTheme("FA").GetGrid theWater = theFlowDir.Watershed(theSrcGrid.SnapPourPoint(theAccum,240)) ' create a theme theGTheme = GTheme.Make(theWater) ' check if output is ok if (theWater.HasError) then return NIL end ' add theme to the view theView.AddTheme(theGTheme)