Non Primitive Şekildeki Veri
Basit olmayan Şeklin Verilerine Erişmek
Bazı durumlarda, yerleşik olmayan bir şekilden veriye erişmeniz gerekebilir. Yerleşik şekiller basit şekiller olarak adlandırılırken, diğerleri basit olmayan şekiller olarak adlandırılır. Örneğin, farklı eğri bağlantılı çizgiler kullanarak kendi şekillerinizi tanımlayabilirsiniz.
Basit Olmayan Bir Şekil
Aspose.Cells for Python via .NET’de, ilkel olmayan şekiller AutoShapeType.NOT_PRIMITIVE türüne atanmıştır. Türlerini Shape.auto_shape_type özelliğini kullanarak kontrol edebilirsiniz.
Şekil verisine Shape.paths özelliğini kullanarak erişin. Bu, primitif olmayan şekli oluşturan tüm bağlantılı yol segmentlerini döndürür. Bu yollar, her bir segmentteki noktaları içeren ShapePath türünden oluşan bir listeyi tutar.
Primitif Olmayan Bir Şeklin Örneğini Gösterir |
---|
![]() |
from aspose.cells import Workbook | |
from aspose.cells.drawing import AutoShapeType | |
# 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(".") | |
workbook = Workbook(dataDir + "NonPrimitiveShape.xlsx") | |
worksheet = workbook.worksheets[0] | |
# Accessing the user defined shape | |
shape = worksheet.shapes[0] | |
if shape.auto_shape_type == AutoShapeType.NOT_PRIMITIVE: | |
# Access shape's data | |
shapePathCollection = shape.paths | |
# Access information of indvidual path | |
for shapePath in shapePathCollection: | |
# Access path segment list | |
pathSegments = shapePath.path_segement_list | |
# Access individual path segment | |
for pathSegment in pathSegments: | |
# Gets the points in path segment | |
segmentPoints = pathSegment.points | |
for pathPoint in segmentPoints: | |
print("X: " + str(pathPoint.x) + ", Y: " + str(pathPoint.y)) |