Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuturial read me #1

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Tuturial read me #1

wants to merge 10 commits into from

Conversation

MSlootwegVIKTOR
Copy link
Contributor

No description provided.

README.md Outdated
@@ -1,59 +1,380 @@
![](https://img.shields.io/badge/SDK-v13.0.0-blue) <Please check version is the same as specified in requirements.txt>
# Tuturial dynamo
Welcome to this tutorial on integrating Dynamo with VIKTOR! VIKTOR is a platform dedicated to the Engineering and Construction industry, providing a seamless integration with 3rd party software. In this tutorial, we will explore how to render a basic house with Dynamo and visualize it in VIKTOR. To get started, the user will provide parameters such as the number of houses, width, depth, number of floors, and heights for floors and roofs. The Viktor worker will then compute the Dynamo model using the command-line interface included within Dynamo Sandbox. The geometry of the model is generated using either Autodesk Revit or FormIt. The geometry JSON is then converted to a mesh, which is rendered and visualized in Viktor. In this tutorial, we will cover the step-by-step process of setting up a VIKTOR app with Dynamo integration we will cover:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Welcome to this tutorial on integrating Dynamo with VIKTOR! VIKTOR is a platform dedicated to the Engineering and Construction industry, providing a seamless integration with 3rd party software. In this tutorial, we will explore how to render a basic house with Dynamo and visualize it in VIKTOR. To get started, the user will provide parameters such as the number of houses, width, depth, number of floors, and heights for floors and roofs. The Viktor worker will then compute the Dynamo model using the command-line interface included within Dynamo Sandbox. The geometry of the model is generated using either Autodesk Revit or FormIt. The geometry JSON is then converted to a mesh, which is rendered and visualized in Viktor. In this tutorial, we will cover the step-by-step process of setting up a VIKTOR app with Dynamo integration we will cover:
Welcome to this tutorial on integrating Dynamo with VIKTOR! VIKTOR is a platform dedicated to the Engineering and Construction industry, providing a seamless integration with 3rd party software. In this tutorial, we will explore how to render a basic house with Dynamo and visualize it in VIKTOR. To get started, the user will provide parameters such as the number of houses, width, depth, number of floors, and heights for floors and roofs. The Viktor worker will then compute the Dynamo model using the command-line interface included within Dynamo Sandbox. The geometry of the model is generated using either Autodesk Revit or FormIt. The geometry JSON is then converted to a mesh, which is rendered and visualized in VIKTOR. In this tutorial, we will cover the step-by-step process of setting up a VIKTOR app with Dynamo integration we will cover:

README.md Outdated

An example of the application is shown in the image below.
By the end of this tutorial, you will have created a simple viktor application that creates a geometry and data view of a simple house, see gif below:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
By the end of this tutorial, you will have created a simple viktor application that creates a geometry and data view of a simple house, see gif below:
By the end of this tutorial, you will have created a simple VIKTOR application that creates a geometry and data view of a simple house, see GIF below:

README.md Outdated

Additionally, the file should contain the following arguments:
During the tutorial, we added some links to additional information; but don't let them distract you too much. Stay
focused on completing the tutorial. After this, you will know everything you need to create an app which includes Dynamo integration.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
focused on completing the tutorial. After this, you will know everything you need to create an app which includes Dynamo integration.
focused on completing the tutorial. After this, you will know everything you need to create an app which includes integrating with Dynamo.

README.md Outdated

```
viktor-cli create-app my-Dynamo-app
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
viktor-cli create-app my-Dynamo-app
viktor-cli create-app my-dynamo-app

My preference goes for lowercase project names

README.md Outdated
the application editor.

### Step 1.2 Define the input fields
The dynamo file has got the following input paramaters.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The dynamo file has got the following input paramaters.
The Dynamo file has got the following input paramaters.

README.md Outdated
2. With the update method, the value of input nodes can be updated.
3. When all inputs have been updated as desired, the generate method can be used to generate an updated `File` object.

### Step 1.4 Define the app logic to convert the output.xml to a data_group
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Step 1.4 Define the app logic to convert the output.xml to a data_group
### Step 1.4 Define the app logic to convert the output.xml to a DataGroup

README.md Outdated
3. When all inputs have been updated as desired, the generate method can be used to generate an updated `File` object.

### Step 1.4 Define the app logic to convert the output.xml to a data_group
In this step, we will define code to extract data from the dynamo file and output file. The dynamo file is used to get the node id, and the output.xml file is used to get the values. We will be creating another `staticmethod` in the `controller` class. See code below:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In this step, we will define code to extract data from the dynamo file and output file. The dynamo file is used to get the node id, and the output.xml file is used to get the values. We will be creating another `staticmethod` in the `controller` class. See code below:
In this step, we will define code to extract data from the Dynamo file and output file. The Dynamo file is used to get the node id, and the output.xml file is used to get the values. We will be creating another `staticmethod` in the `Controller` class. See code below:

README.md Outdated
Let us go through the above mentioned logic:
1. Get the node_id, which corresponds to the same node id as the input file.
2. Collect the numerical results.
3. We create a structured data group from the collected numerical results using the `DataGroup` and `DataItem` classes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if the reader will understand what we mean by a structured DataGroup. Maybe good to mention that for more information on this, refer to:

https://docs.viktor.ai/docs/create-apps/results-and-visualizations/data-and-tables

README.md Outdated

### Step 1.5 generate a geometry and data view

We create a new `GeometryAndDataView` method insdie the `controller` class. This method will enable us to show the 3D model of the house along with its data. Here is the code:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We create a new `GeometryAndDataView` method insdie the `controller` class. This method will enable us to show the 3D model of the house along with its data. Here is the code:
We create a new `GeometryAndDataView` method insdie the `Controller` class. This method will enable us to show the 3D model of the house along with its data. Here is the code:

README.md Outdated
return GeometryAndDataResult(geometry=glb_file, data=data_group)
```
Let us go through the above mentioned logic:
1. Update the dynamo file with the `update_model` method(see step 1.3)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Update the dynamo file with the `update_model` method(see step 1.3)
1. Update the Dynamo file with the `update_model` method(see step 1.3)

@MSlootwegVIKTOR
Copy link
Contributor Author

@LuukBoot I've reviewed the tutorial. Maybe good that @dsommersviktor also takes a quick look?

Copy link

@ddijkhuizen ddijkhuizen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's still quite some reformatting to do before it is suitable to be included in the docs.

The most major point is the structure. You want people to have results fast. Therefore I would think the structure should be such that the user would:

  1. Create input fields
  2. Create a GeometryView with mocked output files
  3. Create a data processing method
  4. Create a DataView with the mocked output files
  5. Create a GeometryAndDataView with the mocked output files
  6. Add the worker logic to supply real output files

Other than that some textual changes I also remarked on the recent 3D model tutorial:

  • No numbered headings below the top level (Introduction, Prerequisites and To infinity and beyond sections have no numbering despite being on the top level)
  • Include showLineNumbers at code snippets
  • Having first references to any object which can be linked to another part of the docs include a link to that object.
  • The app can be bumped to V14 so we can lose the viktor_enforce_field_constraint = True
  • Include the warning on app creation that this tutorial was written with V14 and that the create-app command will always create an app of the most recent SDK version which may cause unforeseen behaviour.

I do have to say that I am impressed with the brevity of this tutorial even though the subject matter is slightly more complex!!

Interested to hear what you think about it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants