SurfaceDefinitionBreaklinesAddNonDestructiveBreaklines(ObjectIdCollection, Double) Method |
Adds non-destructive breaklines to a surface from a collection of entities.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
Syntaxpublic SurfaceOperationAddBreakline AddNonDestructiveBreaklines(
ObjectIdCollection breaklineEntities,
double midOrdinateDistance
)
Public Function AddNonDestructiveBreaklines (
breaklineEntities As ObjectIdCollection,
midOrdinateDistance As Double
) As SurfaceOperationAddBreakline
public:
SurfaceOperationAddBreakline^ AddNonDestructiveBreaklines(
ObjectIdCollection^ breaklineEntities,
double midOrdinateDistance
)
Parameters
- breaklineEntities ObjectIdCollection
- A collection of ObjectIds for entities 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
ExceptionsException | Condition |
---|
ArgumentException |
Thrown when:
- There is an invalid ObjectId in the breaklineEntities collection.
- midOrdinateDistance <= 0.0.
|
Remarks
When defining a non-destructive breakline, surface points are created at each vertex of the object and at each intersection of a surface triangle edge and the non-destructive breakline object.
Example 1
2
3
4[CommandMethod("SurfaceBreaklines")]
5public void SurfaceBreaklines()
6{
7 using (Transaction ts = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction())
8 {
9
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
48 ts.Commit();
49 }
50}
See Also