← Inbox

C3D-0553 · Read soil PDF underlay placement + clip (read-only) done

Underlay 157DC position/scale/rotation/transform, clip boundary, extents, draw order index.

Script file
C3D-0553.cs
Target
260711 - 281 Maranatha Trail R2.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload


string F(double d){ return d.ToString("F6"); }
ObjectId uid; Db.TryGetObjectId(new Handle(Convert.ToInt64("157DC",16)),out uid);
var u=(PdfReference)Tx.GetObject(uid,OpenMode.ForRead);
var d=(PdfDefinition)Tx.GetObject(u.DefinitionId,OpenMode.ForRead);
Log("pos="+F(u.Position.X)+","+F(u.Position.Y)+" scale="+F(u.ScaleFactors.X)+","+F(u.ScaleFactors.Y)+" rot="+F(u.Rotation)+" normal="+u.Normal);
Log("def file="+d.SourceFileName+" active="+d.ActiveFileName+" item="+d.ItemName);
var m=u.Transform; var a=m.ToArray(); Log("transform="+string.Join(",",System.Array.ConvertAll(a,x=>x.ToString("R"))));
Log("isClipped="+u.IsClipped);
var cb=u.GetClipBoundary(); var sb=new System.Text.StringBuilder(); foreach(Point2d p in cb) sb.Append(F(p.X)+","+F(p.Y)+" "); Log("clip(n="+cb.Length+") "+sb);
var x=u.GeometricExtents; Log("ext "+F(x.MinPoint.X)+","+F(x.MinPoint.Y)+" -> "+F(x.MaxPoint.X)+","+F(x.MaxPoint.Y));
// draw order neighbours
var ms=(BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db),OpenMode.ForRead);
var dot=(DrawOrderTable)Tx.GetObject(ms.DrawOrderTableId,OpenMode.ForRead);
var full=dot.GetFullDrawOrder(0); int idx=-1; for(int i=0;i<full.Count;i++) if(full[i]==uid) idx=i; Log("draworder index "+idx+" of "+full.Count);
Log("INSUNITS="+Db.Insunits);

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260711 - 281 Maranatha Trail, Lawrenceville, GA 30045, USA\260711 - 281 Maranatha Trail R2.dwg
Message
Executed C3D-0553 (0 entities touched).
Entities
—
Duration
592 ms
Civil 3D
25.0.0.0

Log

pos=2358904.977781,1425342.185264 scale=50.449528,50.449528 rot=0.000000 normal=(0,0,1)
def file=.\SOIL 281 Maranatha Trail_lvl-3_Alveranga.pdf active=C:\Users\sanja\OneDrive\_SurveyDisco\260711 - 281 Maranatha Trail, Lawrenceville, GA 30045, USA\SOIL 281 Maranatha Trail_lvl-3_Alveranga.pdf item=1
transform=50.449527903459966,0,0,2358904.977780894,0,50.449527903459966,0,1425342.185264061,0,0,50.44952790335668,0,0,0,0,1
isClipped=True
clip(n=2) 0.842654,10.601468 14.262508,0.591022 
ext 2358947.489274,1425372.002032 -> 2359624.514600,1425877.024312
draworder index 0 of 2964
INSUNITS=Feet

Notes

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

No notes yet.