ActiveProject2 (XSIApplication)
Introduced
6.0
Description
Returns or sets the active XSIProject object.
Note: If you are setting the active project with scene currently loaded, a file browser will prompt you to save the current scene as a new file the next time you save the scene. This is because you are now in a new project so the location of the 'current' scene file has changed.
C# Syntax
// get accessor Project rtn = XSIApplication.ActiveProject2; // set accessor XSIApplication.ActiveProject2 = Project;
Examples
1. JScript Example
// // This example demonstrates how to set the current project with jscript // // Backup the current project var sOriginalProjectPath = Application.ActiveProject2.Path Application.LogMessage ( "Original Active Project: " + sOriginalProjectPath ); // Set the active project to be XSI_Samples var sPath = Application.InstallationPath( siFactoryPath ); sPath += "/Data/NewProject"; Application.ActiveProject2 = Application.CreateProject( sPath ); Application.LogMessage ( "New Active Project: " + Application.ActiveProject2.Path ); // Set back the original project Application.ActiveProject2 = Application.CreateProject( sOriginalProjectPath ); Application.LogMessage ( "New Active Project: " + Application.ActiveProject2.Path );
2. Python Example
# # This example demonstrates how to set the current project with python # app = Application from win32com.client import constants as cns # Backup the current project sOriginalProjectPath = app.ActiveProject2.Path; app.LogMessage( "Original Active Project: " + sOriginalProjectPath ); # Set the active project to be XSI_Samples sPath = app.InstallationPath( cns.siFactoryPath ); sPath += "/Data/NewProject"; app.ActiveProject2 = app.CreateProject( sPath ); app.LogMessage( "New Active Project: " + app.ActiveProject2.Path ); # Set back the original project app.ActiveProject2 = app.CreateProject( sOriginalProjectPath ); app.LogMessage( "New Active Project: " + app.ActiveProject2.Path );
See Also
Autodesk Softimage v7.5