Discover the advantage of Grasshopper implementing IronPython is we can import libraries compiled in other .NET languages. Learning to import these libraries greatly extends the functionality of Python and Grasshopper.
- [Instructor] As we've just learned how libraries…relate to IronPython, let's try using the CLR module…to import the Excel Interop DLL.…This will allow us to access Excel directly…from our Python scripts.…In a new Grasshopper file, let's go ahead…and place a Python component, and then double click…to open it up.…The first thing we need to do is replace…the Rhino script syntax import with rhino.geometry,…as RG.…
Next, let's import the CLR module by simply writing…import clr.…Now we can use the CLR module to add the Excel library,…keeping in mind here that you'll need a copy…of Excel installed on your machine.…Don't worry if you don't, however.…The main thing here is to understand how to add…and use libraries.…To do that, we use the Add Reference function…from the CLR module.…So let's access CLR dot AddReference,…and then open parentheses, and here we can write…the full name we want to import as a string.…
The CLR module will then search for this library…on your machine.…To work with Excel, we need to reference…the Excel Interop library, and here we have…
- Python components
- Accessing the Rhino API
- Python programming basics
- Importing modules and libraries
- Grasshopper workflows
- Evaluating surfaces
- Creating and splitting surfaces
- Transforming geometry
- Baking geometry from Python into Rhino
- Adding text objects
- Exporting rendered frames for animation
Skill Level Intermediate
1. Working with Python
2. Python Basics
3. Importing Modules and Libraries
4. Grasshopper Workflows
Next steps3m 53s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.