- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am dynamically creating alignments in Civil 3D based on some self-defined objects. These objects contain all the information needed to create an alignment as well as the respective entities such as lines, arcs, and spirals.
In a first step I create my alignment (This alignment perfectly shows in Civil 3D):
var civilDatabase = Application.DocumentManager.MdiActiveDocument.Database; var civilDocument = CivilApplication.ActiveDocument; var civilAlignmentId = Alignment.Create("My Aligment (1)", "", "C-ROAD", "Proposed", "All Labels");
Then I open the transaction manager and pass my priorly created alignment ID to get the actual alignment:
using (Transaction civilTransactionManager = civilDatabase.TransactionManager.StartTransaction()) {
var civilAlignment = (Alignment)civilTransactionManager.GetObject(civilAlignmentId, OpenMode.ForWrite);
In the following steps, I want to add the entities to the alignment. Because this did not work, I tried using the example from https://knowledge.autodesk.com/support/autocad-civil-3d/learn-explore/caas/CloudHelp/cloudhelp/2017/... to just create one simple entity looking like the following:
Int32 previousEntityId = 0; Point3d startPoint = new Point3d(8800.7906, 13098.1946, 0.0000); Point3d middlePoint = new Point3d(8841.9624, 13108.6382, 0.0000); Point3d endPoint = new Point3d(8874.2664, 13089.3333, 0.0000); AlignmentArc retVal = myAlignment.Entities.AddFixedCurve(previousEntityId, startPoint, middlePoint, endPoint);
However, this is when I am failing. The arc never shows in Civil 3D. I also tried the same with a line, but it does not show either. Am I missing a step here?
Regards,
Felix
Solved! Go to Solution.