private static void processWater(string nameLayer, ObjectId idPolyGuideline, BlockTableRecord ms, ref List <POI> varPOI, out ObjectId idAlign) { string nameAlign = Align.getAlignName(nameLayer); Alignment align = Align.addAlignmentFromPoly(nameAlign, nameLayer, idPolyGuideline, "Standard", "Standard", true); fStake.ACTIVEALIGN = align; idAlign = align.ObjectId; fStake.objectID = idAlign; Stake_GetCardinals.getCardinals_Horizontal(idAlign, ref varPOI); Stake_GetNestedObjects.getNestedObjects(idAlign, ref varPOI, "CNTL"); Stake_GetCardinals.getCrossingAligns(idAlign, ref varPOI); varPOI = Stake_ModifyStaking.modifyStaking(varPOI); fStake.POI_ORG = varPOI; Stake_GetCardinals.checkBegAndEndStations(idAlign, ref varPOI); Stake_AddProfile.makeProfile(idAlign, varPOI, "STAKE", "ByLayout", false); Stake_GetAnglePoints.getAnglePoints(idAlign, ref varPOI);//IDENTIFY ANGLE POINTS - CHECK IF CLOSED var sortSta = from s in varPOI orderby s.Station ascending select s; List <POI> poiTmp = new List <POI>(); foreach (var s in sortSta) { poiTmp.Add(s); } varPOI = poiTmp; Stake_DuplicateStations.resolveDuplicateStations(ref varPOI); Stake_GetSurfaceElev.getSurfaceElevations(idAlign, ref varPOI);//ALL ELEVATIONS COME FROM SURFACE Stake_AddProfile.makeProfile(idAlign, varPOI, "STAKE", "ByLayout", true); if (varPOI[0].isClosed) { Stake_GetAnglePoints.addEndElev(idAlign, ref varPOI, "CPNT"); } Stake_UpdateProfile.updateProfile(idAlign, varPOI, "STAKE", true, "STAKE"); fStake.POI_CALC = varPOI; }
processCurb(string nameLayer, ObjectId idPolyGuideline, BlockTableRecord ms, string nameXRef, ref List <POI> varPOI, out ObjectId idAlign) { string nameAlign = Align.getAlignName(nameLayer); Alignment align = Align.addAlignmentFromPoly(nameAlign, nameLayer, idPolyGuideline, "Standard", "Standard", true); fStake.ACTIVEALIGN = align; idAlign = align.ObjectId; fStake.objectID = idAlign; Stake_GetCardinals.getCardinals_Horizontal(idAlign, ref varPOI); Stake_GetNestedObjects.getNestedPoints(idAlign, ref varPOI, ms, nameXRef); fStake.POI_ORG = varPOI; Stake_GetCardinals.getCardinals_Vertical(idAlign, ref varPOI); Stake_AddProfile.makeProfile(idAlign, varPOI, "CURB", "ByLayout", false); //VERTICAL CONTROL IS SET FROM POINTS Stake_GetAnglePoints.getAnglePoints(idAlign, ref varPOI); //IDENTIFY ANGLE POINTS - CHECK IF CLOSED Stake_GetCardinals.checkBegAndEndStations(idAlign, ref varPOI); if (varPOI[0].isClosed) { Stake_GetAnglePoints.addEndElev(idAlign, ref varPOI, "FLOWLINE"); } Stake_GetBC_EC.getBC_EC(idAlign, ref varPOI); Debug.Print("BEGIN POI AFTER getBC_EC"); for (int i = 0; i < varPOI.Count; i++) { Debug.Print(i + " " + varPOI[i].Station + " " + varPOI[i].Elevation + " " + varPOI[i].Desc0 + " " + varPOI[i].DescX); } Debug.Print("END POI AFTER getBC_EC"); Stake_DuplicateStations.resolveDuplicateStations(ref varPOI); Stake_AddProfile.makeProfile(idAlign, varPOI, "CURB", "ByLayout", true); Stake_UpdateProfile.updateProfile(idAlign, fStake.POI_ORG, "FLOWLINE", true, "ORG"); Stake_UpdateProfile.updateProfile(idAlign, varPOI, "STAKE", false, "STAKE"); }
Process(string varObjName = "") { Object xRefPath = null; Entity obj = xRef.getEntity("\nSelect feature to stake: ", out escape, out xRefPath, out ps); fStake.XRefDbModelSpace = xRef.getXRefBlockTableRecordMS(xRefPath.ToString()); ObjectId idAlign = ObjectId.Null; if (escape) { return; } ObjectId idPolyGuideline = ObjectId.Null; string nameLayer = ""; switch (obj.GetType().Name) { case "Arc": case "Line": case "Polyline": case "Polyline2d": case "Polyline3d": idPolyGuideline = Stake_GetGuidelines.getGuidelines(obj); if (varObjName == "") { nameLayer = obj.Layer; int intPos = nameLayer.IndexOf("|"); nameLayer = nameLayer.Substring(intPos + 1); fStake.NameStakeObject = nameLayer; } else { nameLayer = "SIDEWALK"; fStake.ClassObj = "SIDEWALK"; fStake.NameStakeObject = "SIDEWALK"; } if (nameLayer.Contains("CURB")) { if (!testClass("CURB", nameLayer)) { return; } } else if (nameLayer.Contains("FL")) { if (!testClass("FL", nameLayer)) { return; } } else if (nameLayer.Contains("FTG") || nameLayer.Contains("FOOTING")) { if (!testClass("FTG", nameLayer)) { return; } } else if (nameLayer.Contains("SEWER")) { if (!testClass("SEWER", nameLayer)) { return; } } else if (nameLayer.Contains("SD")) { if (!testClass("SD", nameLayer)) { return; } } else if (nameLayer.Contains("WALL")) { if (!testClass("WALL", nameLayer)) { return; } } else if (nameLayer.Contains("WATER") || nameLayer.Contains("WAT") || nameLayer.Contains("WTR") || nameLayer.Contains("FIRE") || nameLayer.Contains("VERIZON") || nameLayer.Contains("ELEC") || nameLayer.Contains("CABLE") || nameLayer.Contains("PHONE") || nameLayer.Contains("TELE")) { if (!testClass("WTR", nameLayer)) { return; } } processAlign(nameLayer, idPolyGuideline); break; case "DbAlignment": List <POI> varPOI = new List <POI>(); Alignment objAlign = (Alignment)obj; idAlign = objAlign.ObjectId; fStake.ACTIVEALIGN = objAlign; nameLayer = string.Format("STAKE-{0}", objAlign.Name); Layer.manageLayers(nameLayer); idAlign.changeProp(nameLayer: nameLayer); fStake.HandleAlign = objAlign.Handle; fStake.objectID = idAlign; fStake.NameStakeObject = objAlign.Name; if (objAlign.Name.Contains("WALL")) { fStake.ClassObj = "WALL"; } else { fStake.ClassObj = "ALIGN"; } switch (fStake.ClassObj) { case "ALIGN": Stake_GetCardinals.getCardinals_Horizontal(idAlign, ref varPOI); Stake_GetNestedObjects.getNestedPoints(idAlign, ref varPOI, fStake.XRefDbModelSpace, Path.GetFileName(xRefPath.ToString())); Stake_GetCardinals.getCardinals_Vertical(idAlign, ref varPOI); // Call getNestedObjects(objAlign, varPOI) Stake_GetCardinals.getCrossingAligns(idAlign, ref varPOI); Stake_AddProfile.makeProfile(idAlign, varPOI, "STAKE", "ByLayout", false); Stake_GetBC_EC.getBC_EC(idAlign, ref varPOI); Stake_DuplicateStations.resolveDuplicateStations(ref varPOI); Stake_UpdateProfile.updateProfile(idAlign, varPOI, "STAKE", false, "STAKE"); Stake_UpdateProfile.updateProfile(idAlign, (fStake.POI_PNTs), "STAKE", true, "PNTS"); ResultBuffer rb = xRef.getXRefsContainingTargetDwgName("GCAL"); if (rb == null) { Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog("GCAL drawing not attached"); return; } TypedValue[] tvs = rb.AsArray(); string nameXRef = tvs[0].Value.ToString(); BlockTableRecord ms = xRef.getXRefBlockTableRecordMS(nameXRef); // If getNestedPoints(objAlign, varPOI, objXRefDbModelSpace, "GCAL") = False Then // Exit Sub // End If Debug.Print("After getNestedPoints"); for (int i = 0; i < varPOI.Count; i++) { Debug.Print(varPOI[i].Station + " " + varPOI[i].Desc0); } // Call makeProfileINVERT(objAlign, varPOI) fStake.POI_CALC = varPOI; //############################################################# ObjectId idTable = Stake_Table.makeTable(idAlign, varPOI); Stake_Table.addTableData(idTable, varPOI); break; case "WALL": Stake_Wall.processWall(idAlign); break; } break; default: break; } if (fStake.ClassObj != "BLDG") { TypedValue[] tvs = new TypedValue[2] { new TypedValue(1001, "CLASS"), new TypedValue(1000, fStake.ClassObj) }; idAlign.setXData(tvs, "CLASS"); } }
changeAlignStartPoint() { //BEGIN: UPDATE PROFILE, TABLE, AND POIs AlgnData algnData = new AlgnData(); ObjectId idAlign = ObjectId.Null; Alignment objAlign = null; if (selectAlignment(idAlign)) { objAlign = fStake.ACTIVEALIGN; } else { return; } objAlign = fStake.ACTIVEALIGN; AlignmentEntityCollection objAlignEnts = objAlign.Entities; //BEGIN: UPDATE PROFILE, TABLE, AND POIs double dblLenAlign = objAlign.Length; PromptStatus ps; Point3d varPnt = UserInput.getPoint("Select Desired Start Point", out ps, osMode: 0); double dblStation = 0, dblOffset = 0; idAlign.getAlignStaOffset(varPnt, ref dblStation, ref dblOffset); double dblStationStart = objAlign.StartingStation; double dblStationDelta = dblStation - dblStationStart; // if varPnt is out of range then dblStation returns ZERO Profile profFLOWLINE = Prof.getProfile(idAlign, "FLOwLINE"); ProfilePVICollection pvis = profFLOWLINE.PVIs; List <POI> varPOI_Temp = new List <POI>(); foreach (ProfilePVI pvi in pvis) { POI poi = new POI { Station = Math.roundDown3(pvi.Station), Elevation = pvi.Elevation }; varPOI_Temp.Add(poi); } Debug.Print("varPOI_Temp Before"); for (int i = 0; i < varPOI_Temp.Count; i++) { Debug.Print(varPOI_Temp[i].Station + " " + varPOI_Temp[i].Elevation); } //adjust POI_Temp stationing for (int i = 0; i < varPOI_Temp.Count; i++) { POI poi = varPOI_Temp[i]; if (poi.Station < dblStationDelta + dblStationStart) { poi.Station = Math.roundDown3(dblLenAlign + varPOI_Temp[i].Station); } else { poi.Station = Math.roundDown3(varPOI_Temp[i].Station - dblStationDelta); } varPOI_Temp[i] = poi; } List <POI> poiTmp = new List <POI>(); var sortPOI_Temp = from t in varPOI_Temp orderby t.Station ascending select t; foreach (var t in sortPOI_Temp) { poiTmp.Add(t); } varPOI_Temp = poiTmp; int k = varPOI_Temp.Count; POI poitemp = varPOI_Temp[k - 1]; poitemp.Elevation = varPOI_Temp[0].Elevation; varPOI_Temp[k] = poitemp; Debug.Print("varPOI_Temp After"); for (int i = 0; i < k; i++) { Debug.Print(varPOI_Temp[i].Station + " " + varPOI_Temp[i].Elevation); } //END: UPDATE PROFILE, TABLE, AND POIs ObjectId idPoly = objAlign.GetPolyline(); Polyline poly = (Polyline)idPoly.getEnt(); string strAlignName = objAlign.Name; AlgnData aData; for (int j = 1; j < fStake.algnData.Count; j++) { aData = fStake.algnData[j]; if (aData.AlignHandle == objAlign.Handle) { break; } } objAlign.ReferencePointStation = 100.0; foreach (AlignmentEntity ent in objAlignEnts) { objAlignEnts.Remove(ent); } List <Vertex2d> v2ds = Conv.poly_Vertex2dList(idPoly); int p = 0; foreach (Vertex2d v in v2ds) { if (v.Position.IsEqualTo(varPnt, new Tolerance(0, 0))) { break; } p++; } List <Vertex2d> v2dsNew = new List <Vertex2d>(); for (int i = p; i < v2ds.Count; i++) { v2dsNew.Add(v2ds[i]); } for (int i = 1; i < p; i++) { v2dsNew.Add(v2ds[i]); } v2dsNew.Add(v2ds[p]); int lngID = 0; Point3d dblPntBeg = Pub.pnt3dO, dblPntEnd = Pub.pnt3dO, dblPntMid = Pub.pnt3dO; for (int i = 1; i < v2dsNew.Count; i++) { if (v2dsNew[i].Bulge == 0) { dblPntBeg = v2dsNew[i - 1].Position; dblPntEnd = v2dsNew[i = 0].Position; AlignmentLine objAlignEntTan = objAlign.Entities.AddFixedLine(lngID, dblPntBeg, dblPntEnd); lngID = objAlignEntTan.EntityId; } else { dblPntBeg = v2dsNew[i - 1].Position; dblPntEnd = v2dsNew[i = 0].Position; int intDir = 0; if (v2dsNew[i - 1].Bulge > 0) { intDir = 1; } else { intDir = -1; } Arc arc = (Arc)Arc.Create(IntPtr.Zero, true); arc.StartPoint = dblPntBeg; arc.EndPoint = dblPntEnd; Point3d pnt3dMidLC = dblPntBeg.getMidPoint3d(dblPntEnd); double lenLC = dblPntBeg.getDistance(dblPntEnd); double dirLC = dblPntBeg.getDirection(dblPntEnd); double lenM = System.Math.Abs(lenLC / 2 * v2dsNew[i - 1].Bulge); dblPntMid = pnt3dMidLC.traverse(dirLC + System.Math.PI / 2 * intDir, lenM); AlignmentArc objAlignEntArc = objAlign.Entities.AddFixedCurve(lngID, dblPntBeg, dblPntMid, dblPntEnd); lngID = objAlignEntArc.EntityId; } } objAlign.Update(); objAlign.ReferencePoint = varPnt.Convert2d(BaseObjs.xyPlane); objAlign.ReferencePointStation = System.Math.Round(100.0 + dblStationDelta, 3); //BEGIN: UPDATE PROFILE, TABLE, AND POIs List <POI> varpoi = fStake.POI_CALC; //POIs are updated when selectAlignment is executed //ADJUST POI STATIONING //need complete POIs for descriptions for (int i = 0; i < varpoi.Count; i++) { if (varpoi[i].Station < dblStationDelta + dblStationStart) { varpoi[i].Station = Math.roundDown3(dblLenAlign + varpoi[i].Station); } else { varpoi[i].Station = Math.roundDown3(varpoi[i].Station - dblStationDelta); } } varpoi = varpoi.sortPOIbyStation(); int n = varpoi.Count; varpoi[0].DescX = "BEG " + varpoi[0].Desc0; varpoi[n - 2].DescX = varpoi[n - 2].DescX.Replace("END", "").Trim(); varpoi[n - 1].DescX = varpoi[n - 1].DescX.Replace("BEG", "END").Trim(); if (fStake.ClassObj == "CURB") { Stake_AddProfile.makeProfile(idAlign, varPOI_Temp, "CURB", "ByLayout", true); } ObjectId idTable = Stake_Table.makeTable(idAlign, varpoi); Stake_Table.addTableData(idTable, varpoi); if (Stake_GetBC_EC.getBC_EC(idAlign, ref varpoi) == false) { return; } fStake.POI_CALC = varpoi; //END: UPDATE PROFILE, TABLE, AND POIs }
public static void reverseAlign(ObjectId idAlign) { List <POI> varpoi = null; List <POI> varPOI_ORG = null; List <POI> varPOI_Temp = null; ProfilePVICollection objPVIs = null; string nameLayer = idAlign.getLayer(); TypedValue[] tvs = new TypedValue[9]; tvs.SetValue(new TypedValue((int)DxfCode.Operator, "<OR"), 0); tvs.SetValue(new TypedValue((int)DxfCode.Start, RXClass.GetClass(typeof(Polyline)).DxfName), 1); tvs.SetValue(new TypedValue((int)DxfCode.Start, RXClass.GetClass(typeof(Leader)).DxfName), 2); tvs.SetValue(new TypedValue((int)DxfCode.Start, RXClass.GetClass(typeof(DBText)).DxfName), 3); tvs.SetValue(new TypedValue((int)DxfCode.Start, RXClass.GetClass(typeof(MText)).DxfName), 4); tvs.SetValue(new TypedValue((int)DxfCode.Start, RXClass.GetClass(typeof(Circle)).DxfName), 5); tvs.SetValue(new TypedValue((int)DxfCode.Start, RXClass.GetClass(typeof(Dimension)).DxfName), 6); tvs.SetValue(new TypedValue((int)DxfCode.Operator, "OR>"), 7); tvs.SetValue(new TypedValue((int)DxfCode.LayerName, nameLayer), 8); SelectionSet ss = Select.buildSSet(tvs); ObjectId[] ids = ss.GetObjectIds(); foreach (ObjectId id in ids) { id.delete(); } Alignment objAlign = (Alignment)idAlign.getEnt(); double dblLenAlign = objAlign.Length; switch (fStake.ClassObj) { case "BLDG": Profile profCPNT = Prof.getProfile(idAlign, "CPNT"); objPVIs = profCPNT.PVIs; break; case "CURB": Profile profFLOWLINE = Prof.getProfile(idAlign, "FLOWLINE"); objPVIs = profFLOWLINE.PVIs; break; case "FL": profCPNT = Prof.getProfile(idAlign, "CPNT"); objPVIs = profCPNT.PVIs; break; case "SEWER": case "WTR": profCPNT = Prof.getProfile(idAlign, "CPNT"); objPVIs = profCPNT.PVIs; break; case "ALIGN": Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog("Object is an existing design alignment - exiting"); return; } int j = objPVIs.Count; for (int i = 0; i < j; i++) { varPOI_Temp[i].Station = Math.roundDown3(dblLenAlign - (objPVIs[i].Station - objAlign.StartingStation)) + objAlign.StartingStation; //starting station is always 100 varPOI_Temp[i].Elevation = objPVIs[i].Elevation; } objAlign.Reverse(); varpoi = fStake.POI_CALC; //reverse varPOI stationing //need all POIs for descriptions for (int i = 0; i < varpoi.Count; i++) { varpoi[i].Station = Math.roundDown3(dblLenAlign - (varpoi[i].Station - objAlign.StartingStation)) + objAlign.StartingStation; //starting station is always 100 varpoi[i].Side = varpoi[i].Side * -1; switch (varpoi[i].Desc0) { case "AP": if (varpoi[i].isRightHand) { varpoi[i].AngDir = varpoi[i].AngDir + varpoi[i].AngDelta; } else { varpoi[i].AngDir = varpoi[i].AngDir - varpoi[i].AngDelta; } varpoi[i].isRightHand = !varpoi[i].isRightHand; break; case "BC": varpoi[i].Desc0 = "EC"; varpoi[i].DescX = varpoi[i].DescX.Replace("BC", "EC"); break; case "EC": varpoi[i].Desc0 = "BC"; varpoi[i].DescX = varpoi[i].DescX.Replace("EC", "BC"); break; } } varPOI_ORG = fStake.POI_ORG; //reverse varPOI_ORG stationing //need all POIs for descriptions for (int i = 0; i < varPOI_ORG.Count; i++) { varPOI_ORG[i].Station = Math.roundDown3(dblLenAlign - (varPOI_ORG[i].Station - objAlign.StartingStation)) + objAlign.StartingStation; //starting station is always 100 } List <POI> poiTmp = new List <POI>(); var sortPOI = from p in varpoi orderby p.Station ascending select p; foreach (var p in sortPOI) { poiTmp.Add(p); } varpoi = poiTmp; poiTmp = new List <POI>(); var sortPOI_ORG = from n in varPOI_ORG orderby n.Station ascending select n; foreach (var n in sortPOI_ORG) { poiTmp.Add(n); } varPOI_ORG = poiTmp; poiTmp = new List <POI>(); var sortPOI_Temp = from t in varPOI_Temp orderby t.Station ascending select t; foreach (var t in sortPOI_Temp) { poiTmp.Add(t); } varPOI_Temp = poiTmp; j = varpoi.Count; varpoi[0].DescX = varpoi[0].DescX.Replace("END", "BEG"); varpoi[j].DescX = varpoi[j].DescX.Replace("BEG", "END"); ObjectId idTable = Stake_Table.getTableId(idAlign); Stake_Table.addTableData(idTable, varpoi); fStake.POI_CALC = varpoi; fStake.POI_ORG = varPOI_ORG; switch (fStake.ClassObj) { case "BLDG": Stake_AddProfile.makeProfile(idAlign, varPOI_Temp, "STAKE", "ByLayout", true); Stake_UpdateProfile.updateProfile(idAlign, (fStake.POI_ORG), "STAKE", true, "STAKE"); break; case "CURB": Stake_AddProfile.makeProfile(idAlign, varPOI_Temp, "CURB", "ByLayout", true); Stake_UpdateProfile.updateProfile(idAlign, (fStake.POI_ORG), "FLOWLINE", true, "ORG"); break; case "FL": Stake_AddProfile.makeProfile(idAlign, varPOI_Temp, "FLOWLINE", "BySurface", true); Stake_UpdateProfile.updateProfile(idAlign, (fStake.POI_ORG), "STAKE", true, "ORG"); break; case "WTR": Stake_AddProfile.makeProfile(idAlign, varPOI_Temp, "STAKE", "BySurface", true); Stake_UpdateProfile.updateProfile(idAlign, (fStake.POI_ORG), "CPNT", true, "ORG"); Stake_UpdateProfile.updateProfile(idAlign, varpoi, "STAKE", false, "STAKE"); break; } }
processSewer(string nameLayer, ObjectId idPolyGuideline, BlockTableRecord ms, string nameXRef, ref List <POI> varPOI, out ObjectId idAlign) { List <Point3d> pnts3d = idPolyGuideline.getCoordinates3dList(); Alignment align = null; string nameAlign = ""; idAlign = ObjectId.Null; if (pnts3d.Count == 1) { DialogResult varResponse = System.Windows.Forms.MessageBox.Show("Single segment selected!!\n\n" + "Proceed with single segment?\n", "SINGLE SEGMENT SELECTED", MessageBoxButtons.YesNo); switch (varResponse) { case DialogResult.Yes: nameAlign = Align.getAlignName(nameLayer); align = Align.addAlignmentFromPoly(nameAlign, nameLayer, idPolyGuideline, "Standard", "Standard", true); fStake.ACTIVEALIGN = align; idAlign = align.ObjectId; fStake.objectID = idAlign; break; case DialogResult.No: varResponse = System.Windows.Forms.MessageBox.Show("Create Alignment?\n", "CREATE ALIGNMENT", MessageBoxButtons.YesNo); switch (varResponse) { case DialogResult.Yes: Stake_Algn.createNewAlign(nameLayer); idPolyGuideline.delete(); break; case DialogResult.No: idPolyGuideline.delete(); break; } break; } } else { nameAlign = Align.getAlignName(nameLayer); align = Align.addAlignmentFromPoly(nameAlign, nameLayer, idPolyGuideline, "Standard", "Standard", true); fStake.ACTIVEALIGN = align; idAlign = align.ObjectId; fStake.objectID = idAlign; } fStake.HandleAlign = idAlign.getHandle(); fStake.NameStakeObject = nameAlign; Stake_GetCardinals.getCardinals_Horizontal(idAlign, ref varPOI); Stake_GetNestedObjects.getNestedPoints(idAlign, ref varPOI, ms, nameXRef); Stake_GetCardinals.getCrossingAligns(idAlign, ref varPOI); fStake.POI_ORG = varPOI; Stake_GetCardinals.getCardinals_Vertical(idAlign, ref varPOI); Stake_AddProfile.makeProfile(idAlign, varPOI, "STAKE", "ByLayout", false); Stake_GetBC_EC.getBC_EC(idAlign, ref varPOI); Stake_DuplicateStations.resolveDuplicateStations(ref varPOI); Stake_UpdateProfile.updateProfile(idAlign, varPOI, "STAKE", false, "STAKE"); Stake_UpdateProfile.updateProfile(idAlign, fStake.POI_PNTs, "STAKE", true, "PNTS"); }
modifyStaking(List <POI> varpoi) { Alignment objAlign = fStake.ACTIVEALIGN; ObjectId idAlign = objAlign.ObjectId; List <POI> varPOIadd = new List <POI>(); if (Stake_GetCardinals.userAddCrossingsFeatures(idAlign, ref varPOIadd)) { switch (fStake.ClassObj) { case "WTR": Stake_GetSurfaceElev.getSurfaceElevations(idAlign, ref varPOIadd); break; case "ALIGN": case "SEWER": Stake_GetSurfaceElev.getProfileElevations(idAlign, "STAKE", ref varPOIadd); break; } for (int i = 0; i <= varPOIadd.Count; i++) { varpoi.Add(varPOIadd[i]); } var sortSta = from s in varpoi orderby s.Station ascending select s; List <POI> poitmp = new List <POI>(); foreach (var s in sortSta) { poitmp.Add(s); } varpoi = poitmp; Stake_AddProfile.makeProfile(idAlign, varpoi, "STAKE", "ByLayout", true); switch (fStake.ClassObj) { case "ALIGN": case "SEWER": Stake_UpdateProfile.updateProfile(idAlign, varpoi, "STAKE", false, "STAKE"); break; } List <AlgnData> algnData = fStake.algnData; AlgnData aData = new AlgnData(); Table objTable = null; for (int i = 1; i < algnData.Count; i++) { aData = algnData[i]; if (aData.AlignHandle == objAlign.Handle) { objTable = (Table)aData.TableHandle.getEnt(); objTable.ObjectId.delete(); break; } } ObjectId idTable = Stake_Table.makeTable(idAlign, varpoi, aData); Stake_Table.addTableData(idTable, varpoi); } return(varpoi); }