Create line on a plane

Hi,

I’m using rs.PlaneFromPoints to create a new plane and want to draw geometry, for example: a line, on that plane. Can someone tell me how to do this?

Rhino 7 using RhinoScript or Rhino Common

Eric

Hi Eric, please see below:

import Rhino
import scriptcontext
import rhinoscriptsyntax as rs

def DoSomething():
    
    plane = Rhino.Geometry.Plane.WorldZX
    
    line = Rhino.Geometry.Line(plane.PointAt(10,10,0), plane.PointAt(20,20,0))
    
    scriptcontext.doc.Objects.AddLine(line)
    scriptcontext.doc.Views.Redraw()
    
DoSomething()

or like this:

import rhinoscriptsyntax as rs

def DoSomething():
    
    plane = rs.WorldZXPlane()
    
    point_a = rs.EvaluatePlane(plane, (10,10))
    point_b = rs.EvaluatePlane(plane, (20,20))
    
    line = rs.AddLine(point_a, point_b)
    
DoSomething()

_
c.

It is also possible to dynamically draw points or a polyline constrained to a plane via RhinoCommon, but it takes a bit more coding…

This will work for me thank you!!

Eric

Are there any code examples of this workflow? Goal here is to construct a 3D assembly of parts based on data so I was thinking create polylines which I will subsequently extrude to create the components of the assembly. Something like Solidworks where you are sketching on different planes and extruding the sketches into solids.

Eric