← Inbox

C3D-0052 · READ-ONLY: the 4 ParcelSegments on C-PROP-LINE and their styles [PSEG-CPROP] error

A ParcelSegment layer is driven by the parcel style, which is why setting it in Properties reverts on regen. Lists each C-PROP-LINE segment with endpoints, owning parcel/site and style, plus every parcel with its site, layer and style. No changes.

Script file
C3D-0052.cs
Target
260612 · model space
Author
claude
Approved
yes · reviewer
Timeout
180s

C# payload

// READ-ONLY. The 4 ParcelSegments on C-PROP-LINE will not stay on a new layer - the layer is
// driven by the parcel STYLE, not the entity, so Properties gets overwritten on regen.
//
// Report each segment: its handle, endpoints, length, which parcel/site owns it, and the STYLE
// that is forcing the layer. Also print what each style's display settings actually say, since
// the style is what has to change (or the segment has to move to a parcel using another style).
// Nothing is modified.
var civil = CivilApplication.ActiveDocument;
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForRead);

Log("=== ParcelSegments on C-PROP-LINE ===");
foreach (ObjectId id in ms) {
    var ps = Tx.GetObject(id, OpenMode.ForRead) as ParcelSegment;
    if (ps == null) continue;
    if (ps.Layer != "C-PROP-LINE") continue;

    Log("");
    Log("SEGMENT [" + ps.Handle + "]  layer=" + ps.Layer);
    Log(String.Format("   start {0:F2},{1:F2}   end {2:F2},{3:F2}",
        ps.StartPoint.X, ps.StartPoint.Y, ps.EndPoint.X, ps.EndPoint.Y));
    try { Log("   StyleName  " + ps.StyleName); } catch (System.Exception ex) { Log("   StyleName: " + ex.Message); }
    try { Log("   StyleId    " + ps.StyleId); } catch { }
    try { Log("   Description " + ps.Description); } catch { }
    try { Log("   BaseCurve  " + ps.BaseCurve.GetType().Name); } catch { }
}

Log("");
Log("=== every parcel, its site and its style ===");
foreach (ObjectId sid in civil.GetSiteIds()) {
    var site = (Site)Tx.GetObject(sid, OpenMode.ForRead);
    foreach (ObjectId pid in site.GetParcelIds()) {
        var p = (Parcel)Tx.GetObject(pid, OpenMode.ForRead);
        string st = "?";
        try { st = p.StyleName; } catch { }
        Log(String.Format("   site \"{0}\"  parcel \"{1}\" [{2}]  layer={3}  style={4}  area={5:F2}",
            site.Name, p.Name, p.ObjectId.Handle, p.Layer, st, p.Area));
    }
}

Result

Status
error
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260613 - 5030 E Lake Pkwy, Stockbridge, GA 30281, USA\260612 - CSTORE WATER ABS 30.dwg
Message
eNotApplicable
Entities
Duration
380 ms
Civil 3D
25.0.0.0

Log

=== ParcelSegments on C-PROP-LINE ===

SEGMENT [101C9]  layer=C-PROP-LINE

Notes

What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.

No notes yet.