Exemplo n.º 1
0
        modLDRlnkBubsEndPnts(DBObject dbObj, TypedValue[] tvsLDR)
        {
            Leader   ldr     = (Leader)dbObj;
            Point3d  pnt3dVX = ldr.LastVertex;
            Handle   hSM     = tvsLDR[3].Value.ToString().stringToHandle();
            ObjectId idSM    = hSM.getObjectId();

            ObjectId[] ids = pnt3dVX.getEntitysAtPoint("TEXT");
            if (ids == null)
            {
                Application.ShowAlertDialog("Attention Walmart Shoppers: Last Vertex of Leader is no longer connected to the Symbol.  Exiting...");
                return;
            }

            switch (ids.Length)
            {
            case 0:
                Application.ShowAlertDialog("Attention Walmart Shoppers: Last Vertex of Leader is no longer connected to the Symbol.  Exiting...");
                return;

            case 1:

                Ldr.setLdrXData(pnt3dVX, ldr.ObjectId, idSM);

                break;

            default:
                Application.ShowAlertDialog("Attention Walmart Shoppers: More than one Target Entity at picked location. Exiting...");
                break;
            }
        }
Exemplo n.º 2
0
        addLdr()
        {
            Point3d                  pnt3d  = Pub.pnt3dO;
            bool                     canLdr = false;
            Handle                   hTarget;
            ObjectId                 idSM        = ObjectId.Null;
            string                   layerTarget = "";
            FullSubentityPath        path        = new FullSubentityPath();
            List <FullSubentityPath> paths       = new List <FullSubentityPath>();

            Entity ent = Ldr.getFirstLdrPoint(out pnt3d, out canLdr, out hTarget, out layerTarget, out path);

            if (canLdr)
            {
                return;
            }
            ent.PushHighlight(path, Autodesk.AutoCAD.GraphicsInterface.HighlightStyle.Glow);
            Color    color = Misc.getColorByLayer();
            ObjectId idLDR = JigSplineLeader_BB.jigSplineLeader(pnt3d, 0.09, "BUBBLE", color);

            if (idLDR == ObjectId.Null)
            {
                return;
            }

            Point3d     pnt3dEnd = idLDR.getLastVertex();
            List <Type> types    = new List <Type> {
                typeof(Polyline),
                typeof(Circle)
            };

            ObjectId[] ids = Select.getEntityatPoint(pnt3dEnd, types, "BUBBLE");

            if (ids == null)
            {
                return;
            }

            foreach (ObjectId id in ids)
            {
                ResultBuffer rb = id.getXData(apps.lnkBubs);
                if (rb != null)
                {
                    idSM = id;
                    Ldr.setLdrXData(pnt3dEnd, idLDR, idSM);
                    if (!updateSMxData(idSM, idLDR))
                    {
                        Application.ShowAlertDialog("Leader linkage to Symbol failed.");
                    }
                    break;
                }
            }
            paths.Add(path);
            xRef.unHighlightNestedEntity(paths);
        }
Exemplo n.º 3
0
        moveLdrEndPoint(TypedValue[] tvsSM, Point3d pnt3dCEN, Point3d pnt3dIns, ObjectId idSM)
        {
            for (int i = 6; i < tvsSM.Length; i++)
            {
                ObjectId idLDR     = tvsSM.getObjectId(i);
                Point3d  pnt3dBase = idLDR.getLastVertex();
                Point3d  pnt3dEnd  = idLDR.moveLdrEndPoint(pnt3dCEN, pnt3dIns, pnt3dBase);

                Ldr.setLdrXData(pnt3dEnd, idLDR, idSM);
            }
        }
Exemplo n.º 4
0
        scaleLDRs(Point3d pnt3dCEN, double scaleFactor, ObjectId idSM)
        {
            TypedValue[] tvsSM = idSM.getTVsAsArray(apps.lnkBubs);
            for (int i = 6; i < tvsSM.Length; i++)
            {
                ObjectId     idLDR  = tvsSM.getObjectId(i);
                ResultBuffer rbLDR  = idLDR.getXData(apps.lnkBubsLdrEndPnt);
                TypedValue[] tvsLDR = rbLDR.AsArray();

                Point3d pnt3dOrg = new Point3d((double)tvsLDR[1].Value, (double)tvsLDR[2].Value, 0.0);
                Point3d pnt3dEnd = idLDR.adjLdrEndPnt(pnt3dCEN, Pub.pnt3dO, scaleFactor);

                Ldr.setLdrXData(pnt3dEnd, idLDR, idSM);
            }
        }