public static MapValue ReadComponentOffsetX(BlockReference br, System.Data.DataTable fjvTable) { Matrix3d transform = br.BlockTransform; Matrix3d inverseTransform = transform.Inverse(); br.TransformBy(inverseTransform); Extents3d bbox = br.Bounds.GetValueOrDefault(); br.TransformBy(transform); double value = (bbox.MinPoint.X + bbox.MaxPoint.X) / 2; //Debug if (ReadComponentFlipState(br) != "_PP") { prdDbg(br.Handle.ToString() + ": " + ReadComponentFlipState(br)); } //Debug switch (ReadComponentFlipState(br)) { case "_NP": value = value * -1; break; default: break; } return(new MapValue(value)); }
public static MapValue ReadComponentHeight(BlockReference br, System.Data.DataTable fjvTable) { Matrix3d transform = br.BlockTransform; Matrix3d inverseTransform = transform.Inverse(); br.TransformBy(inverseTransform); Extents3d bbox = br.Bounds.GetValueOrDefault(); br.TransformBy(transform); return(new MapValue(Math.Abs(bbox.MaxPoint.Y - bbox.MinPoint.Y))); }
public static double ReadComponentOffsetY(BlockReference br, System.Data.DataTable fjvTable) { Matrix3d transform = br.BlockTransform; Matrix3d inverseTransform = transform.Inverse(); br.TransformBy(inverseTransform); Extents3d bbox = br.Bounds.GetValueOrDefault(); br.TransformBy(transform); return(-(bbox.MinPoint.Y + bbox.MaxPoint.Y) / 2); }