← Inbox

C3D-CURBLAYERTYPES · Entity type breakdown on SS-V-ROAD-CURB done

Read-only: diagnose why erasing SS-V-ROAD-CURB entities failed with eNotApplicable.

Script file
C3D-CURBLAYERTYPES.cs
Target
active document · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

// READ-ONLY: what entity types are on SS-V-ROAD-CURB (90 found) - the erase failed with eNotApplicable
// on one of them, need to know which type(s) so we can handle/skip appropriately.
using System;
using System.Collections.Generic;
using System.Linq;
using Autodesk.AutoCAD.DatabaseServices;

const string LAYER = "SS-V-ROAD-CURB";

var byType = new Dictionary<string,int>();
foreach (ObjectId id in ModelSpace)
{
    var ent = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
    if (ent == null) continue;
    if (ent.Layer != LAYER) continue;
    var t = ent.GetType().FullName;
    byType[t] = byType.TryGetValue(t, out var c) ? c+1 : 1;
    if (ent.IsErased || !ent.IsWriteEnabled && false) {} // no-op, just placeholder for clarity
}
foreach (var kv in byType.OrderByDescending(k=>k.Value))
    Log($"{kv.Value,4}  {kv.Key}");

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260709 - 1512 Bass Rd, Macon, GA 31210, USA\260709 - 1512 Bass Rd.dwg
Message
Executed C3D-CURBLAYERTYPES (0 entities touched).
Entities
Duration
456 ms
Civil 3D
25.0.0.0

Log

  33  Autodesk.AutoCAD.DatabaseServices.Polyline3d
  18  Autodesk.AutoCAD.DatabaseServices.Line
  15  Autodesk.AutoCAD.DatabaseServices.Polyline
  11  Autodesk.Civil.DatabaseServices.FeatureLine
  10  Autodesk.AutoCAD.DatabaseServices.AlignedDimension
   1  Autodesk.Civil.DatabaseServices.Site
   1  Autodesk.AutoCAD.DatabaseServices.Hatch
   1  Autodesk.AutoCAD.DatabaseServices.Wipeout

Notes

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

No notes yet.