addProfileView(ObjectId idAlign, Point3d pnt3dIns, ObjectId idProfileViewBandSet, ObjectId idProfileViewStyle) { ProfileView pview = null; try { using (Transaction tr = BaseObjs.startTransactionDb()) { Alignment align = (Alignment)tr.GetObject(idAlign, OpenMode.ForRead); //ObjectId id = ProfileView.Create(idAlign, pnt3dIns, align.Name, idProfileViewBandSet, idProfileViewStyle); ObjectId id = ProfileView.Create(BaseObjs._civDoc, idAlign.getAlignName(), idProfileViewBandSet, idAlign, pnt3dIns); pview = (ProfileView)tr.GetObject(id, OpenMode.ForWrite); pview.Layer = align.Layer; pview.StyleId = idProfileViewStyle; //pview.StationStart = align.StartingStation; //pview.StationEnd = align.EndingStation; tr.Commit(); } } catch (System.Exception ex) { BaseObjs.writeDebug(string.Format("{0} Prof.cs: line: 138", ex.Message)); } return(pview); }
addProfileView(ObjectId alignID, Point3d pnt3dIns) { ObjectId id = ProfileView.Create(alignID, pnt3dIns); ProfileView pview = null; try { using (Transaction tr = BaseObjs.startTransactionDb()) { pview = (ProfileView)tr.GetObject(id, OpenMode.ForRead); tr.Commit(); } } catch (System.Exception ex) { BaseObjs.writeDebug(string.Format("{0} Prof.cs: line: 118", ex.Message)); } return(pview); }