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 Tool.run method is invoked.

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

see Tools

Extended by

  • InteractiveTool
  • AccuDrawSetOriginTool
  • AccuDrawSetLockSmartTool
  • AccuDrawSetLockXTool
  • AccuDrawSetLockYTool
  • AccuDrawSetLockZTool
  • AccuDrawSetLockDistanceTool
  • AccuDrawSetLockAngleTool
  • AccuDrawChangeModeTool
  • AccuDrawRotateCycleTool
  • AccuDrawRotateTopTool
  • AccuDrawRotateFrontTool
  • AccuDrawRotateSideTool
  • AccuDrawRotateViewTool
  • PluginTool

Methods

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

Properties

Name Type Description
description Accessor ReadOnly string Get the localized description string from this Tool's class  
description Accessor StaticReadOnly string Get the localized description for this Tool class.  
englishKeyin Accessor StaticReadOnly string Get the English keyin string for this Tool class.  
flyover Accessor ReadOnly string Get the localized flyover string from this Tool's class  
flyover Accessor StaticReadOnly string Get the localized flyover for this Tool class.  
hidden Static boolean If true, this Tool will not appear in the list from ToolRegistry.getToolList.  
i18n Static I18N The internationalization services instance used to translate strings from the namespace.  
iconSpec Accessor ReadOnly string Get the iconSpec from this Tool's class.  
iconSpec Static string The icon for this Tool.  
keyin Accessor ReadOnly string Get the localized keyin string from this Tool's class  
keyin Accessor StaticReadOnly string Get the localized keyin string for this Tool class.  
maxArgs Accessor StaticReadOnly number | undefined The maximum number of arguments allowed by Tool.parseAndRun, or undefined if there is no maximum. Beta
minArgs Accessor StaticReadOnly number The minimum number of arguments allowed by Tool.parseAndRun. Beta
namespace Static I18NNamespace The I18NNamespace 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: 08 January, 2020