Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"Ghost" Alignments

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Alexey.Terno
766 Views, 4 Replies

"Ghost" Alignments

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.

2017-03-20_10-49-09.png2017-03-20_10-49-38.png

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

Tags (1)
4 REPLIES 4
Message 2 of 5
Jeff_M
in reply to: Alexey.Terno

When you save, close, reopen the dwg the ghost alignment goes away.
>>>GUESS<<< The ghost alignment may be the one held in memory due to the copy to clipboard.
Jeff_M, also a frequent Swamper
EESignature
Message 3 of 5
Alexey.Terno
in reply to: Jeff_M

For this drawing - yes. But I have another drawing from other PC and its have ghost alignments always.

Message 4 of 5
tyronebk
in reply to: Alexey.Terno

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.

Message 5 of 5
Alexey.Terno
in reply to: tyronebk

Yes - it's works!
Thank you!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report