I am making a tool to automatically generate diagrams in draw but I have issues applying properties to the ConnectorShape
I am using LibreOffice 24.2.3 Portable and the uno python library
I would like to make an arrow with dotted line connecting one shape to the other in a straight line
The code below allow to create the connector shape but the properties change have either no effect or causes an error
Code: Select all
def add_connector(self, rect_start, rect_end):
"""Create a connector between rect"""
connector = self.document.createInstance("com.sun.star.drawing.ConnectorShape")
# Ajouter le connecteur à la page de dessin
self.page.add(connector)
# Définir le type de connecteur
connector.setPropertyValue("LineStyle", "DASH")
connector.setPropertyValue("ConnectorType", "LINE") # "Straight", "Curved", etc.
connector.setPropertyValue("LineJoint", "ROUND")
# Définir les flèches aux extrémités du connecteur
#connector.setPropertyValue("EndArrow", 2) # 2 pour une flèche pleine
#connector.setPropertyValue("StartArrow", 0) # 0 pour pas de flèche
# Connecter le connecteur aux rectangles
connector.StartShape = rect_start
connector.EndShape = rect_end
return connector
Do you know how to implement theses properties in python or any guide that will help me do so ?
Thanks for any help