Python in Dynamo: Basic Examples

  Рет қаралды 39,469

Aussie BIM Guru

Aussie BIM Guru

Күн бұрын

Пікірлер: 48
@isaiass.1951
@isaiass.1951 3 жыл бұрын
Hi, I'm from Brazil, and your video help me so much... Thanks
@AussieBIMGuru
@AussieBIMGuru 3 жыл бұрын
You're welcome! Great to know I have viewers in Brazil :)
@michaelwickerson4862
@michaelwickerson4862 Жыл бұрын
Thank you for this series, I wish I started with revit, dynamo and python before grasshopper and rhino3D. Michael
@AussieBIMGuru
@AussieBIMGuru Жыл бұрын
They're both highly valuable platforms - I use both! The only thing I wish was different in Grasshopper was a bit more list logic at the surface level, trees are powerful for geometry, but challenging in other scenarios.
@damirces
@damirces Жыл бұрын
Really great series that you made Gavin. I am using Revit 2022 and for example Dynamo Node "if" works just fine. Also the first two basic codes for "if" node that you made doesn't work. Start working from the moment when you used if and else with the IN...
@AussieBIMGuru
@AussieBIMGuru Жыл бұрын
Yes they fixed it eventually in later builds to behave properly. As far as I know the code I used should still work, make sure there are no typos or missing colons.
@eng.tiago.b
@eng.tiago.b 10 ай бұрын
bro, epic intro hahha greetings from Brazil
@AussieBIMGuru
@AussieBIMGuru 10 ай бұрын
Haha thanks!
@ATTechTutorials
@ATTechTutorials 4 жыл бұрын
Great concepts for learning the basics of Python in Dynamo! Thanks Gavin!
@AussieBIMGuru
@AussieBIMGuru 4 жыл бұрын
Cheers Alan! Next week we go deeper so wanted to start simple
@youpeng7008
@youpeng7008 3 жыл бұрын
Despite my english is bad, i can inderstang very well Thank you
@AussieBIMGuru
@AussieBIMGuru 3 жыл бұрын
You are welcome! I am glad it is still understandable, and thank you for the kind feedback.
@陳冠亦-j4s
@陳冠亦-j4s 3 жыл бұрын
Thanks Gavin! I appreciate it, learned a lot.
@AussieBIMGuru
@AussieBIMGuru 3 жыл бұрын
You're welcome!
@rezwanulhoque117
@rezwanulhoque117 Жыл бұрын
In the last part of this tutorial, you created a python script for random numbers, when you run the script numbers are automatically generated without code block.... how?
@AussieBIMGuru
@AussieBIMGuru Жыл бұрын
At 22:40 I show that my node has some default inputs. These can be set inside the custom node input nodes using the syntax inputName: dataType = default value
@mago_Maximo_do_Universo
@mago_Maximo_do_Universo 10 ай бұрын
bro, epic intro
@AussieBIMGuru
@AussieBIMGuru 10 ай бұрын
Haha thanks! I shortened it eventually as it was a bit on the long side....
@LinhKSD
@LinhKSD 2 жыл бұрын
5:53 please explain, what is the "if_bool" in "if if_bool:" syntax in this case?
@LinhKSD
@LinhKSD 2 жыл бұрын
"if bool" is 1 condition?
@AussieBIMGuru
@AussieBIMGuru 2 жыл бұрын
In this case I am storing the input as a variable. This can sometimes be more useful if you want to use the input more than once in your code.
@LinhKSD
@LinhKSD 2 жыл бұрын
@@AussieBIMGuru It will automatically interpret the condition as True, right? thanks
@AussieBIMGuru
@AussieBIMGuru 2 жыл бұрын
@@LinhKSD no. It's just a variable name and will store the value provided to the input er assign to it (the boolean going into IN[0]).
@engomardriouich9329
@engomardriouich9329 2 жыл бұрын
i have tried the script but I have got a problem with the dwg file. when I opened the file it doesn't have the filters that it was in the Revit sheet. the colors look different than the Revit and also the filters that were applied in Revit it doesn't have them. what can I do to get the DWG files to look the same as the Revit sheet?
@AussieBIMGuru
@AussieBIMGuru 2 жыл бұрын
I don't believe this is possible. You can choose layer/import settings in Revit under options, but filters etc. don't carry over when exported from Revit naturally, so Dynamo can't apply them either. In AutoCAD generally you would need to configure a .ctb file to control line weights and colours.
@tumzarelaxing
@tumzarelaxing 2 жыл бұрын
Question ? ? ? ? ? - Hi Guru, How can you setup a Loop that uses While (iteration of count at levels). How will you implement, Geometry.intersect and IndexOF and GetItematIndex. 2. how do you deal with levels list.map (iteration to collect information for each 3 levels deep at L2).
@AussieBIMGuru
@AussieBIMGuru 2 жыл бұрын
I typically wouldn't to be honest, I recommend trying to get geometry into a consistent list structure and then you can iterate at a predictable depth. Usually in data science and also Dynamo it is best to clean data before working with it rather than receiving it in unpredictable shapes. If you want to exhaust levels anyway, you would need to run a for loop across all item at the top level of the data structure, then iterate within a try/except/break statement probably so that if it doesn't work, it can move on. For running some functions at levels from Dynamo I usually prefer to package my Python into a custom node and can then work with levels in the node itself.
@tumzarelaxing
@tumzarelaxing 2 жыл бұрын
Thanks for the reply
@immi85
@immi85 4 жыл бұрын
again great video.
@AussieBIMGuru
@AussieBIMGuru 4 жыл бұрын
Cheers Immi! Hope these help give some more context to your learning during the Python series. You'll see in the next video the usefulness of 'for' loops when dealing with Dynamo elements in lists.
@immi85
@immi85 4 жыл бұрын
@@AussieBIMGuru sure 👍
@adityakelkar7178
@adityakelkar7178 4 жыл бұрын
Hi Gavin, thanks for another great video! Just a quick question about the random package. I am getting an IronPython error saying the random package is not defined. Do I need to install that somehow in Dynamo?
@AussieBIMGuru
@AussieBIMGuru 4 жыл бұрын
I believe you may need a certain build of Dynamo to access it - in my case I'm using Revit 2020 and Dynamo 2.3. I believe they introduced it in 2.1 but not 100% certain.
@vntk7686
@vntk7686 4 жыл бұрын
Great video! I want to use python libralies numpy and scipy, if you have any idea, could you tell me?
@AussieBIMGuru
@AussieBIMGuru 4 жыл бұрын
It isn't present by default, but GHRemote might allow you to run external packages if you use Rhino Inside; www.food4rhino.com/app/gh-python-remote I don't believe Dynamo itself can access these packages directly as it uses IronPython, whilst these rely on CPython.
@Faizan-k8t
@Faizan-k8t 4 жыл бұрын
How much python should i know for dynamo...?
@AussieBIMGuru
@AussieBIMGuru 4 жыл бұрын
It depends what you need to do with it. Most users get by with no understanding. Personally I learnt it because; - It provides more efficient list management (e.g. for loops, if statements) - It allows custom node development - It provided me with access to Revit API commands My specific 'bending point' was that I needed to set the time of day in multiple Revit views, and no custom package I could find was able to do this, so I learnt about Revit API and Python and eventually built a custom node to achieve this (most of which uses Python, and can be found in my custom package on my github). I would suggest you first learn the fundamentals - definitely watch my 10 part quick tip series which will give you the core skills in Python that you will need for Dynamo Python.
@Faizan-k8t
@Faizan-k8t 4 жыл бұрын
@@AussieBIMGuru Thank you 👌
@aliarslan8313
@aliarslan8313 3 жыл бұрын
I couldn't find your python template on your github, can you share the path?
@AussieBIMGuru
@AussieBIMGuru 3 жыл бұрын
github.com/aussieBIMguru/Misc/blob/master/PythonTemplate.py
@aliarslan8313
@aliarslan8313 3 жыл бұрын
@@AussieBIMGuru Thank you so much
@Gustavostarke
@Gustavostarke 3 жыл бұрын
Great lesson. I tried to replicate the last but it's not working.. here's my code (should be exaclty like yours) Am i missing something? Thanks in advance ------------ from random import seed from random import random rcount = IN[0] rseed = IN[1] rmin = IN[2] rmax = IN[3] seed(rseed) nums[] for r in range(rcount): val = rmin + (random() * (rmax-rmin)) nums.append(val) OUT = nums --------------
@AussieBIMGuru
@AussieBIMGuru 3 жыл бұрын
The only error I can see is the line nums[] should be nums = []
@Gustavostarke
@Gustavostarke 3 жыл бұрын
@@AussieBIMGuru Thats it! Thanks a lot for replying! Reallly appreciate it.
@borun67
@borun67 2 жыл бұрын
Thanks.👃👃👃👃👃
@AussieBIMGuru
@AussieBIMGuru 2 жыл бұрын
You're welcome!
@plaiclaudiamihaela366
@plaiclaudiamihaela366 2 жыл бұрын
Tom Geri
@AussieBIMGuru
@AussieBIMGuru 2 жыл бұрын
Not quite sure what that means, but thanks anyway!
Python in Dynamo: Create Sheets (API 1)
20:08
Aussie BIM Guru
Рет қаралды 13 М.
Python in Dynamo: Views to Sheets (API 2)
14:52
Aussie BIM Guru
Рет қаралды 7 М.
Хаги Ваги говорит разными голосами
0:22
Фани Хани
Рет қаралды 2,2 МЛН
Жездуха 41-серия
36:26
Million Show
Рет қаралды 5 МЛН
Andro, ELMAN, TONI, MONA - Зари (Official Audio)
2:53
RAAVA MUSIC
Рет қаралды 8 МЛН
How I Would Learn Python FAST (if I could start over)
12:19
5 Python Libraries You Should Know in 2025!
22:30
Keith Galli
Рет қаралды 91 М.
Please Master These 10 Python Functions…
22:17
Tech With Tim
Рет қаралды 274 М.
SFDUG Sept 2017 | Beginner's Guide to Python for Dynamo Users
1:13:46
Computational Design Institute
Рет қаралды 38 М.
Modern Python logging
21:32
mCoding
Рет қаралды 219 М.
Python in Dynamo: The Boiler Plate
19:03
Aussie BIM Guru
Рет қаралды 28 М.
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 498 М.
3 simple dynamo script for everyday use | Dynamo |
13:05
Niko G.
Рет қаралды 38 М.
Learn Any Programming Language In 3 Hours!
22:37
Code With Huw
Рет қаралды 651 М.
Python Logging: How to Write Logs Like a Pro!
11:02
ArjanCodes
Рет қаралды 190 М.