A collection of AcEdKeyword objects, mirroring Autodesk.AutoCAD.EditorInput.KeywordCollection. Represents the set of valid keywords for a prompt.

Constructors

  • Constructs a keyword collection by parsing an ObjectARX-style keyword list string, equivalent to the kwl argument of acedInitGet.

    The keyword list is a single space-delimited string. Each token defines one keyword specification and is interpreted using AutoCAD command-line rules:

    • Keywords are separated by one or more spaces.
    • Each keyword may contain only letters, digits, and hyphens (-).
    new AcEdKeywordCollection("Width Height Depth")
    

    AutoCAD recognizes keyword abbreviations using one of two methods:

    1. Capital-letter method Uppercase letters inside the keyword define the required abbreviation.

      LType   → LT
      eXit    → X
      
    2. Comma method The full keyword is written in uppercase, followed by a comma and an explicit abbreviation.

      LTYPE,LT
      

      The abbreviation part after the comma is not part of the returned keyword value.

    The keyword list may define local-to-global mappings using an underscore (_):

    Ja Nein _ Yes No
    
    • Keywords before _ are local
    • Keywords after _ are global
    • When a local keyword is entered, the corresponding global keyword is returned
    • Global keywords may be entered explicitly using a leading underscore

    A one-to-one match is not required:

    • Extra local keywords return an empty string
    • Extra global keywords are valid but require a leading underscore

    Regardless of how the user types a keyword (full form or abbreviation), the resolved keyword value is always the global keyword as specified in the keyword list, preserving its original capitalization.

    Parameters

    • Optionalkwl: string

      Optional ObjectARX-style keyword list string. If omitted, an empty keyword collection is created.

    Returns AcEdKeywordCollection

Accessors

Methods

  • Adds a new keyword (displayName only).

    Parameters

    • displayName: string

      The text shown to the user for this keyword.

    Returns AcEdKeyword

    The newly created AcEdKeyword.

  • Adds a new keyword with globalName and localName.

    Parameters

    • globalName: string

      The internal, non-display name.

    • localName: string

      The name that the user types to select the keyword.

    Returns AcEdKeyword

    The newly created AcEdKeyword.

  • Adds a new keyword with displayName, globalName, localName, enabled, visible.

    Parameters

    • displayName: string

      The text shown to the user.

    • globalName: string

      Internal identifier for the keyword.

    • localName: string

      The name used by the user to type the keyword.

    • Optionalenabled: boolean

      If false, the keyword cannot be selected.

    • Optionalvisible: boolean

      If false, the keyword is hidden from display.

    Returns AcEdKeyword

    The newly created AcEdKeyword.