コード例 #1
0
        //posistion unit:m
        BCOM.LineElement[] CreateArrowElement(Point3d position, IPileProperty pileprop)
        {
            //double uorpermaster = app.ActiveModelReference.UORsPerMasterUnit;
            BCOM.Point3d centroidp = position.Point3dToBCOMPoint3d(1e4 / uorpermaster);
            centroidp.Z = 0; // 平面
            BG.DVector3d linevector     = new BG.DVector3d(pileprop.PileTopPoint.Point3dToDPoint3d(), pileprop.PileBottomPoint.Point3dToDPoint3d());
            double       xyrotationRad  = linevector.AngleXY.Radians;
            double       arrowbarlength = 5 * pileprop.PileDiameter * 1e4 / uorpermaster;

            BCOM.Point3d     startp = app.Point3dZero(), endp = app.Point3dFromXY(arrowbarlength, 0);
            BCOM.LineElement bar      = app.CreateLineElement2(null, ref startp, ref endp);
            BCOM.Point3d     wingendp = app.Point3dFromXY(-arrowbarlength / 3, 0);
            var wing1 = app.CreateLineElement2(null, ref startp, ref wingendp);
            var wing2 = wing1.Clone().AsLineElement();

            wing1.RotateAboutZ(ref startp, app.Radians(25));
            wing2.RotateAboutZ(ref startp, app.Radians(-25));
            wing1.Move(ref endp); wing2.Move(ref endp);
            var lineArray = new BCOM.LineElement[] { bar, wing1, wing2 };

            foreach (var line in lineArray)
            {
                line.RotateAboutZ(ref startp, xyrotationRad);
                line.Move(ref centroidp);
                line.Color = 2;
                //line.LineWeight = 3;
            }
            return(lineArray);
        }
コード例 #2
0
ファイル: CreateElement.cs プロジェクト: abnerdi/eZBM
        public static void LineAndLineString(string unparsed)
        {
            Bentley.Interop.MicroStationDGN.Application app = Bentley.MicroStation.InteropServices.Utilities.ComApp;
            Point3d startPnt = app.Point3dZero();
            Point3d endPnt   = startPnt;

            startPnt.X = 10;
            LineElement oLine = app.CreateLineElement2(null, ref startPnt, ref endPnt);

            oLine.Color      = 0;
            oLine.LineWeight = 2;
            app.ActiveModelReference.AddElement(oLine);
            Point3d[] pntArray = new Point3d[5];
            pntArray[0]      = app.Point3dZero();
            pntArray[1]      = app.Point3dFromXY(1, 2);
            pntArray[2]      = app.Point3dFromXY(3, -2);
            pntArray[3]      = app.Point3dFromXY(5, 2);
            pntArray[4]      = app.Point3dFromXY(6, 0);
            oLine            = app.CreateLineElement1(null, ref pntArray);
            oLine.Color      = 1;
            oLine.LineWeight = 2;
            app.ActiveModelReference.AddElement(oLine);
        }
コード例 #3
0
        public static BCOM.Element createPointElement(this BCOM.Application app)
        {
            var zero = app.Point3dZero();

            return(app.CreateLineElement2(null, zero, zero));
        }
コード例 #4
0
ファイル: LabelUtil.cs プロジェクト: albertolei/RebarLabel
        public Element create_line(double length)
        {
            Element line = app.CreateLineElement2(null, app.Point3dFromXYZ(0, 0, 0), app.Point3dFromXYZ(0, -length, 0));

            return(line);
        }