In AutoCAD Civil 3D COM API, using AeccSurveyDatabase:: Projects, we can access the collection of the existing Survey projects. If you want to access a particular Survey Project e.g. (Test_Survey_DB) as shown in the screenshot below, we can use the AeccSurveyProjects:: FindItem(VARIANT varIndex).
Here is a C# .NET code snippet which demonstrates how to access a particular Survey Project using the COM API :
// Get the AutoCAD Editor
Editor ed = AcadApp.DocumentManager.MdiActiveDocument.Editor;
// Get the Survey Application and AeccSurveyDatabase
AeccSurveyApplication aeccSurveyApp = newAeccSurveyApplication();
aeccSurveyApp.Init((AcadApplication)AcadApp.AcadApplication);
AeccSurveyDatabase aeccSurveydb = (AeccSurveyDatabase)aeccSurveyApp.ActiveDocument.Database;
AeccSurveyProjects surveyProjs = aeccSurveydb.Projects;
// Accessing a Particular Survey Project
// IAeccSurveyProjects:: FindItem
// Gets the Survey Project with the given name.
AeccSurveyProject surveyProj = surveyProjs.FindItem("Test_Survey_DB");
if (surveyProj != null)
{
// now we can access the various Props of AeccSurveyProject object
ed.WriteMessage("\nSurvey Project Name : " + surveyProj.Name.ToString());
ed.WriteMessage("\nSurvey Project Path : " + surveyProj.Path.ToString());
ed.WriteMessage("\nNext available point number : " + surveyProj.GetNextWritablePointNumber().ToString());
}