July 19, 2013

Autodesk InfraWorks Tips and Tricks: JavaScript Support

Here at Ideate, we are always on the lookout for helpful tips and tricks that might be of value to our customers. While attending Autodesk Technical Academy this year, we were able to get a first-hand look at some of the additional features of Autodesk InfraWorks. One of these was the support of JavaScript for use when configuring data and for adding Tooltips to existing objects in the model. The Autodesk techs hosting the session were kind enough to share those scripts with us, and now we would like to share them with you.

The first of our scripts deals with Building Randomization. In many cases, our InfraWorks model may start with building footprint information that locates and defines areas that the buildings will occupy. In order to create buildings in the model, we can apply a user-specified height to those footprints to produce an extruded 3D model. Although this is a quick and relatively easy solution, it does not provide much in terms of variety. All buildings are generated at the same height, giving it an unnatural look. With the Building Randomization script, varying height, façade, and roof styles are assigned to the buildings based on pre-defined case criteria. To use the script, simply delete the default script and paste it in as a replacement.

Here are some screenshots of a sample model with the defaults, then with the randomization script applied.

Default: All Buildings are the same height

After Randomization Script Applied: Varying Height & Styles

Our second script was created to add a custom Object Tooltip that includes a Google Maps link in it. This script can be applied to buildings in your InfraWorks model and automatically launches and locates those buildings when clicked. It also includes user-defined Name, Description and User Data fields that can be edited for each object when the Tooltip is applied. It can also be copied and pasted, however this script is added to the Tooltip cell in the Object Properties palette for each individual object rather than applied to the entire data source like in our first example.

The screenshot below shows the Tooltip that appears when the object is hovered over in InfraWorks as well as the user-defined properties and link to Google Maps.

Google Maps Tooltip

You can download a copy of the scripts here: 

Building Randomization

Google Maps Tooltip

To see a video on how these are applied, visit our website at www.ideateinc.com/2014.

Matt Miyamoto, P.E.
Ideate AEC Application Specialist

Matt is a licensed Civil Engineer in the state of Hawaii. Matt obtained a BS in Mechanical Engineering from the University of Hawaii at Manoa, and has 7 years of private sector design experience which he applies in his role as an application specialist with Ideate, Inc. His project experience includes residential and commercial site development, private and public sewer, water and drainage systems, harbors improvements, and roadway improvements. While in Hawaii, Matt was involved in multidisciplinary projects for City and County agencies, State Departments, the Army COE and private developers. @MattM_PE

Get it. Know it. Use it.