Sample app Dynamo



Parametric building design with Dynamo
Use this open-source sample application to make your Dynamo models more accessible. The sample app provides the possibility to edit and view your Dynamo models from within the VIKTOR platform.
Download the white paper and get INSPIRED

Collaborative parametric design models allow you to work together for better solutions

Pros and cons of Dynamo

Dynamo is a great tool for designers to create visual logic that you can use to easily calculate and visualize a parametric design of a structure. With Dynamo, designers can automate repetitive design tasks in order to use their productive time more wisely.

However, the visual logic of Dynamo can be difficult to read for any other person than the one who created it. The logic quickly becomes ‘messy’, which reduces the usability. Especially for longer running projects this can become a problem when certain people leave or get assigned to a different project. Additionally, sharing Dynamo models is difficult, because an installation of Dynamo is required on each individual device to open the drawings.

A Dynamo web app

With VIKTOR, you can develop user-friendly web applications that integrate with all kinds of software programs, such as Dynamo. VIKTOR apps have a clear and intuitive user interface in which users only see the adjustable parameters, which improves the usability of Dynamo software. VIKTOR also enables connecting Dynamo drawings to other computational programs through integrations, for example to calculate the strength of the structure. Additionally, everything runs in the Cloud, making your data always accessible to anyone with an internet connection!

In this article, we give an example of such an application. Continue reading to learn more, or try the app immediately in the VIKTOR demo environment. You can also find the open-source code in our GitHub repository.

Using the functionality

You can use the code out-of-the-box with VIKTOR.

Here, you see a snippet of the Python code that shows how little lines of code are needed to edit, compute and visualize your Dynamo model within VIKTOR.

1file = File.from_path(Path(__file__).parent.parent / "lib" / "files" / "dynamo_model_sample_app.dyn") 2input_file = DynamoFile(file) 3 4input_file.update("Height roof", params.step_2.height_roof) 5 6# Generate updated dynamo file and load into memory 7input_file = input_file.generate() 8files = [('input.dyn', BytesIO(input_file.getvalue_binary()))] 9 10# Run the analysis and obtain the output file 11generic_analysis = GenericAnalysis(files=files, executable_key="dynamo", 12 output_filenames=["output.xml", "geometry.json"]) 13generic_analysis.execute(timeout=60) 14 15# Generate output file and set up data for the DataViewer 16output_file = generic_analysis.get_output_file("output.xml", as_file=True) 17
  • In row 1 and 2 the dynamo model is loaded
  • In row 4 the dynamo model is updated
  • In row 7 and 8 the dynamo model is updated with your input parameter
  • In row 11 to 13 the dynamo model is computed by the worker and sent back to the application

And that’s it! Your model is now computed and visualized within the VIKTOR platform.

The necessary modules are included in this sample app. All that needs to be done is import them, call them and let them do their work for you!

In the video you can see the functionality being used in an applicaton on the VIKTOR platform.

Apply for a demo account to get access to this and all other sample applications!

Dynamo in 3 steps

The process of using the Dynamo sample app consists of 3 steps.

  1. Defining the location. As a first step you can choose the location of you project on the map. In the example the construction of a residential block is used. By clicking on the map the necessary required space for the project is shown on the map. When the input parameters are adjusted, they are also adjusted on the map

Define location on the map

  1. 3D dynamo model. In this step the input parameters for your project are required. For this example the parameters are used such as the dimensions of the house and the number of houses. When the update button is pressed, the model is computed and vizualized.

Generate 3D model

  1. Report. It is possible to compute additional information related to your project, such as the cost of construction or the impact on the environment. Using the Report functionality from VIKTOR a report is generated automatically, in which all this information is presented. It is of course possible to edit the template of this report to your taste.

Download report

Use the free version or apply for a demo account to try VIKTOR apps yourself!

illustration of free trial

Start building apps now

Try for free

Related Blog Posts

Hackathon stimulates knowledge development

Read more
automate chemical engineering web application

Molecule visualization and initial value problems sample apps

Read more
Automatic machine learning sample app

Sample app automatic machine learning

Read more

Free Trial

Start building apps now
Try for free