Partager via


ProjectNode.clear Method

Definition

Removes the contents of a project.

public:
 virtual void clear();
public virtual void clear ();
abstract member clear : unit -> unit
override this.clear : unit -> unit
Public Overridable Sub clear ()

Remarks

This method does not remove the project contents from the Application Object Tree (AOT), only from the project itself. This method removes the project contents but does not remove the project folder. To delete a project and its contents in one method call, use the AOTdelete method. To delete objects from the AOT, use the AOTdelete method.

The following example removes any objects in the Project1 project in the Private folder.

static void clearProjectObjects(Args _args) 
    { 
        ProjectNode privatePn; 
        ProjectNode pn; 
        // Navigate to the Private projects folder. 
        privatePn = infolog.projectRootNode().AOTfindChild("Private"); 
        // Get a reference to the project. 
        pn = privatePn.AOTfindChild("Project1"); 
        // Clear the project. 
        pn.clear(); 
    }

Applies to