Hello,
I have found issue with Alignments. If i copy and paste existing Alignment in C3D I will get additional Alignment with the same name in database without displaying in C3D Prospector Toolspace.
Even after deleting all Alignments from drawing I have still one "ghost" Alignment in database.
Here the code to get all Alignments from database:
[CommandMethod("AlignsList")] public static void AlignsList() { Document doc = Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; Editor ed = doc.Editor; CivilDocument civildoc = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument; List<Alignment> aligns = new List<Alignment>(); using (Transaction trans = db.TransactionManager.StartTransaction()) { ObjectIdCollection ids = civildoc.GetAlignmentIds(); foreach (ObjectId id in ids) { aligns.Add((Alignment)id.GetObject(OpenMode.ForRead)); } ed.WriteMessage("\nTotal Alignments: " + aligns.Count.ToString()); for (int i = 0; i < aligns.Count; i++) { ed.WriteMessage("\n [" + i + "] " + aligns[i].Name); } trans.Abort(); } }
PS. I have using C3D 2016 SP1
Solved! Go to Solution.
Solved by tyronebk. Go to Solution.
For this drawing - yes. But I have another drawing from other PC and its have ghost alignments always.
The alignment is likely embedded in a block. Purge all blocks from the drawing and my guess is that the "ghost" alignment will go with them.