Re: Macro to add a connection point to the center of every circle in a dwg

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Markus Breugst (markus.breugst__AT__gedilan-technologies.de)
Date: 07/29/04


Date: Thu, 29 Jul 2004 14:23:32 +0200

Hi,

I don't know how to find out if the shape is a circle, since these basic
shapes don't seem to have a master. Thus, the macro below just adds one
connection point to the middle of each selected(!) shape, independent of its
type.
Note that the function below does not check if the connection point already
exists. However, it's just meant as an example to show how this could work.

Best regards,
Markus

Public Sub AddConnectionPoint()
    Dim selectedShapes As Selection
    Dim theShape As Shape
    Dim index As Integer
    Dim rowNumber As Integer

    Set selectedShapes = ActiveWindow.Selection

    For index = 1 To selectedShapes.Count
        Set theShape = selectedShapes.Item(index)
        If theShape.SectionExists(Visio.visSectionConnectionPts, 1) = False
Then
            theShape.AddSection (Visio.visSectionConnectionPts)
        End If
        rowNumber = theShape.AddRow(Visio.visSectionConnectionPts,
Visio.visRowConnectionPts, Visio.VisRowTags.visTagCnnctPt)
        theShape.CellsSRC(Visio.visSectionConnectionPts,
Visio.visRowConnectionPts, Visio.visX).Formula = "=Width/2"
        theShape.CellsSRC(Visio.visSectionConnectionPts,
Visio.visRowConnectionPts, Visio.visY).Formula = "=Height/2"
    Next
End Sub

"Yury" <ymonakov@skycapitalholdings.com> schrieb im Newsbeitrag
news:es2SJX0cEHA.2268@TK2MSFTNGP12.phx.gbl...
> Hello, I'm trying to figure out how to add a connection point that is
> relative to a shape, such as the center of a circle. I'm used to doing
this
> in Autocad, but not in visio. Can someone show me how to make a macro or
> know if one already esists that can find all the circle shapes in a
drawing,
> and insert a connection point at the center of each one.
>
> (Usiing visio2003)
>
> Thanks in advance..
>
>



Relevant Pages

  • Re: Macro to add a connection point to the center of every circle in a dwg
    ... I don't know how to find out if the shape is a circle, ... the macro below just adds one ... Note that the function below does not check if the connection point already ... Dim selectedShapes As Selection ...
    (microsoft.public.visio.developer.vba)
  • Re: Macro to add a connection point to the center of every circle in a dwg
    ... I don't know how to find out if the shape is a circle, ... the macro below just adds one ... Note that the function below does not check if the connection point already ... Dim selectedShapes As Selection ...
    (microsoft.public.visio.developer)
  • Re: Macro to add a connection point to the center of every circle in a dwg
    ... I don't know how to find out if the shape is a circle, ... the macro below just adds one ... Note that the function below does not check if the connection point already ... Dim selectedShapes As Selection ...
    (microsoft.public.visio)
  • mail merge code template with connection strings
    ... I am wanting to create a macro that will connect to a file in code and ... I am currently connecting with an ODBC connection, ... Dim cnn As New ADODB.Connection ... Set rst = New ADODB.Recordset ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Roundabouts
    ... but here's a thought - has anyone every tried constructing a "city ... That's essentially the way the circle line in London came into being. ... the GC and the Metropolitan still exists, with Met trains and Chiltern ... The connection at King's Cross onto the widenned ...
    (uk.railway)