OrientObject

Orients a single object based on input points.

Syntax

rhinoscriptsyntax.OrientObject (object_id, reference, target, flags=0)

rhinoscript.object.OrientObject (object_id, reference, target, flags=0)

Parameters

object_id

Required.  String or Guid.  The identifier of the object to orient.

reference

Required.  Array.  An array of 3-D reference points.  If two 3-D points are specified, then this method will function similar to Rhino's Orient command.  If more than two 3-D points are specified, then the function will orient similar to Rhino's Orient3Pt command.

target

Required.  Array.  An array of 3-D target points.  If two 3-D points are specified, then this method will function similar to Rhino's Orient command.  If more than two 3-D points are specified, then the function will orient similar to Rhino's Orient3Pt command.

flags

Optional.  Number.  The orient flags.  Values can be added together to specify multiple options.

Value

Description

1

Copy object.  The default is not to copy the object.

2

Scale object.  The default is not to scale the object.  Note, the scale option only applies if both reference and target contain only two 3-D points.

Returns

Guid

The identifier of the oriented object if successful.

Example

import rhinoscriptsyntax as rs

obj = rs.GetObject("Select object to orient")

if obj:

    reference = rs.GetPoints(message1="First reference point")

    if reference and len(reference)>0:

        target = rs.GetPoints(message1="First target point")

        if target and len(target)>0:

            rs.OrientObject( obj, reference, target )

Also See

OrientObjects