Visio SDKページの再レイアウトフローチャート上から下へ
-
13-12-2019 - |
質問
フローチャートを表すデータの階層セットから動的VSDを作成しています。私はあなたがこれらの要素の絶対位置決めに耐える必要がありません - 自動レイアウトのオプションはちょうどうまく機能します。
問題は、コードを介してこのコマンドを実行する方法を理解することができません。UI(Visio 2010)では、コマンドがリボンにあります。デザイン(TAB) - >レイアウト(グループ) - >再レイアウト(スプリットボタン)。
これらのいずれかをやるでしょう。2,2日間のVisio SDKのドキュメンテーションとグーグルを通して見ることは非常に多くの使用のものを元に戻しました。
任意のアイデア?(C#を使用していますが、VB / VBAがやること)
解決
page.layout()メソッド自体は十分ではありません。
wbstreeview.slnサンプルプロジェクト(vb.net)私はこれを達成する方法を見つけましたが、8時間後まで私の答えを投稿できませんでした:-x
下記の列挙型を覗くことで他のレイアウトの種類が可能です。 Compact - > RoundRightは、作成しているほとんどのフローに向かって優れているだけです。
C#:
に翻訳されました // auto-layout, Compact Tree -> Down then Right
var layoutCell = this._page.PageSheet.get_CellsSRC(
(short)VisSectionIndices.visSectionObject,
(short)VisRowIndices.visRowPageLayout,
(short)VisCellIndices.visPLOPlaceStyle);
layoutCell.set_Result(
VisUnitCodes.visPageUnits,
(short)VisCellVals.visPLOPlaceCompactDownRight);
layoutCell = this._page.PageSheet.get_CellsSRC(
(short)VisSectionIndices.visSectionObject,
(short)VisRowIndices.visRowPageLayout,
(short)VisCellIndices.visPLORouteStyle);
layoutCell.set_Result(
VisUnitCodes.visPageUnits,
(short)VisCellVals.visLORouteFlowchartNS);
//// to change page orientation
//layoutCell = this._page.PageSheet.get_CellsSRC(
// (short)VisSectionIndices.visSectionObject,
// (short)VisRowIndices.visRowPrintProperties,
// (short)VisCellIndices.visPrintPropertiesPageOrientation);
//layoutCell.set_Result(
// VisUnitCodes.visPageUnits,
// (short)VisCellVals.visPPOLandscape);
// curved connector lines
layoutCell = this._page.PageSheet.get_CellsSRC(
(short)VisSectionIndices.visSectionObject,
(short)VisRowIndices.visRowPageLayout,
(short)VisCellIndices.visPLOLineRouteExt);
layoutCell.set_Result(
VisUnitCodes.visPageUnits,
(short)VisCellVals.visLORouteExtNURBS);
// perform the layout
this._page.Layout();
// optionally resize the page to fit the space taken by its shapes
this._page.ResizeToFitContents();
//
.
コネクタ線の色を変える
色の数式がどのように機能するかに不慣れな場合、これも非常にイライラするかもしれません。
他のヒント
レイアウトメソッド page オブジェクト。このページで選択された形がある場合、このメソッドは現在の選択のみで動作します。 ActiveWindow 最初の
所属していません StackOverflow