Draw dynamically rectangle using editpythonscript

Hi,

I am new to editpythonscript.

I would like to ask if someone could help me to write a code how to draw a simple rectangle3d dynamically using editpythonscript?

I would like to replicate the command rectangle using 3 points.
This command dynamically draws rectangle while adding points.

Hello Tom,

Have you tried the Rhino Python primer 101 ? It is very good.

It is also worth doing a basic online introduction to Python course to get used to the syntax, looping, etc.

Python is very powerful and relatively easy to get started with.

It is as simple as this:

import rhinoscriptsyntax as rs

rect = rs.GetRectangle(2)

if rect:
    for i, corner in enumerate(rect):
        rs.AddTextDot( i, corner )
2 Likes

Thanks it solves the problem I have.

I have more questions.

I would like to ask how can I temporary display additional line of rectangle that indicates the normal of it?
By normal, I mean the line that is derived from cross-product of first two segments.

I would like to see the line while it is drawn :

And once it is drawn it would disappear:

I see that rectangle is the default Rhino method from this rhinocommon method:
Rhino.Input.RhinoGet.GetRectangle(mode, base_point, prompts)

But I cannot find any information in the primer or elsewhere how to alter the display while drawing

you need a display conduit. for example:

Hi @Tom_Holt, you can only do this using a custom GetPoint but not using GetRectangle. See if below example helps.

DrawRectangleDisplayNormal.py (2.2 KB)

_
c.