0

我正在编写一个 visio 导出并创建了一个包含自定义行尾的 visio 模板文件。当我尝试使用代码设置它们时,它不起作用。

    //Create two shapes
    final IVMaster lApp = stencilObj.masters("Application");
    IVShape shapeFrom = pagObj.drop(lApp, 1, 1);
    IVShape shapeTo = pagObj.drop(lApp, 2, 3);

    //Connect the shapes
    final IVMaster connMaster = stencilObj.masters("Connection");
    IVShape connection = pagObj.drop(connMaster, 2, 3);
    final IVCell gluefrom1 = connection.cells("BeginX");
    final IVCell glueat1 = shapeFrom.cells("PinX");
    gluefrom1.glueTo(glueat1);

    final IVCell gluefrom2 = connection.cells("EndX");
    final IVCell glueat2 = shapeTo.cells("PinX");
    gluefrom2.glueTo(glueat2);

    //Set arrow ending
    connection.cellsU("EndArrow").formulaForceU(new Integer(46).toString());

所以 visio 中有 45 个默认行尾,列表中的第 46 个是我的。当我设置数字 45 时,它有效,数字 46 无效。当我右键单击连接并转到格式-> 行时,选择了正确的行尾并且预览也是正确的。我必须再次选择结尾并单击应用以在文档中更新它。

我正在使用 Visio 2007

4

1 回答 1

0

好的,我发现了问题。您需要使用行尾的全名并使用它调用 visio 函数。

 //Set arrow ending
 connection.cellsU("EndArrow").formula("=USE(\"46: interface_in\")");
于 2012-10-19T15:21:55.343 回答