← Inbox

C3D-0524 · Read SS_BLOCK_17X11 def + 22 sheets (read-only) [C3D-0525] done

Dump SS_BLOCK_17X11 definition geometry and block refs/page setup on COVER, 17X11, and the two 22 layouts.

Script file
C3D-0524.cs
Target
260714 - 285 Huckaby Rd 22x17.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload


string F(double d){ return d.ToString("F3"); }
var bt=(BlockTable)Tx.GetObject(Db.BlockTableId,OpenMode.ForRead);
var def=(BlockTableRecord)Tx.GetObject(bt["SS_BLOCK_17X11"],OpenMode.ForRead);
Log("=== DEF SS_BLOCK_17X11 origin="+def.Origin+" ===");
foreach(ObjectId eid in def){ var o=Tx.GetObject(eid,OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity; if(o==null) continue;
  string t=o.GetType().Name; string d="";
  if(o is Line l) d=F(l.StartPoint.X)+","+F(l.StartPoint.Y)+" -> "+F(l.EndPoint.X)+","+F(l.EndPoint.Y);
  else if(o is Polyline p){ var sb=new System.Text.StringBuilder("v="+p.NumberOfVertices+" cl="+p.Closed+" "); for(int i=0;i<p.NumberOfVertices;i++){var q=p.GetPoint2dAt(i); sb.Append(F(q.X)+","+F(q.Y)+" ");} d=sb.ToString(); }
  else if(o is AttributeDefinition ad) d=ad.Tag+" @"+F(ad.Position.X)+","+F(ad.Position.Y)+" h="+F(ad.Height)+" just="+ad.Justify;
  else if(o is DBText tx) d="'"+tx.TextString+"' @"+F(tx.Position.X)+","+F(tx.Position.Y)+" h="+F(tx.Height);
  else if(o is MText mt) d="'"+(mt.Text.Length>40?mt.Text.Substring(0,40):mt.Text).Replace("\n"," ").Replace("\r"," ")+"' @"+F(mt.Location.X)+","+F(mt.Location.Y);
  else { try{ var e=o.GeometricExtents; d="ext "+F(e.MinPoint.X)+","+F(e.MinPoint.Y)+" -> "+F(e.MaxPoint.X)+","+F(e.MaxPoint.Y);}catch{} }
  if(o is BlockReference nb){ var nd=(BlockTableRecord)Tx.GetObject(nb.BlockTableRecord,OpenMode.ForRead); d="nested "+nd.Name+" @"+F(nb.Position.X)+","+F(nb.Position.Y)+" sc="+F(nb.ScaleFactors.X); }
  Log(t+" h="+o.Handle+" ["+o.Layer+"] "+d);
}
var lm=(DBDictionary)Tx.GetObject(Db.LayoutDictionaryId,OpenMode.ForRead);
foreach(System.Collections.DictionaryEntry de in lm){ string ln=(string)de.Key; if(!(ln.Contains("22")||ln=="COVER"||ln=="17X11")) continue;
  var lay=(Layout)Tx.GetObject((ObjectId)de.Value,OpenMode.ForRead);
  Log("=== LAYOUT "+ln+" media="+lay.CanonicalMediaName+" rot="+lay.PlotRotation+" paper="+F(lay.PlotPaperSize.X/25.4)+"x"+F(lay.PlotPaperSize.Y/25.4)+" margins LL="+F(lay.PlotPaperMargins.MinPoint.X/25.4)+","+F(lay.PlotPaperMargins.MinPoint.Y/25.4)+" ===");
  var ps=(BlockTableRecord)Tx.GetObject(lay.BlockTableRecordId,OpenMode.ForRead);
  foreach(ObjectId eid in ps){ if(eid.IsErased) continue; var br=Tx.GetObject(eid,OpenMode.ForRead) as BlockReference; if(br==null) continue; var bd=(BlockTableRecord)Tx.GetObject(br.BlockTableRecord,OpenMode.ForRead); string ex=""; try{var e=br.GeometricExtents; ex=" ext "+F(e.MinPoint.X)+","+F(e.MinPoint.Y)+" -> "+F(e.MaxPoint.X)+","+F(e.MaxPoint.Y);}catch{} Log("  BREF "+bd.Name+" h="+br.Handle+" @"+F(br.Position.X)+","+F(br.Position.Y)+" sc="+F(br.ScaleFactors.X)+" rot="+F(br.Rotation)+ex); }
}

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260714 - 285 Huckaby Rd, Brooks, GA 30205, USA\260714 - 285 Huckaby Rd 22x17.dwg
Message
Executed C3D-0524 (0 entities touched).
Entities
—
Duration
455 ms
Civil 3D
25.0.0.0

Log

=== DEF SS_BLOCK_17X11 origin=(0,0,0) ===
Line h=21076 [BLOCK_TB2] -6.536,0.041 -> -6.536,2.548
Line h=21077 [BLOCK_TB2] -16.299,10.300 -> -0.042,10.300
Line h=21078 [BLOCK_TB2] -16.340,10.340 -> 0.000,10.340
Line h=2107B [BLOCK_TB2] -16.297,1.674 -> -8.854,1.673
Line h=2107C [BLOCK_TB2] -16.297,1.421 -> -8.854,1.419
Line h=2107D [BLOCK_TB2] -16.297,1.167 -> -8.854,1.166
Line h=2107E [BLOCK_TB2] -16.297,0.913 -> -8.854,0.912
Line h=2107F [BLOCK_TB2] -16.297,1.928 -> -8.975,1.928
DBText h=21080 [BLOCK_TB2] 'SCALE: GRAPHIC' @-11.392,1.230 h=0.110
Line h=21081 [BLOCK_TB2] -13.856,1.674 -> -13.856,0.913
Line h=21082 [BLOCK_TB2] -8.975,1.928 -> -6.535,1.928
Line h=21083 [BLOCK_TB2] -16.297,2.548 -> -6.536,2.548
DBText h=21084 [BLOCK_TB2] 'PREPARED FOR:' @-16.258,2.427 h=0.072
Line h=21085 [BLOCK_TB2] -11.828,1.674 -> -11.828,0.913
Line h=21086 [BLOCK_TB2] -16.299,10.300 -> -16.297,0.041
Line h=21087 [BLOCK_TB2] -8.854,1.928 -> -8.854,0.041
Line h=21088 [BLOCK_TB2] -16.297,0.041 -> -0.042,0.041
Line h=21089 [BLOCK_TB2] -6.536,2.548 -> -16.297,2.548
Line h=2108A [BLOCK_TB2] 0.000,0.000 -> 0.000,10.340
Line h=2108B [BLOCK_TB2] -0.042,0.041 -> -0.042,10.300
Line h=2108C [BLOCK_TB2] -16.340,0.000 -> 0.000,0.000
Line h=2108D [BLOCK_TB2] -16.340,10.340 -> -16.340,0.000
DBText h=2108E [BLOCK_TB2] 'SAWHNEY & ASSOCIATES' @-14.704,0.562 h=0.223
DBText h=2108F [BLOCK_TB2] '523 HASTINGS WAY' @-14.292,0.355 h=0.099
DBText h=21090 [BLOCK_TB2] 'JONESBORO GA 30238' @-12.599,0.343 h=0.099
DBText h=21091 [BLOCK_TB2] 'PH.# (678)478-6857' @-13.441,0.221 h=0.077
Line h=21092 [BLOCK_TB2] -9.479,0.912 -> -9.479,0.041
Line h=21093 [BLOCK_TB2] -0.000,6.470 -> -0.000,10.300
AttributeDefinition h=21094 [BLOCK_TB2] JOB_NO @-11.394,1.000 h=0.110 just=BaseLeft
AttributeDefinition h=21095 [BLOCK_TB2] SITE_ADDRESS @-16.237,1.757 h=0.110 just=BaseLeft
AttributeDefinition h=21096 [BLOCK_TB2] REF_DB_PG @-16.233,0.988 h=0.110 just=BaseLeft
AttributeDefinition h=21097 [BLOCK_TB2] LAND_LOT @-13.822,1.505 h=0.110 just=BaseLeft
AttributeDefinition h=21098 [BLOCK_TB2] DISTRICT @-13.819,1.255 h=0.110 just=BaseLeft
AttributeDefinition h=21099 [BLOCK_TB2] COUNTY @-13.825,0.988 h=0.110 just=BaseLeft
AttributeDefinition h=2109A [BLOCK_TB2] DATE @-11.371,1.494 h=0.110 just=BaseLeft
AttributeDefinition h=2109B [BLOCK_TB2] SUBDIVISION_NAME_LOT @-11.360,1.740 h=0.110 just=BaseLeft
AttributeDefinition h=2109C [BLOCK_TB2] PREP_FOR @-16.189,2.103 h=0.141 just=BaseLeft
AttributeDefinition h=2109D [BLOCK_TB2] SURVEY_TYPE @-16.283,2.651 h=0.188 just=BaseLeft
MText h=2109E [BLOCK_NOTES_FLOOD] 'FLOOD NOTE:  THIS PROPERTY IS NOT LOCATE' @-9.468,2.899
AttributeDefinition h=2109F [BLOCK_NOTES_FLOOD] FIRM_PANEL @-9.466,2.590 h=0.052 just=BaseLeft
AttributeDefinition h=210A0 [BLOCK_NOTES_FLOOD] FIRM_DATE @-8.883,2.589 h=0.052 just=BaseLeft
AttributeDefinition h=210A1 [BLOCK_NOTES_FLOOD] FLOOD_ZONE @-7.590,2.588 h=0.052 just=BaseLeft
=== LAYOUT 17X11 media=ANSI_full_bleed_B_(17.00_x_11.00_Inches) rot=Degrees000 paper=17.000x11.000 margins LL=0.000,0.000 ===
  BREF SS_BLOCK_17X11 h=20E5D @16.670,0.330 sc=1.000 rot=0.000 ext 0.330,0.330 -> 16.670,10.670
  BREF SS_LEGEND h=20FB9 @13.720,1.075 sc=1.000 rot=0.000 ext 10.493,1.293 -> 13.197,4.501
  BREF SCALE200 h=2120A @13.054,0.738 sc=1.000 rot=0.000 ext 11.035,0.486 -> 15.143,0.987
=== LAYOUT 22X17 (2) media=ANSI_full_bleed_C_(22.00_x_17.00_Inches) rot=Degrees000 paper=22.000x17.000 margins LL=0.000,0.000 ===
  BREF SS_BLOCK_17X11 h=23735 @16.670,0.330 sc=1.000 rot=0.000 ext 0.330,0.330 -> 16.670,10.670
  BREF SS_LEGEND h=2387B @13.720,1.075 sc=1.000 rot=0.000 ext 10.493,1.293 -> 13.197,4.501
  BREF SCALE200 h=2387C @13.054,0.738 sc=1.000 rot=0.000 ext 11.035,0.486 -> 15.143,0.987
=== LAYOUT COVER media=ANSI_full_bleed_B_(17.00_x_11.00_Inches) rot=Degrees000 paper=17.000x11.000 margins LL=0.000,0.000 ===
  BREF SS_BLOCK_17X11 h=225B4 @16.670,0.330 sc=1.000 rot=0.000 ext 0.330,0.330 -> 16.670,10.670
  BREF SIGNATURE h=22D8B @-410.857,34.682 sc=0.543 rot=0.000 ext 40.989,5.746 -> 43.023,6.258
  BREF SIGNATURE h=22D8C @-412.848,35.433 sc=0.543 rot=0.000 ext 38.998,6.497 -> 41.032,7.010
=== LAYOUT COVER (22) media=ANSI_full_bleed_C_(22.00_x_17.00_Inches) rot=Degrees000 paper=22.000x17.000 margins LL=0.000,0.000 ===
  BREF SS_BLOCK_17X11 h=23891 @16.670,0.330 sc=1.000 rot=0.000 ext 0.330,0.330 -> 16.670,10.670

Notes

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

No notes yet.