← Inbox

C3D-0404 · Create HCWA property-line family layers (skip existing) [C3D-PROPLAYERS] done

Creates the 8 HCWA property-line layers from the As-built CAD Standards PDF - LAND_LOT_LINE, LAND_LOT_LINE_TEXT, LOT_NUMBER_TEXT, PROJECT_BOUNDARY, PROJECT_BOUNDARY_TEXT, PROPERTY_LINE, ROAD_RIGHT-OF-WAY, ROAD_RIGHT-OF-WAY_TEXT - skipping any already present. Verifies all 8 exist.

Script file
C3D-0404.cs
Target
ACAD-260612-C-Store As-Built 60 H2O wPROFILE.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
120s

C# payload

// Create the HCWA property-line family layers (exact names from the standard). Skip any already
// present. Colours matched to what the drawing uses per discipline where a sibling exists,
// else a sensible default; the standard specifies names + type, not colour.
Log("drawing: " + Db.Filename);
var lt = (LayerTable)Tx.GetObject(Db.LayerTableId, OpenMode.ForWrite);

// name -> ACI colour
var want = new (string name, short color)[] {
    ("LAND_LOT_LINE",           7),
    ("LAND_LOT_LINE_TEXT",      7),
    ("LOT_NUMBER_TEXT",         7),
    ("PROJECT_BOUNDARY",        3),
    ("PROJECT_BOUNDARY_TEXT",   7),
    ("PROPERTY_LINE",           7),
    ("ROAD_RIGHT-OF-WAY",       6),
    ("ROAD_RIGHT-OF-WAY_TEXT",  7),
};

int created=0, existed=0;
foreach (var w in want){
    if (lt.Has(w.name)){ existed++; Log("  exists: " + w.name); continue; }
    var l=new LayerTableRecord();
    l.Name=w.name;
    l.Color=Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByAci, w.color);
    lt.Add(l); Tx.AddNewlyCreatedDBObject(l,true);
    created++; Log("  created: " + w.name + " (color " + w.color + ")");
}
Log("");
Log(string.Format("created {0}, already existed {1}", created, existed));
// verify all 8 now present
int missing=0; foreach (var w in want) if(!lt.Has(w.name)){ missing++; Log("  STILL MISSING: " + w.name); }
Log("VERIFY: all 8 present = " + (missing==0));

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260613 - 5030 E Lake Pkwy, Stockbridge, GA 30281, USA\ACAD-260612-C-Store As-Built 60 H2O wPROFILE.dwg
Message
Executed C3D-0404 (0 entities touched).
Entities
Duration
443 ms
Civil 3D
25.0.0.0

Log

drawing: C:\Users\sanja\OneDrive\_SurveyDisco\260613 - 5030 E Lake Pkwy, Stockbridge, GA 30281, USA\ACAD-260612-C-Store As-Built 60 H2O wPROFILE.dwg
  exists: LAND_LOT_LINE
  exists: LAND_LOT_LINE_TEXT
  created: LOT_NUMBER_TEXT (color 7)
  created: PROJECT_BOUNDARY (color 3)
  created: PROJECT_BOUNDARY_TEXT (color 7)
  created: PROPERTY_LINE (color 7)
  exists: ROAD_RIGHT-OF-WAY
  created: ROAD_RIGHT-OF-WAY_TEXT (color 7)

created 5, already existed 3
VERIFY: all 8 present = True

Notes

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

No notes yet.