Persisting Visio masters

29 views
Skip to first unread message

nbelyh

unread,
Apr 16, 2007, 1:38:39 AM4/16/07
to
I mean, I need to persist Visio masters outside of the Visio drawings,
and be able to drop those saved masters afterwards back to the
drawings. How do I do that?

How do I serialize/deserialize Visio master to/from a stream?
How this is implemented in ShapeStudio?

Paul Herber

unread,
Apr 16, 2007, 5:46:22 AM4/16/07
to

Look at XML in the Visio help and SDK.


--
Regards, Paul Herber, Sandrila Ltd.
Electronics for Visio http://www.electronics.sandrila.co.uk/

nbelyh

unread,
Apr 16, 2007, 10:02:18 AM4/16/07
to
Paul, thank you for the response.

> Look at XML in the Visio help and SDK.

Please, can you be more concrete?
I know, XML and open formats are great, but what relation does it have
to my question..?

I do NOT want to generate masters/drawings with XML... this is NOT the
intention.
I want to persist already existing masters (created by users).
Just like the ShapeStudio does.
(it persists masters to the database, in table "Masters" as BLOBs)

How can XML help here?

Kind regards, Nikolay K. Belyh

nbelyh

unread,
Apr 21, 2007, 4:12:16 PM4/21/07
to
Just to let the community know that the subject is possible.
Namely, it is possible to store master/shape in a stream and then drop
it back to the document.
The way this can be implemented:

- Query master or shape you want to persist for IDataObject interface.
- Using this interface, obtain data blob in "Visio 11 Shapes/Visio 11
Masters" clipboard format (for Visio 2003).

Now this blob can be stored any way you want (database/memory/
whaever).
To drop it back to the drawing, you can use "Drop" functions of visio
document/page.
It turns out that these functions are happy enough with IDataObject
interface passed in.
So, to drop the stored master or shape back to the drawing:

- Create you own object that implements IDataObject interface.
- Pass this object in one of those "Drop" functions,
- When asked for the data, return your stored data blob in that visio
format.

It works :)
But maybe there is an easier way to do all this stuff?

Reply all
Reply to author
Forward
0 new messages