1

I'm attempting to pull physical property information (dimensions and resistance values, in particular) from an architectural (Autodesk - Revit) model and organize that information to be exported as specific variables.

To expand slightly, for an independent study I want to perform energy balances on Revit Models, starting simple and building from there. The goal is to write code that collects information from a Revit Model and then organizes it into variables such as "Total Wall Area", "Insulation Resistance", "Drywall depth", "Total Window Area", etc. that could be then sent to a model (or simply a spreadsheet) and stored as such.

I hope that makes some sense.

Given that I am a novice coder and would prefer to write in Python, does anyone have any advice or resources concerning an efficient (simple) path to go about importing and organizing specific parameters from a Revit model?

Is it necessary (or realistically necessary, given the humble extent of my knowledge) to use the API for this program (Revit) to accomplish this task?

I imagine this task is similar to web scraping yet I have no HTML to call and search through and therefore am happily winging my way along, asking folks far more knowledgeable than I if they have any insight.

A brief background, I have next to no knowledge of Revit or APIs in general, basic knowledge of coding in Python and really want to learn more!

Any help you are able to give is absolutely appreciated! I'm also happy to answer any questions that come up.

Thank you for reading and have a terrific day!

2 Answers 2

1

Great question - my +1 is definitely for Revit Python Shell (RPS).

Likewise I had a basic understanding of Python and none of the Revit API, but with RPS Ive coded multiple addins for our office (including rich user interfaces using winforms) and had no limitations so far from coding in Python. Its true that there is some translating C# API samples into Python - but the reward is in seeing a few paragraphs of code becoming a few lines...

The maker of RPS (Daren) is also really helpful, so no questions go unanswered.

Disclaimer is that (like you), Im a novice programmer who has simply wanted to use the API to extend Revit. RPS for the win

Sign up to request clarification or add additional context in comments.

3 Comments

This should be a comment.
Thank you! It's excellent to hear about your experience with RPS; am I right in understanding that the SDK is not necessary for RPS use? I've started to play around with RPS and it seems like it runs independent of the SDK yet I could easily be missing something. Thanks again!
The Revit API SDK is the core reference regardless of what language you use - if using RPS you just have to figure out how to translate the C# into Python. In theory (and so far in practice) everything in the SDK can be used in RPS. Typically though, if you read most code samples the bulk of the work has little to do with the API - its more managing, filtering, presenting data. Python is really ninja at this!
0

Indeed the most used programming language for Revit is C# (.NET), if you decide to go with IronPython, it should work, but there is less material...

Using C#, check the My First Revit Plugin training. For your specific scenario, download the SDK and check the "Fire Rating" sample.

1 Comment

I believe I'll run with python for now and see where I get in the next weeks. Thank you for the resources! They are useful no matter the language I choose and it looks like C# may be in my future. Happy Sunday!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.