Author Topic: Change shape image dependent on database entry  (Read 6663 times)

0 Members and 1 Guest are viewing this topic.

cotswolddave

  • Newbie
  • *
  • Posts: 7
  • Infrastructure Visiualisation Specialist
    • Infrastructure Configuration Management
Change shape image dependent on database entry
« on: September 22, 2008, 04:19:39 PM »
I used another tool called netViz where the image could be changed based on a database field. The need is for displaying a shape called server in a rack, but the actual image would depend on the model number. I don't want different shapes as I need to preserve the data structures, just a different image.
netviz is no longer available, so any help welcome

Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1716
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Change shape image dependent on database entry
« Reply #1 on: September 23, 2008, 01:01:13 AM »
Hey CDave,

NetViz is no longer available period, or just at your company? Looks like CA bought them...

Anyway, to load different images would require a bit of code. I don't think you can coerce the data-linking features of Visio to somehow swap-out images based on data. Visio shapes don't really have the notion of: "I'm a link to an image, here's my path, load me"

Although the OrgChart solution in Visio can import images into employee shapes. It may be possible that a part of the OrgChart code that could be bastardised for more general purposes? Most of the OrgChart solution is contained in what is called an 'add-on". And shapes can call parts of the add-on's functionality using the add-on name and some command-line-style arguments.

Maybe someone out there has played around with this?
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2933
    • Paul Herber's website
Re: Change shape image dependent on database entry
« Reply #2 on: September 23, 2008, 02:58:56 PM »
If the required shapes aren't too complicated or there aren't too many of them then you could put each shape into separate geometry sections and just enable the required one. There is a shape like this (Flowchart shapes) in the basic flowchart shapes stencil. Each geometry section can be enabled individually.

If there are a lot of complicated shapes this could generate a very large shape. This may or may not be a problem.


Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1716
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Change shape image dependent on database entry
« Reply #3 on: September 23, 2008, 04:20:49 PM »
Oh yes, this article might help--it kind of relates to what Paul is talking about:

Visio Film Strip Shapes: Hurray for Hollywood!
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2933
    • Paul Herber's website
Re: Change shape image dependent on database entry
« Reply #4 on: September 23, 2008, 05:05:11 PM »
Crikey! Somebody knows what I'm talking about! Well, there's a novelty!



Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

aledlund

  • Hero Member
  • *****
  • Posts: 1412
Re: Change shape image dependent on database entry
« Reply #5 on: September 25, 2008, 10:16:33 AM »
I ended up adding a separate table to the process (product data) that has the stencil, front master, rear master definitions. I then point my component record to the product to put the correct version into the rack. This has the added beauty of allowing me to keep the environmentals in the same record for site reporting (heat, power, voltage, etc.)
HTH
al