Linear Dimension behaving strangely

dimension
rhinocommon
rhino6

#1

Hi, i am trying to create some simple linear dimensions using a pair of points for the ends (ext1, ext2) and one point (pt) in order to define the location of the dimension line.

The first dimensioin looks good, however, translating these points and recreating linear dimensions with them gives me the following result:

I don’t think this is what’s supposed to happen… :no_mouth:

Here’s my code:

protected override Result RunCommand(RhinoDoc doc, RunMode mode)
    {
        Point2d ext1 = new Point2d(0, 0);
        Point2d ext2 = new Point2d(3000, 0);
        Point2d pt = new Point2d(1500, -100);

        AddLinearDimension(Plane.WorldXY, ext1, ext2, pt, doc);

        Vector3d translationVector = Plane.WorldXY.YAxis * -1 * 200;

        ext1.Transform(Transform.Translation(translationVector));
        ext2.Transform(Transform.Translation(translationVector));
        pt.Transform(Transform.Translation(translationVector));

        AddLinearDimension(Plane.WorldXY, ext1, ext2, pt, doc);

        ext1.Transform(Transform.Translation(translationVector));
        ext2.Transform(Transform.Translation(translationVector));
        pt.Transform(Transform.Translation(translationVector));

        AddLinearDimension(Plane.WorldXY, ext1, ext2, pt, doc);

        doc.Views.Redraw();

        return Result.Success;
    }

    private void AddLinearDimension(Plane p, Point2d ext1, Point2d ext2, Point2d pt, RhinoDoc doc)
    {
        doc.Objects.AddTextDot(new TextDot("ext1", new Point3d(ext1.X, ext1.Y, 0)));
        doc.Objects.AddTextDot(new TextDot("ext2", new Point3d(ext2.X, ext2.Y, 0)));
        doc.Objects.AddTextDot(new TextDot("pt", new Point3d(pt.X, pt.Y, 0)));

        Rhino.Geometry.LinearDimension ld = new LinearDimension(Plane.WorldXY, ext1, ext2, pt);
        ld.TextHeight = 35;
        ld.ArrowSize = 30;

        doc.Objects.AddLinearDimension(ld);
    }

(Alain Cormier) #11

Logged and fixed in SR 6.4


#12

Thanks @Alain, works excellent now!!!