Reading the contents of Microsoft Visio (2010) doc in IronPython

后端 未结 1 851
-上瘾入骨i
-上瘾入骨i 2021-01-26 14:37

I have an assignment to write a program in IronPython, that reads a Visio (2010) Document, and outputs in CMD what objects are in the active page, and how they are connected to

相关标签:
1条回答
  • 2021-01-26 15:21

    You could start with something like this... it's pretty straightforward I suppose..

    .......
    .......
    page = visapp.ActivePage
    
    for shape in page.Shapes:
        if not shape.OneD:
            print shape.Name + " '" + shape.Text + "'"
            for connectedShapeId in shape.ConnectedShapes(2, ""):
                connectedShape = page.Shapes.ItemFromID[connectedShapeId]
                print " => " + connectedShape.Name + " '" + connectedShape.Text + "'"
    
    0 讨论(0)
提交回复
热议问题