[C# ORD 10.09] Create CivilDTM

Is there a way to create a CivilDTM using .NET?

We are programmatically creating elements in our models, when we go to cut cross sections we are having to manually adjust the height of the named boundary for anything that is not either a corridor object or a civil terrain.

For the current application we are working on we were hoping create a small dtm so that the named boundary would be generated to include the dtm. I can create a Bentley.TerrainModelNET.DTM and add it to the model but the cross section tool doesn't pick it up for named boundary inclusion. 

I have found the Bently.CifNET.TerrainModel.CivilDTM object and was hoping to create a Civil Terrain using CivilDTM.BuildDTMFromTriangles(Bentley.TerrainModelNET.DTM), I can run the code (see attached) but I don't see anything changed in the file nor does the method return and object that I can investigate.

Any ideas?

DTM dtm = new DTM();
dtm.AddPoint(new DPoint3d(0, 0, 0));
dtm.AddPoint(new DPoint3d(4, 0, 0));
dtm.AddPoint(new DPoint3d(4, 4, 0));
dtm.AddPoint(new DPoint3d(0, 4, 0));
dtm.Triangulate();

DTMElement dTMElement = new DTMElement(Session.Instance.GetActiveDgnModel(), null, dtm);
dTMElement.AddToModel();

CivilDTM.BuildDTMFromTriangles(dtm);

Parents
  • MIke,

    I checked with our DTM expert and he said that what you have is fine except:

    1) You do not need the CivilDTM line of code

    2)  The DTM is in UORs so your coordinates would be VERY small and you probably would not be able to see the DTM

    3)  The DTM is a 3D only element and will not show up in 2D

    We hope this helps.

  • Chris,

    The DTM that is created is not picked up in the Cross Section tool to create the named boundary deep enough to include the terrain I've created. Looking at the properties of the dtm I've created the Element Description is "Terrain".

    If I create a Terrain manually in the same location by creating a linestring using those coordinates, then use the Terrain>From Elements tool the cross-section tool will automatically create the named boundary with enough height to include the terrain. Looking at the properties of the terrain I created manually the Element Description is "Terrain Model".

    I was hoping the CivilDTM.BuildDTMFromTriangles(dtm); would create a "Terrain Model" from the "Terrain"

    Is there a way to create a "Terrain Model" or some other way to get the cross-section tool to pick up an element and adjust the named boundary height to include the element in cross-sections?

  • I'm attaching a graphic to better explain what I'm after. Using the code above (with actual coordinates) I create a small DTM at the bottom of the blue cylinder. If I then create a named boundary the bottom of the cylinder is below the bottom of the named boundary. If I manually create a shape from the coordinates of the DTM then use the Terrain>From Element tool and select that shape it creates a "Terrain Model", the named boundary tool automatically adjusts its size to include the Terrain Model.

  • Hi Mike,

    Does giving the new Terrain a Feature Definition make it visible to the Named Boundary tool?

    Regards,

    Mark


    OpenRoads Designer 2023  |  Microstation 2023.2  |  ProjectWise 2023

Reply Children