Piano in python


#1

How do you put a rectangle on a plane, using python
for example the xz or yz plane or on a higher level
In python gives me error line 22
Thanks for your cooperationrectangolo python


#2

Why do you need python for that, Alex? Wouldn’t it be easier to do it straight into a code block?:

2014-12-12_112914

 

The Plane.Offset function needs only one input for distance. So your syntax should be piannoxy.Offset(15) because you are applying an action on an element and you have to specify the said element.

Creation functions like Rectangle however require all parameters. That’s why you need to add your newly created plane to the function: Rectangle.ByWidthHeight(secondolivello, largh, alt).

The rectangle create function is one of a few that can have varying outputs depending on the type and amount of parameters you input. You can either specify just width and height and have the rectangle created on the XY plane, specify an alternative plane, or specify a new coordinate system and have it created in a completely unique place:

2014-12-12_114357


#3

Thank Dimitar
use python to have something more compact … I feel better
Now it works well, thanks for the explanation of the plans
Thanks again for your help


#4

If the reason for using python is to make the Dynamo definition more compact, you can right click your codeblock after you’ve written it and make node from selection. If you create a great node you can also share it on the package manager! :slight_smile:


#5

Grazie per la informazione Jostein