Skip to content

Commit ae188d5

Browse files
committed
add get_grasshopper_library_path
1 parent bdf7b4d commit ae188d5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/compas_ghpython/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
compas_ghpython.utilities
1313
1414
"""
15+
import os
1516
import compas
1617

1718
if compas.RHINO:
@@ -21,5 +22,16 @@
2122
__version__ = '1.0.0'
2223

2324

25+
def _get_grasshopper_library_path(version):
26+
if compas.WINDOWS:
27+
grasshopper_library_path = os.path.join(os.getenv('APPDATA'), 'Grasshopper', 'Libraries')
28+
elif compas.OSX:
29+
grasshopper_library_path = os.path.join(os.getenv('HOME'), 'Library', 'Application Support', 'McNeel', 'Rhinoceros', '{}'.format(version),
30+
'Plug-ins', 'Grasshopper (b45a29b1-4343-4035-989e-044e8580d9cf)', 'Libraries')
31+
else:
32+
raise Exception('Unsupported platform')
33+
return grasshopper_library_path
34+
35+
2436
__all_plugins__ = ['compas_ghpython.install']
2537
__all__ = [name for name in dir() if not name.startswith('_')]

0 commit comments

Comments
 (0)