C3D-0620 · What is inside the 3 giant circles (read-only) done
Read-only: count model-space objects (by layer/type) whose centre falls inside each of the 3 V-NODE-STRM circles 4AC89/4AC8A/4AC8B.
C# payload
var ms=(BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db),OpenMode.ForRead);
var cs=new List<Circle>(); foreach(var hs in new[]{"4AC89","4AC8A","4AC8B"}){ ObjectId i; Db.TryGetObjectId(new Handle(Convert.ToInt64(hs,16)),out i); cs.Add((Circle)Tx.GetObject(i,OpenMode.ForRead)); }
var tally=cs.Select(c=>new SortedDictionary<string,int>()).ToList();
foreach(ObjectId id in ms){ var en=Tx.GetObject(id,OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity; if(en==null||en is Circle&&cs.Any(c=>c.ObjectId==id)) continue;
Point3d m; try{ var e=en.GeometricExtents; m=new Point3d((e.MinPoint.X+e.MaxPoint.X)/2,(e.MinPoint.Y+e.MaxPoint.Y)/2,0);}catch{continue;}
for(int k=0;k<3;k++){ var c=cs[k]; if(new Point3d(c.Center.X,c.Center.Y,0).DistanceTo(m)<=c.Radius){ var key=en.Layer+" "+en.GetType().Name; tally[k][key]=tally[k].ContainsKey(key)?tally[k][key]+1:1; } } }
for(int k=0;k<3;k++){ Log("=== circle h="+cs[k].Handle+" r="+cs[k].Radius.ToString("F0")+" total="+tally[k].Values.Sum()); foreach(var kv in tally[k].OrderByDescending(x=>x.Value).Take(15)) Log(" "+kv.Key+" x"+kv.Value); }
Result
Log
=== circle h=4AC89 r=463 total=12301
PDF3_Geometry Polyline x10815
PDF3_Solid Fills Hatch x883
PDF3_Geometry Arc x241
PDF3_Text MText x174
PDF3_Geometry Circle x108
PDF3_Solid Fills Solid x34
PDF3_Geometry Ellipse x25
PDF3_Geometry Spline x20
PDF3_Images RasterImage x1
=== circle h=4AC8A r=400 total=7690
PDF4_Geometry Polyline x5960
PDF4_Solid Fills Hatch x833
PDF4_Text MText x519
PDF4_Geometry Arc x195
PDF4_Geometry Circle x72
PDF4_Solid Fills Solid x71
PDF4_Geometry Spline x20
PDF4_Geometry Ellipse x17
PDF4_Images RasterImage x3
=== circle h=4AC8B r=298 total=9698
PDF5_Geometry Polyline x8353
PDF5_Solid Fills Hatch x866
PDF5_Geometry Arc x194
PDF5_Text MText x107
PDF5_Geometry Ellipse x73
PDF5_Solid Fills Solid x50
PDF5_Geometry Circle x39
PDF5_Geometry Spline x16Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.