HOW TO
This article provides sample Avenue code that splits a polygon feature using a selected line from a different theme.
Code:
theView = av.GetActiveDoc
t = theView.GetThemes
splitTheme = msgbox.choice(t,"","Choose the line theme with the selected line")
theProjection = theView.GetProjection
theFtab = splitTheme.GetFTab
theShapeField = theFtab.FindField("Shape")
thebit = theFtab.GetSelection
for each x in thebit
aShape = theFtab.ReturnValue(theShapeField, x)
if (theProjection.IsNull) then
aGraphic = GraphicShape.Make(aShape.ReturnProjected(theProjection))
else
aGraphic = GraphicShape.Make(aShape)
end
if (aShape.Is(Polygon)) then
msgbox.info("You must choose a line theme","Warning")
end
end
theTheme = theView.GetEditableTheme
if (theTheme <> nil) then
theTheme.GetFtab.BeginTransaction
theField = theTheme.GetFTab.FindField("Shape")
theType = theField.GetType
if ((theType = #FIELD_SHAPEPOLY) or (theType = #FIELD_SHAPELINE)) then
theTheme.Split(aShape)
end
theTheme.GetFtab.EndTransaction
end
av.GetProject.SetModified(true)
Get help from ArcGIS experts
Download the Esri Support App