Add Geometry of Connector Shape programmatically

758 views Asked by At

I create shape and connectors with C# but I want to set Geometry of connectors (I mean lineTo, MoveTo) by code too.

I tried this code but it raise: This section type does not support named rows

short iRow = (short)(Microsoft.Office.Interop.Visio.VisRowIndices.visRowVertex);
short visTagLineTo = (short)Microsoft.Office.Interop.Visio.VisRowTags.visTagLineTo;
var aa = newShape.get_Section(1);
short sectionId = (short)(newShape.AddSection(
    (short)Microsoft.Office.Interop.Visio.VisSectionIndices.visSectionFirstComponent));
var row = newShape.AddNamedRow(sectionId, "LineTo", visTagLineTo);

Actually I don't know how to get the Geometry1 section.

1

There are 1 answers

1
Mike Woolf On

Despite the misleading user interface in the shapesheet window, geometry rows are not named rows. Try newShape.AddRow(sectionId, rowIndex, visTagLineTo) instead.