CommandAliasList

public static class CommandAliasList
Contains static methods and properties to access command aliases.

Properties

Count

#Since v5.0
public static int Count { get; }
Returns the number of command alias in Rhino.

InstantAliasDelayMilliseconds

#Since v9.0
public static int InstantAliasDelayMilliseconds { get; set; }
Timer delay to use before triggering instant aliases

Methods

Add

#Since v5.0
public static bool Add(string alias, string macro)
Adds a new command alias to Rhino.
alias (string)[in] The name of the command alias.
macro (string)[in] The command macro to run when the alias is executed.
true if successful.

Clear

#Since v5.0
public static void Clear()
Removes all aliases from the list.

Delete

#Since v5.0
public static bool Delete(string alias)
Deletes an existing command alias from Rhino.
alias (string)[in] The name of the command alias.
true if successful.

FindAlias

#Since v9.0
public static CommandAlias FindAlias(string alias)
Find an existing CommandAlias given the alias string
alias (string)

GetAlias

#Since v9.0
public static CommandAlias GetAlias(int index)
Get command alias from the list
index (int)
null is index is out of range

GetDefaults

#Since v5.0
public static Dictionary<string, string> GetDefaults()
Constructs a dictionary containing as keys the default names and as value the default macro.

The returned dictionary contains a copy of the settings.

A new dictionary with the default name/macro combinations.

GetMacro

#Since v5.0
public static string GetMacro(string alias)
Returns the macro of a command alias.
alias (string)[in] The name of the command alias.

GetNames

#Since v5.0
public static string[] GetNames()
Returns a list of command alias names.
An array of strings. This can be empty.

IsAlias

#Since v5.0
public static bool IsAlias(string alias)
Verifies that a command alias exists in Rhino.
alias (string)[in] The name of the command alias.
true if the alias exists.

IsDefault

#Since v5.0
public static bool IsDefault()
Computes a value indicating if the current alias list is the same as the default alias list.
true if the current alias list is exactly equal to the default alias list; false otherwise.

SetMacro

#Since v5.0
public static bool SetMacro(string alias, string macro)
Modifies the macro of a command alias.
alias (string)[in] The name of the command alias.
macro (string)[in] The new command macro to run when the alias is executed.
true if successful.

ToDictionary

#Since v5.0
public static Dictionary<string, string> ToDictionary()
Constructs a new dictionary that contains: as keys all names and as values all macros.

Modifications to this dictionary do not affect any Rhino command alias.

The new dictionary.

Update

#Since v9.0
public static void Update(IEnumerable<CommandAlias> aliases, bool replaceAll)
Add or modify the command aliases with a list of aliases
aliases (IEnumerable<CommandAlias>)
replaceAll (bool)