Aspose.Diagram.Examples.CSharp.Working_with_Text_Boxes.SetShapeTextPositionAtBottom.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run() 
        {
            // ExStart:SetShapeTextPositionAtBottom
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_ShapeTextBoxData();

            // Load source Visio diagram
            Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
            // Get shape
            long shapeid = 1;
            Shape shape = diagram.Pages.GetPage("Page-1").Shapes.GetShape(shapeid);

            // Set text position at the bottom,
            // TxtLocPinY = "TxtHeight*1" and TxtPinY = "Height*0"
            shape.TextXForm.TxtLocPinY.Value = shape.TextXForm.TxtHeight.Value;
            shape.TextXForm.TxtPinY.Value = 0;

            // Set orientation angle
            double angleDeg = 0;
            double angleRad = (Math.PI / 180) * angleDeg;
            shape.TextXForm.TxtAngle.Value = angleRad;

            // Save Visio diagram in the local storage
            diagram.Save(dataDir + "SetShapeTextPositionAtBottom_out.vsdx", SaveFileFormat.VSDX);
            // ExEnd:SetShapeTextPositionAtBottom
        }
    }
SetShapeTextPositionAtBottom