NetworkAddLinePipe Method

Add a line pipe by using the geometry information of an input line.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
Syntax
public void AddLinePipe(
	ObjectId pipeFamilyId,
	ObjectId pipeSizeId,
	LineSegment3d line,
	ref ObjectId newPipeId,
	bool applyRules
)

Parameters

pipeFamilyId  ObjectId
Pipe family id.
pipeSizeId  ObjectId
Object id of the Pipe Size.
line  LineSegment3d
The line which supplies the geometry information.
newPipeId  ObjectId
Returns the object id of the added new pipe.
applyRules  Boolean
Returns whether the method needed to apply rules.
Example
C#
 1ObjectIdCollection oIdCollection = doc.GetPipeNetworkIds();
 2// Get the first network in the document
 3ObjectId objId = oIdCollection[0];
 4Network oNetwork = ts.GetObject(objId, OpenMode.ForWrite) as Network;
 5ed.WriteMessage("Pipe Network: {0}\n", oNetwork.Name);
 6// Go through the list of part types and select the first pipe found
 7ObjectId pid = oNetwork.PartsListId;
 8PartsList pl = ts.GetObject(pid, OpenMode.ForWrite) as PartsList;
 9
10ObjectId oid = pl["Concrete Pipe"];
11PartFamily pfa = ts.GetObject(oid, OpenMode.ForWrite) as PartFamily;
12ObjectId psize = pfa[0];
13LineSegment3d line = new LineSegment3d(new Point3d(30, 9, 0), new Point3d(33, 7, 0));
14ObjectIdCollection col = oNetwork.GetPipeIds();
15ObjectId oidNewPipe = ObjectId.Null;
16
17oNetwork.AddLinePipe(oid, psize, line, ref oidNewPipe, false);
18Pipe oNewPipe = ts.GetObject(oidNewPipe, OpenMode.ForRead) as Pipe;
19ed.WriteMessage("Pipe created: {0}\n", oNewPipe.DisplayName);
20ts.Commit();
See Also