Paul24
(Paul)
October 28, 2022, 1:09pm
1
I want to use Hops and rhinoinside, but I’m not having luck so far.
I followed the video found on the page
We are announcing a new component we are testing. Call into CPython with a Grasshopper component.
Some advantages of this component:
Call into CPython libraries including Numpy and SciPy
Use some of the newest libraries available for CPython such as TensorFlow.
Create re-usable functions and parallel processing.
Supports real debugging modes including breakpoints.
Full support of Visual Studio Code.
Give it a try if you are interested.
Getting started with CPython in Grasshopper.
This pyth…
I copied the python Hops code at the end of the video that uses rhinoinside. It says, Import “Rhino” could not be resolved Pylance.
I also tried Flask, using rhino3dm. I can create an object but I don’t know how to add the object to the doc. rhinoscriptsyntax import also fails.
sphere = rhino3dm.Sphere(mote.pt, radius)
rhinoscriptsyntax.doc.Objects.AddSphere(sphere)
I have Rhino 7 and Visual Studio 1.72.2
Could it be a configuration issue?
stevebaer
(Steve Baer)
October 28, 2022, 2:38pm
2
What version of CPython are you running? The current implementation of Rhino.Inside.CPython requires CPython 3.8
Also, did you pip install rhinoinside?
Embed Rhino in CPython
Paul24
(Paul)
October 30, 2022, 9:12am
3
Hi Steve,
Thanks for the quick response.
I have python 3.10.8
and I did pip install rhinoinside.
-Paul
Paul24
(Paul)
October 30, 2022, 9:46am
4
Also, I have Rhino 7.23. On your page, it says Rhino 7.4 is required, but I couldn’t find 7.4 anywhere
nathanletwory
(Nathan 'jesterKing' Letwory)
October 30, 2022, 9:57am
5
You really need to make sure you do this work with Python 3.8. That is a hard requirement for Rhino Inside to work.
Paul24
(Paul)
October 30, 2022, 12:40pm
6
I just uninstalled java 3.10 and installed 3.8, along with all the stuff required for hops. Now, the Import Rhino works when I run the python script from within the Grasshopper Python editor, but import Rhino fails when editing using Visual Studio. Therefore, there must be some configuration of Visual Studio that I’m searching for
nathanletwory
(Nathan 'jesterKing' Letwory)
October 30, 2022, 12:44pm
7
I guess you are trying to do this on a Mac? Rhino Inside technology is for now Windows-only.
Paul:
java 3.10
Python 3.10 no doubt?
Paul:
Visual Studio
Visual Studio Code, right?
Paul24
(Paul)
October 30, 2022, 3:10pm
8
Yes - Visual Studio Code, python 3.8, I have tried with Rhino 7.23 and Rhino 8 WIP
Paul24
(Paul)
October 30, 2022, 7:51pm
9
I don’t think it’s related to rhinoinside. When I try any python script in VS code (with or without rhinoinside), the imports fail. I tried installing all extensions in VS code that had anything to do with Rhino, but no luck.
Paul23
(Paul)
October 31, 2022, 11:12am
10
I’ve tried everything to configure Visual Studio Code, but it refuses to find Modules System and Rhino. It must be something something simple that I’m not seeing.
Paul24
(Paul)
October 31, 2022, 2:14pm
12
I went through the instructions to set up VS code - https://marketplace.visualstudio.com/items?itemName=designtoproduction.rhinopython
and VS code now finds Rhino and System modules
However, I’m still having trouble getting the modules rhinoscriptsyntax and scriptcontex
Any suggestions? Tx
Paul24
(Paul)
October 31, 2022, 2:42pm
13
Also, I’m doing all this on Rhino 7.23. your documentation says I need Rhino 7.4 but
wim
(Wim Dekeyser)
October 31, 2022, 3:05pm
14
Hi Paul -
I’m afraid I can’t help you with the rest of this, but…
That would be the minimum required version. Not only that specific version.
-wim