Linking shapes on a Data Center Floorplan

J

John

Hello All,

I have a Data Center Floorplan in Visio Professional 2003. I would like to
link the individual shapes (cabinets) on this floorplan to individual Visio
Files (.vsd) that contain a front view of these cabinets. These files are on
our networked disk drive. And if that is possible then I would like to link
the shapes (servers) in the front view of each cabinet (.vsd file) to it's
corresponding asset in a Remedy Action Request System (ARS) database.
Basically I am trying to do what the Aperture Application already does.
Thank you. John B. Beck
 
A

AlEdlund

The first part is easy, you can add a hyperlink to the shape to call the vsd
file. The second part has always been a challenge in that somebody is going
to have to write the database specific interface (Sybase, MS SQL Server,
Oracle, etc...) to query the information that you want. This of course
infers knowledge of the schema and the ability to link to the actual data.
My limited experience is that DBA's don't let others into the domain
lightly. One technique that worked for me was to have the DBA batch a
read-only copy of the tables I needed so that I could use SQL Server DTS to
mirror them to a local copy for me to work against.
al
 
J

John

Thank you for the quick reply. And for me to add the hyperlink and call the
vsd file would be something like the following:

Highlight or select the shape
Click on the 'Insert' pull-down menu
Click on 'Hyperlinks'
Then from the Hyperlinks dialog box click on 'Browse' to the right of the
'Address' box

Is there a way for me to be able to double-click on the shape and it will
launch the vsd file?
 
A

AlEdlund

well, you could add a custom property to each of the shapes where you could
save the appropriate path/file for the drawings, then write a macro to read
the selected shape and open the drawing, the macro can be called from the
shape double click event.
al
 
J

John

How exactly do I save the appropriate path/file for the vsd drawings? I
admit that I am not a Visio Guru. And I have never written a macro before. I
do know how to get to the shape double click event.
 
A

AlEdlund

For this example

I created a custom property in the shape called "OtherDrawing"
(prop.otherdrawing)
In the field I put a pointer to another drawing ("c:\temp\drawing2.vsd")
In the eventdblclick field I put
"RUNMACRO(""ThisDocument.OpenOtherDrawing"")"
In the thisdocument (vba editor) I put the following macro

works for me,
al



Public Sub OpenOtherDrawing()

On Error GoTo ErrHandler

Dim docsObj As Visio.Documents
Dim docObj As Visio.Document
Set docsObj = Visio.Documents
Dim strOtherFile As String
Dim selShape As Visio.Selection
Dim shpSelected As Visio.Shape
Set shpSelected = Application.ActiveWindow.Selection(1)
Dim visCell As Visio.Cell
If shpSelected.CellExists("prop.OtherDrawing", False) = True Then
Set visCell = shpSelected.Cells("prop.OtherDrawing")
strOtherFile = visCell.ResultStr("")
Set docObj = docsObj.Open(strOtherFile)
'MsgBox "other file opened"
End If
Exit Sub

ErrHandler:

MsgBox "OpenOtherFileFailed " & Err.Description

End Sub
 

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