Rectangle.ByCornerpoints can't work?

I use python code to get points, and I want to create rectangle.
But It show:
Warning: One or more of the input types are not matching. Couldn’t find a version of ByCornerPoints that takes arguments of type (__array)

How can I feed points?@mellouze
Thanks~

Hi,

I guess you are not feeding points to Rectangle.ByCornerPoints. You might want yo check the type of data.

They are not points. you need to use a point.by coordinates after your python node

Create points as I showed you in the example above. You can use the same syntax in a Python Node.

1 Like

If UX1,UY1, etc. are of type double, i guess you just have to replace :

U1 = XYZ(UX1, UY, UZ1)

by

U1 = Point.ByCoordinates(UX1,UY1,UZ1)

and so on.

I tried. @mellouze But It show:
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 65, in
AttributeError: ‘type’ object has no attribute ‘ByCoordinates’

image

To be honest, i don’t know. Have you imported the corresponding Dynamo functions ? What version of Dynamo are you using ?

import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

My version is 1.2

It’s Okay now

Maybe I import too much things.
Thanks~ @mellouze

As far as i understand from the comment of @Thomas_Mahon (topic below), that could give problems.

https://forum.dynamobim.com/t/creating-line-by-two-points-in-python/14507/2

For the rest, interesting topic,learned some new things :thumbsup:

Kind regards,
Mark