OpenRoads Designer CONNECT Edition SDK Help

Understanding Geometry model

What is Geometry Model?

  • OpenRoads Designer Or Any other Civil Product uses Civil Schema on top of basic DGN model.
  • DGN model store core CAD elements like Line, Arc, Text etc.
  • Civil Schema uses Geometric model which is a container to store objects such as Horizontal and vertical alignment, Corridor, SuperElevationSection, Terrains, Annotation Definitions, Civil Cells, Cants, Feature definition, etc.
  • Geometric model supports read only access for some of the objects like Cant, FlowModelComponent, SightVisibilitySection,AnnotationDefinition, AnnotationGroup, FeatureDefinition, ImportedEntities, SurfaceEntity.

Conceptual Class Diagram

Examples of accessing objects in Geometric Model

  • Get Active Geometric Model
//Get Connection to Active DGN
Bentley.DgnPlatformNET.DgnModel activeModel = Bentley.MstnPlatformNET.Session.Instance.GetActiveDgnModel();
Bentley.CifNET.SDK.ConsensusConnection con = new Bentley.CifNET.SDK.ConsensusConnection(activeModel);
Bentley.CifNET.GeometryModel.SDK.GeometricModel geomModel = con.GetActiveGeometricModel();
  • Alignments

//List All Alignments
foreach (Alignment al in geomModel.Alignments)
{
	//Do something with Alignment
}
  • Corridors

//List All Corridors 
foreach (Corridor corridor in geomModel.Corridors)
{
	//Do something with corridor
}
  • Terrains

//List All Terrains
foreach (TerrainSurface terrain in geomModel.TerrainSurfaces)
{
    //Do something with terrain
}
  • SuperElevations

//List All SuperElevations
foreach (SuperElevationSection superElevationSection in geomModel.SuperElevationSections)
   {
       IEnumerable<SuperElevation> superElevations = superElevationSection.SuperElevations;
       foreach(SuperElevation superElevation in superElevations)
       {
        //Do something with superelevation
       }
   }
  • CurveWidenings

foreach (Corridor corridor in geomModel.Corridors)
{
    IEnumerable<CurveWidening> curveWidenings= corridor.CurveWidenings;
    foreach(CurveWidening curveWidening in curveWidenings)
    {
        //Do something with curve widening    
    }
}
  • CiviCells

//List All CivilCells
foreach (CivilCell civilCell in geomModel.CivilCells)
{
	//Do something with civil cell       
}
  • AnnotationGroups
			
//Get all annotation groups 
foreach (AnnotationGroup annotationGroup in geomModel.AnnotationGroups)
{
	IEnumerable<AnnotationDefinition> annotationDefinitions =  annotationGroup.AnnotationDefinitions;
	foreach(AnnotationDefinition annotationDefinition in annotationDefinitions)
		{
			//Do something with annotation definition
		}
}