Beispiel #1
0
        private Block BuildBlock()
        {
            Block myBlock = new Block("ArrowWithAttributes");

            Line     l = new Line(0, 0, 10, 0);
            Triangle t = new Triangle(new Point3D(0, -1.5), new Point3D(0, 1.5), new Point3D(1.5, 0));

            t.Translate(10, 0, 0);
            l.ColorMethod = t.ColorMethod = colorMethodType.byParent;

            devDept.Eyeshot.Entities.Attribute a1 = new devDept.Eyeshot.Entities.Attribute(5, 0.2, 0, "att1", "Top Text", 0.8);
            a1.Alignment = devDept.Eyeshot.Entities.Text.alignmentType.BottomCenter;

            devDept.Eyeshot.Entities.Attribute a2 = new devDept.Eyeshot.Entities.Attribute(5, -0.4, 0, "att2", "Bottom Text", 0.8);
            a2.Alignment = devDept.Eyeshot.Entities.Text.alignmentType.TopCenter;

            l.ColorMethod              =
                t.ColorMethod          =
                    a1.ColorMethod     =
                        a2.ColorMethod = colorMethodType.byParent;

            myBlock.Entities.Add(l);
            myBlock.Entities.Add(t);
            myBlock.Entities.Add(a1);
            myBlock.Entities.Add(a2);

            return(myBlock);
        }
Beispiel #2
0
        private void BuildAssembly()
        {
            model1.AntiAliasing = (antiAliasingCheckBox.IsChecked == true) ? true : false;
            model1.Rendered.PlanarReflections = (planarCheckBox.IsChecked == true) ? true : false;
            model1.UseShaders = (shadersCheckBox.IsChecked == true) ? true : false;
            model1.WriteDepthForTransparents = (depthCheckBox.IsChecked == true) ? true : false;
            model1.Flat.ShowEdges            = (edgesCheckBox.IsChecked == true) ? true : false;
            model1.HiddenLines.ShowEdges     = (edgesCheckBox.IsChecked == true) ? true : false;
            model1.Rendered.ShowEdges        = (edgesCheckBox.IsChecked == true) ? true : false;
            model1.Shaded.ShowEdges          = (edgesCheckBox.IsChecked == true) ? true : false;
            model1.Wireframe.ShowEdges       = (edgesCheckBox.IsChecked == true) ? true : false;

            _entityList.Clear();
            model1.Entities.Clear();
            model1.Blocks.Clear();

            if (model1.Materials.Count > 0)
            {
                if (!transparencyCheckBox.IsChecked == true)
                {
                    model1.Materials[_wallMatName].Diffuse = System.Drawing.Color.FromArgb(25, 150, 25);
                }
                else
                {
                    model1.Materials[_wallMatName].Diffuse = System.Drawing.Color.FromArgb(100, 25, 150, 25);
                }
            }

            // Variables for unique Mesh (SingleMesh)
            List <Point3D>       globalVerts = new List <Point3D>();
            List <IndexTriangle> globalTris  = new List <IndexTriangle>();
            int offset = globalVerts.Count;

            // Pillar column block
            devDept.Eyeshot.Block column = new devDept.Eyeshot.Block("squareCol");
            // creates a gray box
            Mesh m1 = Mesh.CreateBox(COLUMN_B, COLUMN_H, COLUMN_L);

            // apply texture if Texture is true
            if (textureCheckBox.IsChecked == true)
            {
                m1.ApplyMaterial("Bricks", textureMappingType.Cubic, 1, 1);
            }
            else
            {
                m1.ColorMethod  = colorMethodType.byEntity;
                m1.Color        = System.Drawing.Color.LightGray;
                m1.MaterialName = _concreteMatName;
            }

            for (int i = 0; i < m1.Vertices.Length; i++)
            {
                globalVerts.Add(m1.Vertices[i]);
            }
            for (int i = 0; i < m1.Triangles.Length; i++)
            {
                globalTris.Add(new ColorTriangle(offset + m1.Triangles[i].V1, offset + m1.Triangles[i].V2,
                                                 offset + m1.Triangles[i].V3, System.Drawing.Color.Gray));
            }

            Plane p = new Plane(new Vector3D(0, 1, 0));

            devDept.Eyeshot.Entities.Attribute at = new devDept.Eyeshot.Entities.Attribute(p,
                                                                                           new Point3D(-(TEXT_HEIGHT + TEXT_PAD), COLUMN_B / 2, COLUMN_L / 2), "Name", "Frame", TEXT_HEIGHT);
            at.Alignment  = devDept.Eyeshot.Entities.Text.alignmentType.BaselineCenter;
            at.UpsideDown = true;
            column.Entities.Add(at);

            column.Entities.Add(m1);

            // adds the block to the master block dictionary
            model1.Blocks.Add(column);

            BlockReference reference;

            // Beam
            devDept.Eyeshot.Block beam = new devDept.Eyeshot.Block("beam");
            // creates a gray box
            Mesh m2 = Mesh.CreateBox(BEAM_B, BEAM_L, BEAM_H);

            m2.ColorMethod  = colorMethodType.byEntity;
            m2.Color        = System.Drawing.Color.LightGray;
            m2.MaterialName = _concreteMatName;

            offset = globalVerts.Count;
            for (int i = 0; i < m2.Vertices.Length; i++)
            {
                globalVerts.Add(m2.Vertices[i]);
            }
            for (int i = 0; i < m2.Triangles.Length; i++)
            {
                globalTris.Add(new ColorTriangle(offset + m2.Triangles[i].V1, offset + m2.Triangles[i].V2,
                                                 offset + m2.Triangles[i].V3, System.Drawing.Color.Gray));
            }

            beam.Entities.Add(m2);

            p  = new Plane(new Vector3D(1, 0, 0));
            at = new devDept.Eyeshot.Entities.Attribute(p, new Point3D(BEAM_B / 2, BEAM_L / 2, BEAM_H + TEXT_PAD), "Name",
                                                        "Frame", TEXT_HEIGHT);
            at.Alignment   = devDept.Eyeshot.Entities.Text.alignmentType.BaselineCenter;
            at.Color       = System.Drawing.Color.Green;
            at.ColorMethod = colorMethodType.byEntity;
            beam.Entities.Add(at);

            // adds the block to the master block dictionary
            model1.Blocks.Add(beam);

            // Shell
            devDept.Eyeshot.Block shell = new devDept.Eyeshot.Block("shell");
            double shellB = BEAM_L / _shellSubValue;
            double shellH = COLUMN_L / _shellSubValue;

            // Mesh
            Mesh m3 = Mesh.CreateBox(shellB, SHELL_TICKNESS, shellH);

            m3.ColorMethod  = colorMethodType.byEntity;
            m3.Color        = System.Drawing.Color.LightGreen;
            m3.MaterialName = "wallMat";
            shell.Entities.Add(m3);

            // adds the block to the master block dictionary
            model1.Blocks.Add(shell);

            for (int k = 0; k < _floorsValue; k++)
            {
                for (int j = 0; j <= _bayYValue; j++)
                {
                    for (int i = 0; i <= _bayXValue; i++)
                    {
                        if (pillarsCheckBox.IsChecked == true)
                        {
                            reference = new BlockReference(i * BEAM_L - COLUMN_B / 2, j * BEAM_L - COLUMN_H / 2, k * COLUMN_L,
                                                           "squareCol", 1, 1, 1, 0);
                            if ((structureType)structureModeEnumButton.Value == structureType.SingleMesh)
                            {
                                Mesh mm = (Mesh)model1.Blocks["squareCol"].Entities[1].Clone();
                                mm.Translate(i * BEAM_L - COLUMN_B / 2, j * BEAM_L - COLUMN_H / 2, k * COLUMN_L);
                                offset = globalVerts.Count;
                                globalVerts.AddRange(mm.Vertices);
                                for (int n = 0; n < mm.Triangles.Length; n++)
                                {
                                    globalTris.Add(new ColorTriangle(offset + mm.Triangles[n].V1,
                                                                     offset + mm.Triangles[n].V2, offset + mm.Triangles[n].V3, System.Drawing.Color.Gray));
                                }
                            }

                            if (labelCheckBox.IsChecked == true)
                            {
                                reference.Attributes.Add("Name", string.Format("Pillar_{0},{1},{2}", i, j, k));
                            }
                            _entityList.Add(reference);
                        }

                        if (showBeamXCheckBox.IsChecked == true)
                        {
                            if (j <= _bayYValue && i < _bayXValue)
                            {
                                // Parallel beams to X
                                Transformation t = new Transformation();
                                t.Rotation(-Math.PI / 2, Vector3D.AxisZ);
                                Transformation t2 = new Transformation();
                                t2.Translation(i * BEAM_L, j * BEAM_L + BEAM_B / 2, (k + 1) * COLUMN_L - BEAM_H / 2);
                                reference = new BlockReference(t2 * t, "beam");

                                if ((structureType)structureModeEnumButton.Value == structureType.SingleMesh)
                                {
                                    Mesh mm = (Mesh)model1.Blocks["beam"].Entities[0].Clone();
                                    mm.TransformBy(t2 * t);

                                    offset = globalVerts.Count;
                                    globalVerts.AddRange(mm.Vertices);
                                    for (int n = 0; n < mm.Triangles.Length; n++)
                                    {
                                        globalTris.Add(new ColorTriangle(offset + mm.Triangles[n].V1,
                                                                         offset + mm.Triangles[n].V2, offset + mm.Triangles[n].V3, System.Drawing.Color.Gray));
                                    }
                                }

                                if (labelCheckBox.IsChecked == true)
                                {
                                    reference.Attributes.Add("Name", string.Format("Beam_{0},{1},{2}", i, j, k));
                                }
                                _entityList.Add(reference);
                            }
                        }

                        if (showBeamYCheckBox.IsChecked == true)
                        {
                            if (i <= _bayXValue && j < _bayYValue)
                            {
                                // Parallel beams to X
                                Transformation t = new Transformation();
                                t.Translation(i * BEAM_L - BEAM_B / 2, j * BEAM_L, (k + 1) * COLUMN_L - BEAM_H / 2);
                                reference = new BlockReference(t, "beam");

                                if ((structureType)structureModeEnumButton.Value == structureType.SingleMesh)
                                {
                                    Mesh mm = (Mesh)model1.Blocks["beam"].Entities[0].Clone();
                                    mm.TransformBy(t);
                                    offset = globalVerts.Count;
                                    globalVerts.AddRange(mm.Vertices);
                                    for (int n = 0; n < mm.Triangles.Length; n++)
                                    {
                                        globalTris.Add(new ColorTriangle(offset + mm.Triangles[n].V1,
                                                                         offset + mm.Triangles[n].V2, offset + mm.Triangles[n].V3, System.Drawing.Color.Gray));
                                    }
                                }
                                if (labelCheckBox.IsChecked == true)
                                {
                                    reference.Attributes.Add("Name", string.Format("Beam_{0},{1},{2}", i, j, k));
                                }
                                _entityList.Add(reference);
                            }
                        }

                        if (shellCheckBox.IsChecked == true)
                        {
                            if ((j == 0 || j == _bayYValue) && i < _bayXValue)
                            {
                                for (int i1 = 0; i1 < _shellSubValue; i1++)
                                {
                                    for (int j1 = 0; j1 < _shellSubValue; j1++)
                                    {
                                        Transformation t = new Transformation();
                                        t.Translation(i * BEAM_L + i1 * shellB, j * BEAM_L - SHELL_TICKNESS / 2,
                                                      k * COLUMN_L + j1 * shellH);
                                        reference = new BlockReference(t, "shell");

                                        if ((structureType)structureModeEnumButton.Value == structureType.SingleMesh)
                                        {
                                            Mesh mm = (Mesh)model1.Blocks["shell"].Entities[0].Clone();
                                            mm.TransformBy(t);
                                            offset = globalVerts.Count;
                                            globalVerts.AddRange(mm.Vertices);
                                            for (int n = 0; n < mm.Triangles.Length; n++)
                                            {
                                                globalTris.Add(new ColorTriangle(offset + mm.Triangles[n].V1,
                                                                                 offset + mm.Triangles[n].V2, offset + mm.Triangles[n].V3,
                                                                                 System.Drawing.Color.FromArgb(123, System.Drawing.Color.LightGreen)));
                                            }
                                        }
                                        _entityList.Add(reference);
                                    }
                                }
                            }
                        }
                        if (nodesCheckBox.IsChecked == true)
                        {
                            Joint joint1 = new Joint(i * BEAM_L, j * BEAM_L, k * COLUMN_L, 40, 2);
                            joint1.Color       = System.Drawing.Color.Blue;
                            joint1.ColorMethod = colorMethodType.byEntity;
                            Joint joint2 = new Joint(i * BEAM_L, j * BEAM_L, (k + 1) * COLUMN_L, 40, 2);
                            joint2.Color       = System.Drawing.Color.Blue;
                            joint2.ColorMethod = colorMethodType.byEntity;
                            _entityList.Add(joint1);
                            _entityList.Add(joint2);
                        }
                    }

                    if (shellCheckBox.IsChecked == true)
                    {
                        if (j == 0)
                        {
                            for (int l = 0; l < _bayYValue; l++)
                            {
                                for (int i1 = 0; i1 < _shellSubValue; i1++)
                                {
                                    for (int j1 = 0; j1 < _shellSubValue; j1++)
                                    {
                                        Transformation t = new Transformation();
                                        t.Translation(l * BEAM_L + i1 * shellB, j * BEAM_L - SHELL_TICKNESS / 2,
                                                      k * COLUMN_L + j1 * shellH);
                                        Transformation t2 = new Transformation();
                                        t2.Rotation(Math.PI / 2, Vector3D.AxisZ);
                                        reference = new BlockReference(t2 * t, "shell");

                                        if ((structureType)structureModeEnumButton.Value == structureType.SingleMesh)
                                        {
                                            Mesh mm = (Mesh)model1.Blocks["shell"].Entities[0].Clone();
                                            mm.TransformBy(t2 * t);
                                            offset = globalVerts.Count;
                                            globalVerts.AddRange(mm.Vertices);
                                            for (int n = 0; n < mm.Triangles.Length; n++)
                                            {
                                                globalTris.Add(new ColorTriangle(offset + mm.Triangles[n].V1,
                                                                                 offset + mm.Triangles[n].V2, offset + mm.Triangles[n].V3,
                                                                                 System.Drawing.Color.FromArgb(123, System.Drawing.Color.LightGreen)));
                                            }
                                        }
                                        _entityList.Add(reference);
                                    }
                                }
                            }
                        }
                        if (j == _bayYValue)
                        {
                            for (int l = 0; l < _bayYValue; l++)
                            {
                                for (int i1 = 0; i1 < _shellSubValue; i1++)
                                {
                                    for (int j1 = 0; j1 < _shellSubValue; j1++)
                                    {
                                        Transformation t = new Transformation();
                                        t.Translation(l * BEAM_L + i1 * shellB, -SHELL_TICKNESS / 2, k * COLUMN_L + j1 * shellH);
                                        Transformation t2 = new Transformation();
                                        t2.Rotation(Math.PI / 2, Vector3D.AxisZ);
                                        Transformation t3 = new Transformation();
                                        t3.Translation(_bayXValue * BEAM_L, 0, 0);
                                        reference = new BlockReference(t3 * t2 * t, "shell");

                                        if ((structureType)structureModeEnumButton.Value == structureType.SingleMesh)
                                        {
                                            Mesh mm = (Mesh)model1.Blocks["shell"].Entities[0].Clone();
                                            mm.TransformBy(t3 * t2 * t);
                                            offset = globalVerts.Count;
                                            globalVerts.AddRange(mm.Vertices);
                                            for (int n = 0; n < mm.Triangles.Length; n++)
                                            {
                                                globalTris.Add(new ColorTriangle(offset + mm.Triangles[n].V1,
                                                                                 offset + mm.Triangles[n].V2, offset + mm.Triangles[n].V3,
                                                                                 System.Drawing.Color.FromArgb(123, System.Drawing.Color.LightGreen)));
                                            }
                                        }
                                        _entityList.Add(reference);
                                    }
                                }
                            }
                        }
                    }
                }
            }

            _buildingMesh             = new Mesh(globalVerts, globalTris);
            _buildingMesh.ColorMethod = colorMethodType.byEntity;
            model1.Entities.AddRange(_entityList);

            switch ((structureType)structureModeEnumButton.Value)
            {
            case structureType.Flattened:
            {
                Entity[] entList = model1.Entities.Explode();
                model1.Entities.Clear();
                model1.Entities.AddRange(entList);
                model1.Invalidate();
                break;
            }

            case structureType.SingleMesh:
            {
                model1.Entities.Clear();
                model1.Entities.Add(_buildingMesh);
                model1.Invalidate();
                break;
            }

            case structureType.Assembly:
            {
                model1.Invalidate();
                break;
            }
            }
            TreeViewUtility.PopulateTree(treeView1, model1.Entities.ToList(), model1.Blocks);
        }
Beispiel #3
0
        protected override void OnContentRendered(EventArgs e)
        {
            model1.AutoHideLabels = true;

            model1.GetGrid().AutoSize = true;
            model1.GetGrid().Step     = 100;

            string concreteMatName = "Concrete";
            string steelMatName    = "Blue steel";

            model1.Materials.Add(new Material(concreteMatName, System.Drawing.Color.FromArgb(25, 25, 25), System.Drawing.Color.LightGray, System.Drawing.Color.FromArgb(31, 31, 31), .05f, 0));
            model1.Materials.Add(new Material(steelMatName, System.Drawing.Color.RoyalBlue));

            // square column block
            Block b = new Block("squareCol");

            // creates a gray box
            Mesh m1 = Mesh.CreateBox(30, 30, 270);

            m1.ColorMethod  = colorMethodType.byEntity;
            m1.Color        = System.Drawing.Color.Gray;
            m1.MaterialName = concreteMatName;

            // adds it to the block
            b.Entities.Add(m1);

            // creates a new black polyline
            LinearPath steel = new LinearPath();

            steel.Vertices    = new Point3D[8];
            steel.Vertices[0] = new Point3D(4, 4, -20);
            steel.Vertices[1] = new Point3D(4, 4, 290);
            steel.Vertices[2] = new Point3D(4, 26, 290);
            steel.Vertices[3] = new Point3D(4, 26, -20);
            steel.Vertices[4] = new Point3D(26, 26, -20);
            steel.Vertices[5] = new Point3D(26, 26, 290);
            steel.Vertices[6] = new Point3D(26, 4, 290);
            steel.Vertices[7] = new Point3D(26, 4, -20);

            steel.ColorMethod = colorMethodType.byEntity;
            steel.Color       = System.Drawing.Color.Black;

            // adds it to the block
            b.Entities.Add(steel);

            // creates a price tag
            devDept.Eyeshot.Entities.Attribute at = new devDept.Eyeshot.Entities.Attribute(new Point3D(0, -15), "Price", "$25,000", 10);

            // adds it to the block
            b.Entities.Add(at);

            // adds the block to the master block dictionary
            model1.Blocks.Add(b);

            // inserts the "SquareCol" block many times: this is a HUGE memory and graphic resources saving for big models
            BlockReference reference;

            for (int k = 0; k < 4; k++)
            {
                for (int j = 0; j < 5; j++)
                {
                    for (int i = 0; i < 5; i++)
                    {
                        if (i < 2 && j < 2)
                        {
                            System.Diagnostics.Debug.WriteLine("No columns here");
                        }

                        else
                        {
                            reference = new BlockReference(i * 500, j * 400, k * 300, "squareCol", 1, 1, 1, 0);

                            // defines a different price for each one
                            reference.Attributes.Add("Price", "$" + i + ",000");

                            model1.Entities.Add(reference);
                        }
                    }
                }
            }

            // again as above
            b = new Block("floor");

            double width = 2030;
            double depth = 1630;
            double dimA  = 1000;
            double dimB  = 800;

            Point2D[] outerPoints = new Point2D[7];

            outerPoints[0] = new Point2D(0, dimB);
            outerPoints[1] = new Point2D(dimA, dimB);
            outerPoints[2] = new Point2D(dimA, 0);
            outerPoints[3] = new Point2D(width, 0);
            outerPoints[4] = new Point2D(width, depth);
            outerPoints[5] = new Point2D(0, depth);
            outerPoints[6] = (Point2D)outerPoints[0].Clone();

            LinearPath outer = new LinearPath(Plane.XY, outerPoints);

            Point2D[] innerPoints = new Point2D[5];

            innerPoints[0] = new Point2D(1530, 800);
            innerPoints[1] = new Point2D(1530, 950);
            innerPoints[2] = new Point2D(1650, 950);
            innerPoints[3] = new Point2D(1650, 800);
            innerPoints[4] = (Point2D)innerPoints[0].Clone();

            LinearPath inner = new LinearPath(Plane.XY, innerPoints);

            devDept.Eyeshot.Entities.Region reg = new devDept.Eyeshot.Entities.Region(outer, inner);

            Mesh m2 = reg.ExtrudeAsMesh(30, 0.1, Mesh.natureType.Plain);

            m2.ColorMethod  = colorMethodType.byEntity;
            m2.Color        = System.Drawing.Color.White;
            m2.MaterialName = concreteMatName;

            b.Entities.Add(m2);

            model1.Blocks.Add(b);

            for (int i = 0; i < 4; i++)
            {
                reference = new BlockReference(0, 0, 270 + i * 300, "floor", 1, 1, 1, 0);

                model1.Entities.Add(reference);
            }

            string brickMatName = "Wall bricks";

            model1.Materials.Add(new Material(brickMatName, new Bitmap("../../../../../../dataset/Assets/Textures/Bricks.jpg")));

            b = new Block("brickWall");

            Mesh rm = Mesh.CreateBox(470, 30, 270, Mesh.natureType.RichPlain);

            rm.ApplyMaterial(brickMatName, textureMappingType.Cubic, 1.5, 1.5);

            rm.ColorMethod = colorMethodType.byEntity;
            rm.Color       = System.Drawing.Color.Chocolate;

            b.Entities.Add(rm);

            model1.Blocks.Add(b);

            for (int j = 1; j < 4; j++)
            {
                for (int i = 0; i < 2; i++)
                {
                    reference = new BlockReference(1030 + i * 500, 0, j * 300, "brickWall", 1, 1, 1, 0);

                    model1.Entities.Add(reference);
                }
            }


            // Cylindrical column
            b = new Block("CylindricalCol");

            Mesh m3 = Mesh.CreateCylinder(20, 270, 32, Mesh.natureType.Smooth);

            m3.ColorMethod  = colorMethodType.byEntity;
            m3.Color        = System.Drawing.Color.RoyalBlue;
            m3.MaterialName = steelMatName;

            b.Entities.Add(m3);

            model1.Blocks.Add(b);

            for (int j = 0; j < 2; j++)
            {
                for (int i = 0; i < 3; i++)
                {
                    reference = new BlockReference(100 + i * 400, 115 + j * 200, 0, "CylindricalCol", 1, 1, 1, 0);

                    model1.Entities.Add(reference);
                }
            }

            // Roof (not a block this time)
            Mesh roof = Mesh.CreateBox(880, 280, 30);

            // Edits vertices to add a slope
            roof.Vertices[4].Z = 15;
            roof.Vertices[7].Z = 15;

            roof.Translate(60, 75, 270);

            model1.Entities.Add(roof, System.Drawing.Color.DimGray);


            // Labels
            LeaderAndText lat = new LeaderAndText(new Point3D(0, 800, 1200),
                                                  "Height = 12 m", new System.Drawing.Font("Tahoma", 8.25f), System.Drawing.Color.White, new Vector2D(0, 20));

            lat.FillColor = System.Drawing.Color.Black;
            model1.Labels.Add(lat);


            LeaderAndText ff;

            ff = new LeaderAndText(new Point3D(1000, 1000, 300),
                                   "First floor", new System.Drawing.Font("Tahoma", 8.25f), System.Drawing.Color.White, new Vector2D(0, 10));

            ff.FillColor = System.Drawing.Color.Red;
            ff.Alignment = System.Drawing.ContentAlignment.BottomCenter;

            model1.Labels.Add(ff);

            // fits the model in the viewport
            model1.ZoomFit();

            // refresh the viewport
            model1.Invalidate();

            base.OnContentRendered(e);
        }
Beispiel #4
0
        public bool AreEqual(Entity ent1, Entity ent2)
        {
            if (ent1 is CompositeCurve)
            {
                CompositeCurve cc1 = (CompositeCurve)ent1;
                CompositeCurve cc2 = (CompositeCurve)ent2;

                if (cc1.CurveList.Count == cc2.CurveList.Count)
                {
                    int equalCurvesInListCount = 0;

                    foreach (Entity entC in cc1.CurveList)
                    {
                        foreach (Entity entC2 in cc2.CurveList)
                        {
                            if (entC.GetType() == entC2.GetType())
                            {
                                if (CompareIfEqual(entC, entC2))
                                {
                                    equalCurvesInListCount++;
                                    break;
                                }
                            }
                        }
                    }

                    if (cc1.CurveList.Count == equalCurvesInListCount)
                    {
                        return(true);
                    }
                }
            }

            else if (ent1 is LinearPath)
            {
                LinearPath lp1 = (LinearPath)ent1;
                LinearPath lp2 = (LinearPath)ent2;

                if (lp1.Vertices.Length == lp2.Vertices.Length)
                {
                    for (int i = 0; i < lp1.Vertices.Length; i++)
                    {
                        if (!(lp1.Vertices[i] == lp2.Vertices[i]))
                        {
                            return(false);
                        }
                    }
                    return(true);
                }
            }

            else if (ent1 is PlanarEntity)
            {
                PlanarEntity pe1 = (PlanarEntity)ent1;
                PlanarEntity pe2 = (PlanarEntity)ent2;
                if (
                    pe1.Plane.AxisZ == pe2.Plane.AxisZ &&
                    pe1.Plane.AxisX == pe2.Plane.AxisX
                    )
                {
                    if (ent1 is Arc)
                    {
                        Arc arc1 = (Arc)ent1;
                        Arc arc2 = (Arc)ent2;

                        if (
                            arc1.Center == arc2.Center &&
                            arc1.Radius == arc2.Radius &&
                            arc1.Domain.Min == arc2.Domain.Min &&
                            arc1.Domain.Max == arc2.Domain.Max
                            )
                        {
                            return(true);
                        }
                    }
                    else if (ent1 is Circle)
                    {
                        Circle c1 = (Circle)ent1;
                        Circle c2 = (Circle)ent2;

                        if (
                            c1.Center == c2.Center &&
                            c1.Radius == c2.Radius
                            )
                        {
                            return(true);
                        }
                    }
                    else if (ent1 is EllipticalArc)
                    {
                        EllipticalArc e1 = (EllipticalArc)ent1;
                        EllipticalArc e2 = (EllipticalArc)ent2;

                        if (
                            e1.Center == e2.Center &&
                            e1.RadiusX == e2.RadiusX &&
                            e1.RadiusY == e2.RadiusY &&
                            e1.Domain.Low == e2.Domain.Low &&
                            e1.Domain.High == e2.Domain.High
                            )
                        {
                            return(true);
                        }
                    }
                    else if (ent1 is Ellipse)
                    {
                        Ellipse e1 = (Ellipse)ent1;
                        Ellipse e2 = (Ellipse)ent2;

                        if (
                            e1.Center == e2.Center &&
                            e1.RadiusX == e2.RadiusX &&
                            e1.RadiusY == e2.RadiusY
                            )
                        {
                            return(true);
                        }
                    }

                    else if (ent1 is Text)
                    {
                        if (ent1 is Dimension)
                        {
                            Dimension dim1 = (Dimension)ent1;
                            Dimension dim2 = (Dimension)ent2;

                            if (
                                dim1.InsertionPoint == dim2.InsertionPoint &&
                                dim1.DimLinePosition == dim2.DimLinePosition
                                )
                            {
                                if (ent1 is AngularDim)
                                {
                                    AngularDim ad1 = (AngularDim)ent1;
                                    AngularDim ad2 = (AngularDim)ent2;

                                    if (
                                        ad1.ExtLine1 == ad2.ExtLine1 &&
                                        ad1.ExtLine2 == ad2.ExtLine2 &&
                                        ad1.StartAngle == ad2.StartAngle &&
                                        ad1.EndAngle == ad2.EndAngle &&
                                        ad1.Radius == ad2.Radius
                                        )
                                    {
                                        return(true);
                                    }
                                }
                                else if (ent1 is LinearDim)
                                {
                                    LinearDim ld1 = (LinearDim)ent1;
                                    LinearDim ld2 = (LinearDim)ent2;

                                    if (
                                        ld1.ExtLine1 == ld2.ExtLine1 &&
                                        ld1.ExtLine2 == ld2.ExtLine2
                                        )
                                    {
                                        return(true);
                                    }
                                }
                                else if (ent1 is DiametricDim)
                                {
                                    DiametricDim dd1 = (DiametricDim)ent1;
                                    DiametricDim dd2 = (DiametricDim)ent2;

                                    if (
                                        dd1.Distance == dd2.Distance &&
                                        dd1.Radius == dd2.Radius &&
                                        dd1.CenterMarkSize == dd2.CenterMarkSize
                                        )
                                    {
                                        return(true);
                                    }
                                }
                                else if (ent1 is RadialDim)
                                {
                                    RadialDim rd1 = (RadialDim)ent1;
                                    RadialDim rd2 = (RadialDim)ent2;

                                    if (
                                        rd1.Radius == rd2.Radius &&
                                        rd1.CenterMarkSize == rd2.CenterMarkSize
                                        )
                                    {
                                        return(true);
                                    }
                                }
                                else if (ent1 is OrdinateDim)
                                {
                                    OrdinateDim od1 = (OrdinateDim)ent1;
                                    OrdinateDim od2 = (OrdinateDim)ent2;

                                    if (
                                        od1.DefiningPoint == od2.DefiningPoint &&
                                        od1.Origin == od2.Origin &&
                                        od1.LeaderEndPoint == od2.LeaderEndPoint
                                        )
                                    {
                                        return(true);
                                    }
                                }
                                else
                                {
                                    Console.Write("Type " + ent1.GetType() + " not implemented.");
                                    return(true);
                                }
                            }
                        }

                        else if (ent1 is devDept.Eyeshot.Entities.Attribute)
                        {
                            devDept.Eyeshot.Entities.Attribute att1 = (devDept.Eyeshot.Entities.Attribute)ent1;
                            devDept.Eyeshot.Entities.Attribute att2 = (devDept.Eyeshot.Entities.Attribute)ent2;

                            if (
                                att1.Value == att2.Value &&
                                att1.InsertionPoint == att2.InsertionPoint
                                )
                            {
                                return(true);
                            }
                        }

                        else
                        {
                            Text tx1 = (Text)ent1;
                            Text tx2 = (Text)ent2;

                            if (
                                tx1.InsertionPoint == tx2.InsertionPoint &&
                                tx1.TextString == tx2.TextString &&
                                tx1.StyleName == tx2.StyleName &&
                                tx1.WidthFactor == tx2.WidthFactor &&
                                tx1.Height == tx2.Height
                                )
                            {
                                return(true);
                            }
                        }
                    }

                    else
                    {
                        Console.Write("Type " + ent1.GetType() + " not implemented.");
                        return(true);
                    }
                }
            }

            else if (ent1 is Line)
            {
                Line line1 = (Line)ent1;
                Line line2 = (Line)ent2;

                if (
                    line1.StartPoint == line2.StartPoint &&
                    line1.EndPoint == line2.EndPoint
                    )
                {
                    return(true);
                }
            }

            else if (ent1 is devDept.Eyeshot.Entities.Point)
            {
                devDept.Eyeshot.Entities.Point point1 = (devDept.Eyeshot.Entities.Point)ent1;
                devDept.Eyeshot.Entities.Point point2 = (devDept.Eyeshot.Entities.Point)ent2;

                if (
                    point1.Position == point2.Position
                    )
                {
                    return(true);
                }
            }

#if NURBS
            else if (ent1 is Curve)
            {
                Curve cu1 = (Curve)ent1;
                Curve cu2 = (Curve)ent2;

                if (
                    cu1.ControlPoints.Length == cu2.ControlPoints.Length &&
                    cu1.KnotVector.Length == cu2.KnotVector.Length &&
                    cu1.Degree == cu2.Degree
                    )
                {
                    for (int k = 0; k < cu1.ControlPoints.Length; k++)
                    {
                        if (cu1.ControlPoints[k] != cu2.ControlPoints[k])
                        {
                            return(false);
                        }
                    }

                    for (int k = 0; k < cu1.KnotVector.Length; k++)
                    {
                        if (cu1.KnotVector[k] != cu2.KnotVector[k])
                        {
                            return(false);
                        }
                    }

                    return(true);
                }
            }
#endif

            else
            {
                Console.Write("Type " + ent1.GetType() + " not implemented.");
                return(true);
            }
            return(false);
        }