Example #1
0
        public void CreateNewAlignment(double station1, double station2)
        {
            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                ObjectId aligStyleId   = CivilApplication.ActiveDocument.Styles.AlignmentStyles["Basic"];
                ObjectId newAligIdTemp = Alignment.CreateOffsetAlignment("Temp", selectedALig.ObjectId, 1, aligStyleId, station1, station2);
                ObjectId newAligId     = Alignment.CreateOffsetAlignment(alignmentName, newAligIdTemp, -1, aligStyleId);
                Entity   item          = tr.GetObject(newAligIdTemp, OpenMode.ForWrite) as Entity;
                item.Erase();


                newAlig = tr.GetObject(newAligId, OpenMode.ForWrite) as Alignment;

                CreateProfil(station1, station2);

                tr.Commit();
            }
        }