Exemplo n.º 1
0
        public void DrawJointsText(vdDocument doc, double txtSize)
        {
            nodalLay = doc.Layers.FindName("Nodes");
            if (nodalLay == null)
            {
                nodalLay      = new vdLayer();
                nodalLay.Name = "Nodes";
                nodalLay.SetUnRegisterDocument(doc);
                nodalLay.setDocumentDefaults();
                doc.Layers.AddItem(nodalLay);
            }
            nodalLay.PenColor = new vdColor(Color.Magenta);
            //nodalLay.PenColor = new vdColor(Color.Green);
            nodalLay.Update();

            for (int i = 0; i < list.Count; i++)
            {
                //vdMText vTxt = new vdMText();
                //vTxt.SetUnRegisterDocument(doc);
                //vTxt.setDocumentDefaults();
                //vTxt.InsertionPoint = list[i].Point;
                //vTxt.Height = txtSize;
                //vTxt.HorJustify = VdConstHorJust.VdTextHorCenter;
                //vTxt.VerJustify = VdConstVerJust.VdTextVerCen;
                //vTxt.TextString = list[i].NodeNo.ToString();
                //vTxt.Layer = nodalLay;
                //doc.ActiveLayOut.Entities.AddItem(vTxt);

                vdText vTxt = new vdText();
                vTxt.SetUnRegisterDocument(doc);
                vTxt.setDocumentDefaults();
                vTxt.InsertionPoint = list[i].Point;
                vTxt.Height         = txtSize;
                //vTxt.HorJustify = VdConstHorJust.VdTextHorCenter;
                //vTxt.VerJustify = VdConstVerJust.VdTextVerCen;
                vTxt.TextString = list[i].NodeNo.ToString();

                vTxt.ToolTip = string.Format("Joint No : {0} [X:{1:f4}, Y:{2:f4}, Z:{3:f4}",
                                             list[i].NodeNo, list[i].Point.x, list[i].Point.y, list[i].Point.z);

                vTxt.Layer = nodalLay;
                doc.ActiveLayOut.Entities.AddItem(vTxt);


                //vdCircle vcir = new vdCircle();
                //vcir.SetUnRegisterDocument(doc);
                //vcir.setDocumentDefaults();
                //vcir.Center = list[i].Point;
                //vcir.Radius = txtSize;
                //vcir.Layer = nodalLay;
                //doc.ActiveLayOut.Entities.AddItem(vcir);
            }
            doc.Update();
            doc.Redraw(true);
        }
Exemplo n.º 2
0
        public void DrawJointsText(vdDocument doc, double txtSize)
        {
            vdLayer nodalLay = null;

            nodalLay = doc.Layers.FindName("Nodes");
            if (nodalLay == null)
            {
                nodalLay      = new vdLayer();
                nodalLay.Name = "Nodes";
                nodalLay.SetUnRegisterDocument(doc);
                nodalLay.setDocumentDefaults();
                doc.Layers.AddItem(nodalLay);
            }
            nodalLay.PenColor = new vdColor(Color.Magenta);
            //nodalLay.PenColor = new vdColor(Color.Green);
            nodalLay.Update();


            vdMText vTxt = new vdMText();

            vTxt.SetUnRegisterDocument(doc);
            vTxt.setDocumentDefaults();
            vTxt.InsertionPoint = Point;
            vTxt.Height         = txtSize;
            vTxt.HorJustify     = VdConstHorJust.VdTextHorCenter;
            vTxt.VerJustify     = VdConstVerJust.VdTextVerCen;
            vTxt.TextString     = NodeNo.ToString();
            vTxt.Layer          = nodalLay;
            doc.ActiveLayOut.Entities.AddItem(vTxt);


            vdCircle vcir = new vdCircle();

            vcir.SetUnRegisterDocument(doc);
            vcir.setDocumentDefaults();
            vcir.Center = Point;
            vcir.Radius = txtSize;
            //vcir.TextString = list[i].NodeNo.ToString();
            vcir.Layer = nodalLay;
            doc.ActiveLayOut.Entities.AddItem(vcir);


            doc.Update();
            doc.Redraw(true);
        }
Exemplo n.º 3
0
        //Chiranjit [2011 12 14]
        void ResizeText(double text_size)
        {
            for (int i = 0; i < MainDoc.ActiveLayOut.Entities.Count; i++)
            {
                vdText  t = MainDoc.ActiveLayOut.Entities[i] as vdText;
                vdMText m = MainDoc.ActiveLayOut.Entities[i] as vdMText;

                if (t != null)
                {
                    t.Height = text_size;
                    t.Update();
                }
                else if (m != null)
                {
                    m.Height = text_size;
                    m.Update();
                }
            }
            MainDoc.Redraw(true);
            MainDoc.Update();
        }
Exemplo n.º 4
0
 public static void RefreshVectorDraw(vdDocument document)
 {
     document.Update();
     document.Redraw(true);
 }