Tool Class

A Tool that performs an action. It has a toolId that uniquely identifies it, so it can be found via a lookup in the ToolRegistry. Every time a tools run, a new instance of (a subclass of) this class is created and its run method is invoked.

@see - InteractiveTool for a base Tool class to handle user input events from a Viewport.

Extended by

Methods

Name Description
constructor(..._args: any[]): Tool    
parseAndRun(..._args: string[]): Promise<boolean> Run this instance of a tool using a series of string arguments.  
run(..._args: any[]): Promise<boolean> Run this instance of a Tool.  
register(namespace?: string): void Static Register this Tool class with the ToolRegistry.  

Properties

Name Type Description
description Accessor Static ReadOnly string Get the localized description for this Tool class.  
description Accessor ReadOnly string Get the localized description string from this Tool's class  
englishKeyin Accessor Static ReadOnly string Get the English keyin string for this Tool class.  
flyover Accessor Static ReadOnly string Get the localized flyover for this Tool class.  
flyover Accessor ReadOnly string Get the localized flyover string from this Tool's class  
hidden Static boolean If true, this Tool will not appear in the list from getToolList.  
iconSpec Static string The icon for this Tool.  
iconSpec Accessor ReadOnly string Get the iconSpec from this Tool's class.  
keyin Accessor Static ReadOnly string Get the localized keyin string for this Tool class.  
keyin Accessor ReadOnly string Get the localized keyin string from this Tool's class  
maxArgs Accessor Static ReadOnly undefined | number The maximum number of arguments allowed by parseAndRun, or undefined if there is no maximum.  
minArgs Accessor Static ReadOnly number The minimum number of arguments allowed by parseAndRun.  
namespace Static string The namespace that provides localized strings for this Tool.  
toolId Accessor ReadOnly string Get the toolId string for this Tool class.  
toolId Static string The unique string that identifies this tool.  

Defined in

Last Updated: 17 December, 2024