Here
is a c
# code snippet -
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
CivilDocument cDoc = CivilApplication.ActiveDocument;
Database db = Application.DocumentManager.MdiActiveDocument.Database;
using (Transaction trans = db.TransactionManager.StartTransaction())
{
try
{
GreenEvaluate checkGreenEvl
= new GreenEvaluate
();
// Call GreenEvaluatation to compute the Green factor and
// Sustainablility factor for the current CivilDocument
checkGreenEvl.GreenEvaluatation(cDoc);
// Check the Green factor and Sustainability factor
ed.WriteMessage("\nIs this Project Green ? :" + checkGreenEvl.GreenFactor.ToString());
ed.WriteMessage("\nIs this Project Sustainable :" + checkGreenEvl.SustainableFactor.ToString());
trans.Commit();
}
catch (System.Exception ex)
{
ed.WriteMessage("\nException: " + ex.Message);
}
}