ScenomeApplication.OpenFile

This page contains reference documentation for the OpenFile function. This function opens a file in Scenome, replacing the existing file.

Prototype

int OpenFile( string Filename )

Parameters

Function parameters are as follows:

Examples

Examples are as follows:

if ( importModel.OpenFile( file ) )
{
   Group newParent = GetStandardAddGroup(); 

   for ( ; importModel.ChildCount != 0; )
   {
      // take the nodelink out of the imported model
      NodeLink importReference = (NodeLink)importModel.Children[ 0 ];
      Group nullGroup; 
      importReference.SetParent( nullGroup );

      // convert the absolute path to a relative path
      importReference.PathToFile = Application.MakeRelativePath( importReference.PathToFile , Model.Filename );

      // Moves the node from the imported model into the open document
      Model.AddNode( importReference, newParent, -1 );
   }
}

Working Sample Code

For sample code: