Command API

In addition to the graphical user interface (menu and the toolbar), RV2 commands are directly accessible through the Rhino command line. Simply start typing RV2_... in the Rhino command line, and you should see a dropdown list of all the available RV2 commands.

Accessing RV2 commands and features via the command line is available for both Windows and Mac.

RV2 Commands

The Rhino plugin is implemented as a CommandPlugin. In the current release, the following commands are available:

  • RV2boundary_boundaries

  • RV2boundary_openings

  • RV2boundary_supports

  • RV2clear_all

  • RV2cloud_check

  • RV2cloud_restart

  • RV2cloud_shutdown

  • RV2file_open

  • RV2file_save_as

  • RV2file_save

  • RV2force_attributes

  • RV2force

  • RV2force_modify_edges

  • RV2force_modify_vertices

  • RV2force_move_vertices

  • RV2form_attributes

  • RV2form

  • RV2form_modify_edges

  • RV2form_modify_vertices

  • RV2form_move_vertices

  • RV2form_relax

  • RV2form_smooth

  • RV2init

  • RV2pattern_attributes

  • RV2pattern_delete

  • RV2pattern_from_features

  • RV2pattern_from_lines

  • RV2pattern_from_mesh

  • RV2pattern_from_skeleton

  • RV2pattern_from_surface

  • RV2pattern_from_triangulation

  • RV2pattern_modify_edges

  • RV2pattern_modify_vertices

  • RV2pattern_move_vertices

  • RV2pattern_relax

  • RV2pattern_smooth

  • RV2pattern_subdivide

  • RV2redraw

  • RV2settings

  • RV2thrust_attributes

  • RV2thrust_modify_vertices

  • RV2thrust_move_supports

  • RV2tna_horizontal

  • RV2tna_vertical

Each command has a corresponding xxx_cmd.py file. All command files have the same structure. For example, one of the simplest commands is RV2redraw, which is defined in RV2redraw_cmd.py

from __future__ import print_function
from __future__ import absolute_import
from __future__ import division


from compas_rv2.rhino import get_scene


__commandname__ = "RV2redraw"


def RunCommand(is_interactive):

    scene = get_scene()
    if not scene:
        return

    scene.update()


# ==============================================================================
# Main
# ==============================================================================

if __name__ == '__main__':

    RunCommand(True)

Last updated