FxProject ​
This module contains functions for managing projects.
Load ​
FxProject = require "FxProject";Functions ​
| Function | Description |
|---|---|
| Close () | Closes the open project. |
| Create () | Creates a new project. |
| Delete (ProjectID) | Deletes a project. |
| Duplicate (ProjectID) | Duplicates a project. |
| Get1f (ProjectProperty) Get1i (ProjectProperty) Get1s (ProjectProperty) | Return property values of the open project. |
| Open (ProjectID) | Opens a project. |
| Rename (ProjectID, NewProjectID) | Renames a project. |
| Save () | Saves changes made to the open project. |
| Select (ProjectID, Value) | Sets the selection state of a project. |
| SelectEx (ProjectID) | Exclusively selects a project. |
| Set1f ProjectProperty, Value) Set1i (ProjectProperty, Value) Set1s (ProjectProperty, Value) | Set property values of the open project. |
Close () ​
This function closes the open project as well as the open asset, if there is one. All unsaved changes to the project (and asset) will be lost.
Errors ​
Possible errors include FX_REQUIRED_PROJECT_UNAVAILABLE
Since ​
Version 1.0
Example ​
FxProject.Close();Create () ​
This function creates a new project and returns its ID.
Errors ​
Possible errors include FX_FILE_OPERATION_FAILED
Since ​
Version 1.0
Example ​
projectid = FxProject.Create();Delete (ProjectID) ​
This function deletes the specified project. If the project was open, it will be closed and unsaved changes will be lost.
Parameters ​
- ProjectID: The ProjectID to identify the projects to delete
Errors ​
Possible errors include FX_PROJECT_NOT_FOUND, FX_FILE_OPERATION_FAILED
Since ​
Version 1.0
Example ​
FxProject.Delete("myproject");Duplicate (ProjectID) ​
This function duplicates the specified project. If the project is opened, its current state is duplicated.
Parameters ​
- ProjectID: The ProjectID to identify the projects to duplicate
Returns ​
ProjectID of duplicated projects
Errors ​
Possible errors include FX_PROJECT_NOT_FOUND, FX_FILE_OPERATION_FAILED
Since ​
Version 1.0
Example ​
projectid = FxProject.Duplicate("myproject");Get1f (ProjectProperty)
Get1i (ProjectProperty)
Get1s (ProjectProperty) ​
These functions return the value of the specified project property. The value type of the property must match the selected Get function; for example, if the property is of type int, use Get1i.
Parameters ​
- ProjectID: The FileID of the file
- ProjectProperty: The ProjectProperty to query
Returns ​
Get1i returns 1 valueGet1f returns 1 valueGet1s returns 1 value
Errors ​
Possible errors include FX_REQUIRED_PROJECT_UNAVAILABLE, FX_TYPE_INVALID, FX_PROPERTY_INVALID
Since ​
Version 1.0
Example ​
val = FxProject.Get1s("description");Open (ProjectID) ​
This function opens the specified project. If the project was already open, it will be closed and unsaved changes will be lost.
Parameters ​
- ProjectID: The ProjectID of the project to open
Errors ​
Possible errors include FX_PROJECT_NOT_FOUND, FX_FILE_OPERATION_FAILED
Since ​
Version 1.0
Example ​
FxProject.Open("myproject");Rename (ProjectID, NewProjectID) ​
This function changes the ID of a project and returns the new ID. The new ID may be different from the requested one if that ID has already been taken. If the requested ID contains illegal characters or is empty, a default ID is used. If the project was open, it will be closed and unsaved changes will be lost.
Parameters ​
- ProjectID: The ProjectID to identify the projects to rename
- NewProjectID: The new ProjectID, can't be a wildcard, filter, or list
Returns ​
ProjectID of renamed projects
Errors ​
Possible errors include FX_PROJECT_NOT_FOUND, FX_FILE_OPERATION_FAILED
Since ​
Version 1.0
Example ​
projectid = FxProject.Rename("project1", "myproject");Save () ​
This function saves changes made to the open project. It does not save changes made to the open asset, if there is one. Use FxFile.Save for that.
Errors ​
Possible errors include FX_REQUIRED_PROJECT_UNAVAILABLE, FX_FILE_OPERATION_FAILED
Since ​
Version 1.0
Example ​
FxProject.Save();Select (ProjectID, Value) ​
This function sets the selection state of the specified project.
Parameters ​
- ProjectID: The ProjectID to identify the projects to select
- Value: The selection state to set
Errors ​
Possible errors include FX_PROJECT_NOT_FOUND
Since ​
Version 1.0
Example ​
FxProject.Select("myproject", true);SelectEx (ProjectID) ​
This function selects the specified projects and deselects all other projects.
Parameters ​
- ProjectID: The ProjectID to identify the projects to select exclusively
Errors ​
Possible errors include FX_PROJECT_NOT_FOUND
Since ​
Version 1.0
Example ​
FxProject.Select("myproject", true);Set1f (ProjectProperty, Value)
Set1i (ProjectProperty, Value)
Set1s (ProjectProperty, Value) ​
These functions set the values of properties of the specified open file. The value type of the property must match the selected set function. For example if the property is of the type int, use Set1i.
Parameters ​
- ProjectProperty: The ProjectProperty to change
- Value: Value to set, type depends on function called
Errors ​
Possible errors include FX_REQUIRED_PROJECT_UNAVAILABLE, FX_PROPERTY_INVALID, FX_VALUE_INVALID
Since ​
Version 1.0
Example ​
FxProject.Set1f("unitscale", 0.1);