From caf2b698519ee6c08de042787644dae63c5b4c9a Mon Sep 17 00:00:00 2001 From: tomvanmele Date: Wed, 2 Oct 2024 17:24:19 +0200 Subject: [PATCH] update to use # r: ... --- docs/userguide/cad.rhino8.rst | 60 +++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/docs/userguide/cad.rhino8.rst b/docs/userguide/cad.rhino8.rst index 8e9260215ea9..3cf50051a7d0 100644 --- a/docs/userguide/cad.rhino8.rst +++ b/docs/userguide/cad.rhino8.rst @@ -1,57 +1,63 @@ ******************************************************************************** -Working in Rhino 8 +Working in Rhino 8 (with CPython) ******************************************************************************** .. warning:: - Support for the new Rhino 8 ScriptEditor is experimental. + Support for the new Rhino 8 Script Editor is experimental. -.. note:: - The installation procedures listed here are for using COMPAS with CPython in Rhino 8. - For using COMPAS with IronPython in Rhino 8, see :doc:`/userguide/cad.rhino`. +Rhino 8 supports both CPython and IronPython. +The instructions on this page are for working with COMPAS in the new Script Editor using CPython. +More information about the Script Editor is available here: + +For working with COMPAS in Rhino 8 with IronPython, +or for information about working in earlier versions of Rhino, see :doc:`/userguide/cad.rhino`. +.. note:: + + To launch Rhino 8 Script Editor, simply type `ScriptEditor` at the Rhino 8 command prompt. Installation ============ -Rhino 8 comes with its own CPython executable (Python 3.9). -This procedure simply uses that executable and its associated ``pip`` to install COMPAS. -The location of the executable is different on different platforms. +To use COMPAS packages in your Rhino 8 CPython scripts, +you can now simply add the packages as requirements in a comment. -* Windows: ``%USERPROFILE%\.rhinocode\py39-rh8\python.exe`` -* macOS: ``~/.rhinocode/py39-rh8/python3.9`` +.. code-block:: python -.. note:: + #! python3 + # r: compas - If you already have an installation of COMPAS on your system, you can try finding the Rhino 8 Python executable by running the following in a terminal or command prompt: + import compas + from compas.datastructures import Mesh - .. code-block:: bash + mesh = ... - python -m compas_rhino.print_python_path +More information is available here: -Update `pip` -~~~~~~~~~~~~ -Before installing `compas` with `pip`, it is highly recommended that you update `pip` itself. +Alternative Method +================== -.. code-block:: bash +The above method only works if the package you want to install is available on `PyPI `_. +If you want to install a package from local source, +you can use `pip` directly in combination with the Python executable that is included in Rhino. +The default location of the executable is different for Windows and Mac. - $ ~/.rhinocode/py39-rh8/python3.9 -m pip install --upgrade pip +* Windows: ``%USERPROFILE%\.rhinocode\py39-rh8\python.exe`` +* macOS: ``~/.rhinocode/py39-rh8/python3.9`` +.. code-block:: bash -Install from PyPI -~~~~~~~~~~~~~~~~~ + $ cd path/to/compas + $ ~/.rhinocode/py39-rh8/python3.9 -m pip install . -For example on Mac: +To create an editable install, you should update `pip` itself, first. .. code-block:: bash - $ ~/.rhinocode/py39-rh8/python3.9 -m pip install compas - - -Install from Source -~~~~~~~~~~~~~~~~~~~ + $ ~/.rhinocode/py39-rh8/python3.9 -m pip install --upgrade pip .. code-block:: bash