How to use documentation
A documentation is a set of documents that provides information about a library, its features and how to use them. It is a guide that helps you to understand the functionalities of the library and how to use it.
In Rhino you have two documentation libraries that you can use to write Python scripts:
Let’s see how to use the RhinoCommonAPI documentation to create a point in Rhino.
RhinoCommonAPI UI
a
- Search barb
- Select the version of Rhino. Be sure to select the version you are using.c
- All the items in the library. You can navigate through the library by clicking on the items.d
- The selected item’s name. You can see the description of the item and its methods.e
- The tabs of the object (constructor, methods, properties, events, etc.)f
- The selected method’s or property’s name. You can see the description of the method and its parameters.
Using the documentation is your best friend when you are writing a script. When in doubt, check the documentation. It will help you to understand the functionalities of the library and how to use them. And mostly which methods are available to you.
🛠 Exercise
Basic questions:
01 : How many constructors are available to create a Point3d
in RhinoCommonAPI?
02 : What is the name of the method that checks if several Point3d
’s are coplanar in RhinoCommonAPI?
03 : What are the parameters of the 4th method from the top to create a Line
in RhinoCommonAPI?
04 : Look for the DistanceTo()
method in the Point3d
class. What is the return type of this method?
05 : Is the operator <=
available for the Point3d
and Vector3d
classes?
More advanced questions: 06 : Check out the Rhino.Geometry.GeometryBase class. Have a look a the constructors, properties and methods of this class. Keeping in mind that a class can inherit from another class, what can you say about the Rhino.Geometry.GeometryBase class? What is the relation between the Rhino.Geometry.GeometryBase class and, for example, the Rhino.Geometry.Surface class? 07 : Have a look at the Rhino.Geometry.Surface class, and specifically its constructors. Can you use them directly ? 08 : What is the type of the object returned by CreateExtrusion(profile, direction) method of the Rhino.Geometry.Surface class? 09 : Keeping in mind the answer to the previous question, how many ways are there to create a surface in the Rhino.Geometry.Surface class? —