static void genIntersection(MyDB2 mydb) { ObjectId[] boundary = Selection.getBoundarys(); ObjectId[] contours = Selection.getContours(LayerUtil.contourLayerName(mydb.Resolution)); Database db = HostApplicationServices.WorkingDatabase; using (Transaction tran = db.TransactionManager.StartTransaction()) { for (int i = 0; i < contours.Length; i++) { Polyline pl = tran.GetObject(contours[i], OpenMode.ForRead) as Polyline; for (int j = 0; j < boundary.Length; j++) { Polyline b = tran.GetObject(boundary[i], OpenMode.ForRead) as Polyline; double p = b.GetParameterAtPoint(pl.StartPoint); } } } }