BIM World
A Professional BIM Learning Platform


Integrating SQL Server and Python Scripts for Storing Material Appearance Properties in Revit Dynamo

First, let’s review a blog post titled: IronPython uses SQL Server database.

Our Dynamo Python Script environment is essentially a form of IronPython, which integrates seamlessly with databases, especially when combined with the methods discussed in the blog above.

In my previous article, I demonstrated how to read the appearance properties of materials and store them in a SQL Server database. Today, I will modify that approach by encapsulating the reading process into a DLL file, allowing most of the work to be completed within the Python Script environment.

We will make slight adjustments to MyClass, transforming it into the class shown in the image below, while leaving the ReadAssetPropelity class unchanged.Dynamo Programming in Revit - Combining SQL Server Database with Python Script to Store Material Appearance Properties

Next, complete the code implementation in the Python Script environment as shown below:Dynamo Programming in Revit - Combining SQL Server Database with Python Script to Store Material Appearance Properties

Pay special attention to this snippet, which converts elements recognized by Dynamo into a format readable by the Revit API:

wrappedElement = IN[0]
unwrappedElement = UnwrapElement(wrappedElement)

Finally, the data was successfully transmitted and imported into SQL Server, as demonstrated below.Dynamo Programming in Revit - Combining SQL Server Database with Python Script to Store Material Appearance Properties

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 » Integrating SQL Server and Python Scripts for Storing Material Appearance Properties in Revit Dynamo

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