Visio Guy

Visio Discussions => Programming & Code => Topic started by: suhaspatil3007 on November 24, 2011, 05:30:35 AM

Title: Export selected shapes to xml
Post by: suhaspatil3007 on November 24, 2011, 05:30:35 AM
I want to export selected shapes to xml.

e.g. i am thinking export shapesheet data to xml and recreate shape using that data.

please suggest guidelines on this
Title: Re: Export selected shapes to xml
Post by: aledlund on November 24, 2011, 06:18:39 AM
Export to XML is an all or none scenario. Saving the document as a VXD file is the XML export process.
al
Title: Re: Export selected shapes to xml
Post by: suhaspatil3007 on November 24, 2011, 08:18:14 AM
thanks for quick reply.
yes i got your point but i need to export only selected shapes and use them as reusable in other files.

so for that  i found that shape can be exported to vector graphics  (.svg ) file which is xml file.
So now the question is how can i read this data and create shape using  VBA or c#.

any suggestions..
Title: Re: Export selected shapes to xml
Post by: Nikolay on November 24, 2011, 08:28:18 AM
Check out my article:
http://unmanagedvisio.blogspot.com/2010/05/persisting-visio-shapes.html

It refers to binary data but maybe you will be able to persist Visio shape as XML in a similar way.
Title: Re: Export selected shapes to xml
Post by: suhaspatil3007 on November 24, 2011, 09:55:46 AM
i got my solution as
export -
Shape.Export ("c:\\testShape.svg")
import-
Visio.ActivePage.Import ("c:\\testShape.svg")
Title: Re: Export selected shapes to xml
Post by: Nikolay on November 24, 2011, 10:07:28 AM
Yes, looks fine )
Title: Re: Export selected shapes to xml
Post by: marko999 on August 08, 2012, 03:17:59 PM
Actually, for export, this will export all shapes, not just that shape?
Anyone knows how to do export of just one shape to svg?

Thanks
Marko
Title: Re: Export selected shapes to xml
Post by: Jumpy on August 10, 2012, 06:28:47 AM
Only a workarround: Copy shape to a blank page first.
Title: Re: Export selected shapes to xml
Post by: Nikolay on August 10, 2012, 06:39:20 AM
Quote from: marko999 on August 08, 2012, 03:17:59 PM
Actually, for export, this will export all shapes, not just that shape?

Why? This will export only the shape for which you called the "Export" method.
Title: Re: Export selected shapes to xml
Post by: marko999 on August 10, 2012, 02:52:18 PM
After some investigation around this issue and why I got confused - yes it exports only that shape, but only for simple shapes...if you export for example CFF Container(Swimlane), you will get all of contained shapes too...

Marko
Title: Re: Export selected shapes to xml
Post by: aledlund on August 11, 2012, 12:13:27 PM
And given the changes in v2013 vs. the previous versions, the new XML schemas come into play.
al
Browser ID: smf (is_webkit)
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 1: index+Modifications.english (default).
Style sheets: 0: .
Hooks called: 70 (show)
Files included: 25 - 925KB. (show)
Memory used: 770KB.
Tokens: post-login.
Cache hits: 6: 0.00109s for 22,292 bytes (show)
Cache misses: 1: (show)
Queries used: 8.

[Show Queries]