[MSCE U17 C#] Get DTM Points from DTMFeatureType

It was found that there was a guy used Microstation V8i VBA to extract points from DTM by using DTMFeatureScanCriteria and DTMFeatureEnumerator.

Link to Mark Stefanchuk's post

However, in MSCE .NET API the DTMFeatureScanCriteria is found missing and the direct functions from DTM are very limited.

Should the code become like this?

DTM dtm = new DTM();
DTMFeatureEnumerator ee = new DTMFeatureEnumerator(dtm);
ee.IncludeFeature(DTMFeatureType.SlopeToe);
IEnumerator<DTMFeatureInfo> info = ee.GetEnumerator();
while (info.MoveNext())
{
    // Do something
    DPoint3d[] pt = info.Current.Points;
}

Parents
  • Hi,

    It was found that there was a guy used Microstation V8i VBA to extract points from DTM by using DTMFeatureScanCriteria and DTMFeatureEnumerator.

    This my comment is similar to what Jon wrote: Because you specified C# as used API, it can be misleading to mention and think in terms V8i VBA, because API changed and VBA uses COM object model, but in NET, we have completely different set of classes and API structure available.

    I also assume GEOPAK DTM element is not equal to MicroStation terrain model element (which I think your question is about).

    However, in MSCE .NET API the DTMFeatureScanCriteria is found missing

    I do not think anything like "scan criteria" is necessary to use. This concept is obsolete and there is no reason to use it even for scanning elements in model.

    and the direct functions from DTM are very limited.

    It is not clear what do you want to achieve. DTM is stored as DTMElement class, that can be optionally converted to DTM class. Both classes provides plenty of methods, allowing to ask for different aspects of DTM.

    Should the code become like this?

    Code for what? Please specify exactly what is expected result, because DTM element is a data structure, describing terrain model, which can be queried / rendered in different ways (triangles, contours, slopes...). To share simple DGN example would help too.

    With regards,

      Jan

  • This concept is obsolete and there is no reason to use it even for scanning elements in model.

    As I remember that in VBA Element ScanCriteria, you have to exclude something first otherwise the result look strange. so as a newbie I want to verify in .NET API do we need to do ".ExcludeAllFeatureTypes"?

    It is not clear what do you want to achieve

    I am just examinating how far could the Microstation go with .NET API and DTM programming. Recently, our team explored the automation of slope works with grasshopper. The main common function they used in grasshopper are:

    - Get the contour lines by Computing Intersections between Surfaces (Not sure if there the easy way in Microstation)

    - Project Point Onto Model (Already has GetProjectedPointOnDTM)

    - Preview design without adding Elements (......Um)

    However, it could not know what are road, slopetoe, u-channel else directly from the 3D Model. This would affect the correctness of automation, such as direction and position of soil nails. In view of the Microstation store these kind of Features in DTM and likely to be accessible through .NET API, so I am still seeking what I want to achieve.

Reply
  • This concept is obsolete and there is no reason to use it even for scanning elements in model.

    As I remember that in VBA Element ScanCriteria, you have to exclude something first otherwise the result look strange. so as a newbie I want to verify in .NET API do we need to do ".ExcludeAllFeatureTypes"?

    It is not clear what do you want to achieve

    I am just examinating how far could the Microstation go with .NET API and DTM programming. Recently, our team explored the automation of slope works with grasshopper. The main common function they used in grasshopper are:

    - Get the contour lines by Computing Intersections between Surfaces (Not sure if there the easy way in Microstation)

    - Project Point Onto Model (Already has GetProjectedPointOnDTM)

    - Preview design without adding Elements (......Um)

    However, it could not know what are road, slopetoe, u-channel else directly from the 3D Model. This would affect the correctness of automation, such as direction and position of soil nails. In view of the Microstation store these kind of Features in DTM and likely to be accessible through .NET API, so I am still seeking what I want to achieve.

Children