Implements

Methods

  • Add a category to the ribbon bar.

    Parameters

    • name: string

      The name of the category, used to identify a specific category.

    • title: string

      The title of the category, used to display the category.

    Returns Promise<null | RibbonCategoryType>

    The RibbonCategory obj added to the ribbon bar.

    const ribbonBar = await app.getRibbonBar(parentWnd);
    const ribbonCategory = await ribbonBar.addCategory('categoryName', 'categoryTitle');
  • Find the RibbonElement object by the name of the category, panel, and element.

    Parameters

    • categoryName: string

      The name of the category, used to specify the required category.

    • panelName: string

      The name of the panel, used to specify the required panel.

    • btnName: string

      The name of the element, used to specify the required element.

    Returns Promise<null | RibbonElementType>

    • Get the specified RibbonElement object.
  • Get the category object by index.

    Parameters

    • index: number

      The index of the category. This value can be iterated through from getCategoryCount.

    Returns Promise<null | RibbonCategoryType>

    Get the specified category object.

    const ribbonBar = await app.getRibbonBar(parentWnd);
    const categoryCount = await ribbonBar.getCategoryCount(0);
    for (let i = 0; i < categoryCount; i++) {
    const ribbonCategory = await ribbonBar.getCategoryByIndex(i);
    }
  • Get the number of categories in the ribbon bar.

    Returns Promise<number>

    The number of categories in the ribbon bar.

    const ribbonBar = await app.getRibbonBar(parentWnd);
    const categoryCount = await ribbonBar.getCategoryCount();
  • Recalculate the layout of the ribbon bar.

    Parameters

    • reCalcPanels: boolean = true

      Whether to recalculate the layout of the panel.

    Returns Promise<void>

  • Set the active category by name.

    Parameters

    • categoryName: string

      The name of the category that needs to be activated.

    Returns Promise<boolean>

    • Whether the category is activated successfully.