Automation and automatic layout information

I

ilias

Hi,

Can you please elucidate how someone can create an automatic layout
based on a text data file? Imagine that I have many txt files, each
one populated with only a NxN number matrix M that corresponds to a
network connectivity (if element m(i,j) is 1, then node i and j are
connected). If I want to have Visio to automatically import one by
one these txt files, draw the network nodes and connectivity and save
them iteratively, how should I do that. Specifically :

a) What language would you use (VBA, C++) and what are the trade
offs?
b) What if the shape of nodes is not one of the basics but one that I
have predefined in Visio previously.
c) Are there routing algorithms already implemented in Visio so that
connectivity lines would not overlap with shapes? If not then are
there commands that would implement such constrains?

Thanks for your answer and time, I would appreciate if you could
include complete code or http links to similar sources. I hope this
post to evolve and be a newbie's -like me- handbook to the visio
automation universe.

Thanks
ilias
 
A

Al Edlund

An interesting question. There are many parts to it so maybe if we look at
some of the components. First Visio stopped inputing text directly quite
awhile ago so you may have to write your own. However the latest version of
Visio Professional (v2007) does support datarecordsets which can be loaded
using odbc connections. Odbc does support text input of table data, and it
can feed datarecordsets. This might help with the inferred table structure
you are mentioning.

Dropping shapes on the page based upon datarecordsets is demonstrated in the
v2007 sdk which is available on MSDN. The code example demonstrates how to
drop various different shapes using excel worksheets (although not directly
text, excel does support importing it natively). The solution illustrates
shape selection from stencils.

Another point of interest is the new datamining addin which supports drawing
complex interrelationships natively. The assumption here is the data is in
some structured mechanism.

http://blogs.msdn.com/wmorein/archive/2007/02/24/data-mining-add-ins-for-visio-2007-released.aspx

Finally connecting the shapes that you drop with the code that you write can
also be an interesting scenario. The visio team has a good discussion of how
to tie shapes together over here.

http://blogs.msdn.com/visio/archive/2006/09/15/756352.aspx

al

ps Predicate logic is now supported in vs.net which can be used to develop
some interesting solutions similar to what traditionally has been only
available in declaritive languages such as Prolog and Lisp.
 
N

nbelyh

a) What language would you use (VBA, C++) and what are the trade

If you do not have other reasons for using C++,
Visio integration is definitely not a reason to go for it.
b) What if the shape of nodes is not one of the basics but one that I
have predefined in Visio previously.

These "predefined" shapes are called "masters" in visio,
and you can use those without any problems.
There is a bunch of functions in visio api to work with them.
c) Are there routing algorithms already implemented in Visio so that
connectivity lines would not overlap with shapes? If not then are
there commands that would implement such constrains?

You could try Visio built-in layout engine..
Maybe it will be good enough for your perposes.

BTW, have you looked at GraphViz (http://www.graphviz.org/)?
if all you need is a picture of the graph from the interconnection
matrix,
maybe it would be easier for you to go with it (either for layout or
for everything?)
 
I

ilias

Thanks for your responses. It is strange that Visio would support txt
entries only going through db. In my case I find it very
restrictive.
As for graphviz this is exactly what I was hoping Visio would be able
to do. I am using Graphviz for 3 years now for automatic graph
layouts
and I am happy with all its aspects except from aesthetics. If anyone
has code snippets or link to a specific example where visio would be
utilized the same way graphviz is, this would be very helpful.

Thanks
ilias
 
M

Maurice Calvert

You might be interested in this Visio addin to layout diagrams with Graphviz:

http://www.calvert.ch/graphvizio/

Best regards,
Maurice Calvert




ilias wrote:

Thanks for your responses.
23-May-07

Thanks for your responses. It is strange that Visio would support tx
entries only going through db. In my case I find it ver
restrictive
As for graphviz this is exactly what I was hoping Visio would be abl
to do. I am using Graphviz for 3 years now for automatic grap
layout
and I am happy with all its aspects except from aesthetics. If anyon
has code snippets or link to a specific example where visio would b
utilized the same way graphviz is, this would be very helpful

Thank
ilia


Previous Posts In This Thread:

Automation and automatic layout information
Hi

Can you please elucidate how someone can create an automatic layou
based on a text data file? Imagine that I have many txt files, eac
one populated with only a NxN number matrix M that corresponds to
network connectivity (if element m(i,j) is 1, then node i and j ar
connected). If I want to have Visio to automatically import one b
one these txt files, draw the network nodes and connectivity and sav
them iteratively, how should I do that. Specifically

a) What language would you use (VBA, C++) and what are the trad
offs
b) What if the shape of nodes is not one of the basics but one that
have predefined in Visio previously
c) Are there routing algorithms already implemented in Visio so tha
connectivity lines would not overlap with shapes? If not then ar
there commands that would implement such constrains

Thanks for your answer and time, I would appreciate if you coul
include complete code or http links to similar sources. I hope thi
post to evolve and be a newbie's -like me- handbook to the visi
automation universe

Thank
ilias

An interesting question.
An interesting question. There are many parts to it so maybe if we look at
some of the components. First Visio stopped inputing text directly quite
awhile ago so you may have to write your own. However the latest version of
Visio Professional (v2007) does support datarecordsets which can be loaded
using odbc connections. Odbc does support text input of table data, and it
can feed datarecordsets. This might help with the inferred table structure
you are mentioning

Dropping shapes on the page based upon datarecordsets is demonstrated in the
v2007 sdk which is available on MSDN. The code example demonstrates how to
drop various different shapes using excel worksheets (although not directly
text, excel does support importing it natively). The solution illustrates
shape selection from stencils

Another point of interest is the new datamining addin which supports drawing
complex interrelationships natively. The assumption here is the data is in
some structured mechanism

http://blogs.msdn.com/wmorein/archive/2007/02/24/data-mining-add-ins-for-visio-2007-released.asp

Finally connecting the shapes that you drop with the code that you write can
also be an interesting scenario. The visio team has a good discussion of how
to tie shapes together over here

http://blogs.msdn.com/visio/archive/2006/09/15/756352.asp

a

ps Predicate logic is now supported in vs.net which can be used to develop
some interesting solutions similar to what traditionally has been only
available in declaritive languages such as Prolog and Lisp


If you do not have other reasons for using C++,Visio integration is definitely
If you do not have other reasons for using C++
Visio integration is definitely not a reason to go for it

These "predefined" shapes are called "masters" in visio
and you can use those without any problems
There is a bunch of functions in visio api to work with them


You could try Visio built-in layout engine..
Maybe it will be good enough for your perposes.

BTW, have you looked at GraphViz (http://www.graphviz.org/)?
if all you need is a picture of the graph from the interconnection
matrix,
maybe it would be easier for you to go with it (either for layout or
for everything?)

Thanks for your responses.
Thanks for your responses. It is strange that Visio would support txt
entries only going through db. In my case I find it very
restrictive.
As for graphviz this is exactly what I was hoping Visio would be able
to do. I am using Graphviz for 3 years now for automatic graph
layouts
and I am happy with all its aspects except from aesthetics. If anyone
has code snippets or link to a specific example where visio would be
utilized the same way graphviz is, this would be very helpful.

Thanks
ilias



Submitted via EggHeadCafe - Software Developer Portal of Choice
WPF Report Engine, Part 4
http://www.eggheadcafe.com/tutorial...45-8b37cb7f3186/wpf-report-engine-part-4.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top