LoginSignup
1
0

More than 1 year has passed since last update.

GHPythonRemoteの環境構築

Last updated at Posted at 2022-06-25

不手際や不適切な箇所がありましたらご指導ご鞭撻のほどよろしくお願いいたします。

GHPythonRemoteでの環境構築

前提
・Rhino7をインストールする

手順
1.pythonをインストールする
2.GHPythonRemoteをインストールする
3.exampleを必要に応じて編集する

1.pythonをインストールする

rhinoのpythonは3系に対応するとはいっているものの、
現状ほぼ2系(IronPython)対応なので、
Pythonは2系でインストールまたはバージョンを変更する。

下記を参照
gh-python-remote 1.4.4

2.GHPythonRemoteをインストールする

GHPythonRemote
上記リンクがGHPythonのfood4rhino
リンクより本家のusageがダウンロードできる。
今回はrhino7で私は行った。

上記のusageをかいつまむと、
python2.7のsite-packagesのディレクトリ下で以下の操作を行う
pip install gh-python-remote --upgrade
python -m ghpythonremote._configure_ironpython_installation

3.exampleを必要に応じて編集する

GHPythonRemoteがインストールできたら、
・GH_python_remote.ghxを自身のworkSpaceにコピペする
・Rhinoのプロジェクトを立ち上げる
・Grasshopperを開く
・GH_python_remote.ghxを開き編集していく
 ・GHPythonRemoteコンポーネントのlocationは自身のpython環境をwhich pythonなどでディレクトリを調べて、それを選択させるように書き換える(condaでの環境構築が推奨されてはいる) 
 ・おそらく画面右に位置しているGHPythonコンポーネントにcodeのインプットを追加する
 ・Read fileコンポーネントを作成する
  ・コンポーネントをGHPythonコンポーネントにつなげる
  ・Fを右クリックしてsynchroniseを選択
  ・これからコードを書くpythonファイルを作成する
  ・select one existing fileで自身のコードを書いていくpythonファイルを選択する
  ・Read Fileコンポーネントを左クリックしてper lineを解除しておく

参考記事
【GHPython × VSCode】GrasshopperでPython開発に外部エディターを使う方法
gh-python-remote 1.4.4
GHPythonRemote

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0