Frequently Asked Questions - Advanced Scripting

Questions about writing and using scripts in Autodesk Ecotect.

I have a calculated 3D analysis grid which I can use the slider to manually reposition the displayed axial section through. How can I animate this same axial section using an Ecotect script?

The following script shows you how to animate the position of the base 2D analysis grid within a set of 3D calculation results. It uses one of the example models that comes with Ecotect, but you can use your own model by simply commenting out line 4.

The key to using this script is to have already calculated full 3D dataset. Many of the calculation wizards in Ecotect provide an option for this when you select the Analysis Grid as the method for storing results. Without it, the base 2D analysis grid section won't move as it will only have results for its current position.

I see that I can simply cycle through all object in the model, but sometimes I want only certain types or just selected objects. Are there easier and quicker ways of doing this ?

One of the tasks you often need to do in an Ecotect script is iterate over objects within the model. This could just be to count all the DOOR elements or you may need to calculate the total area of all FLOOR objects. The example functions shown here illustrate different ways to do this depending on whether you want all objects or those of a certain type, on a certain zone or just from the current selection set.

I'd like to create an object and then add one or more child windows to it. I can add a new window, but how do I make it an actual hole in a wall.

The easiest way to add a child object is simply to create it and then use the command to link it to it's parent object. This emulates using the Edit»Link Objects menu item. The following script snippit shows how to do this...

How would I go about calculating the area of the analysis grid that is above a given threshold value. I know I can find the percentage of all points above it, but I need the actual floor-area and preferably very accurately.

This Ecotect script demonstrates how to iterate over the current analysis grid in your model and calculate the actual surface area that is above a given threshold, in this case the current minimum scale value. Whilst Ecotect can already show the percentage of grid points above a threshold, this script includes the fractional areas of cells that are partially above and partially below.