Class library to assist with working with Primavera P6 entities.
$ dotnet add package Universal.Oracle.Primavera.P6A comprehensive library for interacting with Oracle Primavera P6 data structures, supporting versions 8 through 19. This package provides strongly-typed models and utilities for efficient handling of P6 project management data.
Utility for parsing XER files exported from Primavera P6.
var parser = new XerFileParser();
using (FileStream fs = new FileStream("project_data.xer", FileMode.Open, FileAccess.Read))
{
XerFile xerFile = parser.Parse(fs);
Console.WriteLine($"Project Name: {xerFile.ProjectName}");
Console.WriteLine($"P6 Version: {xerFile.Version}");
}
Extend the library's functionality by creating custom table handlers:
public class CustomResourceTable : Table<IResource>
{
public IEnumerable<IResource> GetCriticalResources()
{
return Rows.Where(r => r.IsCritical);
}
}
// Usage
var customResourceTable = new CustomResourceTable
{
Name = "RSRC",
Rows = xerFile.GetTable<IResource>().Rows
};
var criticalResources = customResourceTable.GetCriticalResources();
Implement version-specific behavior using the XerFile's Version property:
if (xerFile.Version >= new Version("15.0"))
{
// Logic for P6 version 15 and above
}
else
{
// Logic for earlier versions
}
The library includes strongly-typed models for all P6 data structures, including:
Each model is version-aware and implements the appropriate interface (e.g., IProjectWorkBreakdownStructure) for consistent access across versions. Due to version-specific differences, these interfaces represent the lowest-common denominator.