SurfaceDefinitionBreaklinesAddProximityBreaklines(ObjectIdCollection, Double) Method

Adds proximity breaklines to a surface from an ObjectId collection.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
Syntax
public SurfaceOperationAddBreakline AddProximityBreaklines(
	ObjectIdCollection breaklineEntities,
	double midOrdinateDistance
)

Parameters

breaklineEntities  ObjectIdCollection
A collection of entity ObjectIds used to create breaklines.
midOrdinateDistance  Double
When the breakline is defined from a polyline with curves, the midOrdinateDistance value is used to tessellate the arcs in the polyline.

Return Value

SurfaceOperationAddBreakline
Exceptions
ExceptionCondition
ArgumentException Thrown when:
  1. There is an invalid ObjectId in breaklineEntities.
  2. midOrdinateDistance <= 0.0.
Remarks
This method creates proximity breaklines that reference surface points in proximity to the vertices of the breaklineEntities as the breakline.
Example
C#
 1/// <summary>
 2/// Illustrates creating breaklines
 3/// </summary>
 4[CommandMethod("SurfaceBreaklines")]
 5public void SurfaceBreaklines()
 6{
 7    using (Transaction ts = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction())
 8    {
 9        // Prompt the user to select a TIN surface and a polyline, and create a breakline from the polyline
10
11        ObjectId surfaceId = promptForEntity("Select a TIN surface to add a breakline to", typeof(TinSurface));
12        ObjectId lineId = promptForEntity("Select a 3D polyline to use as the breakline", typeof(Polyline3d));
13        TinSurface oSurface = surfaceId.GetObject(OpenMode.ForWrite) as TinSurface;
14        ObjectId[] lines = { lineId };
15
16        PromptKeywordOptions pKeyOpts = new PromptKeywordOptions("");
17        pKeyOpts.Message = "\nEnter the type of breakline to create: ";
18        pKeyOpts.Keywords.Add("Standard");
19        pKeyOpts.Keywords.Add("Non-Destructive");
20        pKeyOpts.Keywords.Add("Proximity");
21        pKeyOpts.Keywords.Default = "Standard";
22        pKeyOpts.AllowNone = true;
23        PromptResult pKeyRes = editor.GetKeywords(pKeyOpts);
24
25        try
26        {
27            switch (pKeyRes.StringResult)
28            {
29                case "Non-Destructive":
30                    oSurface.BreaklinesDefinition.AddNonDestructiveBreaklines(new ObjectIdCollection(lines), 1);
31                    break;
32                case "Proximity":
33                    oSurface.BreaklinesDefinition.AddProximityBreaklines(new ObjectIdCollection(lines), 1);
34                    break;
35                case "Standard":
36                default:
37                    oSurface.BreaklinesDefinition.AddStandardBreaklines(new ObjectIdCollection(lines), 10, 5, 5, 0);
38                    break;
39            }
40        }
41
42        catch (System.Exception e)
43        {
44            editor.WriteMessage("Operation failed: {0}", e.Message);
45        }
46
47        // commit the transaction
48        ts.Commit();
49    }
50}
See Also