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; }
Hi,
clever_anthony said: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).
clever_anthony said: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.
clever_anthony said: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.
clever_anthony said: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
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan Šlegr said: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"?
Jan Šlegr said: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.
clever_anthony said:I want to verify in .NET API
How to enumerate elements using .NET.
Regards, Jon Summers LA Solutions
clever_anthony said:As I remember that in VBA
When working in NET, clean your mind from anything related to VBA! It is different API, differently structured, based on better (but more complex) OOP concepts.
clever_anthony said:so as a newbie I want to verify in .NET API do we need to do ".ExcludeAllFeatureTypes"?
You are mixing several different things together:
clever_anthony said:I am just examinating how far could the Microstation go with .NET API and DTM programming.
I think pretty far, but there is no public documentation for NET DTM API, and also no examples exists. So you must use C++ documentation and in NET API to find equivalent method (which is usually simple) and to test, what individual methods return.
clever_anthony said: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.
MicroStation has no "features". Do you talk about OpenRoads environment, where features are one from core concepts?
In MicroStation, DTM data is stored as DTMElement (which is a handle to access data in DGN file) and from this element, DTM data can be obtained. Both DTMElement and DTM classes provides plenty of methods, so it is up to you to play with them. But be aware that DTMElement represents access (handle) to data in DGN file, whereas DTM represents (if I understand it right) the data itself.