Importing different libraries allows you to utilize functions from multiple sources. Learn how to utilize functions from the Math library and Random library.
- [Instructor] Python provides built-in modules…that we can import and use as we need…in our own Python scripts.…You'll notice I've created a new Dynamo file,…so let's go ahead and place a new Python script node.…Let's have a look at importing both built-in modules…and also external modules created by others.…To start, let's import a module…that is very useful in Python…which is known as the math module.…To import we simply use the keyword import…and then the module name…as we have just done with our own library.…
The math library is simply called math.…And we now have the math module imported into our script…and we can access the functions…within the math namespace.…As we are importing a built-in module…readily available in Python, we don't need to append path…to the sys object.…Python automatically knows where to look…and retrieve this module.…To view all the functions within a module…we can use a built-in function known as DIR…which is short for directory.…This can be used on both modules…and objects to find all the methods and attributes…
Note: This course uses Dynamo 1.3.1 and Revit 2018. For best results, it helps to have the same versions of the software.
- Importing the Dynamo Geometry library
- Defining variables
- Making decisions with conditionals
- Controlling flow with operators
- Defining functions
- Working with external libraries in Python
- Accessing the Revit API with Python
Skill Level Intermediate
1. Dynamo and Python
2. Python Basics
3. Working with Libraries
4. Revit API
Next steps2m 18s
- 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.