TransformCommand

Command
public abstract class TransformCommand : Command

Properties

CommandContextHelpUrl

protected virtual string CommandContextHelpUrl { get; }
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.

inherited fromCommand

EnglishName

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

HistoryReplayOnObjectAttributeChange

public bool HistoryReplayOnObjectAttributeChange { get; set; }
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.
inherited fromCommand

Id

public virtual Guid Id { get; }
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
inherited fromCommand

LocalName

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

PlugIn

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

Settings

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

Methods

DuplicateObjects

#
protected void DuplicateObjects(TransformObjectList list)
list (TransformObjectList)

OnHelp

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

ReplayHistory

protected virtual bool ReplayHistory(ReplayHistoryData replayData)
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.

inherited fromCommand
replayData (ReplayHistoryData)The replay history information.
true if the operation succeeded.

The default implementation always returns false.

ResetGrips

#
protected void ResetGrips(TransformObjectList list)
Sets dynamic grip locations back to starting grip locations. This makes things like the Copy command work when grips are "copied".
list (TransformObjectList)A list of object to transform. This is a special list type.

RunCommand

protected abstract Result RunCommand(RhinoDoc doc, RunMode mode)
Executes the command.
inherited fromCommand
doc (RhinoDoc)The current document.
mode (RunMode)The command running mode.
The command result code.

SelectObjects

#
[CLSCompliant(false)] protected Result SelectObjects(string prompt, ObjectType filter, TransformObjectList list)
Selects objects within the command.
prompt (string)The selection prompt.
filter (ObjectType)Geometry filter to limit selection. Use function above if you do not need specific types.
list (TransformObjectList)A list of objects to transform. This is a special list type.
The operation result.

SelectObjects

#
protected Result SelectObjects(string prompt, TransformObjectList list)
Selects objects within the command.
prompt (string)The selection prompt.
list (TransformObjectList)A list of objects to transform. This is a special list type.
The operation result.

TransformObjects

#
protected void TransformObjects(TransformObjectList list, Transform xform, bool copy, bool autoHistory)
list (TransformObjectList)
xform (Transform)
copy (bool)
autoHistory (bool)