モデルの子要素を取得する
モデルが所有している子要素を取得します。
public void GetChildren(ICommandContext c, ICommandParams p)
{
    var children = c.App.Workspace.CurrentModel.GetChildren();
    // 子要素の名前を情報ウィンドウの出力タブに出力します
    foreach ( var child in children )
    {
        c.App.Output.WriteLine("sample",child.Name);
    }
}
モデルが所有しているすべての子孫要素を取得します。
public void GetAllChildren(ICommandContext c, ICommandParams p)
{
    // メインエディタのモデルのすべての子孫要素を取得します
    var children = c.App.Workspace.CurrentModel.GetAllChildren();
    //...
}
プロジェクトのすべてのモデルを取得する場合はIProjectオブジェクトに対してGetAllChildrenメソッドを呼び出します。
public void GetAllChildren(ICommandContext c, ICommandParams p)
{
    // プロジェクトのすべての子孫要素を取得します
    var children = c.App.Workspace.CurrentProject.GetAllChildren();
    //...
}