This short guide describes how to add SmartArt graphics in PowerPoint using Python. It covers the IDE settings, a list of step-by-step instructions, and sample code for working with PowerPoint smart art using Python. You will get details onn how to customize the output PPT/PPTX by setting the various parameters.
Steps for PowerPoint Presentation SmartArt Graphics using Python
- Set up the environment to use Aspose.Slides for Python via .NET to add a SmartArt shape
- Create a blank presentation using the Presentation class
- Create a new basic process diagram with the add_smart_art() method and remove the default nodes using the remove_node() method
- Add new nodes in the diagram for depicting the process steps
- Add another slide with an organization chart and remove the existing default nodes
- Add a root node and multiple child nodes in the diagram at various positions
- Insert a third slide with a basic cycle diagram, remove its default nodes, and add desired formatted nodes
These steps explain how to create smart art for PowerPoint with Python. Import the desired modules from the library, add a SmartArt shape with the add_smart_art() method, remove default nodes with the remove_node() method, and add new nodes with the add_node() method. Set relevant properties for the added nodes, such as text_frame.text, is_assistant, organization_chart_layout, and fonts, as needed.
Code for Adding SmartArt Diagram in PowerPoint using Python
This code demonstrates how to add and set the PowerPoint smart art design using Python. You can switch an existing diagram to a different layout to avoid deleting and creating the diagram again. Use reversed mode on the process diagram so the steps depict the other way.
This article shows how to work with the SmartArt graphics. To remove notes from a PowerPoint, refer to the article Remove Notes from PowerPoint using Python.