BIM World
A Professional BIM Learning Platform


Using Dynamo Programming in Revit with Code Blocks

I spent a lot of time experimenting online, searching for how to use code blocks. Most of what I found were just help documents from the official website.

After several hours of exploration, I finally understood how this code block works.

First, let’s skip the basics for now and focus here. This content is essentially a translation from the official website, but it lacks an explanation on how to define the types of input parameters. For those familiar with C# but new to Python, this can be confusing. Actually, converting from C# to Python, especially in terms of defining parameter types, only takes about a minute to grasp.

In C#, you define parameter types like this:
int a1;

In Python, the equivalent way is:
a1: int;

So, when developing for Revit with either C# or Python, the differences are minimal. However, I personally prefer the strong typing style of C#.

To supplement the above explanation, here is a simple example.

Find the midpoint between two points.
Dynamo Programming in Revit - Code Block

Here is another example involving a list array, which can be applied practically for building steel bars.
Dynamo Programming in Revit - Code Block
As shown below:
Dynamo Programming in Revit - Code Block

If you encounter more questions in the future, feel free to add them as well.

xuebim
Follow the latest BIM developments in the architecture industry, explore innovative building technologies, and discover cutting-edge industry insights.
← Scan with WeChat
Like(0) 打赏
BIM WORLD » Using Dynamo Programming in Revit with Code Blocks

Comment Get first!

Must log in before commenting!

 

BIM World, A Professional BIM Learning Platform

Stay updated on the latest architecture trends and share new building technologies.

Contact UsAbout Us

觉得文章有用就打赏一下小编吧

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

Account Login

By signing in, you agree toUser Agreement

Sign Up