Change Adjustment Values of the Shape
Aspose.Cells for Python via .NET provides Shape.geometry.shape_adjust_values property to make changes to the adjustment points with shapes. In the Microsoft Excel UI, adjustments display as yellow diamond nodes. For example:
- Rounded Rectangle has an adjustment to change the arc
- Triangle has an adjustment to change the location of the point
- Trapezoid has an adjustment to change the width of the top
- Arrows have two adjustments to change the shape of the head and tail
This article will explain the use of Shape.geometry.shape_adjust_values property to change the adjustment value of the different shapes.
The below code sample shows how to change adjustment values of the shape.
from aspose.cells import Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Create workbook object from source excel file | |
workbook = Workbook(dataDir + "source.xlsx") | |
# Access first worksheet | |
worksheet = workbook.worksheets[0] | |
# Access first three shapes of the worksheet | |
shape1 = worksheet.shapes[0] | |
shape2 = worksheet.shapes[1] | |
shape3 = worksheet.shapes[2] | |
# Change the adjustment values of the shapes | |
shape1.geometry.shape_adjust_values[0].value = 0.5 | |
shape2.geometry.shape_adjust_values[0].value = 0.8 | |
shape3.geometry.shape_adjust_values[0].value = 0.5 | |
# Save the workbook | |
workbook.save(dataDir + "output_out.xlsx") |