예제 #1
0
        public static void CreateStraightDimension(double distance)
        {
            PointList pointList = new PointList();
            ViewBase  view;
            Point     firstPoint;
            Point     SecondPoint;

            Picker picker = new DrawingHandler().GetPicker();

            picker.PickTwoPoints("Pick first point", "Pick second point", out firstPoint, out SecondPoint, out view);
            pointList.Add(firstPoint);
            pointList.Add(SecondPoint);

            Vector direction = new Vector(firstPoint.Y - SecondPoint.Y, SecondPoint.X - firstPoint.X, firstPoint.Z);

            StraightDimensionSet sds = new StraightDimensionSetHandler().CreateDimensionSet(view, pointList, direction, distance);

            sds.Attributes.LeftLowerTag.Add(new TextElement("LeftLow"));
            sds.Attributes.LeftMiddleTag.Add(new TextElement("LeftMiddle"));
            sds.Attributes.LeftUpperTag.Add(new TextElement("LeftUpper"));
            sds.Attributes.RightLowerTag.Add(new TextElement("RightLow"));
            sds.Attributes.RightMiddleTag.Add(new TextElement("RightMiddle"));
            sds.Attributes.RightUpperTag.Add(new TextElement("RightUpper"));

            bool isOk = sds.Modify();
        }