S
Søren M. Olesen
Hi
Is there a fast way to add connection points to a shape, something like
SetFormulas ??
today I do something like (for a circle):
_shape = _visioApp.ActivePage.DrawOval(_xpos, _ypos, _xpos + radius, _ypos +
radius)
'Lets add some connectpoints to the circle
'First one at the bottom of the circle
Dim i As Integer =
_shape.AddRow(CShort(Visio.VisSectionIndices.visSectionConnectionPts),
CShort(Visio.VisRowIndices.visRowLast),
CShort(Visio.VisRowTags.visTagCnnctPt))
_bottomConnectRow =
_shape.Section(CShort(Visio.VisSectionIndices.visSectionConnectionPts)).Row(CShort(i))
_bottomConnectRow.Cell(Visio.VisCellIndices.visCnnctX).FormulaU =
"Width*0.5"
_bottomConnectRow.Cell(Visio.VisCellIndices.visCnnctY).FormulaU = "Height*0"
_bottomConnectRow.Cell(Visio.VisCellIndices.visCnnctDirX).FormulaU = "0.0"
_bottomConnectRow.Cell(Visio.VisCellIndices.visCnnctDirY).FormulaU = "1.0"
_bottomConnectRow.Cell(Visio.VisCellIndices.visCnnctType).FormulaU =
CStr(Visio.VisCellVals.visCnnctTypeInward)
'Next one at the top
i = _shape.AddRow(CShort(Visio.VisSectionIndices.visSectionConnectionPts),
CShort(Visio.VisRowIndices.visRowLast),
CShort(Visio.VisRowTags.visTagCnnctPt))
_topConnectRow =
_shape.Section(CShort(Visio.VisSectionIndices.visSectionConnectionPts)).Row(CShort(i))
_topConnectRow.Cell(Visio.VisCellIndices.visCnnctX).FormulaU = "Width*0.5"
_topConnectRow.Cell(Visio.VisCellIndices.visCnnctY).FormulaU = "Height"
_topConnectRow.Cell(Visio.VisCellIndices.visCnnctDirX).FormulaU = "0.0"
_topConnectRow.Cell(Visio.VisCellIndices.visCnnctDirY).FormulaU = "-1.0"
_topConnectRow.Cell(Visio.VisCellIndices.visCnnctType).FormulaU =
CStr(Visio.VisCellVals.visCnnctTypeInward)
'Next one to the right
i = _shape.AddRow(CShort(Visio.VisSectionIndices.visSectionConnectionPts),
CShort(Visio.VisRowIndices.visRowLast),
CShort(Visio.VisRowTags.visTagCnnctPt))
_rightConnectRow =
_shape.Section(CShort(Visio.VisSectionIndices.visSectionConnectionPts)).Row(CShort(i))
_rightConnectRow.Cell(Visio.VisCellIndices.visCnnctX).FormulaU = "Width"
_rightConnectRow.Cell(Visio.VisCellIndices.visCnnctY).FormulaU =
"Height*0.5"
_rightConnectRow.Cell(Visio.VisCellIndices.visCnnctDirX).FormulaU = "-1.0"
_rightConnectRow.Cell(Visio.VisCellIndices.visCnnctDirY).FormulaU = "0.0"
_rightConnectRow.Cell(Visio.VisCellIndices.visCnnctType).FormulaU =
CStr(Visio.VisCellVals.visCnnctTypeInward)
'Next one to the left
i = _shape.AddRow(CShort(Visio.VisSectionIndices.visSectionConnectionPts),
CShort(Visio.VisRowIndices.visRowLast),
CShort(Visio.VisRowTags.visTagCnnctPt))
_leftConnectRow =
_shape.Section(CShort(Visio.VisSectionIndices.visSectionConnectionPts)).Row(CShort(i))
_leftConnectRow.Cell(Visio.VisCellIndices.visCnnctX).FormulaU = "Width*0"
_leftConnectRow.Cell(Visio.VisCellIndices.visCnnctY).FormulaU = "Height*0.5"
_leftConnectRow.Cell(Visio.VisCellIndices.visCnnctDirX).FormulaU = "1.0"
_leftConnectRow.Cell(Visio.VisCellIndices.visCnnctDirY).FormulaU = "0.0"
_leftConnectRow.Cell(Visio.VisCellIndices.visCnnctType).FormulaU =
CStr(Visio.VisCellVals.visCnnctTypeInward)
however it's rather slow, so I was wondering if a faster way exists....
TIA
Søren
Is there a fast way to add connection points to a shape, something like
SetFormulas ??
today I do something like (for a circle):
_shape = _visioApp.ActivePage.DrawOval(_xpos, _ypos, _xpos + radius, _ypos +
radius)
'Lets add some connectpoints to the circle
'First one at the bottom of the circle
Dim i As Integer =
_shape.AddRow(CShort(Visio.VisSectionIndices.visSectionConnectionPts),
CShort(Visio.VisRowIndices.visRowLast),
CShort(Visio.VisRowTags.visTagCnnctPt))
_bottomConnectRow =
_shape.Section(CShort(Visio.VisSectionIndices.visSectionConnectionPts)).Row(CShort(i))
_bottomConnectRow.Cell(Visio.VisCellIndices.visCnnctX).FormulaU =
"Width*0.5"
_bottomConnectRow.Cell(Visio.VisCellIndices.visCnnctY).FormulaU = "Height*0"
_bottomConnectRow.Cell(Visio.VisCellIndices.visCnnctDirX).FormulaU = "0.0"
_bottomConnectRow.Cell(Visio.VisCellIndices.visCnnctDirY).FormulaU = "1.0"
_bottomConnectRow.Cell(Visio.VisCellIndices.visCnnctType).FormulaU =
CStr(Visio.VisCellVals.visCnnctTypeInward)
'Next one at the top
i = _shape.AddRow(CShort(Visio.VisSectionIndices.visSectionConnectionPts),
CShort(Visio.VisRowIndices.visRowLast),
CShort(Visio.VisRowTags.visTagCnnctPt))
_topConnectRow =
_shape.Section(CShort(Visio.VisSectionIndices.visSectionConnectionPts)).Row(CShort(i))
_topConnectRow.Cell(Visio.VisCellIndices.visCnnctX).FormulaU = "Width*0.5"
_topConnectRow.Cell(Visio.VisCellIndices.visCnnctY).FormulaU = "Height"
_topConnectRow.Cell(Visio.VisCellIndices.visCnnctDirX).FormulaU = "0.0"
_topConnectRow.Cell(Visio.VisCellIndices.visCnnctDirY).FormulaU = "-1.0"
_topConnectRow.Cell(Visio.VisCellIndices.visCnnctType).FormulaU =
CStr(Visio.VisCellVals.visCnnctTypeInward)
'Next one to the right
i = _shape.AddRow(CShort(Visio.VisSectionIndices.visSectionConnectionPts),
CShort(Visio.VisRowIndices.visRowLast),
CShort(Visio.VisRowTags.visTagCnnctPt))
_rightConnectRow =
_shape.Section(CShort(Visio.VisSectionIndices.visSectionConnectionPts)).Row(CShort(i))
_rightConnectRow.Cell(Visio.VisCellIndices.visCnnctX).FormulaU = "Width"
_rightConnectRow.Cell(Visio.VisCellIndices.visCnnctY).FormulaU =
"Height*0.5"
_rightConnectRow.Cell(Visio.VisCellIndices.visCnnctDirX).FormulaU = "-1.0"
_rightConnectRow.Cell(Visio.VisCellIndices.visCnnctDirY).FormulaU = "0.0"
_rightConnectRow.Cell(Visio.VisCellIndices.visCnnctType).FormulaU =
CStr(Visio.VisCellVals.visCnnctTypeInward)
'Next one to the left
i = _shape.AddRow(CShort(Visio.VisSectionIndices.visSectionConnectionPts),
CShort(Visio.VisRowIndices.visRowLast),
CShort(Visio.VisRowTags.visTagCnnctPt))
_leftConnectRow =
_shape.Section(CShort(Visio.VisSectionIndices.visSectionConnectionPts)).Row(CShort(i))
_leftConnectRow.Cell(Visio.VisCellIndices.visCnnctX).FormulaU = "Width*0"
_leftConnectRow.Cell(Visio.VisCellIndices.visCnnctY).FormulaU = "Height*0.5"
_leftConnectRow.Cell(Visio.VisCellIndices.visCnnctDirX).FormulaU = "1.0"
_leftConnectRow.Cell(Visio.VisCellIndices.visCnnctDirY).FormulaU = "0.0"
_leftConnectRow.Cell(Visio.VisCellIndices.visCnnctType).FormulaU =
CStr(Visio.VisCellVals.visCnnctTypeInward)
however it's rather slow, so I was wondering if a faster way exists....
TIA
Søren