A single data record for a Part object.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 10.3.488.0

Syntax

C#
public sealed class PartDataRecord : IDisposable
Visual Basic
Public NotInheritable Class PartDataRecord _
	Implements IDisposable
Visual C++
public ref class PartDataRecord sealed : IDisposable

Remarks

To edit the value of a PartDataField, you must open the Part (Pipe or Structure) for write, get a reference to the Part object's PartData property (type PartDataRecord), modify the PartDatafield value, and then re-set the Part's PartData. See the example code. A similar procedure is required for editing a PartSize. See the example code for PartSize for a sample.

Examples

CopyC#
 1[CommandMethod("pipemann")]
 2public void getPipeManning () {
 3    Autodesk.AutoCAD.EditorInput.Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
 4    PromptEntityOptions opt = new PromptEntityOptions("\nSelect a Pipe");
 5    opt.SetRejectMessage("\nObject must be a pipe.");
 6    opt.AddAllowedClass(typeof(Pipe), false);
 7    ObjectId pipeID = ed.GetEntity(opt).ObjectId;
 8
 9    CivilDocument doc = CivilApplication.ActiveDocument;
10
11    using ( Transaction ts = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction() ) {
12        Pipe PipeEle = ts.GetObject(pipeID, OpenMode.ForWrite) as Pipe;
13        // Save a reference to the PartData to restore later:
14        PartDataRecord record = PipeEle.PartData;
15        // Get a copy of the data:
16        PartDataField PartDataFld = record.GetDataFieldBy(PartContextType.FlowAnalysisManning);
17        // Change the inner data of the copy:
18        PartDataFld.Value = 0.44;
19        // Re-set the PartData property.  The data will not be updated without this step.
20        PipeEle.PartData = record;
21        ed.WriteMessage("Manning value is now: {0}", PartDataFld.Value);
22        ts.Commit();
23    }
24}

Inheritance Hierarchy

System..::..Object
  Autodesk.Civil.DatabaseServices..::..PartDataRecord

See Also