Owner: IMapTopobaseShape;
The Owner property returns the area owning a primitive.
Executing the example requires a form with the Button1 button, the MapBox and UiMap components with a loaded map.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
M: IMap;
Layer: IMapLayer;
Shape: IMapTopobaseShape;
Primitiv: IMapTopobasePrimitives;
P: IMapTopobasePrimitive;
S: String;
Begin
M := UiMap1.Map;
Layer := M.Layers.FindByName("Regions");
Shape := Layer.Shapes.Item(0);
Primitiv := Shape.Primitives;
P := Primitiv.Item(0);
S := P.Owner.Name;
End Sub Button1OnClick;
After executing the example on clicking the button the name of the area, that owns the first primitive, is saved to the S variable.
See also: