BIM Management,  Innovation,  Portfolio,  Programming,  The BIM System Blog

Revit: Placing Elements in Coordinates with Dynamo

As far as I know, at the moment there is no way to put ele­ments in Revit in cer­tain coor­di­nates, and you have to go to Auto­CAD as an inter­me­di­ary. How­ev­er, with the help of Dynamo you can auto­mate the loca­tion of objects in pre­cise coordinates.

The most com­mon exam­ple of use is to enter the coor­di­nates of a site from a table pro­vid­ed by the sur­vey­ing ser­vice provider. Usu­al­ly geo­ref­er­enced CAD planes are also deliv­ered, how­ev­er, we have often found pre­ci­sion errors when posi­tion­ing the coor­di­nates on a linked CAD in Revit. That is why the need arose to enter the points from the coor­di­nate table stored in an Excel file.

In gen­er­al, the def­i­n­i­tion of Dynamo fol­lows this sim­ple process:

  1. Reads the data in the .xlsx file
  2. Places fam­i­ly instances (of 2D struc­tur­al col­umn in this exam­ple) at each of the coor­di­nate points.
  3. Draws the prop­er­ty bound­aries with mod­el lines.
  4. Option­al­ly, tags the coor­di­nate points.
  5. A pre­vi­ous­ly con­fig­ured coor­di­nate sched­ule is filled.

The first thing will be to pre­pare the coor­di­nate spread­sheet in Excel. The order of the columns will deter­mine the order we’ll give lat­er read­ing data in Dynamo. The data is in mm in this example.

Coor­di­nates Excel spreadsheet

If we are work­ing with very high coor­di­nate val­ues, beyond the lim­its of the accu­rate work­space in Revit, it is high­ly rec­om­mend­ed to first spec­i­fy the Sur­vey Point val­ues at a point close to the ones we are going to intro­duce, and prefer­ably one of the points of the plot. I have cho­sen P1 for this case.

Spec­i­fy Coor­di­nates at Point for Sur­vey Point

Before going into details, let’s quick­ly see how it works when exe­cut­ed from Dynamo Play­er. It is always advis­able to access the input data edi­tion before exe­cut­ing the tool. Some field val­ues may be changed, if necessary.

View of Edit Inputs in Dynamo Player

In any case, once exe­cut­ed, thanks to the data | shapes input data form, we will have a new oppor­tu­ni­ty to con­firm or mod­i­fy the input infor­ma­tion. As you can see, all options are intu­itive and their default val­ues cor­re­spond to the most com­mon ones.

Data input form after run­ning the tool

Once OK is pressed, a final dia­log with the results is quick­ly prompted.

Last dia­log show­ing the results

Check in Revit if the lay­out and points are where we expect­ed, as well as the con­tents of the sched­ule. We also see that they are tagged, and in a 3D front view we are pre­sent­ed with the ele­va­tion of each point giv­ing slope to the prop­er­ty bound­ary lines.

As you can see, it is real­ly sim­ple to use, and with­out the need for a great prepara­to­ry work.

Floor plan in Revit
3D Front view in Revit
Coor­di­nate sched­ule in Revit

Now we are going to detail the con­struc­tion of the Dynamo script in steps.

First of all, we see a group of nodes with which a default selec­tion of the path in which the Excel file should be made, fol­low­ing the com­pa­ny’s stan­dard. I’m not going to delve into it, because obvi­ous­ly it is very cus­tomized, but I would like to men­tion that it is a great help to avoid extra clicks look­ing for the file in a cor­po­rate net­work with many direc­to­ries, gain­ing a lot of time when run­ning the def­i­n­i­tion. Keep­ing to the stan­dard has a prize. This group of nodes feeds the default val­ue of the file path of the next group that we will see next.

Group to define the default path of the Excel file

Before the incor­po­ra­tion in Dynamo Play­er of the option to edit input data, there was no oth­er way to con­trol dif­fer­ent options by the user. With the nodes of data | shapes (by Mostafa el Ayoubi) it was pos­si­ble to give this inter­ac­tion to users with dif­fer­ent dia­log box­es and data entry types. Once this was pos­si­ble with Dynamo Play­er, I kept the data | shapes func­tion­al­i­ties in my def­i­n­i­tions, because I think they are still more flex­i­ble and friend­ly, and allow inter­me­di­ate steps with user action. In addi­tion, these input data edi­tions are forced, while in Dynamo Play­er it is hid­den and it is com­mon to for­get about it. Nor­mal­ly, the default val­ues will be as desired and it will be enough to con­firm with OK to con­tin­ue with the execution.

Group of nodes to pre­pare the first input data form

In the next group of nodes the Excel file is read and the data is split from each col­umn, exclud­ing the headers.

How to read and split Excel data

Now we come to an oper­a­tion of tans­la­tion and rota­tion of the points with respect to the inter­nal ori­gin point of Revit. This is nec­es­sary to ensure that in any cir­cum­stance we will have the points cor­rect­ly locat­ed. That is, in cas­es where for some rea­son the Sur­vey Point has shift­ed with respect to the inter­nal ori­gin and / or a rota­tion of the project angle has already been made. If none of this has been done, there is no prob­lem, because the val­ues with which it oper­ates are 0 and the result is not altered.

The main oper­a­tion is hid­den inside the Point.Translate node, which is shown in the fol­low­ing image.

The next group is respon­si­ble for locat­ing the cho­sen fam­i­ly in the points already moved to the ref­er­ence of ori­gin, and mak­ing sure that they do so at the lev­el of the view cho­sen in the pre­vi­ous steps.

The View.GetLevel node is open in the fol­low­ing image.

Trans­la­tion of coor­di­nate and plac­ing families
Cus­tom node Point.Translate
Cus­tom node View.GetLevel

We con­tin­ue with the copy of the coor­di­nate val­ues to cus­tom para­me­ters of the fam­i­lies we have cho­sen to rep­re­sent the coor­di­nate points.

Copy­ing the coor­di­nates and name of points to cus­tom parameters

Next, the prop­er­ty lines are drawn by trac­ing a poly­gon between the points and these are tagged, if we have decid­ed so before.

Plot draw­ing and tag­ging of points
Cus­tom node Polygon.ByPoints
Cus­tom node Tag.ByElementLocationAndType

And final­ly, we use data | shapes again to show a last dia­log box to con­firm the result. In my opin­ion, it is extreme­ly use­ful to do this with all the def­i­n­i­tions so that the user has a more accu­rate idea of what has hap­pened and if every­thing went well before review­ing it in Revit.

Group to gen­er­ate the final results message

I hope this expla­na­tion has been suf­fi­cient­ly clear, although with­out going into many details so that it is not too tire­some either. I encour­age you to leave com­ments to answer ques­tions, and even pro­vide sug­ges­tions for improvements.

Com­plete def­i­n­i­tion image

Notes and acknowledgements:

· The present Dynamo tuto­r­i­al aims to mod­est­ly help the devel­op­ment of automa­tion in the work process­es of the AEC world.

· For con­fi­den­tial­i­ty rea­son and due to its high cus­tomiza­tion, none of the scripts can be shared.

· Thanks to all pack­age devel­op­ers for Dynamo, with­out whose effort, tips and gen­eros­i­ty it would not be pos­si­ble to extend the cus­tomiza­tion pow­er of Revit, con­sid­er­ably increas­ing its effec­tive­ness and effi­cien­cy. I would like to high­light espe­cial­ly the work of:

· Mostafa El Ayoubi (data | shapes)

· Andreas Dieck­mann (Clock­work)

· Kon­rad K Sobon (archi­lab & BumbleBee)

· Nate Miller (Lunch­Box & Rhynamo)

· Dim­i­tar Venkov (SpringN­odes)

· John Pier­son (Rhythm & Bang)

· Julian Benoit (SteamNodes)

· Thomas Mahon (Bimorph)

· Luke John­son (Bak­ery)

· Johnes Hou (Hot Gear)

· Col­in McCrone (Amper­sand)

· Dieter Ver­meulen (BIM4Struc.Rebar)

· Lau­renk Schmidt (Land­form)

· Tomasz Fudala (Struc­tur­al Design)

· Mod­el­i­cal

· Marc Tav­ernier

· For my part, I have devel­oped cus­tom nodes to sim­pli­fy def­i­n­i­tions and reuse them in oth­ers. When it is nec­es­sary for the under­stand­ing of the tuto­ri­als, I show the image of the cus­tom node so that it can be recreated.