SelCommand

Command
public abstract class SelCommand : Command
For adding nestable whole object and subobject selection commands, derive your command from SelCommand and override the abstract SelFilter and virtual SelSubObjectFilter functions.

Properties

BeQuiet

#Since v5.0
public bool BeQuiet { get; set; }

CommandContextHelpUrl

Gets the URL of the command contextual help. This is usually a location of a local CHM file.

The default implementation return an empty string.

protected virtual string CommandContextHelpUrl { get; }
inherited fromCommand

EnglishName

Gets the name of the command. This method is abstract.
public abstract string EnglishName { get; }
inherited fromCommand

HistoryReplayOnObjectAttributeChange

By default, object attribute changes do not trigger history replay. Set this property to true, typically in the command's constructor, if you want objects created with this command to trigger history replay when their attributes change.
public bool HistoryReplayOnObjectAttributeChange { get; set; }
inherited fromCommand

Id

Gets the unique ID of this command. It is best to use a Guid attribute for each custom derived command class since this will keep the id consistent between sessions of Rhino GuidAttribute
public virtual Guid Id { get; }
inherited fromCommand

LocalName

Gets the local name of the command.
public virtual string LocalName { get; }
inherited fromCommand

PlugIn

Gets the plug-in where this commands is placed.
public PlugIn PlugIn { get; }
inherited fromCommand

Settings

Gets the settings of the command.
public PersistentSettings Settings { get; }
inherited fromCommand

TestGrips

#Since v5.0
public bool TestGrips { get; set; }

TestLights

#Since v5.0
public bool TestLights { get; set; }

Methods

OnHelp

Is called when the user needs assistance with this command.
protected virtual void OnHelp()
inherited fromCommand

ReplayHistory

Repeats an operation of a command.

In order to make this function work, you will likely need to grab the Result property that gives the list of input objects. Then, you will be able to replace these inputs by using one of the UpdateToX() methods of the ReplayHistoryResult.

You should NOT use any document AddX() or ReplaceX() functions, as they will break history.

protected virtual bool ReplayHistory(
replayData
The replay history information.
)
inherited fromCommand
true if the operation succeeded.

The default implementation always returns false.

RunCommand

#
protected override Result RunCommand(
doc,
mode
)

SelFilter

#
Override this abstract function and return true if object should be selected.
protected abstract bool SelFilter(
rhObj
The object to check regarding selection status.
)
true if the object should be selected; false otherwise.

SelSubObjectFilter

#Since v7.9
To select subobjects, override this virtual function, add component indices of the subobjects that should get selected to indicesToSelect list and return true. This is called only if the SelFilter returns false and the whole object does not get selected.
protected virtual bool SelSubObjectFilter(
rhObj,
The object to check regarding selection status.
indicesToSelect
The component indices of the subobjects to select.
)
true if components added to indicesToSelect should get selected.