您好,我需要开发一个用于在 visio 中创建图表对象的插件。我能够创建顶部形状,但不能创建其派生类型。 对于 EG 我可以使用 c# 在 visio 中创建开始事件,但无法创建消息类型或其他类型的开始事件
在上图中,我有 3 个开始事件,添加了 BPMN 开始事件,并且更改了其属性 Trigger/Result 选项
Start Event - Multiple
Start Event - Message
Start Event - None
但以上3个形状均来自Start Event。如何创建 Message start 事件或 Multiple start 事件等。
我正在使用 visio 创建形状
Visio.Master shapetodrop = Masters.get_ItemU(@"Start Event");
Visio.Shape DropShape = ActivePage.Drop(shapetodrop, x, y);
DropShape.Name = name;
DropShape.Text = name;
但这只会创建 Start Event,如何创建 Message Start EVent,Multiple Start Event 等
最佳答案
在 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;
}
}
我可以获得消息开始事件。可以为形状的所有属性分配像这样的值。
关于c# - 使用 C# 在 visio 中创建形状,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32989677/