← Inbox

C3D-0290 · Grand Springs: read the raster orientation values done

READ-ONLY. Dumps RasterImage.Orientation origin/axes, extents, rotation, scale and the definitions size and resolution, to place the FIRMette correctly.

Script file
C3D-0290.cs
Target
SS-23014S-The Grand Springs-Final Plat.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

// What does RasterImage.Orientation actually hold, and how does it map to the extents?
ObjectId id;
Db.TryGetObjectId(new Handle(Convert.ToInt64("3D5E", 16)), out id);
var ri = (RasterImage)Tx.GetObject(id, OpenMode.ForRead);
var o = ri.Orientation;
Log("Orientation.Origin : " + o.Origin.ToString());
Log("Orientation.Xaxis  : " + o.Xaxis.ToString() + "  len=" + o.Xaxis.Length.ToString("F5"));
Log("Orientation.Yaxis  : " + o.Yaxis.ToString() + "  len=" + o.Yaxis.Length.ToString("F5"));
var e = ri.GeometricExtents;
Log(string.Format("GeometricExtents   : ({0:F3},{1:F3})-({2:F3},{3:F3}) = {4:F3} x {5:F3}",
    e.MinPoint.X, e.MinPoint.Y, e.MaxPoint.X, e.MaxPoint.Y, e.MaxPoint.X-e.MinPoint.X, e.MaxPoint.Y-e.MinPoint.Y));
Log("Rotation           : " + ri.Rotation.ToString("F6"));
Log("Scale              : " + ri.Scale.ToString());
Log("ImageWidth/Height  : " + ri.ImageWidth + " x " + ri.ImageHeight);
var d = (RasterImageDef)Tx.GetObject(ri.ImageDefId, OpenMode.ForRead);
Log("def.Size           : " + d.Size.ToString());
Log("def.ResolutionMMPerPixel : " + d.ResolutionMMPerPixel.ToString());

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260706 - 3460 Mathis Airport Pkwy, Suwanee, GA 30024, USA\Final plat\SS-23014S-The Grand Springs-Final Plat.dwg
Message
Executed C3D-0290 (0 entities touched).
Entities
Duration
400 ms
Civil 3D
25.0.0.0

Log

Orientation.Origin : (45.388152790126895,3.1425899811303424,0)
Orientation.Xaxis  : (7.251406861756379,0,0)  len=7.25141
Orientation.Yaxis  : (0,5.603359847720839,0)  len=5.60336
GeometricExtents   : (45.388,3.143)-(52.640,8.746) = 7.251 x 5.603
Rotation           : 0.000000
Scale              : (7.251406861756379,7.251406861756379)
ImageWidth/Height  : 1056 x 816
def.Size           : (1056,816)
def.ResolutionMMPerPixel : (0.00022727272727272727,0.00022727272727272727)

Notes

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

No notes yet.