形状から接続ポイントを取得

Contents
[ ]

Aspose.Cells for Python via .NET は、スプレッドシート内の図形を管理する豊富な機能を提供します。時々、図形を適切な位置に配置または整列するために、図形の接続ポイントを取得する必要があります。そのためには、すべての接続ポイントが必要です。以下のコードは、Shape.ConnectionPoints プロパティを使用して図形の接続ポイントのリストを取得するために使用できます。

from aspose.cells import Workbook
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# Instantiate a new Workbook.
workbook = Workbook()
# Get the first worksheet in the book.
worksheet = workbook.worksheets[0]
# Add a new textbox to the collection.
textboxIndex = worksheet.text_boxes.add(2, 1, 160, 200)
# Access your text box which is also a shape object from shapes collection
shape = workbook.worksheets[0].shapes[0]
# Get all the connection points in this shape
ConnectionPoints = shape.get_connection_points()
# Display all the shape points
for pt in ConnectionPoints:
print("X = " + str(pt[0]) + ", Y = " + str(pt[1]))