2.2.4.32.9 OriginObject::Detach

Description

Syntax

void Detach( )

Parameters

Return

Examples

//Detach function is defined in the derived class of OriginObject, e.g. Layer.
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