Parcel represents a 2D closed area in Civil 3D, typically representing a plot of land or a right-of-way. Parcels are dynamic topological entities; they are automatically formed and updated by the geometry (Parcel Segments or Alignments) within their parent Site.
Autodesk.Civil.DatabaseServices
System.Object
└─ RXObject
└─ DBObject
└─ Entity
└─ Feature
└─ Parcel
| Property | Type | Description |
|---|---|---|
Area |
double |
Area of the parcel. |
Perimeter |
double |
Total perimeter. |
Name |
string |
Parcel name/number. |
Number |
int |
Automatic parcel number. |
SiteId |
ObjectId |
The site it belongs to. |
UserDefinedProperties |
UDP |
Custom property bucket. |
| Method | Return Type | Description |
|---|---|---|
Create(...) |
ObjectId |
Static methods to create from objects. |
CreateFromObjects(...) |
ObjectId |
Creates parcels from CAD polylines. |
using (Transaction tr = db.TransactionManager.StartTransaction())
{
ObjectId siteId = ...; // Get target Site
ObjectIdCollection polyIds = ...; // Polylines to convert
ObjectIdCollection createdParcels = Parcel.CreateFromObjects(
polyIds,
siteId,
db.CurrentSpaceId,
false // Erase existing entities?
);
ed.WriteMessage($"\nCreated {createdParcels.Count} parcels.");
tr.Commit();
}Parcel p = tr.GetObject(id, OpenMode.ForRead) as Parcel;
ed.WriteMessage($"\nParcel {p.Name}: Area = {p.Area:F2} sq ft");// Renumbering is usually a Site-level operation or done via properties
p.Name = "Lot " + p.Number;// Parcels don't own the geometry directly; they are defined BY segments.
// To get the shape, you might look at the base curves.// Civil 3D allows custom fields on Parcels (e.g., "Zoning", "Owner")
// Accessing these requires the UDP API (UserDefinedPropertyClassification)
// This is advanced and involves `Parcel.GetUserDefinedPropertyValue`.// If you draw an Alignment through this Parcel (in the same Site),
// The Parcel will split into two AUTOMATICALLY.
// The API reflects this: the original Parcel object usually shrinks,
// and a new Parcel object is created for the split piece.// Getting the "Legal Description" geometry
// Iterate segments...p.StyleId = newStyleId; // Change visual style (e.g., "Single-Family")
p.AreaLabelStyleId = newLabelStyleId; // Change label style- Topology Awareness: Remember that modifying ONE segment can affect TWO parcels (shared edge).
- Site Management: Ensure you are working in the correct Site. Parcels cannot exist without a Site.
- Automatic Updates: Because Parcels react to other geometry, GUIDs/IDs are stable, but geometry is volatile.