Layer::Detach

Description

Detach the internal Origin layer from the layer object.

Syntax

void Detach( )

Parameters

Return

void

Examples

EX1

//Detach the internal Origin layer from the layer object.
void Layer_Detach_ex1()
{
    // Create a Layer object and attach it to the currently active layer
    Layer ly = Project.ActiveLayer();
    if( ly.IsValid() )
    {
        out_str( "Object is attached and is valid" );
        // Now detach the internal Origin layer from the object
        ly.Detach();
        // Now it should no longer be a valid object
        if( !ly.IsValid() )
            out_str( "Object is invalid because it is now detached" );
        else
            out_str( "Failed to detach object" );
    }
    else
        out_str( "No active layer found" );
}

Remark

See Also

header to Include

origin.h