[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.

Reply
  • 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.

Children