private void CheckBrowseContourMethod(Bentley.TerrainModelNET.DTM dTM)
{
ContoursBrowsingDelegate hdl3P = new ContoursBrowsingDelegate(processContours);
// BrowseContours methods
ContoursBrowsingCriteria contoursCriteria = new ContoursBrowsingCriteria(1);
contoursCriteria.SmoothingOption = TerrainModelNET.DTMContourSmoothingMethod.Vertex;//=1
contoursCriteria.UseOnlyContourValues = true;//获取特定高程等高线
contoursCriteria.ContourValues = new double[1] { 1460.5 };//unit m
dTM.BrowseContours(contoursCriteria, hdl3P, null);
}
private bool processContours(DPoint3d[] tPoint, DPoint3d direction, System.Object oArg)
{
if (tPoint == null)
{
return false;
}
DgnModel dgnModel = Bentley.MstnPlatformNET.Session.Instance.GetActiveDgnModel();
CurvePrimitive curvePri = CurvePrimitive.CreateLineString(tPoint);
//CurveVector curveVec = CurveVector.Create(CurveVector.BoundaryType.Outer);
Element lineEle = DraftingElementSchema.ToElement(dgnModel, curvePri, null);// UOR Unit
lineEle.AddToModel();
return true;
}