MicroStation Programming Forum - Creating a Terrain Model through API (MDL or .NET) in Connect
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

Creating a Terrain Model through API (MDL or .NET) in Connect

by
Christian Milne
Explorer

I'm working on a project where we have a DTM model class in our MicroStation plug-in and we want to render it in the drawing as a MicroStation Terrain Model object in Connect.

MDL or .NET can be used, by my preference is .NET.

I've found the Bentley.TerrainModelNET assemblies and the DTM model class looks quite straightforward, but I'm not sure how to get a drawable element from that class.

Here is an example snippet of VB.net code of what I'm trying to achieve as a test that (obviously) doesn't work:

Dim testDTM As New Bentley.TerrainModelNET.DTM
testDTM.AddPoint(New Bentley.GeometryNET.DPoint3d(-50, -50, 20))
testDTM.AddPoint(New Bentley.GeometryNET.DPoint3d(50, -50, 10))
testDTM.AddPoint(New Bentley.GeometryNET.DPoint3d(50, 50, 15))
testDTM.AddPoint(New Bentley.GeometryNET.DPoint3d(-50, 50, 30))
testDTM.Triangulate()
ApplicationEvents.GetComApp.ActiveModelReference.AddElement(testDTM)

Is it possible to do what I'm attempting through the API?  If so, can anyone provide tips or point me at an example?


Many Thanks!