I use microstation 08.11.09.578, DGN 2D V7 Upgrade V8
I want to get the 2D coordinates of the element, I see the manual but don't see the method 'Point2dFromXY'
Point2dFromXY Method Returns a point with specified x and y components. Syntax Point2d = object.Point2dFromXY (X, Y)
ba ranh said:I see the manual but don't see the method 'Point2dFromXY'
What programming language are you using?
Regards, Jon Summers LA Solutions
I get the element's X Y coordinate but it returns null
Code C#
void Test(string sPath) { MicroStationDGN.Application app = new MicroStationDGN.Application(); DesignFile dgnfile = app.OpenDesignFile(sPath, true); ElementScanCriteria _MSesc = new ElementScanCriteria(); _MSesc.ExcludeAllTypes(); _MSesc.IncludeType(MsdElementType.msdElementTypeLine); //_MSesc.IncludeType(MsdElementType.msdElementTypeLineString); _Element ele; ElementEnumerator ee = app.ActiveModelReference.Scan(_MSesc); while (ee.MoveNext()) { ele = ee.Current; int iVectorCount = ele.AsLineElement.VerticesCount; Array xPoint = ele.AsLineElement.GetVertices(); string sTEXT = ""; for (int i = 0; i < iVectorCount; i++) { sTEXT += ", i = " + i + " : X = " + xPoint.GetValue(0) + ", Y = " + xPoint.GetValue(1) + ", Z = " + xPoint.GetValue(2) ; } MessageBox.Show("sTEXT = " + sTEXT); } }