Пример #1
0
        public void CreateSolidPlate()
        {
            // create Plate object
            Log.Append("> create plate...");
            Plate plate = new Plate();

            // read Plate data from xls sheet
            Log.Append("> load plate data...");
            if (!plate.Load())
            {
                return;
            }

            // check input data
            int nErr = plate.Check();

            if (nErr > 0)
            {
                Log.Append(string.Format("*** error: invalid plate data! {0} errors found.", nErr));
                return;
            }

            // join lines or create region
            // draw the profile without hole
            Point3d p0 = new Point3d(0.0, 0.0, 0.0);

            DrawSolidProfile(plate, p0, DIMNO);
        }
Пример #2
0
        public void CreatePlate2d()
        {
            // create Plate object
            Log.Append("> create plate...");
            Plate plate = new Plate();

            // read Plate data from xls sheet
            Log.Append("> load plate data...");
            if (!plate.Load())
            {
                return;
            }

            // check input data
            int nErr = plate.Check();

            if (nErr > 0)
            {
                Log.Append(string.Format("*** error: invalid plate data! {0} errors found.", nErr));
                return;
            }

            // Load linetypes from the linetype file
            //...\AutoCad\AutoCAD 2016\UserDataCache\en-us\Support\acad.lin
            AcTrans.LoadlineType("HIDDEN");       // VERDECKT in German
            AcTrans.LoadlineType("DASHDOT");
            AcTrans.LoadlineType("CENTER");

            // draw the top view
            Point3d p0 = new Point3d(0.0, 0.0, 0.0);

            DrawProfile(plate, p0, DIMNO);

            // draw the side view
            Point3d p1 = new Point3d(plate.dW + plate.dViewSp, 0.0, 0.0);

            DrawSideRectangle(plate, p1, plate.dT, plate.dL, DIMVER);

            // draw the front view
            Point3d p2 = new Point3d(plate.dW, -(plate.dT + plate.dViewSp), 0.0);

            DrawFrontRectangle(plate, p2, -2 * plate.dW, plate.dT, DIMHOR);
        }