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.
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
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.