Closed nnako closed 3 years ago
All these "handles" should be available in python-pptx
. Have you studied this section in the documentation?
https://python-pptx.readthedocs.io/en/latest/user/autoshapes.html#adjusting-an-autoshape
You can ask further questions after getting as far as you can with that.
This is another document that might be helpful after some detective work:
https://github.com/scanny/python-pptx/blob/master/spec/ISO-IEC-29500-1/schemas/dml-geometries/OfficeOpenXML-DrawingMLGeometries/presetShapeDefinitions.xml
This file contains the definitions for each of the "preset" shapes, and callouts are one of those. The mapping of the names is not direct, you'll have to narrow down the one you're interested in, possibly "wedgeRectCallout". But this will tell you what the adjustment points are and how they are used to draw the shape. Also it lists the connection points.
Yeah, pretty sure wedgeRectCallout
corresponds to RECTANGULAR_CALLOUT
. There is some "run once" code here that I used to form some spec files for mapping these and MsoShapeRectangularCallout
is mapped to wedgeRectCallout
in there: https://github.com/scanny/python-pptx/blob/master/spec/gen_spec/src_data/msoAutoShapeType.py
thank you for your help, @scanny. as you mentioned above, the functionality to control the shape's adjustment handles is already present and working within the code base. so, my question is solved and there would be no need to further get into the code for me, at this point. only the documentation should be updated as the description does not fit the implementation. at least not for what I saw concerning RECTANGULAR_CALLOUT shapes. I'll try to fix the documentation as soon as I found out where / how to do so.
thank you for the links to the extensive structure description files. knowledge of those gives a good anchor point for understanding the inner workings of the python-pptx
universe.
Hi,
within my presentations, I am frequently using RECTANGULAR_CALLOUT elements. Within the Powerpoint GUI, they are displayed showing five "handles" with which I can adjust each one of the corners plus one further "pointer" to be placed somewhere on the current slide:
pptx.enum.shapes.MSO_SHAPE.RECTANGULAR_CALLOUT
the RECTANGULAR_CALLOUT looks something like this, where
A
,B
,C
,D
andE
are the visible adjustable handles:Now, in Powerpoint I can access and adjust the four corners of the shape by using the mouse or by using the shape's settings menu. The pointing handle
E
I can drag with the mouse as well. But there is no setting within the shape's settings menu where I could see the current position of the shape's handleE
. And withinpython-pptx
I don't see a corresponding member, either.Is there a way to adjust the pointing handle
E
of the RECTANGULAR_CALLOUT shape by usingpython-pptx
so that I don't need to use the Powerpoint GUI?If there is no way, yet, could somebody assist me in finding the right places within the code base in order to be able to implement and suggest a solution myself? Unfortunately, I lack any knowledge about the
python-pptx
system structure, yet.Any hints?
Thanks.