Visio Guy

Visio Discussions => Programming & Code => Topic started by: OldSchool1948 on April 02, 2019, 12:56:06 PM

Title: Shape Linking Cause Hyperlinks to be Created
Post by: OldSchool1948 on April 02, 2019, 12:56:06 PM
In ThisDocument, I'm using the following code to verify that a "Server" shape with custom shape data is placed into the correct vnet or subnet when the shape is linked to a data row in the External Data window. 

Private Sub m_vsoPage_ShapeLinkAdded( _
                    ByVal vsoShape as IVShape, _
                    ByVal DataRecordSetID as Long, _
                    ByVal dataRowID as Long)

     If isShapeLocOnPageOK(vsoShape) = True then
        If isShapeServerCloud(vsoShape) = True then
             Call deleteShapeHyperLinkSection( _
                        vsoShape)
        End If
     End If
End Sub



The problem is, Visio creates hyperlinks for data elements related to disk sizes (e.g., Disk 1 Size, Disk 2 Size, Disk 3 Size, OS Disk Size), thus, I added code to delete the hyperlink section for "cloud" server shapes.  At no time in subs isShapeLocOnPageOK or isShapeServerCloud do I reference disk size data elements. 

Anyone else ever experience such a thing?
Title: Re: Shape Linking Cause Hyperlinks to be Created
Post by: Paul Herber on April 02, 2019, 01:16:20 PM
What is the shape name and what stencil is it in?
Title: Re: Shape Linking Cause Hyperlinks to be Created
Post by: OldSchool1948 on April 06, 2019, 07:39:57 PM
Sorry, I've been away for a while.

All of the shapes we use have custom shape data with no resemblance to any Visio provided shapes, and stencils are custom made with those shapes.  I maintain an infrastructure design and engineering tool.  Stencils are named:

A sampling of a typical server's shape data name:
Hidden fields:
ShapeClass - Cloud or On-Prem:
ShapeSubclass - VM or Phys (for physical host)
ShapeType - App Server, Web Server, MS DB, ORA DB, Web Service, Appliance, etc.
ShapeSubtype - Multi, Scaling, Sngl, Phys

Visible fields examples:
ServerName
FunctionalRole
Domain
OU
IPAddress
ApplicationSecurityGroup
etc.

Hyperlinks are also created when I refresh linked Shape data.  This is driving me nuts  :D.  I use code to delete them, but I'd rather fix the issue - if possible.
Title: Re: Shape Linking Cause Hyperlinks to be Created
Post by: Paul Herber on April 06, 2019, 08:17:28 PM
Could you post a diagram containing one of these shapes?
Title: Re: Shape Linking Cause Hyperlinks to be Created
Post by: OldSchool1948 on April 08, 2019, 05:04:59 PM
The attached zip file has a Visio file and Excel file.  The Visio file contains four server shapes.  The Excel file contains four notional server definitions.
Two shapes are linked and have the hyperlinks in question.  The other two are not linked.  If you link them, the hyperlinks are created.  Thanks for your help with this.