You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
frompptximportPresentationfrompptx.utilimportInchesprs=Presentation()
slide_layout=prs.slide_layouts[5] # Title and Content layoutslide=prs.slides.add_slide(slide_layout)
slide.shapes.title.text="Adding h3d file"path_to_h3d="test.h3d"slide.shapes.add_ole_object(
object_file=path_to_h3d, prog_id="Package", left=Inches(2), top=Inches(2)
)
prs.save("add_h3d.pptx")
Further improvement possibilities:
When .h3d is inserted by drag-and-drop, the prog_id is set to Package as the application is unknown, but if you know the prog_id for HyperWorks, you can replace that.
You can add icon_file as well for better aesthetics.
I am trying to use the pptx python package to programmatically embed an existing h3d file (Hyperworks output file) into a power point presentation.
I know it can be done manually by drag and drop the file into the power point but I would like to do it programmatically.
The text was updated successfully, but these errors were encountered: