I want to have my python program generate visio drawings using shapes from a stencil (.vss) file. How can I do that? I think I could generate the xml formatted .vdx file, but there isn't a lot of documentation on the .vdx format.
EDIT: the computer has visio installed.
If you have Visio installed, then you can use Visio API and Python CLR or COM bindings to make it do the things for you. Here are some similar SO questions (visio and python):
Reading the contents of Microsoft Visio (2010) doc in IronPython
Cannot open Visio document with Python
Check out Visio SDK and the free "Developing Visio Solutions" book in MSDN to start with.
Anyways, some code to start with (opens a standard "basic shapes" .VSS stencil then drops a rectangle shape and then saves as .VDX):
import win32com.clientvisio = win32com.client.Dispatch("Visio.Application")
doc = visio.Documents.Add("")
stn = visio.Documents.Open("BASIC_M.VSS")page = doc.Pages.Item(1)master = stn.Masters.Item("Rectangle")
rect = page.Drop(master, 0, 0)doc.SaveAs("C:\\<some directory>\\file.vdx")
doc.Close()visio.Quit()