RhinoPython


In Rhino, Python can be used to create and modify geometries and solve complex design problems. Rhino, as many other CAD software, has a built-in Python interpreter that allows the user to write and execute Python code.

When you add a geometry with, for instance a Rhino command, (e.g. _Pyramid), the following happens:

1) a code in the background is executed. This code creates first a geometry object in memory.

2) This object is then given a GUID (Globally Unique Identifier) and is added to the document’s objects table which associates the GUID to the geometric data of the object.

3) Then, the renderer visualize all the objects existing in the document. The viewport is updated to display the new object.

To get an existing object, the process is the same but in reverse order.

To modify an existing object, the process is the same but the object is retrieved from the document, modified in the code and then added again to the document.

To delete an object, the object is removed from the document’s objects table and the viewport is updated to reflect the change.


In RhinoPython🦏🐍 you can achieve the same with two libraries installed with Rhino:


🛠 Exercise


🐍⬇️⬇️⬇️ Download the script here ⬇️⬇️⬇️🐍