The IProjectTree66 interface gives the client access to all of the objects and elements in a project through the Project Tree structure. Client applications can control the appearance of the Tree (i.e. expand groups, move items from one group to another etc.), delete single entries or entire groups from the Tree and add their own content to it.
Creating and modifying groups
Using the IProjectTree66 interface you can create new groups in the project. You can create regular groups or locked groups under the root area or any other group in the Tree. Using the IProjectTree66 interface you can also modify existing groups (i.e. expand or collapse a group using the IProjectTree66.ExpandGroup method)
Finding and modifying objects in a project
One of the most important capabilities of the IProjectTree66 interface is to provide a means of traversing the TerraExplorer Project Tree. This, in conjunction with other features, is a very powerful tool that can be used to achieve many different goals. For example, the client can traverse the Tree to change the color for all objects or a subset of them, or to present the project’s content in another format. Traversing the Tree might also be used to search for items in the project that match a set of criteria (i.e. all the models that are in a certain area on the terrain). You can even delete objects from the project using the IProjectTree66.DeleteItem method.
var node = SGWorld.ProjectTree.GetNextItem(group, 11); // code 11 get the first child in the group
while (node > 0)
{
var object = SGWorld.ProjectTree.GetObject(node);
// Here you can perform operation on the object ...
node = SGWorld.ProjectTree.GetNextItem(node, 13); // code 13 gets the next sibling
}