An object that represents a Project Information within the Autodesk Revit project.
Namespace:
Autodesk.Revit.DB
Assembly:
RevitAPI
(in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Syntax
Remarks
This object derived from the Element base object and such supports all the
methods of that object such as the ability to retrieve the parameters of that object.
Examples
Copy
C#
ProjectInfo projectInfo = document.ProjectInformation;
if (null != projectInfo)
{
string message = "Project information:";
//get the project name
message += "\nName: " + projectInfo.Name;
string newName = "My project";
//set the project name
projectInfo.Name = newName;
message += "\nProject Name after set: " + projectInfo.Name;
//get the project number
message += "\nNumber: " + projectInfo.Number;
string newNumber = "TestNumber";
//set the project number
projectInfo.Number = newNumber;
message += "\nProject Number after set: " + projectInfo.Number;
//get the status of the project
message += "\nStatus: " + projectInfo.Status;
string newStatus = "TestStatus";
//set the project status
projectInfo.Status = newStatus;
message += "\nProject status after set: " + projectInfo.Status;
//get the address of the project
message += "\nAddress: " + projectInfo.Address;
string newAddress = "TestAddress";
//set the project address
projectInfo.Address = newAddress;
message += "\nProject address after set: " + projectInfo.Address;
//get the client name of the project
message += "\nClient Name: " + projectInfo.ClientName;
string newClient = "TestClientName";
//set the client name
projectInfo.ClientName = newClient;
message += "\nProject client name after set: " + projectInfo.ClientName;
//get the gbXmlSetting of the project
EnergyDataSettings energyDataSetting = EnergyDataSettings.GetFromDocument(document);
message += "\nBuilding type: " + energyDataSetting.BuildingType.ToString();
TaskDialog.Show("Revit",message);
}
Copy
VB.NET
Dim projectInfo As ProjectInfo = document.ProjectInformation
If projectInfo IsNot Nothing Then
Dim message As String = "Project information:"
'get the project name
message += vbLf & "Name: " + projectInfo.Name
Dim newName As String = "My project"
'set the project name
projectInfo.Name = newName
message += vbLf & "Project Name after set: " + projectInfo.Name
'get the project number
message += vbLf & "Number: " + projectInfo.Number
Dim newNumber As String = "TestNumber"
'set the project number
projectInfo.Number = newNumber
message += vbLf & "Project Number after set: " + projectInfo.Number
'get the status of the project
message += vbLf & "Status: " + projectInfo.Status
Dim newStatus As String = "TestStatus"
'set the project status
projectInfo.Status = newStatus
message += vbLf & "Project status after set: " + projectInfo.Status
'get the address of the project
message += vbLf & "Address: " + projectInfo.Address
Dim newAddress As String = "TestAddress"
'set the project address
projectInfo.Address = newAddress
message += vbLf & "Project address after set: " + projectInfo.Address
'get the client name of the project
message += vbLf & "Client Name: " + projectInfo.ClientName
Dim newClient As String = "TestClientName"
'set the client name
projectInfo.ClientName = newClient
message += vbLf & "Project client name after set: " + projectInfo.ClientName
'get the gbXmlSetting of the project
Dim energyDataSetting As EnergyDataSettings = EnergyDataSettings.GetFromDocument(document)
message += vbLf & "Building type: " & energyDataSetting.BuildingType.ToString()
TaskDialog.Show("Revit", message)
End If