This page contains reference documentation for the SaveFile function. This function saves a model database to the hard disk.
int SaveFile( string Filename )
Function parameters are as follows:
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;
For sample code: