' Example.Clockwise ' Generates report of ring directions for selected polygon in active theme '**** get theme theTitle = "Clockwise" theView = av.GetActiveDoc ThemeList = theView.GetActiveThemes if (ThemeList.Count <> 1) then MsgBox.Info("One Theme must be active",theTitle) exit end theTheme = ThemeList.Get(0) if (theTheme.Is(FTheme).Not) then MsgBox.Info("Active Theme is not an FTheme",theTitle) exit end theFTab = theTheme.GetFTab if (theFTab.GetShapeClass.GetClassName <> "Polygon") then MsgBox.Info("Active Theme is not a Polygon Theme",theTitle) exit end theSelection = theFTab.GetSelection if (theSelection.Count <> 1) then MsgBox.Info("One record must be selected",theTitle) exit end sf = theFTab.FindField("shape") r = theSelection.GetNextSet(-1) thePolygon = theFTab.ReturnValue(sf,r) if (thePolygon.IsNull) then MsgBox.Info("Polygon is null."+NL+"Clean up your data!",theTitle) exit end '**** do it! theMsg = "" r = 0 for each plist in thePolygon.AsList theMsg = theMsg + "Ring" ++ r.AsString if (av.Run("Ring.IsClockwise",{plist})) then theMsg = theMsg ++ "is clockwise" + NL else theMsg = theMsg ++ "is counterclockwise" + NL end r = r + 1 end MsgBox.Report(theMsg,theTitle)