In some of the projects requirement, you may want to convert
the Civil 3D SurveyFigure objects to AutoCAD geometric object like polyline and
retain the curves, bulges etc. When you select a Civil 3D SurveyFigure object
and call the LIST command in Civil 3D, you would see each segment type and
associated details like the following screenshot.
From the Civil 3D SurveyFigure object we can access BaseCurve to get the base geometry which we can then append to Civil
3D Model space. Here is the relevant code snippet :
try
{
SurveyFigure survFig = trans.GetObject(survFigId, OpenMode.ForWrite) as SurveyFigure;
// get the projected curve from SurveyFigure
Curve baseCurve = survFig.BaseCurve;
// Now append the curve to db
BlockTable table = trans.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
BlockTableRecord model = trans.GetObject(table[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
model.AppendEntity(baseCurve);
trans.AddNewlyCreatedDBObject(baseCurve, true);
// Remove the SurveyFigure
survFig.Erase();
trans.Commit();
}
And result of converting the SurveyFigure to Polyline object
:



Leave a Reply