Will Visio do this?

P

Pete Thompson

Hi Visio People,

I wonder if anyone can help. I'm considering using Visio for the
following:

A simple circuit diagram is designed by the user. It consists of a
"power in" shape connected to a variety of switches, lamps and circuit
breakers. Once drawn, the circuit is simulated (by my code) and the
user can change the state of switches. As switches and circuit
breakers change state, the connecting lines change colour to represent
power flow.

The important thing is that the user can design many small circuits to
simulate and that the design element is handled completely by Visio
(meaning I don't have to reinvent the wheel)

The main questions are:

Can the image of a shape be changed programmatically? i.e. from an
open switch to a closed one.

Can I develop within the VB6 envirnment and "reach into" a running
instance of Visio to code the simulation?

Does anyone know of anything similar?

Thanks for your help.

Pete
 
M

Mark Nelson [MS]

Yes, this can be done and has been done. You might check out the Office
Marketplace (go to Help > Microsoft Office Online) to see if any 3rd party
is offering a circuit designer solution.

You can also create such a solution yourself. One option would be to host
the Visio ActiveX control in a VB6 form within an application that you
develop. A second option would be to write an add-on that runs within
Visio. You can also interact with Visio from an external program. Once you
figure out the basic hosting scheme, you should think about using Visio as a
design environment. How restrictive do you want the environment to be? Can
the users do anything they normally do in Visio, or will you be actively
checking to make sure that each action is "legal" and maintains the
integrity of the model? This will determine how much code you have to write
to tailor the design environment. It is easy to have the Visio drawing
reflect the state of varies things in the model.

An essential tool for learning how to create such a solution is the Visio
SDK available for download from MSDN. It has loads of samples for
individual tasks as well as a couple of complete solutions to show you how
applications can interact with Visio. Code snippets are available in
several programming languages.
 
P

Pete Thompson

Mark,

Thank you for an excellent reply! That has given me the confidence to
go ahead and specify Visio for this project. I've got the SDK and
will be trying a few things out before specifying in detail. I'll be
on this forum again I'm sure.

Pete
 

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