IWxWorkspace.DeglueShapes

Syntax

DeglueShapes(Shape1: IWxShape; Shape2: IWxShape);

DeglueShapes(Shape1: Prognoz.Platform.Interop.Andy.IWxShape; Shape2: Prognoz.Platform.Interop.Andy.IWxShape);

Parameters

Shape1. Shape.

Shape2. Shape.

Description

The DeglueShapes method separates two shapes.

Comments

Lines are also considered as shapes. If two shapes are connected with connection line, to disconnect them use the following algorithm: disconnect the first shape from connection line, then - the second one. 

Example

Executing the example requires the object of the workspace. Create a form, add the Button1 button to it, the WorkspaceBox component named WorkspaceBox1, the UiWorkspaceObject component named UiWorkspaceObject1, define the workspace as an object of the UiWorkspaceObject1 component, the UiWorkspaceObject1 component as the source of the WorkspaceBox1 component, and set the True value for the Active property of the UiWorkspaceObject1 component. Two shapes are located on workspace with the OBJ143132 identifier.

Add links to the Andy, Metabase, Workspace system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    mb: IMetabase;
    wsp: IWxWorkspace;
    Shapes: IWxShapes;
    Link: IWxLink;
Begin
        
// Get workspace
    mb := MetabaseClass.Active;
    wsp := mb.ItemById(
"OBJ143132").Edit As IWxWorkspace;
    Shapes := wsp.Shapes;
    Link := wsp.AutoLinkShapes(Shapes.Item(
0), Shapes.Item(1));
    wsp.DeglueShapes(Shapes.Item(
0), Link);
    wsp.DeglueShapes(Shapes.Item(
1), Link);
    
//Save changes
    (wsp As IMetabaseObject).Save;
End Sub Button1OnClick;

Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Workspace;

 
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    mb: IMetabase;
    wsp: IWxWorkspace;
    Shapes: IWxShapes;
    Link: IWxLink;
Begin
    
// Get workspace
    mb := Self.Metabase;
    wsp := mb.ItemById[
"OBJ143132"].Edit() As IWxWorkspace;
    Shapes := wsp.Shapes;
    Link := wsp.AutoLinkShapes(Shapes.Item[
0], Shapes.Item[1]);
    wsp.DeglueShapes(Shapes.Item[
0], Link);
    wsp.DeglueShapes(Shapes.Item[
1], Link);
    
//Save changes
    (wsp As IMetabaseObject).Save();
End Sub;

After executing the example, the workspace will contain a line that previously connected the shapes.

See also:

IWxWorkspace