Skip to content

Commit caf2b69

Browse files
committed
update to use # r: ...
1 parent 1888213 commit caf2b69

File tree

1 file changed

+33
-27
lines changed

1 file changed

+33
-27
lines changed

docs/userguide/cad.rhino8.rst

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,63 @@
11
********************************************************************************
2-
Working in Rhino 8
2+
Working in Rhino 8 (with CPython)
33
********************************************************************************
44

55
.. warning::
66

7-
Support for the new Rhino 8 ScriptEditor is experimental.
7+
Support for the new Rhino 8 Script Editor is experimental.
88

9-
.. note::
109

11-
The installation procedures listed here are for using COMPAS with CPython in Rhino 8.
12-
For using COMPAS with IronPython in Rhino 8, see :doc:`/userguide/cad.rhino`.
10+
Rhino 8 supports both CPython and IronPython.
11+
The instructions on this page are for working with COMPAS in the new Script Editor using CPython.
12+
More information about the Script Editor is available here: <https://www.rhino3d.com/features/developer/scripting/>
13+
14+
For working with COMPAS in Rhino 8 with IronPython,
15+
or for information about working in earlier versions of Rhino, see :doc:`/userguide/cad.rhino`.
1316

17+
.. note::
18+
19+
To launch Rhino 8 Script Editor, simply type `ScriptEditor` at the Rhino 8 command prompt.
1420

1521
Installation
1622
============
1723

18-
Rhino 8 comes with its own CPython executable (Python 3.9).
19-
This procedure simply uses that executable and its associated ``pip`` to install COMPAS.
20-
The location of the executable is different on different platforms.
24+
To use COMPAS packages in your Rhino 8 CPython scripts,
25+
you can now simply add the packages as requirements in a comment.
2126

22-
* Windows: ``%USERPROFILE%\.rhinocode\py39-rh8\python.exe``
23-
* macOS: ``~/.rhinocode/py39-rh8/python3.9``
27+
.. code-block:: python
2428
25-
.. note::
29+
#! python3
30+
# r: compas
2631
27-
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:
32+
import compas
33+
from compas.datastructures import Mesh
2834
29-
.. code-block:: bash
35+
mesh = ...
3036
31-
python -m compas_rhino.print_python_path
37+
More information is available here: <https://developer.rhino3d.com/guides/scripting/scripting-command>
3238

33-
Update `pip`
34-
~~~~~~~~~~~~
3539

36-
Before installing `compas` with `pip`, it is highly recommended that you update `pip` itself.
40+
Alternative Method
41+
==================
3742

38-
.. code-block:: bash
43+
The above method only works if the package you want to install is available on `PyPI <https://pypi.org/>`_.
44+
If you want to install a package from local source,
45+
you can use `pip` directly in combination with the Python executable that is included in Rhino.
46+
The default location of the executable is different for Windows and Mac.
3947

40-
$ ~/.rhinocode/py39-rh8/python3.9 -m pip install --upgrade pip
48+
* Windows: ``%USERPROFILE%\.rhinocode\py39-rh8\python.exe``
49+
* macOS: ``~/.rhinocode/py39-rh8/python3.9``
4150

51+
.. code-block:: bash
4252
43-
Install from PyPI
44-
~~~~~~~~~~~~~~~~~
53+
$ cd path/to/compas
54+
$ ~/.rhinocode/py39-rh8/python3.9 -m pip install .
4555
46-
For example on Mac:
56+
To create an editable install, you should update `pip` itself, first.
4757

4858
.. code-block:: bash
4959
50-
$ ~/.rhinocode/py39-rh8/python3.9 -m pip install compas
51-
52-
53-
Install from Source
54-
~~~~~~~~~~~~~~~~~~~
60+
$ ~/.rhinocode/py39-rh8/python3.9 -m pip install --upgrade pip
5561
5662
.. code-block:: bash
5763

0 commit comments

Comments
 (0)