RhinoScriptSyntax Vs rhinocommon

Pycharm Community Edition is free (as in ‘free beer’, not free and open source) and yes its great.

1 Like

Java…not Javascript

How do I integrate with Rhino 6

@stevebaer’s post on how to get autocomplete and type hints going is a great start:

I mostly write GHPython code and I usually activate and use the Code input of the Python component. You can plug-in a File component that reads/opens a .PY file on your computer and funnels the code into the Python component. This way you can use PyCharm or any other editor or IDE and your component is auto-updated when you save.

For Rhino Python, I usually simply write the code blindly and use the RunPythonScript command to run it.
You could probably also create a bash script, link it as an alias in your bash profile, and thus automate that process. Or even use the subprocess module to the something similar in Python.

Compiling Python scripts in Rhino for Mac is simply not a thing.

Hi @diff-arch,

can you please explain what you mean with

Blockquote I mostly write GHPython code and I usually activate and use the Code input of the Python component.

and exactly how do you use it? Do you plug in a patch to your py file in the code input?

Thanks,
david

I posted a basic demo here that might help:

Thanks, now I understand the idea of the code input.

With your experience, would you say this is a common way of working @AndersDeleuran ?

In my experience, no. But then again I’ve also always been okay with the Windows GHPython editor and found the complexities of using external editors to not be worth it (e.g. getting intellisense and autocomplete working). I understand that Mac users might have a different experience.

Also, I’ve occasionally read Python code from a server or URL and then ran it using exec, which seems like a simpler/more Pythonic solution IMO:

Edit: Passing input parameters is probably simpler with the code input functionality though.

2 Likes

Hey @Terry_Chappell. I just noticed you have been working on the mixing C++ and python. Since Archicad API is in C++, if we write a pug in in python, is it possible to call it by C++ in archicad instead of writing the whole plug in in C++ again?

Have you read this?

This describes in full detail how I access C++ procedures from Python in Rhino.

I find getting Visual Studio to work correctly for creating a C++ DLL callable from Rhino to be the hardest step. I am currently using Visual Studio 2022 with a Visual Studio 2019 toolset as this gives me access to VS 22 improvements while still working with Rhino.

Let me know if you have any questions.

Regards,
Terry.

1 Like

Thank you i am going through your explanations now. Looks like very good explained and detailed. I am actually intending to write a plug in for Archicad which is in C++ to read a specific script from grasshopper. I am kinda beginning to learn about the process, i will go through your explanation. Thank you very much for your help. I will keep in touch with you. :slight_smile:

I hope i can apply your strategy there, If not at least it is valuable to learn it.