What is the difference between : import rhinoscriptsyntax, Rhino, scriptcontext

Hello,
I am a beginner in Ghpython, I have some questions to understand globally the functioning of Ghpython :

  1. I would like to know the difference when we import 3 libraries: rhinoscriptsyntax, Rhino, scriptcontext, for example:

import rhinoscriptsyntax as rs

import Rhino as rh

import scriptcontext as sc

When should we use each library, they do the different things?

  1. Where we can find the help for each method of these libraries, for example:

rh.Geometry.Brep.GetBoundingBox ()

rs.coercebrep (j)

I opened Help for rhinoscriptsyntax F1 (Rhino IronPython) in Grasshopper Python script Editor, I’m looking for GetBoundingBox, coercebrep but it does not exist in the help!

It’s supper if anyone can explain these questions to me. These questions are important for me to understand how Ghpython works.

I thank you very much

1 Like

You may want to start here

Short-ish version:
Rhinoscriptsyntax is a bunch of pre-written functions. They are written in python. under the hood…they are using rhinocommon. You can actually look at all the code because it exists on your computer, located here:
C:\Users\YOURUSERNAMEAppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython Scripting (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript

Here is the help documentation: https://developer.rhino3d.com/api/RhinoScriptSyntax/

when you import rhinoscriptsyntax, you get access to all of those rhinoscriptsyntax functions.
NOTE: when using rhinoscriptsyntax in a ghpython component…you first need to review scriptcontext.
Read the section on ghdoc in the GhPython Common Questions and Answers link.

RhinoCommon:


The API documentation is here:
https://developer.rhino3d.com/api/RhinoCommon/html/R_Project_RhinoCommon.htm#!
When you import Rhino, (commonly written as import Rhino as rc)
You get access to all the namespaces in the RhinoCommon API.

I don’t think I answered your question very well…but maybe this gets you pointed in the right direction.

3 Likes

use %APPDATA%\McNeel\Rhinoceros\6.0\Plug-ins\IronPython Scripting (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript in the address bar of the file explorer.

1 Like

Thanks very much Chris Hanley and Nathanletwory :slight_smile: