Model3D.SaveFile

This page contains reference documentation for the SaveFile function. This function saves a model database to the hard disk.

Prototype

int SaveFile( string Filename )

Parameters

Function parameters are as follows:

Examples

Examples are as follows:

if ( Model.Filename == "" )
{
   Application.MessageBox( 0, "Please save the file or references cannot resolve!", "Warning" ); 
   return;
}

Model3D exportReferences = new Model3D;
if ( exportReferences )
{
   // for each selected node
   for ( int select = 0; select < Model.GetSelectCount (); ++select )
   {
      // get the selected node
      Node selectedNode = Model.GetSelectedNode( select ).GetNode();
      // create a nodelink
      NodeLink link = new NodeLink; 
      if ( link )
      {
	    // set up the type identification
	    link.LinkType = selectedNode.GetType();
            // point the nodelink to the file
            link.PathToFile = Model.Filename;
            // get the hierarchy path to the selected node
            link.PathToNode = GetPathToNode( selectedNode );
            // add to the external model
            exportReferences.AddChild( link );
      }
   }
}
// save the model containing the references 
string file = Application.GetTempPath( "TempLinkCopyReferencesTransport.box", 0 );
exportReferences.SaveFile( file );
// clean up
delete exportReferences;

Working Sample Code

For sample code: