I have created a Visio diagram using aspose and I have a “No Symbol” shape. I have been able to change the color of the shape, but cannot change the thickness of the border.
To adjust the thickness of the border for a “No Symbol” shape in a Visio diagram using Aspose.Diagram, you can modify the LineWeight
property of the shape. Below is a code example demonstrating how to set the line weight, along with changing the line color and other properties:
using System.IO;
using Aspose.Diagram;
namespace Aspose.Diagram.Examples.CSharp.Shapes
{
public class SetLineData
{
public static void Run()
{
// Load a Visio diagram
Diagram diagram = new Diagram("path_to_your_diagram.vsd");
// Get the page by its name
Aspose.Diagram.Page page = diagram.Pages.GetPage("Page-1");
// Get the shape by its ID (replace with your shape ID)
Aspose.Diagram.Shape shape = page.Shapes.GetShape(1);
// Set the thickness of the border (line weight)
shape.Line.LineWeight.Value = 2; // Set to desired thickness in points
// Optionally, set the line color
shape.Line.LineColor.Ufe.F = "RGB(95,108,53)"; // Set to desired color
// Save the modified diagram
diagram.Save("path_to_save_modified_diagram.vsdx", SaveFileFormat.VSDX);
}
}
}
In this example, replace "path_to_your_diagram.vsd"
with the path to your Visio file and adjust the shape ID as necessary. The LineWeight
property is set to 2
, which you can change to your desired thickness. Additionally, you can customize the line color and other properties as needed.
This approach allows you to programmatically adjust the appearance of shapes in your Visio diagrams using Aspose.Diagram.
@richardcromer
Could you please share the sample visio file?
We will check and assist you accordingly.