Ejemplo n.º 1
0
        makeEndBrklines(string strLayer, ObjectIdCollection idEnts)
        {
            ObjectIdCollection idsEntNew = new ObjectIdCollection();

            Polyline3d poly3d = null;

            short i = 0;

            List <Point3d> pnts3dBeg = new List <Point3d>();
            List <Point3d> pnts3dEnd = new List <Point3d>();


            for (i = 0; i <= idEnts.Count - 1; i++)
            {
                poly3d = (Polyline3d)idEnts[i].getEnt();

                pnts3dBeg.Add(poly3d.StartPoint);
                pnts3dEnd.Add(poly3d.EndPoint);
                poly3d.DowngradeOpen();
            }

            if (fWall1.PntsWallCutBeg.Count > 0)
            {
                for (i = 0; i <= fWall1.PntsWallCutBeg.Count - 1; i++)
                {
                    pnts3dBeg.Add(fWall1.PntsWallCutBeg[i]);
                }
            }

            if (fWall1.PntsWallCutEnd.Count > 0)
            {
                for (i = 0; i <= fWall1.PntsWallCutEnd.Count - 1; i++)
                {
                    pnts3dEnd.Add(fWall1.PntsWallCutEnd[i]);
                }
            }


            for (i = 3; i <= idEnts.Count - 1; i++)
            {
                poly3d = (Polyline3d)idEnts[i].getEnt();

                pnts3dBeg.Add(poly3d.StartPoint);
                pnts3dEnd.Add(poly3d.EndPoint);
                poly3d.DowngradeOpen();
            }

            Transaction TR = BaseObjs.startTransactionDb();

            using (TR)
            {
                poly3d            = (Polyline3d)TR.GetObject(Base_Tools45.Draw.addPoly3d(pnts3dBeg), OpenMode.ForWrite);
                poly3d.Layer      = strLayer;
                poly3d.Color      = Color.FromColorIndex(ColorMethod.ByBlock, 140);
                poly3d.LineWeight = LineWeight.LineWeight050;
                idsEntNew.Add(poly3d.ObjectId);

                poly3d            = (Polyline3d)TR.GetObject(Base_Tools45.Draw.addPoly3d(pnts3dEnd), OpenMode.ForWrite);
                poly3d.Layer      = strLayer;
                poly3d.Color      = Color.FromColorIndex(ColorMethod.ByBlock, 140);
                poly3d.LineWeight = LineWeight.LineWeight050;
                idsEntNew.Add(poly3d.ObjectId);
            }

            return(idsEntNew);
        }