Maciej Główka
Blog Games Contact
revit api dynamo machine learning generative python blender javascript webdev rust bevy gamedev android
Sept. 18, 2019

Extracting data from OSM file with Dynamo and Python

While there are some great packages available, like Elk or DynaMaps, to do the task – sometimes we need some data that is not possible to obtain with them. In this post I am gonna show a method to extract necessary data using Python.For parsing a XML file I am gonna use a standard Python library called xml.etree.ElementTree. In the example I will extract building boundaries and their floor …
Sept. 10, 2019

Auto-dimensioning rooms with Dynamo and Python

In this post (series I hope) I want to share some thoughts on possibilities of adding dimensions to rooms in Revit automatically. It is not a trivial task in my opinion, especially that there is no single good solution! Today I want to present a script that, in most cases, is going to dimension rooms along their cardinal directions.So, in the example below it would mean measuring each room twice …
Aug. 8, 2019

Creating elevation views with API

Creating section views at given location and direction with Revit API is relatively easy. You just have to create a right Bounding Box (it’s dimensions and transformation) and pass it as a constructor function parameter. Unfortunately it is not so easy with elevation views.The elevation views in Revit are not independent – they have to belong to a specific elevation marker. Therefore the vie…
July 1, 2019

Efficient auto-join using Dynamo

Joining model elements in Revit can be a tedious task. Surely it is something that most of us would like to automate with Dynamo. Hopefully we can easily find some custom nodes that can join elements. We can also do it with Python using a Revit API funtion: JoinGeometryUtils.JoinGeometry(doc,a,b) where doc is a current document and a and b are elements to join.Efficiency problems will o…
May 24, 2019

Finding element location by using Bounding Box in Dynamo

Most of the times Revit element location can be easily found in Dynamo with a help of some standard nodes – such as FamilyInstance.Location. There are some element categories however, that can cause a bit of a problem. For instance walls will return their location as a curve rather than a point. Elements that are generated by a sketched boundary (eg. floors) will not return a location at all. If …
May 10, 2019

Room boundaries from linked documents

Generating room boundaries with Python is relatively easy. It can be done by using following API call: loops = room.GetBoundarySegments(options) Options is a variable of SpatialElementBoundaryOptions type, which states desired boundary line location, eg. for walls it can be a finish line or centreline. As a result of the above we receive a list of loops, where each loop is a list itself…
March 29, 2019

Resetting MEP systems overrides

Revit MEP models allow overriding graphical display of entire MEP systems. It can be problematic when linking such models to eg. architecture. Often we would like to adjust visibility settings of MEP elements, but it cannot be done because of those overrides. Their priority is higher then view templates or filters.A solution for that is removing those overrides for every system separately, …
Feb. 12, 2019

Dimensioning elements from linked files with Dynamo

In one of the previous posts I have shown how to dimension curtain walls with Dynamo and Python. A thread on the Dynamo Forum made me realize that it will not work in case of elements coming from linked documents.In order to create a new dimension line by script in Revit we have to prepare first a reference array – a list of references to all the objects we want to dimension. According to Revit A…
Jan. 30, 2019

Auto-joining floors and walls

When modelling, Revit automatically joins geometries of intersecting walls – making drafting process a lot faster. It does not happen however for wall and floor pairs. Which results in some extra work while creating sections and can cause errors in schedules. Fortunately it can be easily automated by using Revit API.At the beginning we have to find all the walls and floors (separately) in the mod…
Jan. 9, 2019

Curtain wall dimensions with API and Dynamo

In this post I want to show a method that allows to automatically dimension curtain walls in Revit, with the result as on an image above.First let’s assume that our input data are: a curtain wall, a line specifying location of the future dimension line and a view. In order to create a new dimension line in Revit we use such code: doc.Create.NewDimension(view,line,refArray); Where “doc” is ou…
← newer older →