Some trouble on LinearDimension.GetBoundingBox, specialy if the Lineardimension is horizontal. It look to be ok if it is vertical.
To test use the sample Add Linear Dimension2 and ask the Boundingbox.
Hi Alain,
Thanks to have a look
In my plugins the trouble is only with horizontal dimension, It look ok for the vertical.
When I test with the sample it is the same problem, it alway stick on 0 with the X or the Y axis.
Point3d origin = new Point3d(1, 1, 0);
Point3d offset = new Point3d(11, 1, 0);
Point3d pt = new Point3d((offset.X - origin.X) / 2, 3, 0);
Plane plane = Plane.WorldXY;
plane.Origin = origin;
double u, v;
plane.ClosestParameter(origin, out u, out v);
Point2d ext1 = new Point2d(u, v);
plane.ClosestParameter(offset, out u, out v);
Point2d ext2 = new Point2d(u, v);
plane.ClosestParameter(pt, out u, out v);
Point2d linePt = new Point2d(u, v);
LinearDimension dimension = new LinearDimension(plane, ext1, ext2, linePt);
//var bb = dimension.GetBoundingBox(plane); // this way get the same result
var id = doc.Objects.AddLinearDimension(dimension);
BoundingBox bb = doc.Objects.BoundingBoxVisible;
doc.Objects.AddRectangle(new Rectangle3d(Plane.WorldXY, bb.Min, bb.Max));