使用c#在visio中创建形状

Dah*_*Sra 5 c# visio bpmn visio2013

嗨我需要开发一个用于在visio中创建图表对象的插件.我能够创建顶部形状但不能创建它的派生类型.对于EG,我能够使用c#在visio中创建Start事件,但无法创建消息类型的Start Event或其他 在此输入图像描述

在上图中,我有3个启动事件,添加了BPMN启动事件,并更改了其属性Trigger/Result选项

开始活动 - 多个

开始活动 - 消息

开始活动 - 无

但以上3种形状均来自Start Event.如何创建Message start事件或Multiple start evet等.

我正在使用visio创建形状

            Visio.Master shapetodrop = Masters.get_ItemU(@"Start Event");
            Visio.Shape DropShape = ActivePage.Drop(shapetodrop, x, y);
            DropShape.Name = name;
            DropShape.Text = name;
Run Code Online (Sandbox Code Playgroud)

但这只会创建Start Event,如何创建Message Start EVent,Multiple Start Event等

Dah*_*Sra 3

用于迭代 visio 中形状的每个属性

  short iRow = (short)Visio.VisRowIndices.visRowFirst;
            while (shape.get_CellsSRCExists((short)Visio.VisSectionIndices.visSectionProp, iRow, (short)Visio.VisCellIndices.visCustPropsValue, (short)Visio.VisExistsFlags.visExistsAnywhere) != 0)
            {
                Visio.Cell c = shape.get_CellsSRC((short)Visio.VisSectionIndices.visSectionProp, iRow, (short)Visio.VisCellIndices.visCustPropsValue);
                         switch (c.Name)
                        {
                            case "Prop.BpmnTriggerOrResult":
                                shape.Cells[c.Name].FormulaU = "\"" + "Message" + "\"";
                                break;

                        }
}
Run Code Online (Sandbox Code Playgroud)

我可以得到消息开始事件。像这个值一样,可以为形状的所有属性分配值。