Scale Calculator for architectural drawings

Hello and welcome to this blog post. As an architect it’s always been a challenge to quickly and easily determine the scale of a CAD drawing or to change it to a new one. thus I have programmed a little application called Scale Calculator which addresses that very problem. It’s not extremely polished but I’ve decided to share it with you guys here, hoping that it will help you in your day to day life working with technical drawings of various scales.

Edit: Scale calculator is now a web application, start running it right in your browser. click here.

Click here to download the application.

How to use the application:

Scale Calculator is extremely easy and self explanatory to use, all you really need to do is to download the installer from the link above and go through the simple installation process. once that’s done, a new icon should appear on your desktop with the name Scale Calculator. Once you open that up, you’re greeted with a super simple user interface. The application has two major functionalities:

  • Scale Finder: this functionality asks for a dimension from the drawing and it’s real-world value to find the scale of the drawing (units are irrelevant as long as the same unit is used for both inputs, e.g. in a 1:100 drawing, a 1m wide door measures exactly 1cm. So the user needs to input something like this: drawing dimension = 0.01 and real dimension = 1).
  • Scale Converter: this functionality asks the user to input the current and the desired scale in n:n format (1:100 or 1:25) and it calculates the factor by which the drawing should be enlarged or reduced (simply multiply the drawing by the given factor inside of AutoCad or a similar drafting application).

It’s true that most of the time we tend to use a small number of scales in our day to day lives and it’s very easy to convert them on the fly, but every now and then we might come across an irregular scale factor, this is when this tool might come in handy. Anyways I hope this post delivers some value to you and have an amazing day!

Animating almost anything in Revit using Dynamo.

As amazing as Autodesk Revit is for modeling and documenting a building, there is no question of the fact that it’s not exactly the strongest when it comes to animation. in this tutorial, we’ll go over a few techniques within Dynamo that will allow us to animate “almost” anything in Revit. now I should also mention the fact that not everything is programmatically adjustable in Revit but the general convention is that if you can edit something in the user interface, then you’ll probably be able to animate it (of course there might be exceptions to this; hence the word “almost” in the title of this blog post).

If all you wanna do is to create a simple walk-through by animating the camera and it’s target, then it would be foolish not to use the builtin walk-through creation tools offered by Revit. but if you’re after something more specific with a greater level of control of the parameters of every family instance, then this tutorial is for you. I should also point out that the methodology described here is very much inspired by a custom Dynamo package called Dynanimator which is developed by BadMonkeysTeam. although you do not need to install the package in order to be able to follow along with this tutorial, keep in mind that the general approach that’s explained here is borrowed from Dynanimator and is modified to suit our needs. feel free to download and install this excellent package and experiment with it. now without further ado, let us get started.


Steps:

  • creation of the animation_function node.
  • Creation of the animation node.
  • assembling the graph and feeding in the required information.

Step 1: “animation_function” node

this is the heart of the code, this is where we define our rules and every time that we wish to re-purpose our graph to animate something else, we’ll do it here. the big idea is that, we’ll lay the ground work of the changes that we’ll be making to the model here with a simple twist, we want the changes to happen one after the other for every single iteration (frame). so the general order of execution is as follows:

  • read which iteration we’re at.
  • read the input information.
  • execute change number 1.
  • execute change number 2.
  • execute change number 3, 4 etc….
  • and finally execute the last command: exporting the frame to a user-defined directory with proper naming.

the changes can be anything, this is exactly why this method is so useful, we have so much freedom over what is required to be animated and how. please keep in mind that the changes should be governed by the “iteration” value since we’re trying to generate the frames of an animation. for the purposes of this demonstration, we’ll be animating “object rotation” but the same principles with minor tweaks and changes can be applied to animate other aspect of the model, here is the graph for animation_function.dyf:

animation_function.dyf custom node
  • Input nodes: element, iterations, step, angle, view, path.
  • Change #1: rotating the instance based on this particular time-step. we determine the angle of each iteration based on a few factors (total number of iterations, current step and user defined angle). this is the formula: 1 / iteration * step * angle.
  • Final command: exporting the frame: here we use String.Concat to assemble a string variable using some of our input nodes, notice that the “step” input node is used to make the names varied and thus prevent overwriting of files during the export process. this also makes it easy to find particular frames later on.
  • We plug the last node of every action into a Transaction.End node to close their transactions. we finally feed those into a Function Compose node.

Step 2: “animation” node

there is really nothing special about this node, all that it ever does, is prepare the input information and iteratively run a given function (animation function node) for a total of n times. with n being the user-defined number of iteration or in other words the total number of frames in the whole animation. here is the graph for the custom node animation.dyf:

animation.dyf custom node
  • Input nodes: iteration, angle, element, path, view.
  • Here we place our animation_function custom node that we just created. notice how every slot has a corresponding input assigned to it except for “step”. leaving this argument unassigned turns our node into a function which can then be applied to a range of values using a List.Map node.
  • Outputting the results using an Output node.

Congratulations! our custom Dynamo node is now finished! all that is left to do is to feed in the required input arguments and click enter. a series of .png files will be exported to our defined directory which can then be processed into a video file quite easily:

using the custom node “animation” that we just created.
Rotation animation (demonstrated in this post)
animating family parameters

Introduction

Hello and welcome to CodedBIM! my name is Nasim Naji, I’m an architect from Iraqi Kurdistan and I’ve been working in the field of computational design for a while now. I have created countless custom workflows and solutions to aid me in my day to day challenges as an architect throughout my college years and beyond. I’m also a self taught C# and python programmer who thinks programming can help absolutely anyone and everyone to be more productive. and in some cases, even help them achieve results which are otherwise extremely time consuming, risky or outright impossible. even though I’ve occasionally used the knowledge in some rather cute personal projects outside of my field and profession, but the fact of the matter is, I mainly use software development and computer programming to aid me in my architectural career.

I have always felt that, the main strength of BIM, and it’s biggest advantage over traditional CAD solutions lies in the way it stores, handles and manipulates information in a raw and realistic way, and with the high level of complexity that BIM solutions such as Revit offer, I naturally had a desire to be able to freely and efficiently manipulate the model in meaningful ways. I first realized this fact when I started using an outstanding Autodesk product called Dynamo.


Dynamo’s node based user friendly interface can be used by architects and everyone else with minimum coding background….

Dynamo is a visual programming and non-destructive computational geometry modeling software which is available both as a standalone and an addin for Autodesk Revit and some other Autodesk products. with the innovative and user friendly node-based user interface of dynamo, I was introduced to the amazing world of visual programming and I can daringly say that I could never go back to using Revit without Dynamo. it has helped me tremendously over the years, both in school activities that were meant to be mostly artistic, as well as strictly realistic and accurate real world projects…

As amazing as dynamo is, and as much as I think that it helps smoothen out the learning curve of programming for AEC and it makes it easier to get into topics such as computational design, generative design, parametric architecture etc… but there is only so much that a visual programming tool can do. after using Dynamo for a while it quickly became obvious to me that learning a traditional software programming language can be extremely useful. for those of you who don’t know, Dynamo allows the user to write python code within it, so that’s where I started. one of the greatest advantages of writing python within Dynamo was the fact that now I had access to the Revit API and I could talk to Revit directly (if you don’t know what that is, Revit API is a set of Revit tools and functionalities that the developers have exposed for us to program). after learning python which is a relatively simple, but an extremely powerful language nevertheless, I slowly worked my way up from there, and I started experimenting with another more strongly typed language called C#, which quickly became my favorite language for writing Revit plugins and custom Dynamo nodes.


Now that you, the dear reader, know a little more about me and my past experiences, this brings us to CodedBIM and it’s purpose. CodedBIM is my first blog ever, and the main motivational force behind it’s creation is to serve as a platform, on which I can share my experiences in this field with the world, and hopefully potentially help others along the way. I really hope that you’ll enjoy your stay on my weblog and that we’ll be able to bring about an amazing community of professionals who are willing to excel in their work through exploring different alternatives and interdisciplinary collaboration.

Thank you very much for your time…

Nasim Naji Salim