Exemplo n.º 1
0
        private void drawReflectLight_curve(Curve curve)
        {
            ed.WriteMessage("\n This is a curve !");

            Point3d startPt = curve.StartPoint;

            ed.WriteMessage("\n start point : " + startPt.ToString());
            Point3d nextPt = curve.GetClosestPointTo(startPt, false);

            ed.WriteMessage("  next point : " + nextPt.ToString());
            Vector3d vector  = curve.GetFirstDerivative(startPt);
            Point3d  extendP = startPt + vector * 1;

            ed.WriteMessage("\n " + extendP.ToString());
            Point3d closestP = curve.GetClosestPointTo(extendP, true);

            Line startP2extendP = new Line(startPt, extendP);

            startP2extendP.ColorIndex = 2;
            Line startP2closestP = new Line(startPt, closestP);

            startP2closestP.ColorIndex = 3;

            CADOperator cadOperator = new CADOperator();

            cadOperator.drawLine(startP2extendP);
            cadOperator.drawLine(startP2closestP);
        }
Exemplo n.º 2
0
        private void addLegend(string title, Point3d position, double tableWidth, double tableHeight)
        {
            CADOperator cadOperator = new CADOperator();
            //添加文字
            DBText dbtext = cadOperator.NewDBText(title, position, tableHeight / 7, 0, false);

            cadOperator.addEntity(dbtext);

            //添加表格
            Table table = new Table();

            table.SetSize(8, 4);
            table.Position         = new Point3d(position.X, position.Y - 20, position.Z);
            table.Width            = tableWidth;
            table.Height           = tableHeight;
            table.Cells.TextHeight = tableHeight / 10;


            table.Cells[0, 0].TextString = "颜色";
            table.Cells[0, 1].TextString = "时间";
            table.Cells[0, 2].TextString = "颜色";
            table.Cells[0, 3].TextString = "时间";

            string[] cellString = constantValue.clocks;

            for (int i = 1; i < 8; i++)
            {
                table.Cells[i, 0].BackgroundColor = Autodesk.AutoCAD.Colors.Color.FromColorIndex(
                    Autodesk.AutoCAD.Colors.ColorMethod.ByAci, (short)constantValue.colorArray[i - 1 + 6]);
                table.Cells[i, 1].TextString = cellString[i - 1];
            }

            for (int i = 1; i < 7; i++)
            {
                table.Cells[i, 2].BackgroundColor = Autodesk.AutoCAD.Colors.Color.FromColorIndex(
                    Autodesk.AutoCAD.Colors.ColorMethod.ByAci, (short)constantValue.colorArray[i + 6 + 6]);
                table.Cells[i, 3].TextString = cellString[i + 6];
            }

            cadOperator.addEntity(table);
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="line"></param>
        /// <param name="dirt"></param>
        /// <returns></returns>
        public double midP2LineInDirection(Line line, Vector3d dirt)
        {
            Geometry geo    = new Geometry();
            Line     myLine = this.Entity;

            // Get mid point of itself
            Point3d midP = geo.GetMidPoint(myLine);

            //construct assistant line
            Point3d assisP = midP + dirt;
            Line    guides = new Line(midP, assisP);

            // Get Intersection point
            Point3dCollection insectPoints = new Point3dCollection();

            guides.IntersectWith(line, Intersect.ExtendBoth, insectPoints, 0, 0);

            CADOperator ope = new CADOperator();

            ope.addEntity(new Line(midP, insectPoints[0]));

            return(midP.DistanceTo(insectPoints[0]));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 选择图例位置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button11_Click(object sender, EventArgs e)
        {
            CADOperator cadOperator = new CADOperator();

            ext = cadOperator.GetCorner("baseword", "targetword");
        }
Exemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button8_Click(object sender, EventArgs e)
        {
            CADOperator cadOperator = new CADOperator();

            cadOperator.dataGridViewExportToExcel(dataGridView1);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 选择受影响建筑边
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button13_Click(object sender, EventArgs e)
        {
            CADOperator cadOperator = new CADOperator();

            influencedEntity = cadOperator.Single("Select one line\n");
        }