"
worker_integrations = ["autocad"]
```
In `requirements.txt`, use a VIKTOR version that supports `vkt.autocad.attach()`:
requirements.txt
```
viktor>=14.35.0,<15
```
You do not need to install an AutoCAD Python package. The app talks to AutoCAD through the personal worker.
### Add the beam inputs[](https://docs.viktor.ai/docs/tutorials/integrate-autocad/.md#add-the-beam-inputs "Direct link to Add the beam inputs")
Replace the generated `app.py` with the example below, one step at a time. Start with a title, six simple inputs, and one button:
app.py
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# AutoCAD Beam Detail Tutorial")
span = vkt.NumberField("Beam span", default=6000, suffix="mm", min=1000)
width = vkt.NumberField("Beam width", default=300, suffix="mm", min=100)
depth = vkt.NumberField("Beam depth", default=600, suffix="mm", min=100)
cover = vkt.NumberField("Concrete cover", default=40, suffix="mm", min=10)
bar_diameter = vkt.NumberField("Bar diameter", default=16, suffix="mm", min=6)
stirrup_spacing = vkt.NumberField("Stirrup spacing", default=200, suffix="mm", min=50)
draw = vkt.ActionButton("Draw beam in AutoCAD", method="draw_beam", longpoll=True)
```
All dimensions are in millimetres. The button calls `draw_beam` when you are ready. It does not draw automatically whenever an input changes.
### Draw the beam detail[](https://docs.viktor.ai/docs/tutorials/integrate-autocad/.md#draw-the-beam-detail "Direct link to Draw the beam detail")
Add a small helper function below the inputs. AutoCAD expects the coordinates of each corner of a polyline. Setting `Closed` joins the last corner back to the first one.
app.py
```
class Parametrization(vkt.Parametrization):
...
def rectangle(model_space, x, y, width, height, layer):
points = [x, y, x + width, y, x + width, y + height, x, y + height]
shape = model_space.AddLightWeightPolyline(points)
shape.Closed = True
shape.Layer = layer
```
Now add the `Controller` below `rectangle` in the same `app.py`. The `...` placeholders show code you already wrote, so keep your existing `Parametrization` and `rectangle` function. The controller reads the inputs, attaches to the drawing already open in AutoCAD, and creates two layers. Then it draws the elevation and the cross-section. The `try` block gives a useful message if the worker cannot attach or AutoCAD cannot finish the drawing.
app.py
```
class Parametrization(vkt.Parametrization):
...
def rectangle(model_space, x, y, width, height, layer):
...
class Controller(vkt.Controller):
parametrization = Parametrization
def draw_beam(self, params, **kwargs):
span = params.span
width = params.width
depth = params.depth
cover = params.cover
bar_radius = params.bar_diameter / 2
spacing = int(params.stirrup_spacing)
if 2 * (cover + params.bar_diameter) >= min(width, depth):
raise vkt.UserError("Reduce the cover or bar diameter, or increase the beam size.")
try:
with vkt.autocad.attach(timeout=120) as acad:
drawing = acad.ActiveDocument
model_space = drawing.ModelSpace
for name, color in [
("VKT-BEAM-CONCRETE", 7),
("VKT-BEAM-REBAR", 1),
]:
try:
layer = drawing.Layers.Item(name)
except vkt.errors.ExecutionError:
layer = drawing.Layers.Add(name)
layer.Color = color
# Beam elevation and two continuous longitudinal bars.
rectangle(model_space, 0, 0, span, depth, "VKT-BEAM-CONCRETE")
for y in (cover + bar_radius, depth - cover - bar_radius):
bar = model_space.AddLine([cover, y, 0], [span - cover, y, 0])
bar.Layer = "VKT-BEAM-REBAR"
# Draw one stirrup symbol at each spacing interval.
for x in range(spacing, int(span), spacing):
stirrup = model_space.AddLine(
[x, cover, 0], [x, depth - cover, 0]
)
stirrup.Layer = "VKT-BEAM-REBAR"
# Add a simple cross-section beside the elevation.
section_x = span + 500
rectangle(model_space, section_x, 0, width, depth, "VKT-BEAM-CONCRETE")
rectangle(
model_space, section_x + cover, cover,
width - 2 * cover, depth - 2 * cover, "VKT-BEAM-REBAR"
)
for x in (section_x + cover + bar_radius,
section_x + width - cover - bar_radius):
for y in (cover + bar_radius, depth - cover - bar_radius):
bar = model_space.AddCircle([x, y, 0], bar_radius)
bar.Layer = "VKT-BEAM-REBAR"
drawing.Regen(vkt.autocad.AcRegenType.acAllViewports)
except vkt.errors.WorkerSessionAttachError as error:
raise vkt.UserError(
"Open AutoCAD and a drawing on your personal worker, then try again."
) from error
except vkt.errors.ExecutionError as error:
raise vkt.UserError("AutoCAD could not draw the beam. Check the open drawing.") from error
```
The same dimensions control both views. `attach()` edits the drawing already on your screen, and `Regen()` refreshes it once after all objects are added. This is a drawing example, not a structural design check. Verify bar spacing, cover, anchorage, and code requirements before using a detail in a project.
### Add labels and a callout[](https://docs.viktor.ai/docs/tutorials/integrate-autocad/.md#add-labels-and-a-callout "Direct link to Add labels and a callout")
Let's build on the beam and cross-section we just drew. We stay inside the **same** `draw_beam` method. The `...` lines below stand for code you already have. Add the highlighted annotation layer to the layer list. Then add the highlighted labels and callout after the cross-section's `for` loops, just before `drawing.Regen(...)`:
app.py
```
class Parametrization(vkt.Parametrization):
...
def rectangle(model_space, x, y, width, height, layer):
...
class Controller(vkt.Controller):
parametrization = Parametrization
def draw_beam(self, params, **kwargs):
...
try:
with vkt.autocad.attach(timeout=120) as acad:
...
for name, color in [
("VKT-BEAM-CONCRETE", 7),
("VKT-BEAM-REBAR", 1),
("VKT-BEAM-ANNOTATIONS", 2),
]:
...
# Keep the beam elevation and cross-section code here.
...
for label, x in [("BEAM ELEVATION", 0), ("CROSS-SECTION", section_x)]:
text = model_space.AddText(label, [x, depth + 180, 0], 80)
text.Layer = "VKT-BEAM-ANNOTATIONS"
note = model_space.AddMText(
[span / 3, depth + 420, 0], 1800,
f"Stirrups @ {spacing} mm"
)
note.Height = 80
note.Layer = "VKT-BEAM-ANNOTATIONS"
leader = model_space.AddLeader(
[spacing, depth - cover, 0, span / 3, depth + 420, 0],
note, vkt.autocad.AcLeaderType.acLineWithArrow
)
leader.Layer = "VKT-BEAM-ANNOTATIONS"
drawing.Regen(vkt.autocad.AcRegenType.acAllViewports)
```
The two labels name the views. The callout is an AutoCAD leader attached to text, with its arrow pointing to the first stirrup. If you change the spacing input and draw again, the callout uses the new value.
### Add a native AutoCAD table[](https://docs.viktor.ai/docs/tutorials/integrate-autocad/.md#add-a-native-autocad-table "Direct link to Add a native AutoCAD table")
Finally, put the beam inputs in a small schedule below the elevation. Keep everything from the previous step. Add the highlighted table layer as the fourth item in the same list, then insert the highlighted table code after `leader.Layer = "VKT-BEAM-ANNOTATIONS"` and before the existing `drawing.Regen(...)`. Again, `...` stands for unchanged code:
app.py
```
class Parametrization(vkt.Parametrization):
...
def rectangle(model_space, x, y, width, height, layer):
...
class Controller(vkt.Controller):
parametrization = Parametrization
def draw_beam(self, params, **kwargs):
...
try:
with vkt.autocad.attach(timeout=120) as acad:
...
for name, color in [
("VKT-BEAM-CONCRETE", 7),
("VKT-BEAM-REBAR", 1),
("VKT-BEAM-ANNOTATIONS", 2),
("VKT-BEAM-TABLE", 7),
]:
...
# Keep the beam and annotation code here.
...
leader.Layer = "VKT-BEAM-ANNOTATIONS"
table = model_space.AddTable([0, -250, 0], 7, 2, 160, 900)
table.Layer = "VKT-BEAM-TABLE"
for row_type in (
vkt.autocad.AcRowType.acTitleRow,
vkt.autocad.AcRowType.acHeaderRow,
vkt.autocad.AcRowType.acDataRow,
):
table.SetTextHeight(row_type, 80)
table.SetText(0, 0, "BEAM SCHEDULE")
table.SetText(1, 0, "Parameter")
table.SetText(1, 1, "Value")
for row, (name, value) in enumerate([
("Span", f"{span:g} mm"),
("Section", f"{width:g} x {depth:g} mm"),
("Cover", f"{cover:g} mm"),
("Bar diameter", f"{params.bar_diameter:g} mm"),
("Stirrup spacing", f"{spacing} mm"),
], start=2):
table.SetText(row, 0, name)
table.SetText(row, 1, value)
drawing.Regen(vkt.autocad.AcRegenType.acAllViewports)
```
`AddTable` creates an editable AutoCAD table, not a collection of drawn lines. Its rows summarize the same inputs that produced the detail. Leave the **one** `drawing.Regen(...)` call at the bottom of the `with` block, after all geometry, labels, and table cells have been added.
### Run the app and check AutoCAD[](https://docs.viktor.ai/docs/tutorials/integrate-autocad/.md#run-the-app-and-check-autocad "Direct link to Run the app and check AutoCAD")
From the new app folder, run `viktor-cli clean-start` once. It installs the app dependencies and connects your development app to VIKTOR. Keep the terminal open and use the app link printed by the CLI. Later, use `viktor-cli start` to reconnect without reinstalling.
Open a copy of a drawing in AutoCAD, check that the personal worker is online in VIKTOR Desktop, and click **Draw beam in AutoCAD**. The detail, labels, callout, and beam schedule appear on four `VKT-BEAM-*` layers. Save the drawing in AutoCAD when you are happy with it. Each click adds another detail; the app does not replace the previous one.
The finished app shows the beam inputs beside the elevation, cross-section, callout, and native AutoCAD table:

If the app cannot attach, make sure AutoCAD is open on the worker machine and no dialog is blocking it. The [AutoCAD integration guide](https://docs.viktor.ai/docs/create-apps/software-integrations/autocad/.md#attaching-to-a-running-instance) explains the attach errors in more detail.
### Complete code[](https://docs.viktor.ai/docs/tutorials/integrate-autocad/.md#complete-code "Direct link to Complete code")
Here is the final `app.py` with the beam, cross-section, labels, callout, and native table in one place. Open it if you want to compare your code with the finished app.
**Complete app.py code**
app.py
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# AutoCAD Beam Detail Tutorial")
span = vkt.NumberField("Beam span", default=6000, suffix="mm", min=1000)
width = vkt.NumberField("Beam width", default=300, suffix="mm", min=100)
depth = vkt.NumberField("Beam depth", default=600, suffix="mm", min=100)
cover = vkt.NumberField("Concrete cover", default=40, suffix="mm", min=10)
bar_diameter = vkt.NumberField("Bar diameter", default=16, suffix="mm", min=6)
stirrup_spacing = vkt.NumberField("Stirrup spacing", default=200, suffix="mm", min=50)
draw = vkt.ActionButton("Draw beam in AutoCAD", method="draw_beam", longpoll=True)
def rectangle(model_space, x, y, width, height, layer):
"""Draw one closed rectangle in the XY plane."""
points = [x, y, x + width, y, x + width, y + height, x, y + height]
shape = model_space.AddLightWeightPolyline(points)
shape.Closed = True
shape.Layer = layer
class Controller(vkt.Controller):
parametrization = Parametrization
def draw_beam(self, params, **kwargs):
span = params.span
width = params.width
depth = params.depth
cover = params.cover
bar_radius = params.bar_diameter / 2
spacing = int(params.stirrup_spacing)
if 2 * (cover + params.bar_diameter) >= min(width, depth):
raise vkt.UserError("Reduce the cover or bar diameter, or increase the beam size.")
try:
with vkt.autocad.attach(timeout=120) as acad:
drawing = acad.ActiveDocument
model_space = drawing.ModelSpace
for name, color in [
("VKT-BEAM-CONCRETE", 7),
("VKT-BEAM-REBAR", 1),
("VKT-BEAM-ANNOTATIONS", 2),
("VKT-BEAM-TABLE", 7),
]:
try:
layer = drawing.Layers.Item(name)
except vkt.errors.ExecutionError:
layer = drawing.Layers.Add(name)
layer.Color = color
# Beam elevation and two continuous longitudinal bars.
rectangle(model_space, 0, 0, span, depth, "VKT-BEAM-CONCRETE")
for y in (cover + bar_radius, depth - cover - bar_radius):
bar = model_space.AddLine([cover, y, 0], [span - cover, y, 0])
bar.Layer = "VKT-BEAM-REBAR"
# Draw one stirrup symbol at each spacing interval.
for x in range(spacing, int(span), spacing):
stirrup = model_space.AddLine(
[x, cover, 0], [x, depth - cover, 0]
)
stirrup.Layer = "VKT-BEAM-REBAR"
# Add a simple cross-section beside the elevation.
section_x = span + 500
rectangle(model_space, section_x, 0, width, depth, "VKT-BEAM-CONCRETE")
rectangle(
model_space, section_x + cover, cover,
width - 2 * cover, depth - 2 * cover, "VKT-BEAM-REBAR"
)
for x in (section_x + cover + bar_radius,
section_x + width - cover - bar_radius):
for y in (cover + bar_radius, depth - cover - bar_radius):
bar = model_space.AddCircle([x, y, 0], bar_radius)
bar.Layer = "VKT-BEAM-REBAR"
# Label the two views and point a native leader at a stirrup.
for label, x in [("BEAM ELEVATION", 0), ("CROSS-SECTION", section_x)]:
text = model_space.AddText(label, [x, depth + 180, 0], 80)
text.Layer = "VKT-BEAM-ANNOTATIONS"
note = model_space.AddMText(
[span / 3, depth + 420, 0], 1800,
f"Stirrups @ {spacing} mm"
)
note.Height = 80
note.Layer = "VKT-BEAM-ANNOTATIONS"
leader = model_space.AddLeader(
[spacing, depth - cover, 0, span / 3, depth + 420, 0],
note, vkt.autocad.AcLeaderType.acLineWithArrow
)
leader.Layer = "VKT-BEAM-ANNOTATIONS"
# A real AutoCAD table stays editable in the drawing.
table = model_space.AddTable([0, -250, 0], 7, 2, 160, 900)
table.Layer = "VKT-BEAM-TABLE"
for row_type in (
vkt.autocad.AcRowType.acTitleRow,
vkt.autocad.AcRowType.acHeaderRow,
vkt.autocad.AcRowType.acDataRow,
):
table.SetTextHeight(row_type, 80)
table.SetText(0, 0, "BEAM SCHEDULE")
table.SetText(1, 0, "Parameter")
table.SetText(1, 1, "Value")
for row, (name, value) in enumerate([
("Span", f"{span:g} mm"),
("Section", f"{width:g} x {depth:g} mm"),
("Cover", f"{cover:g} mm"),
("Bar diameter", f"{params.bar_diameter:g} mm"),
("Stirrup spacing", f"{spacing} mm"),
], start=2):
table.SetText(row, 0, name)
table.SetText(row, 1, value)
drawing.Regen(vkt.autocad.AcRegenType.acAllViewports)
except vkt.errors.WorkerSessionAttachError as error:
raise vkt.UserError(
"Open AutoCAD and a drawing on your personal worker, then try again."
) from error
except vkt.errors.ExecutionError as error:
raise vkt.UserError("AutoCAD could not draw the beam. Check the open drawing.") from error
```
## 4. Important limitations[](https://docs.viktor.ai/docs/tutorials/integrate-autocad/.md#4-important-limitations "Direct link to 4. Important limitations")
The app edits the live drawing through AutoCAD's ActiveX API. Keep these points in mind:
* **The app cannot attach when AutoCAD is closed.** Open AutoCAD and the correct drawing before running the action.
* **The drawing changes are real and are not rolled back automatically.** Test the app on a copy of the drawing and use recognizable layer prefixes.
* **AutoCAD must remain available.** A modal dialog or an active command can prevent the worker from attaching to the running instance.
* **The app cannot use interactive command-line prompts.** Ask for dimensions and choices in the VIKTOR interface instead of relying on AutoCAD selections or prompts.
* **Each AutoCAD operation travels through the worker.** Group repeated geometry with polylines, blocks, copies, and arrays, then regenerate once at the end.
For the full list of supported behavior and worker errors, continue with the [AutoCAD integration guide](https://docs.viktor.ai/docs/create-apps/software-integrations/autocad/.md).
## To infinity and beyond\
Well done! You now have three starting points for creating VIKTOR apps that draw structural details and models in the AutoCAD file open on your computer.
Continue by adapting the prompts to your drawing standards, layer conventions, and engineering checks. You can also explore the [Autodesk Forma / ACC tutorial](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md) to work with Revit models stored in Autodesk Construction Cloud, or return to the [tutorial overview](https://docs.viktor.ai/docs/tutorials/.md) for more examples.
---
# Tutorial - Autodesk Forma / ACC
info
Level: **Intermediate**
Time: **30 min**
Prerequisites:
* You have a VIKTOR account and completed the installation process. No account? Get one [here](https://www.viktor.ai/start-building-apps)
* You have access to an Autodesk Construction Cloud project with a Revit model.
* Your VIKTOR environment has an Autodesk Platform Services OAuth 2.0 integration available.
* The AEC Data Model is active in your ACC account for the prompts that query model data.
* [](https://www.viktor.ai/start-building-apps)
## Introduction[](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md#introduction "Direct link to Introduction")
Welcome to this tutorial on how to create VIKTOR apps that work with Revit models stored in Autodesk Forma and Autodesk Construction Cloud (ACC).
If you work with BIM models, you may need more than a model viewer. You may also want to calculate quantities, compare groups of elements, highlight categories, or check whether model properties meet your project rules. So in this tutorial, we will use four prompts to explore these workflows with the VIKTOR App Builder.
Each prompt is a starting point for a different ACC workflow:
1. [Visualize a Revit model in the Autodesk Viewer](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md#prompt-1-visualize-a-revit-model-in-the-autodesk-viewer).
2. [Generate a quantity takeoff from a Revit structural model](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md#prompt-2-generate-a-quantity-takeoff-from-a-revit-structural-model).
3. [Highlight Revit categories with custom colors](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md#prompt-3-highlight-revit-categories-with-custom-colors).
4. [Validate Revit pipe properties](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md#prompt-4-validate-revit-pipe-properties).
## 1. Set up the integration[](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md#1-set-up-the-integration "Direct link to 1. Set up the integration")
Before testing the prompts, configure an Autodesk Platform Services (APS) OAuth 2.0 integration in VIKTOR and connect the same APS application to your ACC account as a custom integration.
Follow these sections to complete the setup:
* [Create the APS OAuth 2.0 integration](https://docs.viktor.ai/docs/create-apps/software-integrations/autodesk-platform-services/.md#creating-an-oauth-20-integration-admin).
* [Connect the APS application to ACC](https://docs.viktor.ai/docs/create-apps/software-integrations/autodesk-platform-services/.md#integration-with-autodesk-construction-cloud-acc).
* [Review the ACC requirements and available APIs](https://docs.viktor.ai/docs/create-apps/software-integrations/autodesk-construction-cloud/.md#requirements-and-guidelines-for-using-acc-apis).
* [Activate the AEC Data Model](https://docs.viktor.ai/docs/create-apps/software-integrations/autodesk-construction-cloud/.md#activating-the-aec-data-model) before using the quantity takeoff or property validation prompts.
Before submitting a prompt, replace `[YOUR-APS-INTEGRATION-NAME-HERE]` with the exact name of the APS OAuth 2.0 integration available in your VIKTOR environment.
## 2. Understand the key concepts[](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md#2-understand-the-key-concepts "Direct link to 2. Understand the key concepts")
Although you can get quite far in VIKTOR with simple prompts, it helps to understand the main concepts behind these workflows:
* **[APS integration](https://docs.viktor.ai/docs/create-apps/software-integrations/autodesk-platform-services/.md)**: Autodesk Platform Services (APS) is the connection between VIKTOR and Autodesk. The OAuth 2.0 integration lets you sign in securely and gives the app permission to access the ACC projects and models available to you.
* **[AEC Data Model API](https://docs.viktor.ai/docs/create-apps/software-integrations/autodesk-construction-cloud/.md#aec-data-model-api)**: This API lets the app read Revit element data from ACC without opening Revit. It can return names, properties, quantities, and relationships between model elements.
* **[APS Viewer](https://docs.viktor.ai/docs/create-apps/results-and-visualizations/autodesk/.md)**: This is the interactive 3D viewer shown inside the VIKTOR app. You can use it to explore the model and highlight elements, while the AEC Data Model API provides the data behind those elements.
* **[Category, family, type, and instance](https://help.autodesk.com/cloudhelp/2022/ENU/Revit-Model/files/GUID-6DDC1D52-E847-4835-8F9A-466531E5FD29.htm)**: These describe where an element belongs in Revit. A **category** is a broad group such as Doors. A **family** is a reusable design such as a single door. A **type** is one configured version, such as a 900 × 2100 mm door. An **instance** is one actual door placed in the model.
* **[GraphQL](https://graphql.org/learn/)**: GraphQL is the query language used by the AEC Data Model API. The app asks only for the model data it needs, such as all pipe instances and their diameters, and the API returns that data in a structured response.
In simple terms, the app uses the APS integration to access the selected model, sends a GraphQL query to retrieve its data, and then shows the result in a viewer, table, or chart.
## 3. Explore ACC workflows with prompts[](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md#3-explore-acc-workflows-with-prompts "Direct link to 3. Explore ACC workflows with prompts")
Click the arrow on a prompt to open it in the VIKTOR App Builder. After the app is generated, connect the APS integration, select a Revit model from ACC, and review the preview.
### Prompt 1: Visualize a Revit model in the Autodesk Viewer[](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md#prompt-1-visualize-a-revit-model-in-the-autodesk-viewer "Direct link to Prompt 1: Visualize a Revit model in the Autodesk Viewer")
Let's start with the simplest workflow. This is useful when you want to review or share an ACC model without downloading the file or opening Revit. The app uses `vkt.AutodeskFileField` to browse the ACC projects available to the signed-in user. After you select a Revit model, it opens in the Autodesk Viewer inside VIKTOR.


### Revit model viewer
Create an app with which I can select a Revit model from Autodesk Forma / ACC and visualize it using the Autodesk Viewer. Use vkt.AutodeskFileField with my existing APS OAuth 2.0 integration "\[YOUR-APS-INTEGRATION-NAME-HERE]" for model selection.
Once the App Builder finishes creating the app, connect the APS integration and select a Revit model. Use the viewer controls to orbit, pan, zoom, isolate elements, and inspect the model.

tip
If you want to visualize another Revit view, including a 2D view, add this instruction to the prompt:
> Use the APS Viewer SDK to visualize the model and let me select any available Revit view, including 2D views.
### Prompt 2: Generate a quantity takeoff from a Revit structural model[](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md#prompt-2-generate-a-quantity-takeoff-from-a-revit-structural-model "Direct link to Prompt 2: Generate a quantity takeoff from a Revit structural model")
The second workflow combines the Autodesk Viewer with the AEC Data Model API. This is useful for early estimates, model checks, and understanding which elements make up a structural model. The generated app groups model elements and calculates the quantities available for each group, so you can explore the results without exporting the Revit data first.


### Revit structural quantity takeoff
Create a VIKTOR app using my APS OAuth 2.0 integration "\[YOUR-APS-INTEGRATION-NAME-HERE]". Let me select a Revit structural model from ACC and generate a QTO using the AEC Data Model API. Follow the ACC and AEC Data Model patterns in the APS knowledge base. Group the elements by category, family, type, and material, and calculate their count and available quantities such as length, area, volume, and weight. Show only the entities with counts greater than 5. Display the model, a TableView, and a PlotlyView bar plot with the category counts.
Select a Revit structural model in the generated app. The model tab lets you inspect the geometry while the QTO table shows the grouped element data and available quantities.

Open the category chart to compare the number of elements in each structural category. Only groups with more than five elements are included in the results.

tip
You can extend this app to analyze the families, types, or individual instances within a selected category. You can also export the results to Excel or PDF, compare model versions, or add other charts such as pie charts.
### Prompt 3: Highlight Revit categories with custom colors[](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md#prompt-3-highlight-revit-categories-with-custom-colors "Direct link to Prompt 3: Highlight Revit categories with custom colors")
The third workflow helps you understand a model faster by giving related categories their own colors. This is useful for design reviews and coordination because you can separate structural, architectural, and building-services elements visually. Add one or more highlighting rules, select the categories for each rule, and choose the color that should be applied in the viewer.


### Revit category highlighter
Using my APS OAuth 2.0 integration "\[YOUR-APS-INTEGRATION-NAME-HERE]", create an app where I can select a model from my Autodesk Construction Cloud (ACC) account.
Add a multi-select field with common Revit categories such as Walls, Floors, Doors, Windows, Structural Framing, Structural Columns, Mechanical Equipment, Pipes, Ducts, Lighting Fixtures, etc.
Use a dynamic array that allows me to add multiple highlighting rules. Each rule should include a multi-select field for one or more Revit categories and a color field.
I should be able to add or remove multiple rules and use them to find and highlight the corresponding model elements with the selected colors using the APS Viewer SDK.
Select a model, add the rules you need, and assign a color to each group of categories. The Autodesk Viewer updates the model so you can identify the selected categories visually.

tip
Use the **View** dropdown in the upper-left corner of the viewer to move between the Revit views available in the model. The selected colors remain visible when you change views, including in supported 2D views.
### Prompt 4: Validate Revit pipe properties[](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md#prompt-4-validate-revit-pipe-properties "Direct link to Prompt 4: Validate Revit pipe properties")
The final workflow turns model data into a repeatable quality check. This is useful when an engineer needs to find elements that do not follow a project requirement without checking every pipe manually. Each rule targets a pipe type, property, operator, and comparison value. Elements that do not satisfy the rule are highlighted in red.


### Revit pipe validation
Create an app using my APS OAuth 2.0 integration "\[YOUR-APS-INTEGRATION-NAME-HERE]" that lets me query data from my Revit model in ACC. Retrieve the distinct pipe types from the Pipes category and use the Element Name parameter as a proxy for the pipe type name. Include a dynamic rule table where I can add one or more validation rules. For each rule, let me select an element name, a property such as Length or Diameter, an inequality operator such as greater than, equal to, or less than, and a comparison value. Evaluate all matching pipe elements and highlight in red any elements in the Autodesk Viewer that do not satisfy the selected rule. Use the APS Viewer SDK.
Select a Revit model and add one or more pipe validation rules. The app evaluates the matching elements and highlights every failed check in red, making it easier to find values that need attention.

tip
You can replace these example rules with custom engineering logic that matches your project standards. Keep in mind that the AEC Data Model API does not expose every Revit property or relationship. Connectivity and some mechanical-system properties may not be available, so check which properties the model returns before defining a rule.
## 4. Limitations[](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md#4-limitations "Direct link to 4. Limitations")
The quantity takeoff and pipe validation prompts use the AEC Data Model API. Before building a production workflow, review the [AEC Data Model limitations](https://docs.viktor.ai/docs/create-apps/software-integrations/autodesk-construction-cloud/.md#aec-data-model-limitations).
Keep these points in mind:
* The AEC Data Model supports the US, EMEA, and AUS regions.
* Linked Revit models are not supported.
* Full geometry queries are not available through the AEC Data Model API. The apps use the Autodesk Viewer to display model geometry.
* The AEC Data Model works with Revit 2024 and later.
## To infinity and beyond\
Well done! You now have four starting points for creating VIKTOR apps that work with Revit models in ACC. You have explored model visualization, quantity takeoffs, category highlighting, and property validation.
Finally, the journey doesn't end here. Continue with the [Autodesk Forma Site Design tutorial](https://docs.viktor.ai/docs/tutorials/integrate-forma-site-design/.md) or check out some of our other [tutorials](https://docs.viktor.ai/docs/tutorials/.md).
---
# Tutorial - Civil 3D
info
Level: **Intermediate**
Time: **30–45 min**
Prerequisites:
* You have a VIKTOR account. No account? Get one [here](https://www.viktor.ai/start-building-apps).
* You have Civil 3D installed and licensed on a Windows computer.
* You can install VIKTOR Desktop on that computer and open a writable Civil 3D drawing.
* [](https://www.viktor.ai/start-building-apps)
## Introduction[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#introduction "Direct link to Introduction")
Welcome to this tutorial on how to create VIKTOR apps that work directly in Civil 3D!
Road geometry often changes during a project. Instead of repeating the same drawing operations, you can describe a workflow in the VIKTOR App Builder, adjust a few inputs, and create native Civil 3D objects in your open drawing. In this tutorial, you will explore three workflows:
1. [Create a road alignment and set-out points](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#prompt-1-create-a-road-alignment-and-set-out-points).
2. [Create an existing-ground longitudinal profile](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#prompt-2-create-an-existing-ground-longitudinal-profile).
3. [Create three cross sections](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#prompt-3-create-three-cross-sections).
Prefer writing Python?
If you're comfortable with Python and want to build the app yourself, select the **Local development** tab under [Choose your approach](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#3-choose-your-approach). You'll build a simple longitudinal-profile app step by step. Complete the Civil 3D and VIKTOR Desktop setup below first, as it applies to both approaches.
## 1. Set up Civil 3D and VIKTOR Desktop[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#1-set-up-civil-3d-and-viktor-desktop "Direct link to 1. Set up Civil 3D and VIKTOR Desktop")
The apps use a personal worker to connect VIKTOR to Civil 3D on your Windows computer. Check the [VIKTOR Desktop requirements](https://docs.viktor.ai/docs/create-apps/software-integrations/viktor-desktop/.md#requirements), then [download and install VIKTOR Desktop](https://docs.viktor.ai/docs/create-apps/software-integrations/viktor-desktop/.md#download-and-install-viktor-desktop) and log in with your VIKTOR account.
In VIKTOR Desktop, click **Add**, choose **Civil 3D**, and start the worker. Follow the [Civil 3D worker installation steps](https://docs.viktor.ai/docs/create-apps/software-integrations/civil3d/.md#install-the-worker) for the complete setup. The worker and Civil 3D must run on the same computer, under the same Windows user, in a logged-in desktop session. You do not need to install Python on the worker computer.
Select **Civil 3D** in the **Add worker** window:

After starting the worker, check that its status is **Running**:

Before running either app:
1. Open Civil 3D and a copy of the drawing you want to work with.
2. Use a metric drawing for these examples and set the worker's **units** to **metric**.
3. Make sure the drawing is writable and **Model Space** is active.
4. Close any dialogs and finish active commands so Civil 3D is idle.
5. Check that the Civil 3D worker is running in VIKTOR Desktop.
note
These apps change the drawing that is already open. Test on a copy, review the result, and save it yourself in Civil 3D. Closing a connection does not undo drawing changes.
## 2. Understand the key concepts[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#2-understand-the-key-concepts "Direct link to 2. Understand the key concepts")
Although you can get quite far with a clear prompt, a little context helps you choose the right inputs:
* **Personal worker**: the connection between the VIKTOR app and Civil 3D on your computer. The app uses [`vkt.civil3d.attach()`](https://docs.viktor.ai/docs/create-apps/software-integrations/civil3d/.md#attaching-to-a-running-instance) to reach the instance that is already open.
* **Alignment and station**: an alignment describes a route in plan. A station is a distance measured along that route, so you can identify where a point or section belongs.
* **COGO points**: Civil 3D survey points with coordinates and descriptions. Set-out points help locate the route on site. **E/N/Z** means easting, northing, and elevation.
* **PI, PC, and PT**: the intersection of two tangents, the start of a circular curve, and the end of that curve.
* **Surface and profile**: a surface represents terrain. An existing-ground profile shows its elevation along an alignment; a profile view displays that information on a grid.
* **Sample lines and cross sections**: sample lines cut across an alignment at selected stations. Sections show the sampled terrain to the left and right, and section views display those cuts in the drawing.
* **Styles**: drawing settings that control how Civil 3D objects and labels look. The profile and cross-section apps inspect your drawing so you can choose styles that already exist.
note
You can also use [`vkt.civil3d.connect()`](https://docs.viktor.ai/docs/create-apps/software-integrations/civil3d/.md#calling-the-api-directly-from-your-app) to start a new Civil 3D instance, do the work, and close it when the session ends. This tutorial uses `attach()` to keep the drawing open so you can review and save it yourself. Both methods are **BETA** and require **viktor >= 14.36.0**.
## 3. Choose your approach[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#3-choose-your-approach "Direct link to 3. Choose your approach")
Use the **Prompt guide** to generate an app with the App Builder, or **Local development** to build a small longitudinal-profile app step by step. Both approaches use the Desktop and worker setup above.
* Prompt guide
* Local development
### Explore Civil 3D workflows with prompts[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#explore-civil-3d-workflows-with-prompts "Direct link to Explore Civil 3D workflows with prompts")
Select the arrow to open a prompt in the VIKTOR App Builder. Review the generated app and its preview before running an action that changes your drawing. The screenshots show example results; your app's layout may differ.
### Prompt 1: Create a road alignment and set-out points[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#prompt-1-create-a-road-alignment-and-set-out-points "Direct link to Prompt 1: Create a road alignment and set-out points")
Let's start with a road alignment. This workflow is useful when you want to explore a route from a few geometric inputs and check its set-out coordinates before adding anything to Civil 3D. Enter the starting coordinates, bearing, and tangent and curve values, then review the alignment preview and point table.


### Road alignment and set-out points
Build a VIKTOR app using only vkt.civil3d.attach() for Civil 3D operations to create a native Civil 3D road alignment and COGO set-out points in the active writable metric drawing.
Inputs: start E/N/Z, initial bearing, point prefix, and approximately three PI locations defined by tangent length, deflection angle, and curve radius. Automatically calculate the tangent intersection points, PC/PT locations, circular curves, bearings, and stations. Default output: approximately 12 set-out points. Preview the full alignment geometry and point table before creating anything in Civil 3D.
Create native Civil 3D alignment entities using tangent + circular curve + tangent geometry and create native COGO points with ID, E/N/Z, station, type, and description. Include important geometry points such as Start, PI, PC, PT, and End, plus intermediate set-out points distributed by station. Create or reuse the required layer, alignment style, and alignment label style set using documented Civil 3D APIs and stable names. Also create a clearly named visible polyline connecting the set-out points in station order on the alignment layer so the sequence is visible in Model Space.
Compute the complete geometry before calling vkt.civil3d.attach(). Use one attach session for creation and one fresh session for verification. Reuse exact matching objects on retry, reject conflicts, never duplicate or delete existing objects, and require an active, writable, idle metric drawing with Model Space active. Verify the alignment entities, COGO points, coordinates, stations, styles, layer, and connecting polyline against the calculated result.
Do not use SendCommand, SetVariable, Save, or DownloadButton. Avoid broad scans of Civil 3D layers and drawing elements. Look up only the named objects needed to create, reuse, and verify this alignment and its set-out points.
Once the App Builder finishes, adjust the inputs and inspect the curve geometry and point coordinates in VIKTOR. This lets you catch an unexpected bearing or radius before writing to the drawing.

When the preview looks right, run the creation action. In Civil 3D, inspect the native alignment, point labels, and polyline connecting the set-out points. Check the app's verification results before saving the drawing.

tip
Ask the App Builder to add an Excel export of the point table or checks for your project's minimum curve radius. Keep the preview separate from the drawing action so you can compare alternatives before creating objects.
### Prepare a drawing for prompts 2 and 3[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#prepare-a-drawing-for-prompts-2-and-3 "Direct link to Prepare a drawing for prompts 2 and 3")
For the next two prompts, download and open the [sample Civil 3D drawing](https://github.com/viktor-platform/ifc-sample-models/releases/download/CIVIL3D/longitudinal-profile-civil-3d.1.dwg) in Civil 3D. You can also use your own metric drawing with an existing alignment and a terrain surface covering the stations and sampling widths you want to use. It should contain the profile, sample-line, section, view, group-plot, and band-set styles requested by the apps. Work on a copy and inspect the available objects and styles before creating a result.
The sample drawing contains a road layout and terrain surface. The following apps read those existing objects; you do not need to run prompt 1 first.

### Prompt 2: Create an existing-ground longitudinal profile[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#prompt-2-create-an-existing-ground-longitudinal-profile "Direct link to Prompt 2: Create an existing-ground longitudinal profile")
The second workflow shows how the terrain changes along a road. This is useful for reviewing existing ground levels before developing a vertical design. Instead of entering elevations manually, the app samples an existing surface along your chosen alignment and creates a native dynamic profile and profile view.


### Existing-ground longitudinal profile
Create a VIKTOR app that generates an existing-ground longitudinal profile along an alignment in the drawing currently open in Civil 3D. Use vkt.civil3d.attach() and follow the Civil 3D knowledge-base guide.
Add an "Inspect open drawing" button that discovers both siteless and Site-based alignments, available surfaces, profile styles, profile-view styles, and band-set styles. Let me select the alignment and surface. Use the alignment's complete station range by default. Then create one native dynamic surface profile and one native profile view in Model Space.
Let me configure the profile name, profile-view name, styles, layer, and insertion coordinates. Create the profile and profile view in separate fresh attached sessions, reconnect after each operation to verify it, and safely reuse existing matching objects on retries.
Do not use SendCommand, SetVariable, or Save. Show clear inspection, creation, and verification results in the VIKTOR app. Follow the examples in the knowledge base.
With the sample drawing or your own model open, click **Inspect open drawing**. Select the alignment and existing-ground surface, then choose the styles, names, layer, and insertion coordinates. Place the profile view in an empty area of Model Space so it does not overlap your plan.

Run the creation action and review the app's verification results. In Civil 3D, locate the profile view and check that its station range and ground elevations match the alignment and surface you selected.

tip
Extend the app to compare existing-ground profiles from different surfaces, or flag steep stretches for review. Ask it to use your office's profile-view and band styles for consistent presentation across projects.
### Prompt 3: Create three cross sections[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#prompt-3-create-three-cross-sections "Direct link to Prompt 3: Create three cross sections")
The third workflow looks across the road instead of along it. Cross sections help you review terrain on both sides of an alignment at selected locations. Using the same [sample drawing](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#prepare-a-drawing-for-prompts-2-and-3), the app creates three native section views from your station range and sampling widths.


### Three native cross sections
Create a VIKTOR app that generates three native Civil 3D cross sections along an existing road alignment and surface. Follow Civil 3D knowledge-base Worked Example 4 and use vkt.civil3d.attach().
Add an "Inspect open drawing" button to discover alignments, surfaces, and the required sample-line, section, section-view, group-plot, and band-set styles. Store the inventory in a HiddenField and populate all drawing-derived dropdowns through callbacks.
Let me choose the alignment and surface, a start and end station, left and right sampling widths, and a naming prefix. Default to three evenly spaced stations within the alignment range. Preview the proposed stations in VIKTOR.
Create a sample-line group, sample the selected surface, add three sample lines, and place three native section views in Model Space. Create each missing section view in its own fresh attach session, then reconnect to verify it. Reuse verified objects on retry and report any missing view without duplicating completed work. Require an active, writable, idle drawing with Model Space active.
Keep the app on a single input page. Use vkt.Text headings to separate groups of inputs instead of Section, Tab, or Page containers.
Click **Inspect open drawing**, select the alignment and surface, and choose the station range and sampling widths. Review the three proposed stations before creating the sections. Make sure the surface extends far enough on both sides of the alignment to cover your sampling widths.
After creation, inspect all three section views in Model Space and check their station labels and terrain lines. If the app reports a missing view, retry with the same naming prefix so it can reuse verified objects instead of duplicating completed work.

tip
Ask the App Builder to let you choose the number of sections or enter specific stations, such as junctions and terrain transitions. You can also request a consistent view spacing and naming convention to make the results easier to review.
### Create a new VIKTOR app[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#create-a-new-viktor-app "Direct link to Create a new VIKTOR app")
tip
Want to dive straight into the code? Jump to the [complete app.py](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#complete-code). You can return to the steps below to see how it works.
Let's build one small app that creates an existing-ground longitudinal profile. Enter the names of an alignment and surface, click a button to create the profile, then click another to place its view in Civil 3D. This is a smaller version of prompt 2, not a tool for designing a new road alignment.
Here is the app beside the open drawing, before creating the profile. The example uses the **First Street** alignment and **EG** surface:

Use a copy of the [sample drawing](https://github.com/viktor-platform/ifc-sample-models/releases/download/CIVIL3D/longitudinal-profile-civil-3d.1.dwg) and complete the [Desktop and worker setup](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#1-set-up-civil-3d-and-viktor-desktop). This example uses an alignment **outside a Site**, a metric drawing, the existing layer `0`, and the first available profile, profile-view, and band-set styles. Your drawing must contain those styles. The prompt guide covers a more flexible app with automatic discovery and dropdowns.
First, [install the VIKTOR CLI](https://docs.viktor.ai/docs/getting-started/installation/.md) if needed. Then create an editor app:
```
viktor-cli create-app "Civil 3D Profile Tutorial" --init --app-type editor --registered-name civil3d-profile-tutorial
```
Open the new app folder in your code editor. The app code can run on your development computer; the personal worker runs on the Windows computer with Civil 3D.
### Configure the VIKTOR app[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#configure-the-viktor-app "Direct link to Configure the VIKTOR app")
Add the Civil 3D worker integration. Keep your own registered name if you chose a different one:
viktor.config.toml
```
app_type = "editor"
python_version = "3.12"
registered_name = "civil3d-profile-tutorial"
worker_integrations = ["civil3d"]
```
Use this SDK version for the example:
requirements.txt
```
viktor==14.37.0
```
No separate Civil 3D Python package is needed.
### 1. Add five simple inputs[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#1-add-five-simple-inputs "Direct link to 1. Add five simple inputs")
Start `app.py` with three names, two insertion coordinates, and two buttons:
app.py
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# Civil 3D Profile Tutorial")
alignment = vkt.TextField("Alignment name", default="First Street")
surface = vkt.TextField("Surface name", default="EG")
profile_name = vkt.TextField("New profile name", default="VKT Tutorial EG")
x = vkt.NumberField("View insertion X", default=0, suffix="m")
y = vkt.NumberField("View insertion Y", default=0, suffix="m")
profile = vkt.SetParamsButton("Create profile", method="create_profile", longpoll=True)
view = vkt.SetParamsButton("Create profile view", method="create_view", longpoll=True)
status = vkt.HiddenField("Status")
result = vkt.OutputField("Last result", value=vkt.Lookup("status"))
```
Copy the exact alignment and surface names from Civil 3D's **Toolspace → Prospector**. The defaults are starting values for the sample model; change them if your drawing uses different names. Give the new profile a unique name.
The buttons call methods we will add below. `status` stores the latest result, and the `OutputField` displays it without making it an editable input.
### 2. Connect to the alignment[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#2-connect-to-the-alignment "Direct link to 2. Connect to the alignment")
Keep the inputs and add these three helpers below them. The `...` placeholders stand for code you already wrote; keep that code rather than replacing it with dots.
app.py
```
class Parametrization(vkt.Parametrization):
...
def names(collection):
return [str(collection.Item(i).Name()) for i in range(collection.Count())]
def get_alignment(document, params):
if document.ReadOnly() or document.GetVariable("TILEMODE") != 1:
raise vkt.UserError("Open a writable drawing and activate the Model tab.")
if document.GetVariable("CMDACTIVE") or document.GetVariable("CMDNAMES"):
raise vkt.UserError("Finish active commands and leave Civil 3D idle.")
if document.GetVariable("MEASUREMENT") != 1:
raise vkt.UserError("Use a metric drawing for this tutorial.")
if params.alignment not in names(document.AlignmentsSiteless):
raise vkt.UserError("Enter the exact name of an alignment outside a Site.")
return document.AlignmentsSiteless.Item(params.alignment)
def verify(params, drawing, collection_name, object_name):
with vkt.civil3d.attach(timeout=600) as civil3d:
document = civil3d.ActiveDocument
if document.FullName() != drawing:
raise vkt.UserError("The active drawing changed. Return to the original drawing.")
alignment = get_alignment(document, params)
if object_name not in names(getattr(alignment, collection_name)):
raise vkt.UserError("The object was not created. Leave Civil 3D idle and retry.")
return vkt.SetParamsResult({"status": f"Verified in Civil 3D: {object_name}"})
```
`names` reads object names from a Civil 3D collection. `get_alignment` checks that the drawing is ready and finds the requested alignment. `verify` reconnects after creation to check that the named object exists.
Properties such as `Name()` and `ReadOnly()` are read with parentheses. Civil 3D object handles only belong to the current connection, so every new connection looks up the alignment again.
### 3. Create the ground profile[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#3-create-the-ground-profile "Direct link to 3. Create the ground profile")
Add the controller below the helpers:
app.py
```
class Parametrization(vkt.Parametrization):
...
# Keep names, get_alignment, and verify above Controller.
class Controller(vkt.Controller):
parametrization = Parametrization
def create_profile(self, params, **kwargs):
with vkt.civil3d.attach(timeout=600) as civil3d:
document = civil3d.ActiveDocument
drawing = document.FullName()
alignment = get_alignment(document, params)
if params.profile_name in names(alignment.Profiles):
raise vkt.UserError("That profile exists. Create its view or use a new name.")
if params.surface not in names(document.Surfaces):
raise vkt.UserError("Enter the exact name of an existing surface.")
style = document.LandProfileStyles.Item(0).Name()
alignment.Profiles.AddFromSurface(
params.profile_name, vkt.civil3d.AeccProfileType.aeccExistingGround,
style, params.surface, float(alignment.StartingStation()),
float(alignment.EndingStation()), "0",
)
return verify(params, drawing, "Profiles", params.profile_name)
```
`AddFromSurface` samples the selected surface over the alignment's full station range. The first profile style is `Item(0)`, because collection indices start at zero. The result is a native existing-ground profile—not yet the grid that displays it.
The app stops if the profile name already exists. It does not overwrite your drawing.
### 4. Add the profile view[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#4-add-the-profile-view "Direct link to 4. Add the profile view")
Extend the same controller with `create_view`. Keep the previous method unchanged:
app.py
```
class Parametrization(vkt.Parametrization):
...
# Keep the helper functions above Controller.
class Controller(vkt.Controller):
parametrization = Parametrization
def create_profile(self, params, **kwargs):
...
def create_view(self, params, **kwargs):
view_name = f"{params.profile_name} - View"
try:
with vkt.civil3d.attach(timeout=600) as civil3d:
document = civil3d.ActiveDocument
drawing = document.FullName()
alignment = get_alignment(document, params)
if params.profile_name not in names(alignment.Profiles):
raise vkt.UserError("Create the profile first with the same name and alignment.")
if view_name in names(alignment.ProfileViews):
raise vkt.UserError("That profile view already exists. Review it in Civil 3D.")
alignment.ProfileViews.Add(
view_name, "0", [float(params.x), float(params.y), 0.0],
document.ProfileViewStyles.Item(0),
document.ProfileViewBandStyleSets.Item(0),
)
except vkt.ExecutionError as error:
# A lock error can occur after Civil 3D has created the view.
if "Lock violation" not in str(error):
raise
return verify(params, drawing, "ProfileViews", view_name)
```
The view displays the profile on a grid at your X/Y insertion point. Choose an empty area of Model Space. It uses the drawing's first profile-view style and band set; bands add information along the grid.
The short `try/except` handles one Civil 3D quirk: a **Lock violation** can occur even after a view was created. For that specific error, we reconnect and check whether it exists. Other errors are not ignored.
note
Keep the same drawing, alignment, and profile name between the two buttons. Existing names are never replaced or deleted. To try a different surface, use a new profile name.
A profile view belongs to an alignment and may display other profiles associated with it. Review the profile visibility settings in Civil 3D.
### 5. Run the app[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#5-run-the-app "Direct link to 5. Run the app")
From your app folder, run:
```
viktor-cli clean-start
```
Open the development URL printed by the CLI, then:
1. Open the sample drawing in Civil 3D and activate **Model**.
2. Enter the exact alignment and surface names, plus a new profile name.
3. Click **Create profile** and check **Last result**.
4. Enter insertion coordinates and click **Create profile view**.
5. Review the view in Civil 3D and save the drawing yourself.
The finished profile view shows the ground elevation along the alignment. **Last result** confirms that the app found the newly created view after reconnecting to Civil 3D:

Leave Civil 3D idle while each action runs. If an action fails, check for partial results before retrying. If the profile was created but its view was not, keep the same inputs and use **Create profile view**. These checks confirm object creation, not the engineering correctness of the result.
tip
Once the example works, try adding start and end station inputs or a style selector. Add one feature at a time so the code stays easy to follow.
### Complete code[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#complete-code "Direct link to Complete code")
Show complete app.py
app.py
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# Civil 3D Profile Tutorial")
alignment = vkt.TextField("Alignment name", default="First Street")
surface = vkt.TextField("Surface name", default="EG")
profile_name = vkt.TextField("New profile name", default="VKT Tutorial EG")
x = vkt.NumberField("View insertion X", default=0, suffix="m")
y = vkt.NumberField("View insertion Y", default=0, suffix="m")
profile = vkt.SetParamsButton("Create profile", method="create_profile", longpoll=True)
view = vkt.SetParamsButton("Create profile view", method="create_view", longpoll=True)
status = vkt.HiddenField("Status")
result = vkt.OutputField("Last result", value=vkt.Lookup("status"))
def names(collection):
return [str(collection.Item(i).Name()) for i in range(collection.Count())]
def get_alignment(document, params):
if document.ReadOnly() or document.GetVariable("TILEMODE") != 1:
raise vkt.UserError("Open a writable drawing and activate the Model tab.")
if document.GetVariable("CMDACTIVE") or document.GetVariable("CMDNAMES"):
raise vkt.UserError("Finish active commands and leave Civil 3D idle.")
if document.GetVariable("MEASUREMENT") != 1:
raise vkt.UserError("Use a metric drawing for this tutorial.")
if params.alignment not in names(document.AlignmentsSiteless):
raise vkt.UserError("Enter the exact name of an alignment outside a Site.")
return document.AlignmentsSiteless.Item(params.alignment)
def verify(params, drawing, collection_name, object_name):
with vkt.civil3d.attach(timeout=600) as civil3d:
document = civil3d.ActiveDocument
if document.FullName() != drawing:
raise vkt.UserError("The active drawing changed. Return to the original drawing.")
alignment = get_alignment(document, params)
if object_name not in names(getattr(alignment, collection_name)):
raise vkt.UserError("The object was not created. Leave Civil 3D idle and retry.")
return vkt.SetParamsResult({"status": f"Verified in Civil 3D: {object_name}"})
class Controller(vkt.Controller):
parametrization = Parametrization
def create_profile(self, params, **kwargs):
with vkt.civil3d.attach(timeout=600) as civil3d:
document = civil3d.ActiveDocument
drawing = document.FullName()
alignment = get_alignment(document, params)
if params.profile_name in names(alignment.Profiles):
raise vkt.UserError("That profile exists. Create its view or use a new name.")
if params.surface not in names(document.Surfaces):
raise vkt.UserError("Enter the exact name of an existing surface.")
style = document.LandProfileStyles.Item(0).Name()
alignment.Profiles.AddFromSurface(
params.profile_name, vkt.civil3d.AeccProfileType.aeccExistingGround,
style, params.surface, float(alignment.StartingStation()),
float(alignment.EndingStation()), "0",
)
return verify(params, drawing, "Profiles", params.profile_name)
def create_view(self, params, **kwargs):
view_name = f"{params.profile_name} - View"
try:
with vkt.civil3d.attach(timeout=600) as civil3d:
document = civil3d.ActiveDocument
drawing = document.FullName()
alignment = get_alignment(document, params)
if params.profile_name not in names(alignment.Profiles):
raise vkt.UserError("Create the profile first with the same name and alignment.")
if view_name in names(alignment.ProfileViews):
raise vkt.UserError("That profile view already exists. Review it in Civil 3D.")
alignment.ProfileViews.Add(
view_name, "0", [float(params.x), float(params.y), 0.0],
document.ProfileViewStyles.Item(0),
document.ProfileViewBandStyleSets.Item(0),
)
except vkt.ExecutionError as error:
# A lock error can occur after Civil 3D has created the view.
if "Lock violation" not in str(error):
raise
return verify(params, drawing, "ProfileViews", view_name)
```
## Limitations of the Civil 3D integration[](https://docs.viktor.ai/docs/tutorials/integrate-civil3d/.md#limitations-of-the-civil-3d-integration "Direct link to Limitations of the Civil 3D integration")
The integration works through Civil 3D's automation interface, so not every action available in the desktop interface is available to the app. See the [Civil 3D integration guide](https://docs.viktor.ai/docs/create-apps/software-integrations/civil3d/.md) for the supported approach and troubleshooting guidance.
* Civil 3D must be open in a logged-in Windows session, with the correct drawing active and no blocking dialogs or commands.
* These prompts create real drawing objects. A failed operation may still have created an object, which is why the apps reconnect and verify before retrying.
* The worker does not allow operations such as `SendCommand`, `SetVariable`, or `Save`. Review and save the drawing yourself in Civil 3D.
* Generated geometry is not an engineering design check. Verify coordinates, units, terrain coverage, and project requirements before using the results.
## To infinity and beyond\
Well done! You now have three starting points for creating road alignments, set-out points, longitudinal profiles, and cross sections from a VIKTOR app.
Try adapting the inputs and drawing styles to your own workflow. Continue with the [AutoCAD tutorial](https://docs.viktor.ai/docs/tutorials/integrate-autocad/.md) to explore other drawing tasks, or check out our other [tutorials](https://docs.viktor.ai/docs/tutorials/.md).
---
# Tutorial - Integrate Dynamo
note
Estimated time: 45 minutes
Difficulty level: Intermediate
* [](https://www.viktor.ai/start-building-apps)
## Introduction[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#introduction "Direct link to Introduction")
Welcome to this tutorial on creating an app that integrates with Dynamo! In this tutorial, we will explore how to render a basic house with Dynamo and visualize it in your app. As a starting point, the user will provide parameters such as the number of houses, width, depth, number of floors, and heights for floors and roofs. These parameters are sent to Dynamo Sandbox using a worker, the program that establishes the connection between VIKTOR and the third-party software, and are used to generate the geometry of the house. The geometry 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 a Dynamo integration:
* [Setup VIKTOR app](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#1-setup-a-viktor-app)
* [Create a method to update Dynamo file](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#2-create-a-method-to-update-dynamo-file)
* [Create a mocked GeometryView](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#3-create-a-geometryview-with-mocked-ouput-files)
* [Create a data processing method](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#4-create-a-data-processing-method)
* [Create a Data View with the mocked output files](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#5-create-a-dataview-with-mocked-ouput-files)
* [Create a geometry processing method](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#6-create-a-geometryanddataview-with-the-mocked-output-files)
* [Add the logic to execute the Dynamo script with a worker](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#7-integrate-dynamo)
* [Setting up worker](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#8-setting-up-worker)
By the end of this tutorial, you will have created a simple VIKTOR application that generates the geometry of a house and calculates some basic properties. For the final result see the GIF below:

tip
You can find the complete code [below](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#all-code-together)
## Pre-requisites[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#pre-requisites "Direct link to Pre-requisites")
Prerequisites
* You have some experience with reading Python code
In 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 an integration with Dynamo (Sandbox).
## 1. Setup a VIKTOR app[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#1-setup-a-viktor-app "Direct link to 1. Setup a VIKTOR app")
### Create an empty app[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#create-an-empty-app "Direct link to Create an empty app")
Let's create, install and start an empty app. This will be the starting point for the rest of the tutorial. But before we start, make sure to shut down any app that is running (like the demo app) by closing the command-line shell (for example Powershell) or end the process using `Ctrl + C`.
Follow these steps to create, install and start an empty app:
1. Open a terminal and run the following command to create the app on the VIKTOR platform and generate the initial code locally:
```
viktor-cli create-app "Dynamo tutorial" --init --app-type editor
```
2. Open the newly created folder in your code editor and run `viktor-cli clean-start` in the terminal to install dependencies and connect the app to the platform.
If all went well, your empty app is installed and connected to your development workspace. **Do not close the terminal** as this will break the connection with your app. The terminal in your code editor should show something like this:
```
INFO : Connecting to cloud.viktor.ai...
INFO : Connection is established (use Ctrl+C to close)
INFO :
INFO : Navigate to the link below to see your app in the browser
INFO : https://cloud.viktor.ai/workspaces/XXX/app
INFO :
INFO : App code loaded, waiting for jobs...
```
Re-starting your app
* You only need to create an app template and install it once for each new app you want to make.
* The app will update automatically once you start adding code in `app.py`, as long as you don't close the terminal or your code editor.
* Did you close your code editor? Use `viktor-cli start` to start the app again. No need to install, clear, etc.
### Add input fields[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#add-input-fields "Direct link to Add input fields")
We will add 6 numeric input fields to our app: `number_of_houses`, `number_of_floors`, `depth`, `width`, `height_floor` and `height_roof`. For these inputs a [`NumberField`](https://docs.viktor.ai/sdk/api/parametrization/.md#_NumberField) will be used. Open `app.py`, and add the relevant fields to the `Parametrization` class. If you like you can accompany the fields with a descriptive text. After adding the fields your `app.py` file should look like this:
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# 3D Dynamo app \n This app parametrically generates and visualises a 3D model of a house using a Dynamo script. \n\n Please fill in the following parameters:")
number_of_houses = vkt.NumberField("Number of houses", max=8.0, min=1.0, variant='slider', step=1.0, default=3.0)
number_of_floors = vkt.NumberField("Number of floors", max=5.0, min=1.0, variant='slider', step=1.0, default=2.0)
depth = vkt.NumberField("Depth", max=10.0, min=5.0, variant='slider', step=1.0, default=8.0, suffix="m")
width = vkt.NumberField("Width", max=6.0, min=4.0, variant='slider', step=1.0, default=5.0, suffix="m")
height_floor = vkt.NumberField("Height floor", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
height_roof = vkt.NumberField("Height roof", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
class Controller(vkt.Controller):
parametrization = Parametrization
```
Refresh the development workspace in your browser and the input fields should appear.
## 2. Create a method to update Dynamo file[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#2-create-a-method-to-update-dynamo-file "Direct link to 2. Create a method to update Dynamo file")
In this section, we will define a function that updates the Dynamo file with the parameters provided by the user. This will be done by defining a `staticmethod` on the `Controller` class, similar to what is described in the [Dynamo](https://docs.viktor.ai/docs/create-apps/software-integrations/dynamo/.md) section of the VIKTOR documentation.
Before you continue, download the sample [dynamo file](https://docs.viktor.ai/files/docs/dynamo-tutorial/dynamo_model_sample_app.dyn) and save it the app folder next to `app.py`. The following code will update the nodes of the Dynamo file and generate an input file with the parameters defined in your app:
```
from pathlib import Path
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# 3D Dynamo app \n This app parametrically generates and visualises a 3D model of a house using a Dynamo script. \n\n Please fill in the following parameters:")
number_of_houses = vkt.NumberField("Number of houses", max=8.0, min=1.0, variant='slider', step=1.0, default=3.0)
number_of_floors = vkt.NumberField("Number of floors", max=5.0, min=1.0, variant='slider', step=1.0, default=2.0)
depth = vkt.NumberField("Depth", max=10.0, min=5.0, variant='slider', step=1.0, default=8.0, suffix="m")
width = vkt.NumberField("Width", max=6.0, min=4.0, variant='slider', step=1.0, default=5.0, suffix="m")
height_floor = vkt.NumberField("Height floor", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
height_roof = vkt.NumberField("Height roof", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
class Controller(vkt.Controller):
parametrization = Parametrization
@staticmethod
def update_model(params) -> tuple[vkt.File, vkt.dynamo.DynamoFile]:
"""This method updates the nodes of the Dynamo file with the parameters
from the parametrization class."""
# Create a DynamoFile object using the sample file
file_path = Path(__file__).parent / "dynamo_model_sample_app.dyn"
dyn_file = vkt.dynamo.DynamoFile(vkt.File.from_path(file_path))
# Update the Dynamo file with parameters from user input
dyn_file.update("Number of houses", params.number_of_houses)
dyn_file.update("Number of floors", params.number_of_floors)
dyn_file.update("Depth", params.depth)
dyn_file.update("Width", params.width)
dyn_file.update("Height floor", params.height_floor)
dyn_file.update("Height roof", params.height_roof)
# Generate updated file
input_file = dyn_file.generate()
return input_file, dyn_file
```
Let us go through the above mentioned logic:
1. Retrieve the input files for the analysis, in this case the `dynamo_model_sample_app.dyn` file, and create a `DynamoFile` object instantiated from the `dynamo_model_sample_app.dyn` file. You can download the sample dynamo model [here](https://docs.viktor.ai/files/docs/dynamo-tutorial/dynamo_model_sample_app.dyn).
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`](https://docs.viktor.ai/sdk/api/core/.md#_File) object.
note
Don't forget to import `Path` from the `pathlib` module
## 3. Create a GeometryView with mocked output files[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#3-create-a-geometryview-with-mocked-output-files "Direct link to 3. Create a GeometryView with mocked output files")
In this section we will add a [`GeometryView`](https://docs.viktor.ai/sdk/api/views/.md#_GeometryView) to display the house's geometry. However, for now, we will use a mocked output file. In [section 7](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#7-add-the-worker-logic-to-supply-the-real-output-files) we will create the json file using the Dynamo script.
Before you continue, download the mocked output file [here](https://docs.viktor.ai/files/docs/dynamo-tutorial/Mocked_3d_model.json) and save it in your app folder next to `app.py`. To visualize the mocked output add a `GeometryView` method to your `Controller` class, see code below:
```
from pathlib import Path
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# 3D Dynamo app \n This app parametrically generates and visualises a 3D model of a house using a Dynamo script. \n\n Please fill in the following parameters:")
number_of_houses = vkt.NumberField("Number of houses", max=8.0, min=1.0, variant='slider', step=1.0, default=3.0)
number_of_floors = vkt.NumberField("Number of floors", max=5.0, min=1.0, variant='slider', step=1.0, default=2.0)
depth = vkt.NumberField("Depth", max=10.0, min=5.0, variant='slider', step=1.0, default=8.0, suffix="m")
width = vkt.NumberField("Width", max=6.0, min=4.0, variant='slider', step=1.0, default=5.0, suffix="m")
height_floor = vkt.NumberField("Height floor", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
height_roof = vkt.NumberField("Height roof", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
class Controller(vkt.Controller):
parametrization = Parametrization
@staticmethod
def update_model(params) -> tuple[vkt.File, vkt.dynamo.DynamoFile]:
"""This method updates the nodes of the Dynamo file with the parameters
from the parametrization class."""
# Create a DynamoFile object using the sample file
file_path = Path(__file__).parent / "dynamo_model_sample_app.dyn"
dyn_file = vkt.dynamo.DynamoFile(vkt.File.from_path(file_path))
# Update the Dynamo file with parameters from user input
dyn_file.update("Number of houses", params.number_of_houses)
dyn_file.update("Number of floors", params.number_of_floors)
dyn_file.update("Depth", params.depth)
dyn_file.update("Width", params.width)
dyn_file.update("Height floor", params.height_floor)
dyn_file.update("Height roof", params.height_roof)
# Generate updated file
input_file = dyn_file.generate()
return input_file, dyn_file
@vkt.GeometryView("Mocked 3d model", x_axis_to_right=True)
def mocked_geometry_view(self, params, **kwargs):
# Step 1: Update model
input_file, dynamo_file = self.update_model(params)
# Step 2: Running analysis
file_path = Path(__file__).parent / "Mocked_3d_model.json"
threed_file = vkt.File.from_path(file_path)
# Step 3: Processing geometry
glb_file = vkt.dynamo.convert_geometry_to_glb(threed_file)
return vkt.GeometryResult(geometry=glb_file)
```
Let us go through the above mentioned logic:
1. Update the Dynamo file with the `update_model` method(see section 2)
2. For now we are using a mocked file, instead of running the analysis in Dynamo. The mocked file can be downloaded [here](https://docs.viktor.ai/files/docs/dynamo-tutorial/Mocked_3d_model.json). In [section 7](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#7-add-the-worker-logic-to-supply-the-real-output-files) it is explained how to create the json file using the Dynamo script.
3. With the helper function [`convert_geometry_to_glb`](https://docs.viktor.ai/sdk/api/external/dynamo/.md#_convert_geometry_to_glb), you can convert the json file to a GLB file, which can directly be visualized in a `GeometryView`.
4. Refresh your app in the browser, and you should see a 3D model of a house.
## 4. Create a data processing method[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#4-create-a-data-processing-method "Direct link to 4. Create a data processing method")
In this section, we will define code to extract data from the dynamo files. The dynamo file is used to get the node ID, and the `output.xml` file is used to get the result values. To do this we will add another `staticmethod` on the `Controller` class. See code below:
```
from pathlib import Path
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# 3D Dynamo app \n This app parametrically generates and visualises a 3D model of a house using a Dynamo script. \n\n Please fill in the following parameters:")
number_of_houses = vkt.NumberField("Number of houses", max=8.0, min=1.0, variant='slider', step=1.0, default=3.0)
number_of_floors = vkt.NumberField("Number of floors", max=5.0, min=1.0, variant='slider', step=1.0, default=2.0)
depth = vkt.NumberField("Depth", max=10.0, min=5.0, variant='slider', step=1.0, default=8.0, suffix="m")
width = vkt.NumberField("Width", max=6.0, min=4.0, variant='slider', step=1.0, default=5.0, suffix="m")
height_floor = vkt.NumberField("Height floor", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
height_roof = vkt.NumberField("Height roof", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
class Controller(vkt.Controller):
parametrization = Parametrization
@staticmethod
def update_model(params) -> tuple[vkt.File, vkt.dynamo.DynamoFile]:
"""This method updates the nodes of the Dynamo file with the parameters
from the parametrization class."""
# Create a DynamoFile object using the sample file
file_path = Path(__file__).parent / "dynamo_model_sample_app.dyn"
dyn_file = vkt.dynamo.DynamoFile(vkt.File.from_path(file_path))
# Update the Dynamo file with parameters from user input
dyn_file.update("Number of houses", params.number_of_houses)
dyn_file.update("Number of floors", params.number_of_floors)
dyn_file.update("Depth", params.depth)
dyn_file.update("Width", params.width)
dyn_file.update("Height floor", params.height_floor)
dyn_file.update("Height roof", params.height_roof)
# Generate updated file
input_file = dyn_file.generate()
return input_file, dyn_file
@vkt.GeometryView("Mocked 3d model", x_axis_to_right=True)
def mocked_geometry_view(self, params, **kwargs):
# Step 1: Update model
input_file, dynamo_file = self.update_model(params)
# Step 2: Running analysis
file_path = Path(__file__).parent / "Mocked_3d_model.json"
threed_file = vkt.File.from_path(file_path)
# Step 3: Processing geometry
glb_file = vkt.dynamo.convert_geometry_to_glb(threed_file)
return vkt.GeometryResult(geometry=glb_file)
@staticmethod
def convert_dynamo_file_to_data_items(input_file: vkt.dynamo.DynamoFile, output_file: vkt.File) -> vkt.DataGroup:
"""Extracts the output of the Dynamo results by using the input and output files."""
# Collect ids for the computational output from the Dynamo file
output_id_floor_area = input_file.get_node_id("(OUTPUT) Floor area per house")
output_id_total_cost = input_file.get_node_id("(OUTPUT) Total cost")
output_id_mki = input_file.get_node_id("(OUTPUT) MKI")
output_id_co2 = input_file.get_node_id("(OUTPUT) CO2")
# Collect the numerical results from the output file using the collected ids
with output_file.open_binary() as f:
floor_area = vkt.dynamo.get_dynamo_result(f, id_=output_id_floor_area)
total_cost = vkt.dynamo.get_dynamo_result(f, id_=output_id_total_cost)
mki = vkt.dynamo.get_dynamo_result(f, id_=output_id_mki)
co2 = vkt.dynamo.get_dynamo_result(f, id_=output_id_co2)
# Add values to a DataGroup to visualize them in the app
data_group = vkt.DataGroup(
vkt.DataItem(label="Floor area", value=round(float(floor_area), 2), suffix="m²"),
vkt.DataItem(label="Total cost", value=round(float(total_cost), 2), suffix="€"),
vkt.DataItem(label="MKI", value=round(float(mki), 2)),
vkt.DataItem(label="CO₂ emission", value=round(float(co2), 2), suffix="ton CO₂"),
)
return data_group
```
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. Create a `DataGroup` from the collected numerical results using the [`DataGroup`](https://docs.viktor.ai/sdk/api/views/.md#_DataGroup) and [`DataItem`](https://docs.viktor.ai/sdk/api/views/.md#_DataItem) classes.
## 5. Create a DataView with mocked output files[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#5-create-a-dataview-with-mocked-output-files "Direct link to 5. Create a DataView with mocked output files")
In this section we will create a [`DataView`](https://docs.viktor.ai/sdk/api/views/.md#_DataView) to display the data. However, for now, we will use a mocked output file. In [section 7](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#7-add-the-worker-logic-to-supply-the-real-output-files) we will generate the xml file using the Dynamo script.
Before you continue, download the result file [here](https://docs.viktor.ai/files/docs/dynamo-tutorial/Mocked_data_results.xml) and save it in your app folder next to `app.py`. To visualize the mocked output add a `DataView` method to your `Controller` class, see code below:
```
from pathlib import Path
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# 3D Dynamo app \n This app parametrically generates and visualises a 3D model of a house using a Dynamo script. \n\n Please fill in the following parameters:")
number_of_houses = vkt.NumberField("Number of houses", max=8.0, min=1.0, variant='slider', step=1.0, default=3.0)
number_of_floors = vkt.NumberField("Number of floors", max=5.0, min=1.0, variant='slider', step=1.0, default=2.0)
depth = vkt.NumberField("Depth", max=10.0, min=5.0, variant='slider', step=1.0, default=8.0, suffix="m")
width = vkt.NumberField("Width", max=6.0, min=4.0, variant='slider', step=1.0, default=5.0, suffix="m")
height_floor = vkt.NumberField("Height floor", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
height_roof = vkt.NumberField("Height roof", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
class Controller(vkt.Controller):
parametrization = Parametrization
@staticmethod
def update_model(params) -> tuple[vkt.File, vkt.dynamo.DynamoFile]:
"""This method updates the nodes of the Dynamo file with the parameters
from the parametrization class."""
# Create a DynamoFile object using the sample file
file_path = Path(__file__).parent / "dynamo_model_sample_app.dyn"
dyn_file = vkt.dynamo.DynamoFile(vkt.File.from_path(file_path))
# Update the Dynamo file with parameters from user input
dyn_file.update("Number of houses", params.number_of_houses)
dyn_file.update("Number of floors", params.number_of_floors)
dyn_file.update("Depth", params.depth)
dyn_file.update("Width", params.width)
dyn_file.update("Height floor", params.height_floor)
dyn_file.update("Height roof", params.height_roof)
# Generate updated file
input_file = dyn_file.generate()
return input_file, dyn_file
@vkt.GeometryView("Mocked 3d model", x_axis_to_right=True)
def mocked_geometry_view(self, params, **kwargs):
# Step 1: Update model
input_file, dynamo_file = self.update_model(params)
# Step 2: Running analysis
file_path = Path(__file__).parent / "Mocked_3d_model.json"
threed_file = vkt.File.from_path(file_path)
# Step 3: Processing geometry
glb_file = vkt.dynamo.convert_geometry_to_glb(threed_file)
return vkt.GeometryResult(geometry=glb_file)
@staticmethod
def convert_dynamo_file_to_data_items(input_file: vkt.dynamo.DynamoFile, output_file: vkt.File) -> vkt.DataGroup:
"""Extracts the output of the Dynamo results by using the input and output files."""
# Collect ids for the computational output from the Dynamo file
output_id_floor_area = input_file.get_node_id("(OUTPUT) Floor area per house")
output_id_total_cost = input_file.get_node_id("(OUTPUT) Total cost")
output_id_mki = input_file.get_node_id("(OUTPUT) MKI")
output_id_co2 = input_file.get_node_id("(OUTPUT) CO2")
# Collect the numerical results from the output file using the collected ids
with output_file.open_binary() as f:
floor_area = vkt.dynamo.get_dynamo_result(f, id_=output_id_floor_area)
total_cost = vkt.dynamo.get_dynamo_result(f, id_=output_id_total_cost)
mki = vkt.dynamo.get_dynamo_result(f, id_=output_id_mki)
co2 = vkt.dynamo.get_dynamo_result(f, id_=output_id_co2)
# Add values to a DataGroup to visualize them in the app
data_group = vkt.DataGroup(
vkt.DataItem(label="Floor area", value=round(float(floor_area), 2), suffix="m²"),
vkt.DataItem(label="Total cost", value=round(float(total_cost), 2), suffix="€"),
vkt.DataItem(label="MKI", value=round(float(mki), 2)),
vkt.DataItem(label="CO₂ emission", value=round(float(co2), 2), suffix="ton CO₂"),
)
return data_group
@vkt.DataView("Mocked data results")
def mocked_data_view(self, params, **kwargs):
# Step 1: Update model
input_file, dynamo_file = self.update_model(params)
# Step 2: Running analysis
file_path = Path(__file__).parent / "Mocked_data_results.xml"
data_file = vkt.File.from_path(file_path)
# Step 3: Process numerical output
data_group = self.convert_dynamo_file_to_data_items(dynamo_file, data_file)
return vkt.DataResult(data=data_group)
```
Let us go through the above mentioned logic:
1. Update the Dynamo file with the `update_model` method (see [section 1](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#1-setup-a-viktor-app))
2. For now we are using a mocked file, instead of running the analysis in Dynamo. The mocked file can be downloaded [here](https://docs.viktor.ai/files/docs/dynamo-tutorial/Mocked_data_results.xml).
3. With the static method `convert_dynamo_file_to_data_items`, you can convert the .xml file to a `DataGroup`, which can be directly visualized in a `DataView`.
4. Refresh your app, and you should see a data view with the data.
## 6. Create a GeometryAndDataView with the mocked output files[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#6-create-a-geometryanddataview-with-the-mocked-output-files "Direct link to 6. Create a GeometryAndDataView with the mocked output files")
In this section we will combine the geometry view and data view in one view using the [`GeometryAndDataView`](https://docs.viktor.ai/sdk/api/views/.md#_GeometryAndDataView) class. We will use the mocked files. To this end, replace the `mocked_data_view` and the `mocked_geometry_view` methods with a single `geometry_and_data_view` method:
```
from pathlib import Path
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# 3D Dynamo app \n This app parametrically generates and visualises a 3D model of a house using a Dynamo script. \n\n Please fill in the following parameters:")
number_of_houses = vkt.NumberField("Number of houses", max=8.0, min=1.0, variant='slider', step=1.0, default=3.0)
number_of_floors = vkt.NumberField("Number of floors", max=5.0, min=1.0, variant='slider', step=1.0, default=2.0)
depth = vkt.NumberField("Depth", max=10.0, min=5.0, variant='slider', step=1.0, default=8.0, suffix="m")
width = vkt.NumberField("Width", max=6.0, min=4.0, variant='slider', step=1.0, default=5.0, suffix="m")
height_floor = vkt.NumberField("Height floor", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
height_roof = vkt.NumberField("Height roof", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
class Controller(vkt.Controller):
parametrization = Parametrization
@staticmethod
def update_model(params) -> tuple[vkt.File, vkt.dynamo.DynamoFile]:
"""This method updates the nodes of the Dynamo file with the parameters
from the parametrization class."""
# Create a DynamoFile object using the sample file
file_path = Path(__file__).parent / "dynamo_model_sample_app.dyn"
dyn_file = vkt.dynamo.DynamoFile(vkt.File.from_path(file_path))
# Update the Dynamo file with parameters from user input
dyn_file.update("Number of houses", params.number_of_houses)
dyn_file.update("Number of floors", params.number_of_floors)
dyn_file.update("Depth", params.depth)
dyn_file.update("Width", params.width)
dyn_file.update("Height floor", params.height_floor)
dyn_file.update("Height roof", params.height_roof)
# Generate updated file
input_file = dyn_file.generate()
return input_file, dyn_file
@staticmethod
def convert_dynamo_file_to_data_items(input_file: vkt.dynamo.DynamoFile, output_file: vkt.File) -> vkt.DataGroup:
"""Extracts the output of the Dynamo results by using the input and output files."""
# Collect ids for the computational output from the Dynamo file
output_id_floor_area = input_file.get_node_id("(OUTPUT) Floor area per house")
output_id_total_cost = input_file.get_node_id("(OUTPUT) Total cost")
output_id_mki = input_file.get_node_id("(OUTPUT) MKI")
output_id_co2 = input_file.get_node_id("(OUTPUT) CO2")
# Collect the numerical results from the output file using the collected ids
with output_file.open_binary() as f:
floor_area = vkt.dynamo.get_dynamo_result(f, id_=output_id_floor_area)
total_cost = vkt.dynamo.get_dynamo_result(f, id_=output_id_total_cost)
mki = vkt.dynamo.get_dynamo_result(f, id_=output_id_mki)
co2 = vkt.dynamo.get_dynamo_result(f, id_=output_id_co2)
# Add values to a DataGroup to visualize them in the app
data_group = vkt.DataGroup(
vkt.DataItem(label="Floor area", value=round(float(floor_area), 2), suffix="m²"),
vkt.DataItem(label="Total cost", value=round(float(total_cost), 2), suffix="€"),
vkt.DataItem(label="MKI", value=round(float(mki), 2)),
vkt.DataItem(label="CO₂ emission", value=round(float(co2), 2), suffix="ton CO₂"),
)
return data_group
@vkt.GeometryAndDataView("Mocked 3d/data", x_axis_to_right=True)
def geometry_and_data_view(self, params, **kwargs):
"""The endpoint that initiates the logic to visualize the geometry and data executed
and retrieved from a Dynamo script."""
# Step 1: Update model
input_file, dynamo_file = self.update_model(params)
# Step 2: Running analysis
file_path = Path(__file__).parent / "Mocked_3d_model.json"
threed_file = vkt.File.from_path(file_path)
file_path = Path(__file__).parent / "Mocked_data_results.xml"
data_file = vkt.File.from_path(file_path)
# Step 3: Processing geometry
glb_file = vkt.dynamo.convert_geometry_to_glb(threed_file)
# Step 4: Process numerical output
data_group = self.convert_dynamo_file_to_data_items(dynamo_file, data_file)
return vkt.GeometryAndDataResult(geometry=glb_file, data=data_group)
```
## 7. Integrate Dynamo[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#7-integrate-dynamo "Direct link to 7. Integrate Dynamo")
In this section, we will implement the logic to trigger the Dynamo calculation from your app. We will update step 2 of the `geometry_and_data_view` to run the Dynamo calculation. Please refer to the code snippet below:
```
from pathlib import Path
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# 3D Dynamo app \n This app parametrically generates and visualises a 3D model of a house using a Dynamo script. \n\n Please fill in the following parameters:")
number_of_houses = vkt.NumberField("Number of houses", max=8.0, min=1.0, variant='slider', step=1.0, default=3.0)
number_of_floors = vkt.NumberField("Number of floors", max=5.0, min=1.0, variant='slider', step=1.0, default=2.0)
depth = vkt.NumberField("Depth", max=10.0, min=5.0, variant='slider', step=1.0, default=8.0, suffix="m")
width = vkt.NumberField("Width", max=6.0, min=4.0, variant='slider', step=1.0, default=5.0, suffix="m")
height_floor = vkt.NumberField("Height floor", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
height_roof = vkt.NumberField("Height roof", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
class Controller(vkt.Controller):
parametrization = Parametrization
@staticmethod
def update_model(params) -> tuple[vkt.File, vkt.dynamo.DynamoFile]:
"""This method updates the nodes of the Dynamo file with the parameters
from the parametrization class."""
# Create a DynamoFile object using the sample file
file_path = Path(__file__).parent / "dynamo_model_sample_app.dyn"
dyn_file = vkt.dynamo.DynamoFile(vkt.File.from_path(file_path))
# Update the Dynamo file with parameters from user input
dyn_file.update("Number of houses", params.number_of_houses)
dyn_file.update("Number of floors", params.number_of_floors)
dyn_file.update("Depth", params.depth)
dyn_file.update("Width", params.width)
dyn_file.update("Height floor", params.height_floor)
dyn_file.update("Height roof", params.height_roof)
# Generate updated file
input_file = dyn_file.generate()
return input_file, dyn_file
@staticmethod
def convert_dynamo_file_to_data_items(input_file: vkt.dynamo.DynamoFile, output_file: vkt.File) -> vkt.DataGroup:
"""Extracts the output of the Dynamo results by using the input and output files."""
# Collect ids for the computational output from the Dynamo file
output_id_floor_area = input_file.get_node_id("(OUTPUT) Floor area per house")
output_id_total_cost = input_file.get_node_id("(OUTPUT) Total cost")
output_id_mki = input_file.get_node_id("(OUTPUT) MKI")
output_id_co2 = input_file.get_node_id("(OUTPUT) CO2")
# Collect the numerical results from the output file using the collected ids
with output_file.open_binary() as f:
floor_area = vkt.dynamo.get_dynamo_result(f, id_=output_id_floor_area)
total_cost = vkt.dynamo.get_dynamo_result(f, id_=output_id_total_cost)
mki = vkt.dynamo.get_dynamo_result(f, id_=output_id_mki)
co2 = vkt.dynamo.get_dynamo_result(f, id_=output_id_co2)
# Add values to a DataGroup to visualize them in the app
data_group = vkt.DataGroup(
vkt.DataItem(label="Floor area", value=round(float(floor_area), 2), suffix="m²"),
vkt.DataItem(label="Total cost", value=round(float(total_cost), 2), suffix="€"),
vkt.DataItem(label="MKI", value=round(float(mki), 2)),
vkt.DataItem(label="CO₂ emission", value=round(float(co2), 2), suffix="ton CO₂"),
)
return data_group
@vkt.GeometryAndDataView("Building 3D", duration_guess=5, x_axis_to_right=True)
def geometry_and_data_view(self, params, **kwargs):
"""Run an analysis using Dynamo and visualize the geometry and data"""
# Step 1: Update model
input_file, dynamo_file = self.update_model(params)
# Step 2: Running analysis
files = [
('input.dyn', input_file),
]
analysis = vkt.dynamo.DynamoAnalysis(files=files, output_filenames=["output.xml", "geometry.json"])
analysis.execute(timeout=60)
# Step 3: Processing geometry
geometry_file = analysis.get_output_file('geometry.json', as_file=True)
glb_file = vkt.dynamo.convert_geometry_to_glb(geometry_file)
# Step 4: Process numerical output
output_file = analysis.get_output_file('output.xml', as_file=True)
data_group = self.convert_dynamo_file_to_data_items(dynamo_file, output_file)
return vkt.GeometryAndDataResult(geometry=glb_file, data=data_group)
```
The steps in `geometry_and_data_view` explained:
1. Update the Dynamo file with the `update_model` method (see section 2)
2. We use the [`DynamoAnalysis`](https://docs.viktor.ai/sdk/api/external/dynamo/.md#_DynamoAnalysis) to run the Dynamo script. The `executable_key` in the example above refers to the "dynamo" command in the configuration file of the worker. For more information on how to configure the worker, refer to next section.
3. Processing the geometry, the .json file can be obtained with the `get_ouput_file` method. With the helper function `convert_geometry_to_glb`, you can convert it to a GLB type file, which can directly be visualized in a `GeometryAndDataView`.
4. Processing geometry, the .xml file can be obtained with the `get_ouput_file`. method. With the static method `convert_dynamo_file_to_data_items`, you can convert the .xml file to a `Datagroup`, which can be directly visualized in `GeometryAndDataView`.
## 8. Setting up a worker[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#8-setting-up-a-worker "Direct link to 8. Setting up a worker")
A worker is a program that connects your app with third-party software to execute tasks and send results. The worker communicates with the VIKTOR cloud via an encrypted connection.
For this integration, we recommend using the **generic worker**. Running a Dynamo script requires passing arguments to the `DynamoWPFCLI` executable (the input and output files, and the path to FormIt or Revit for the geometry export). The dedicated Dynamo worker does not expose these arguments in VIKTOR Desktop, whereas the generic worker lets you define the executables and their arguments yourself in its `config.yaml` file.
### Installation[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#installation "Direct link to Installation")
Follow these steps to install the worker:
* Personal worker
* Organization worker
A personal worker connects the software that is installed on your own machine, for your own use. Personal workers are installed and managed with [VIKTOR Desktop](https://docs.viktor.ai/docs/create-apps/software-integrations/viktor-desktop/.md):
1. [Download and install VIKTOR Desktop](https://docs.viktor.ai/docs/create-apps/software-integrations/viktor-desktop/.md#download-and-install-viktor-desktop) and log in with your VIKTOR account, if you haven't done so already
2. In VIKTOR Desktop, click "Add" and select **Generic**

3.
Define the executables, arguments and paths in the worker's `config.yaml` file, which VIKTOR Desktop exposes when adding the worker
4. Start the worker. You can view its [logs](https://docs.viktor.ai/docs/create-apps/software-integrations/viktor-desktop/.md#view-logs) inside VIKTOR Desktop, and the editor shows when your worker is online
note
Personal workers that were installed with the previous per-worker installer keep running, but new personal workers can only be added through [VIKTOR Desktop](https://docs.viktor.ai/docs/create-apps/software-integrations/viktor-desktop/.md#migrate-existing-workers-to-viktor-desktop): the per-worker installer download and connection-key flow are no longer available for personal use.
An organization worker connects software that runs on a machine managed by your organization, such as a virtual or remote machine, and is shared by the users of the app instance(s) you select.
caution
You need to be an environment administrator in order to install an organization worker.
1. Navigate to the "Integrations" tab in the Administrator panel
2. Click "Add integration"
3. Follow the steps provided in the modal

3.1. Select **Generic**
3.2. Select the app instance(s) the integration should be available to
3.3. Download the worker .msi (Microsoft Installer) and run it on the machine of choice
3.4. Copy the generated **connection key** and paste it when the installer asks for it. In the browser, you can now click Finish and continue in the installer.
Connection Key
The generated connection key **should be copied immediately** as VIKTOR will not preserve this data for security reasons.
4.
After installation, define the executables, arguments and paths in the `config.yaml` file, located in the same directory as the worker
5. Make sure to launch the integration once the installation is finished. If you closed the integration, you can restart it through the desktop shortcut.
### Configuration[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#configuration "Direct link to Configuration")
To configure the worker, you first need to install FormIt, which can be downloaded from [here](https://formit.autodesk.com/). After it is installed, you can set up the worker to execute the logic when the input files have been sent by the VIKTOR app.
The generic worker is configured through its `config.yaml` file. For workers managed with [VIKTOR Desktop](https://docs.viktor.ai/docs/create-apps/software-integrations/viktor-desktop/.md#add-and-configure-a-worker), this file is exposed when you add the worker. For organization workers (installed with the per-worker installer), the file can be found in the same folder where the worker is installed (`C:\Users\{username}\AppData\Local\Viktor\` for development workers and `C:\Program Files\Viktor\` for production workers). Edit the `config.yaml` file as follows:
```
executables:
dynamo:
path: 'C:\Program Files\Autodesk\FormIt\DynamoSandbox\DynamoWPFCLI.exe'
arguments:
- '-o'
- 'input.dyn'
- '-v'
- 'output.xml'
- '-gp'
- 'C:\Program Files\Autodesk\FormIt'
- '-g'
- 'geometry.json'
maxParallelProcesses: 1
```
* `path`: Here we define the path of the program to be executed.
* `arguments`: Under this key we can list all arguments that can be added to the executable. This works similar to command-line arguments.
* `-o` Open the dynamo script(input.dyn)
* `-v` Ouput geometry file (name = output.xml)
* `-gp` Path to local installation of Autodesk FormIt or Revit
* `-g` Ouptut geometry file (name = geometry.json)
For more information about the Dynamo CLI see the [Dynamo CLI documentation](https://github.com/DynamoDS/Dynamo/wiki/Dynamo-Command-Line-Interface)
note
The worker reads the config file once during startup. So when you change the config file, you will need to restart the worker for your changes to take effect.
### Connection[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#connection "Direct link to Connection")
Once your worker is configured, start it in VIKTOR Desktop. The app shows whether the worker is connected, and its [logs](https://docs.viktor.ai/docs/create-apps/software-integrations/viktor-desktop/.md#view-logs) can be viewed inside the app. In the top right corner in your VIKTOR environment you should see a green indicator in your worker overview, see the figure below.
Organization workers
If you installed the worker with the per-worker installer (as used for organization workers), save your `config.yaml` file and start the worker by double-clicking the shortcut on the desktop. If all went well, you will be presented with a window in which the message: "Successfully connected to the server" is displayed.

## All code together[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#all-code-together "Direct link to All code together")
Now that the worker is successfully connected you can open your development workspace and generate new housing configurations based on the supplied input parameters!
```
from pathlib import Path
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# 3D Dynamo app \n This app parametrically generates and visualises a 3D model of a house using a Dynamo script. \n\n Please fill in the following parameters:")
number_of_houses = vkt.NumberField("Number of houses", max=8.0, min=1.0, variant='slider', step=1.0, default=3.0)
number_of_floors = vkt.NumberField("Number of floors", max=5.0, min=1.0, variant='slider', step=1.0, default=2.0)
depth = vkt.NumberField("Depth", max=10.0, min=5.0, variant='slider', step=1.0, default=8.0, suffix="m")
width = vkt.NumberField("Width", max=6.0, min=4.0, variant='slider', step=1.0, default=5.0, suffix="m")
height_floor = vkt.NumberField("Height floor", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
height_roof = vkt.NumberField("Height roof", max=3.0, min=2.0, variant='slider', step=0.1, default=2.5, suffix='m')
class Controller(vkt.Controller):
parametrization = Parametrization
@staticmethod
def update_model(params) -> tuple[vkt.File, vkt.dynamo.DynamoFile]:
"""This method updates the nodes of the Dynamo file with the parameters
from the parametrization class."""
# Create a DynamoFile object using the sample file
file_path = Path(__file__).parent / "dynamo_model_sample_app.dyn"
dyn_file = vkt.dynamo.DynamoFile(vkt.File.from_path(file_path))
# Update the Dynamo file with parameters from user input
dyn_file.update("Number of houses", params.number_of_houses)
dyn_file.update("Number of floors", params.number_of_floors)
dyn_file.update("Depth", params.depth)
dyn_file.update("Width", params.width)
dyn_file.update("Height floor", params.height_floor)
dyn_file.update("Height roof", params.height_roof)
# Generate updated file
input_file = dyn_file.generate()
return input_file, dyn_file
@staticmethod
def convert_dynamo_file_to_data_items(input_file: vkt.dynamo.DynamoFile, output_file: vkt.File) -> vkt.DataGroup:
"""Extracts the output of the Dynamo results by using the input and output files."""
# Collect ids for the computational output from the Dynamo file
output_id_floor_area = input_file.get_node_id("(OUTPUT) Floor area per house")
output_id_total_cost = input_file.get_node_id("(OUTPUT) Total cost")
output_id_mki = input_file.get_node_id("(OUTPUT) MKI")
output_id_co2 = input_file.get_node_id("(OUTPUT) CO2")
# Collect the numerical results from the output file using the collected ids
with output_file.open_binary() as f:
floor_area = vkt.dynamo.get_dynamo_result(f, id_=output_id_floor_area)
total_cost = vkt.dynamo.get_dynamo_result(f, id_=output_id_total_cost)
mki = vkt.dynamo.get_dynamo_result(f, id_=output_id_mki)
co2 = vkt.dynamo.get_dynamo_result(f, id_=output_id_co2)
# Add values to a DataGroup to visualize them in the app
data_group = vkt.DataGroup(
vkt.DataItem(label="Floor area", value=round(float(floor_area), 2), suffix="m²"),
vkt.DataItem(label="Total cost", value=round(float(total_cost), 2), suffix="€"),
vkt.DataItem(label="MKI", value=round(float(mki), 2)),
vkt.DataItem(label="CO₂ emission", value=round(float(co2), 2), suffix="ton CO₂"),
)
return data_group
@vkt.GeometryAndDataView("Building 3D", duration_guess=5, x_axis_to_right=True)
def geometry_and_data_view(self, params, **kwargs):
"""Run an analysis using Dynamo and visualize the geometry and data"""
# Step 1: Update model
input_file, dynamo_file = self.update_model(params)
# Step 2: Running analysis
files = [('input.dyn', input_file)]
analysis = vkt.dynamo.DynamoAnalysis(files=files, output_filenames=["output.xml", "geometry.json"])
analysis.execute(timeout=60)
# Step 3: Processing geometry
geometry_file = analysis.get_output_file('geometry.json', as_file=True)
glb_file = vkt.dynamo.convert_geometry_to_glb(geometry_file)
# Step 4: Process numerical output
output_file = analysis.get_output_file('output.xml', as_file=True)
data_group = self.convert_dynamo_file_to_data_items(dynamo_file, output_file)
return vkt.GeometryAndDataResult(geometry=glb_file, data=data_group)
```
## To infinity and beyond[](https://docs.viktor.ai/docs/tutorials/integrate-dynamo/.md#to-infinity-and-beyond "Direct link to To infinity and beyond")
Nice! You are now able to create an app that can integrate with Dynamo (Sandbox) using the generic worker!
Of course, the journey doesn't end here. Check out some of our other [tutorials](https://docs.viktor.ai/docs/tutorials/.md) or try to replace Dynamo script from this tutorial with one of your own!
---
# Tutorial - Integrate ETABS and SAP2000
note
Estimated time: 55 minutes
Difficulty level: Intermediate
* [](https://www.viktor.ai/start-building-apps)
## Introduction[](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#introduction "Direct link to Introduction")
ETABS and SAP2000 are two of the most commonly used software tools for structural engineering. They offer a range of features for modeling and design, along with a robust API that automates various workflows. In this tutorial, you will learn how to create a VIKTOR web app that integrates these tools behind the scenes. Although this tutorial is written specifically for ETABS, it can easily be modified to use [SAP2000](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#what-about-sap2000).
Here are the main sections we will cover:
1. [Create a new VIKTOR app.](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#create-a-new-viktor-app)
2. [Create a simple parametric model.](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#lets-create-the-3d-model)
3. [Calculate the reaction loads of your model.](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#hands-on-the-etabs-api)
4. [Display the reaction loads in your VIKTOR app.](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#lets-integrate-the-worker-in-our-viktor-app)
Here is a sneak peek at how the app will look: 
## Prerequisites and downloads[](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#prerequisites-and-downloads "Direct link to Prerequisites and downloads")
Prerequisites
* You have [installed VIKTOR](https://docs.viktor.ai/docs/getting-started/installation/)
* You have some experience with reading Python code
* You have some experience with ETABS/SAP2000
Before using the ETABS API in Python, ensure you have `pywin32` and `comtypes` installed in your *Python environment*. If they are not installed, you can add them using pip. Open Windows Powershell and run the following command:
```
pip install pywin32 comtypes
```
## Create a new VIKTOR app[](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#create-a-new-viktor-app "Direct link to Create a new VIKTOR app")
Let's create, install and start an empty app. This will be the starting point for the rest of the tutorial. But before we start, make sure to shut down any app that is running (like the demo app) by closing the command-line shell (for example Powershell) or end the process using `Ctrl + C`.
Follow these steps to create, install and start an empty app:
1. Open a terminal and run the following command to create the app on the VIKTOR platform and generate the initial code locally:
```
viktor-cli create-app "ETABS SAP2000 tutorial" --init --app-type editor
```
2. Open the newly created folder in your code editor and run `viktor-cli clean-start` in the terminal to install dependencies and connect the app to the platform.
If all went well, your empty app is installed and connected to your development workspace. **Do not close the terminal** as this will break the connection with your app. The terminal in your code editor should show something like this:
```
INFO : Connecting to cloud.viktor.ai...
INFO : Connection is established (use Ctrl+C to close)
INFO :
INFO : Navigate to the link below to see your app in the browser
INFO : https://cloud.viktor.ai/workspaces/XXX/app
INFO :
INFO : App code loaded, waiting for jobs...
```
Re-starting your app
* You only need to create an app template and install it once for each new app you want to make.
* The app will update automatically once you start adding code in `app.py`, as long as you don't close the terminal or your code editor.
* Did you close your code editor? Use `viktor-cli start` to start the app again. No need to install, clear, etc.
## Let's define a simple structure[](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#lets-define-a-simple-structure "Direct link to Let's define a simple structure")
To generate a simple moment frame, we use a parametric approach by defining the frame's `length` and `height` as variables. The function **create\_frame\_data** creates the frame’s topology using **nodes** and **lines** to represent its geometry. This approach allows us to generate different configurations by adjusting the `length` and `height` values. Additionally, the geometry is saved to a `json` file each time the function is executed. In the next sections, we will show how this function is used within the `Controller` class, triggered when new inputs are defined in the `Parametrization` class. Take a moment to review the following code snippet before continuing with the tutorial.
```
import viktor as vkt
import json
def create_frame_data(length, height):
nodes = {
1:{"node_id": 1, "x": 0, "y": 0, "z": 0},
2:{"node_id": 2, "x": 0, "y": length, "z": 0},
3:{"node_id": 3, "x": 0, "y": 0, "z": height},
4:{"node_id": 4, "x": 0, "y": length, "z": height},
5:{"node_id": 5, "x": length, "y": 0, "z": 0},
6:{"node_id": 6, "x": length, "y": length, "z": 0},
7:{"node_id": 7, "x": length, "y": 0, "z": height},
8:{"node_id": 8, "x": length, "y": length, "z": height},
}
lines = {
1:{"line_id": 1, "node_i": 1, "node_j": 3},
2:{"line_id": 2, "node_i": 2, "node_j": 4},
3:{"line_id": 3, "node_i": 3, "node_j": 4},
4:{"line_id": 4, "node_i": 6, "node_j": 8},
5:{"line_id": 5, "node_i": 5, "node_j": 7},
6:{"line_id": 6, "node_i": 3, "node_j": 7},
7:{"line_id": 7, "node_i": 4, "node_j": 8},
8:{"line_id": 8, "node_i": 7, "node_j": 8},
}
return nodes, lines
class Parametrization(vkt.Parametrization):
pass
class Controller(vkt.Controller):
parametrization = Parametrization
```
## Let's create the 3D model[](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#lets-create-the-3d-model "Direct link to Let's create the 3D model")
Now that we have a function to generate the topology of our structure, it's time to define the inputs in our `Parametrization` class and implement the logic to create a 3D model of the frame in a `GeometryView`. You can refer to the [documentation](https://docs.viktor.ai/sdk/api/geometry/) for more details on how to work with 3D geometry in VIKTOR. The resulting code of your app is shown below:
```
import json
import viktor as vkt
def create_frame_data(length, height):
nodes = {
1:{"node_id": 1, "x": 0, "y": 0, "z": 0},
2:{"node_id": 2, "x": 0, "y": length, "z": 0},
3:{"node_id": 3, "x": 0, "y": 0, "z": height},
4:{"node_id": 4, "x": 0, "y": length, "z": height},
5:{"node_id": 5, "x": length, "y": 0, "z": 0},
6:{"node_id": 6, "x": length, "y": length, "z": 0},
7:{"node_id": 7, "x": length, "y": 0, "z": height},
8:{"node_id": 8, "x": length, "y": length, "z": height},
}
lines = {
1:{"line_id": 1, "node_i": 1, "node_j": 3},
2:{"line_id": 2, "node_i": 2, "node_j": 4},
3:{"line_id": 3, "node_i": 3, "node_j": 4},
4:{"line_id": 4, "node_i": 6, "node_j": 8},
5:{"line_id": 5, "node_i": 5, "node_j": 7},
6:{"line_id": 6, "node_i": 3, "node_j": 7},
7:{"line_id": 7, "node_i": 4, "node_j": 8},
8:{"line_id": 8, "node_i": 7, "node_j": 8},
}
return nodes, lines
class Parametrization(vkt.Parametrization):
intro = vkt.Text(""" # ETABS Base Reaction App
Please fill in the following parameters:
"""
)
frame_length = vkt.NumberField("Frame Length", min=100, default=4000, suffix="mm")
frame_height = vkt.NumberField("Frame Height", min=100, default=4000, suffix="mm")
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.GeometryView("3D Model", duration_guess=1, x_axis_to_right=True)
def create_render(self, params, **kwargs):
nodes, lines = create_frame_data(length=params.frame_length, height=params.frame_height)
sections_group = []
for line_id, dict_vals in lines.items():
node_id_i = dict_vals["node_i"]
node_id_j = dict_vals["node_j"]
node_i = nodes[node_id_i]
node_j = nodes[node_id_j]
point_i = vkt.Point(node_i["x"], node_i["y"], node_i["z"])
point_j = vkt.Point(node_j["x"], node_j["y"], node_j["z"])
line_k = vkt.Line(point_i, point_j)
section_k = vkt.RectangularExtrusion(300, 300, line_k, identifier=str(line_id))
sections_group.append(section_k)
return vkt.GeometryResult(geometry=sections_group)
```
Great! Now, you can change the dimensions of your frame, and the model will render with the updated geometry. You should see an app like this in your browser:

However, since you're here to learn how to integrate ETABS or SAP2000, let's move on and start using the CSI API!
## Hands on the ETABS API[](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#hands-on-the-etabs-api "Direct link to Hands on the ETABS API")
Let's create a new Python file called `run_etabs_model.py` in the same directory and add a `create_etabs_model` function. This function contains the logic to create our ETABS model using Python. The first step is to initialize the program with `comtypes`. Copy the snippet below, and make sure to update the `program_path` to match your ETABS version. You can run this code in **your Python environment**, and it will open a blank ETABS model.
note
If ETABS is running on a remote server, the `program_path` needs to match the ETABS location on the server where the worker is running.
```
import comtypes.client
import pythoncom
import json
from pathlib import Path
def create_etabs_model():
# Initialize ETABS model
program_path=r"C:\Program Files\Computers and Structures\ETABS 22\ETABS.exe"
pythoncom.CoInitialize()
try:
helper = comtypes.client.CreateObject("ETABSv1.Helper")
helper = helper.QueryInterface(comtypes.gen.ETABSv1.cHelper)
EtabsEngine = helper.CreateObject(program_path)
EtabsEngine.ApplicationStart()
EtabsObject = EtabsEngine.SapModel
EtabsObject.InitializeNewModel(9) # Set units to mm
EtabsObject.File.NewBlank()
finally:
pythoncom.CoUninitialize()
if __name__ == "__main__":
create_etabs_model()
```
## Create the structure in ETABS[](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#create-the-structure-in-etabs "Direct link to Create the structure in ETABS")
Next, let's extend the `create_etabs_model` function to add joints, members, and rigid supports. We'll load the nodes and lines geometry from the `inputs.json` file, then create the nodes and members in ETABS, followed by defining the material properties for the frame. Here's how all this looks in code:
```
def create_etabs_model():
# Initialize ETABS model
program_path=r"C:\Program Files\Computers and Structures\ETABS 22\ETABS.exe"
pythoncom.CoInitialize()
try:
helper = comtypes.client.CreateObject("ETABSv1.Helper")
helper = helper.QueryInterface(comtypes.gen.ETABSv1.cHelper)
EtabsEngine = helper.CreateObject(program_path)
EtabsEngine.ApplicationStart()
EtabsObject = EtabsEngine.SapModel
EtabsObject.InitializeNewModel(9) # Set units to mm
EtabsObject.File.NewBlank()
finally:
pythoncom.CoUninitialize()
# Create joints
input_json = Path.cwd() / "inputs.json" #only works when running python from the working directory!
with open(input_json) as jsonfile:
data = json.load(jsonfile)
nodes, lines = data[:]
# Create nodes
for node_id, node in nodes.items():
ret, _ = EtabsObject.PointObj.AddCartesian(
node["x"], node["y"], node["z"], " ", str(node_id))
)
# Create members
MATERIAL_CONCRETE = 2
ret = EtabsObject.PropMaterial.SetMaterial("CONC", MATERIAL_CONCRETE)
ret = EtabsObject.PropMaterial.SetMPIsotropic("CONC", 30000, 0.2, 0.0000055)
section_name = "300x300 RC"
ret = EtabsObject.PropFrame.SetRectangle(section_name, "CONC", 300, 300)
for line_id, line in lines.items():
point_i = line["node_i"]
point_j = line["node_j"]
ret, _ = EtabsObject.FrameObj.AddByPoint(
str(point_i), str(point_j), str(line_id), section_name, "Global"
)
# Add rigid supports
list_nodes = [1, 2, 5, 6]
for node_id in list_nodes:
ret = EtabsObject.PointObj.SetRestraint(str(node_id), [1, 1, 1, 1, 1, 1])
EtabsObject.View.RefreshView(0, False)
if __name__ == "__main__":
create_etabs_model()
```
## Run the model[](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#run-the-model "Direct link to Run the model")
Now you can save the model and run the analysis. By default, ETABS creates a load case called `Dead`, which includes only the self-weight of the structure. After the analysis, we can extract the reaction loads and save the results in a `.json` file to be used later in our VIKTOR app.
```
def create_etabs_model():
# Initialize ETABS model
program_path=r"C:\Program Files\Computers and Structures\ETABS 22\ETABS.exe"
pythoncom.CoInitialize()
try:
helper = comtypes.client.CreateObject("ETABSv1.Helper")
helper = helper.QueryInterface(comtypes.gen.ETABSv1.cHelper)
EtabsEngine = helper.CreateObject(program_path)
EtabsEngine.ApplicationStart()
EtabsObject = EtabsEngine.SapModel
EtabsObject.InitializeNewModel(9) # Set units to mm
EtabsObject.File.NewBlank()
finally:
pythoncom.CoUninitialize()
# Create joints
input_json = Path.cwd() / "inputs.json" #only works when running python from the working directory!
with open(input_json) as jsonfile:
data = json.load(jsonfile)
nodes, lines = data[:]
# Create nodes
for node_id, node in nodes.items():
ret, _ = EtabsObject.PointObj.AddCartesian(
node["x"], node["y"], node["z"], " ", str(node_id))
)
# Create members
MATERIAL_CONCRETE = 2
ret = EtabsObject.PropMaterial.SetMaterial("CONC", MATERIAL_CONCRETE)
ret = EtabsObject.PropMaterial.SetMPIsotropic("CONC", 30000, 0.2, 0.0000055)
section_name = "300x300 RC"
ret = EtabsObject.PropFrame.SetRectangle(section_name, "CONC", 300, 300)
for line_id, line in lines.items():
point_i = line["node_i"]
point_j = line["node_j"]
ret, _ = EtabsObject.FrameObj.AddByPoint(
str(point_i), str(point_j), str(line_id), section_name, "Global"
)
# Add rigid supports
list_nodes = [1, 2, 5, 6]
for node_id in list_nodes:
ret = EtabsObject.PointObj.SetRestraint(str(node_id), [1, 1, 1, 1, 1, 1])
EtabsObject.View.RefreshView(0, False)
# Create the model and run the analysis
file_path = Path.cwd() / "etabsmodel.edb"
EtabsObject.File.Save(str(file_path))
EtabsObject.Analyze.RunAnalysis()
# Get the reaction loads
load_case = "Dead"
ret = EtabsObject.Results.Setup.DeselectAllCasesAndCombosForOutput()
reactions_list = list()
ret = EtabsObject.Results.Setup.SetCaseSelectedForOutput(load_case)
for node in list_nodes:
*_, U1, U2, U3, R1, R2, R3, ret = EtabsObject.Results.JointReact(
str(node), 0, 0
)
reaction = {
"Node": str(node),
"LoadCase": load_case,
"U1": U1[0],
"U2": U2[0],
"U3": U3[0],
"R1": R1[0],
"R2": R2[0],
"R3": R3[0],
}
reactions_list.append(reaction)
# Save the output in a JSON
output = Path.cwd() / "output.json"
with open(output, "w") as jsonfile:
json.dump(reactions_list, jsonfile)
ret = EtabsEngine.ApplicationExit(False)
return ret
if __name__ == "__main__":
create_etabs_model()
```
After running your `run_etabs_model.py` in your Python environment, you should end up with a model like the following:

## How to connect your VIKTOR app with the CSI API?[](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#how-to-connect-your-viktor-app-with-the-csi-api "Direct link to How to connect your VIKTOR app with the CSI API?")
The connection between VIKTOR and SAP2000 or ETABS is managed by a “worker.” A worker is a program that connects the VIKTOR platform to third-party software running outside the platform. You can install the worker on your local machine to test the integration by following this [tutorial](https://docs.viktor.ai/docs/create-apps/software-integrations/etabs-and-sap2000/.md).
## Let's integrate the worker in our VIKTOR app[](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#lets-integrate-the-worker-in-our-viktor-app "Direct link to Let's integrate the worker in our VIKTOR app")
In the `Controller` of our VIKTOR app, we need to set up the communication with the worker. To call the worker, we use the `ETABSAnalysis` class, which allows us to send inputs (files and objects) to the worker. In this example, we will send the `inputs.json` and `run_etabs_model.py` to be executed in the environment set up for the worker. This environment can be on your own computer or a remote server. When `run_etabs_model.py` is executed, it will generate the `output.json` file, and the worker will handle transferring this file from the server environment to our VIKTOR app. Here's how it looks in the code:
```
import json
from io import BytesIO
from pathlib import Path
import viktor as vkt
def create_frame_data(length, height):
nodes = {
1:{"node_id": 1, "x": 0, "y": 0, "z": 0},
2:{"node_id": 2, "x": 0, "y": length, "z": 0},
3:{"node_id": 3, "x": 0, "y": 0, "z": height},
4:{"node_id": 4, "x": 0, "y": length, "z": height},
5:{"node_id": 5, "x": length, "y": 0, "z": 0},
6:{"node_id": 6, "x": length, "y": length, "z": 0},
7:{"node_id": 7, "x": length, "y": 0, "z": height},
8:{"node_id": 8, "x": length, "y": length, "z": height},
}
lines = {
1:{"line_id": 1, "node_i": 1, "node_j": 3},
2:{"line_id": 2, "node_i": 2, "node_j": 4},
3:{"line_id": 3, "node_i": 3, "node_j": 4},
4:{"line_id": 4, "node_i": 6, "node_j": 8},
5:{"line_id": 5, "node_i": 5, "node_j": 7},
6:{"line_id": 6, "node_i": 3, "node_j": 7},
7:{"line_id": 7, "node_i": 4, "node_j": 8},
8:{"line_id": 8, "node_i": 7, "node_j": 8},
}
return nodes, lines
class Parametrization(vkt.Parametrization):
intro = vkt.Text(
"# ETABS Base Reaction App"
"\n\n Please fill in the following parameters:"
)
frame_length = vkt.NumberField("Frame Length", min=100, default=4000, suffix="mm")
frame_height = vkt.NumberField("Frame Height", min=100, default=4000, suffix="mm")
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.GeometryView("3D Model", duration_guess=1, x_axis_to_right=True)
def create_render(self, params, **kwargs):
nodes, lines = create_frame_data(length=params.frame_length, height=params.frame_height)
sections_group = []
for line_id, dict_vals in lines.items():
node_id_i = dict_vals["node_i"]
node_id_j = dict_vals["node_j"]
node_i = nodes[node_id_i]
node_j = nodes[node_id_j]
point_i = vkt.Point(node_i["x"], node_i["y"], node_i["z"])
point_j = vkt.Point(node_j["x"], node_j["y"], node_j["z"])
line_k = vkt.Line(point_i, point_j)
section_k = vkt.RectangularExtrusion(300, 300, line_k, identifier=str(line_id))
sections_group.append(section_k)
return vkt.GeometryResult(geometry=sections_group)
def run_etabs(self, params, **kwargs):
nodes, lines = create_frame_data(length=params.frame_length, height= params.frame_height)
input_json = json.dumps([nodes, lines])
script_path = Path(__file__).parent / "run_etabs_model.py"
files = [("inputs.json", BytesIO(bytes(input_json, 'utf8')))]
etabs_analysis = vkt.etabs.ETABSAnalysis(
script=vkt.File.from_path(script_path), files=files, output_filenames=["output.json"]
)
etabs_analysis.execute(timeout=300)
output_file = etabs_analysis.get_output_file("output.json", as_file=True)
```
And of course, we would like to see the results in a nice table, so we will decorate the previous function with a `TableView` and post-process the results from the `output.json` file, as shown below:
```
import json
from io import BytesIO
from pathlib import Path
import viktor as vkt
def create_frame_data(length, height):
nodes = {
1:{"node_id": 1, "x": 0, "y": 0, "z": 0},
2:{"node_id": 2, "x": 0, "y": length, "z": 0},
3:{"node_id": 3, "x": 0, "y": 0, "z": height},
4:{"node_id": 4, "x": 0, "y": length, "z": height},
5:{"node_id": 5, "x": length, "y": 0, "z": 0},
6:{"node_id": 6, "x": length, "y": length, "z": 0},
7:{"node_id": 7, "x": length, "y": 0, "z": height},
8:{"node_id": 8, "x": length, "y": length, "z": height},
}
lines = {
1:{"line_id": 1, "node_i": 1, "node_j": 3},
2:{"line_id": 2, "node_i": 2, "node_j": 4},
3:{"line_id": 3, "node_i": 3, "node_j": 4},
4:{"line_id": 4, "node_i": 6, "node_j": 8},
5:{"line_id": 5, "node_i": 5, "node_j": 7},
6:{"line_id": 6, "node_i": 3, "node_j": 7},
7:{"line_id": 7, "node_i": 4, "node_j": 8},
8:{"line_id": 8, "node_i": 7, "node_j": 8},
}
return nodes, lines
class Parametrization(vkt.Parametrization):
intro = vkt.Text(
"# ETABS Base Reaction App"
"\n\n Please fill in the following parameters:"
)
frame_length = vkt.NumberField("Frame Length", min=100, default=4000, suffix="mm")
frame_height = vkt.NumberField("Frame Height", min=100, default=4000, suffix="mm")
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.GeometryView("3D Model", duration_guess=1, x_axis_to_right=True)
def create_render(self, params, **kwargs):
nodes, lines = create_frame_data(length=params.frame_length, height=params.frame_height)
sections_group = []
for line_id, dict_vals in lines.items():
node_id_i = dict_vals["node_i"]
node_id_j = dict_vals["node_j"]
node_i = nodes[node_id_i]
node_j = nodes[node_id_j]
point_i = vkt.Point(node_i["x"], node_i["y"], node_i["z"])
point_j = vkt.Point(node_j["x"], node_j["y"], node_j["z"])
line_k = vkt.Line(point_i, point_j)
section_k = vkt.RectangularExtrusion(300, 300, line_k, identifier=str(line_id))
sections_group.append(section_k)
return vkt.GeometryResult(geometry=sections_group)
@vkt.TableView("Base Reactions",duration_guess=10, update_label="Run ETABS analysis")
def run_etabs(self, params, **kwargs):
nodes, lines = create_frame_data(length=params.frame_length, height= params.frame_height)
input_json = json.dumps([nodes, lines])
script_path = Path(__file__).parent / "run_etabs_model.py"
files = [("inputs.json", BytesIO(bytes(input_json, 'utf8')))]
etabs_analysis = vkt.etabs.ETABSAnalysis(
script=vkt.File.from_path(script_path), files=files, output_filenames=["output.json"]
)
etabs_analysis.execute(timeout=300)
output_file = etabs_analysis.get_output_file("output.json", as_file=True)
reactions = json.loads(output_file.getvalue())
data = []
for reaction in reactions:
data.append([
reaction.get("Node", 0),
reaction.get("LoadCase", "Dead"),
round(reaction.get("U1", 0), 0),
round(reaction.get("U2", 0), 0),
round(reaction.get("U3", 0), 0)
])
return vkt.TableResult(
data,
row_headers=["Sup 1","Sup 2","Sup 3","Sup 4"],
column_headers=["Node", "Load Case","U1[N]", "U2[N]", "U3[N]"],
)
```
Now you're ready to test your app. Make sure your worker is running, then try generating the model. After the analysis, your app should look like this:

## What about SAP2000?[](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#what-about-sap2000 "Direct link to What about SAP2000?")
You can integrate SAP2000 in the same way we did for ETABS. All you need to do is change the program path and the helper, as shown below.
```
import pythoncom
import comtypes.client
def initialize_sap2000(
program_path=r"C:\Program Files\Computers and Structures\SAP2000 25\SAP2000.exe",
):
pythoncom.CoInitialize()
try:
helper = comtypes.client.CreateObject("SAP2000v1.Helper")
helper = helper.QueryInterface(comtypes.gen.SAP2000v1.cHelper)
SapEngine = helper.CreateObject(program_path)
SapEngine.ApplicationStart()
SapObject = SapEngine.SapModel
SapObject.InitializeNewModel()
SapObject.File.NewBlank()
return SapObject, SapEngine
finally:
pythoncom.CoUninitialize()
```
## Your turn to build[](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md#your-turn-to-build "Direct link to Your turn to build")
You now have everything you need to start building powerful applications that integrate ETABS and SAP2000 into your VIKTOR apps. But the journey doesn’t end here, you can explore our other [tutorials](https://docs.viktor.ai/docs/tutorials/.md) or try integrating your own ETABS or SAP2000 model.
---
# Tutorial - Autodesk Forma Site Design
info
Level: **Intermediate**
Time: **30 min**
Prerequisites:
* You have a VIKTOR account and completed the installation process. No account? Get one [here](https://www.viktor.ai/start-building-apps)
* You have access to an Autodesk Forma Site Design project.
* Your VIKTOR environment has an OAuth 2.0 integration available for Autodesk Forma Site Design.
* [](https://www.viktor.ai/start-building-apps)
## Introduction[](https://docs.viktor.ai/docs/tutorials/integrate-forma-site-design/.md#introduction "Direct link to Introduction")
Welcome to this tutorial on how to create VIKTOR apps that connect to Autodesk Forma Site Design through Autodesk Platform Services (APS), VIKTOR, and Python.
As an engineer or architect, you may work with changing requirements throughout a project. In this tutorial, we use three example workflows to explore how VIKTOR can help you read Forma data, generate geometry, visualize results, and publish new design outcomes without changing the app's source code for every variation.
Instead of starting with a single finished application, we will use prompts as the starting point for each workflow. Each prompt describes a different way to combine VIKTOR with Forma Site Design:
1. [Create a parametric tower and publish it to the Forma Library](https://docs.viktor.ai/docs/tutorials/integrate-forma-site-design/.md#prompt-1-create-a-parametric-tower-and-publish-it-to-the-forma-library).
2. [Analyze terrain for drainage and ponding risks](https://docs.viktor.ai/docs/tutorials/integrate-forma-site-design/.md#prompt-2-analyze-terrain-for-drainage-and-ponding-risks).
3. [Place a building on terrain and publish it to a derived proposal](https://docs.viktor.ai/docs/tutorials/integrate-forma-site-design/.md#prompt-3-place-a-building-on-terrain-and-publish-it-to-a-derived-proposal).
## 1. Set up the integration[](https://docs.viktor.ai/docs/tutorials/integrate-forma-site-design/.md#1-set-up-the-integration "Direct link to 1. Set up the integration")
Before testing the prompts, configure the APS application, VIKTOR OAuth 2.0 integration, ACC custom integration, and Forma extension service account. The same APS client ID must be connected across these services, and the Forma extension must be installed in every project the app needs to access.
For the complete setup procedure, including the required permissions, regions, project access, and OAuth 2.0 integration configuration, follow the [Autodesk Forma Site Design integration guide](https://docs.viktor.ai/docs/create-apps/software-integrations/autodesk-forma-site-design/.md). In particular, review these sections:
* [Before you begin](https://docs.viktor.ai/docs/create-apps/software-integrations/autodesk-forma-site-design/.md#before-you-begin): confirm the required VIKTOR, APS, ACC, and Forma access.
* [Create the APS application and VIKTOR integration](https://docs.viktor.ai/docs/create-apps/software-integrations/autodesk-forma-site-design/.md#1-create-the-aps-application-and-viktor-integration).
* [Add the APS client ID to the ACC account](https://docs.viktor.ai/docs/create-apps/software-integrations/autodesk-forma-site-design/.md#2-add-the-aps-client-id-to-the-acc-account).
* [Create and install the Forma extension](https://docs.viktor.ai/docs/create-apps/software-integrations/autodesk-forma-site-design/.md#3-create-and-install-the-forma-extension).
## 2. Understand the key concepts[](https://docs.viktor.ai/docs/tutorials/integrate-forma-site-design/.md#2-understand-the-key-concepts "Direct link to 2. Understand the key concepts")
Most Forma workflows created with the VIKTOR App Builder start with the same project context: a Forma **project ID** and a selected **proposal or project revision**. You can find these values in the URL of the open Forma Site Design project:
* **Project ID**: the value after `/designmodel/`, such as `pro_gsbvy6xpyt` in the example below.
* **Proposal or revision ID**: the identifier that follows the project ID. The exact field label depends on the generated app. When the app asks you to select a revision, choose the proposal or revision you want it to read or extend.
Copy the relevant values into the generated app when prompted. The examples below may ask for the project ID and region first, then load the available proposals dynamically so you can select the right proposal or revision.

## 3. Explore Forma Site Design workflows with prompts[](https://docs.viktor.ai/docs/tutorials/integrate-forma-site-design/.md#3-explore-forma-site-design-workflows-with-prompts "Direct link to 3. Explore Forma Site Design workflows with prompts")
The following prompts are starting points for three different Forma workflows. Click the arrow to open a prompt in the VIKTOR App Builder. Review the generated app and test its preview before using an action that writes to Forma.
### Prompt 1: Create a parametric tower and publish it to the Forma Library[](https://docs.viktor.ai/docs/tutorials/integrate-forma-site-design/.md#prompt-1-create-a-parametric-tower-and-publish-it-to-the-forma-library "Direct link to Prompt 1: Create a parametric tower and publish it to the Forma Library")
Let's start by creating a parametric tower. This is useful in the early stages of a project, when you want to explore different building options without rebuilding the model by hand. Before you submit the prompt, replace `[YOUR-FORMA-SITE-INTEGRATION-NAME-HERE]` with the name of the OAuth 2.0 integration configured in your VIKTOR environment. Then open the prompt in the App Builder, review the generated app, and test the preview before publishing the GLB to your Forma Library.


### Parametric twisting tower
Create a parametric 30-story twisting tower with a 40 × 30 m base, 4 m floor height, 1% taper per floor, and 2° rotation per floor. Preview it vertically, export it as a Forma-compatible GLB with the correct Y-up axis conversion, and publish it to the current project's Forma Library.
Use my OAuth integration "\[YOUR-FORMA-SITE-INTEGRATION-NAME-HERE]".
Once the App Builder finishes creating the app, open the preview and enter the Forma project ID. You can then change the tower parameters, such as the number of stories, base dimensions, floor height, taper, and rotation. When the model looks right, publish it to the Forma Library.

Next, open the Forma Site Design project and go to the Library. Select the parametric twisting tower and place it into the proposal you want to update. This lets you reuse the generated model in Forma after testing different parameters in the VIKTOR app.

### Prompt 2: Analyze terrain for drainage and ponding risks[](https://docs.viktor.ai/docs/tutorials/integrate-forma-site-design/.md#prompt-2-analyze-terrain-for-drainage-and-ponding-risks "Direct link to Prompt 2: Analyze terrain for drainage and ponding risks")
The second workflow looks at the terrain before you make a design decision. It is useful when you want to find possible low points and drainage risks during early site planning. Enter the Forma project ID and region, select a proposal from the proposals loaded by the app, and review the heatmap and summary table before publishing a new proposal.


### Drainage and ponding risk analysis
Create a VIKTOR app for Forma Site Design using my OAuth integration "\[YOUR-FORMA-SITE-INTEGRATION-NAME-HERE]".
I want to screen a site's terrain for possible drainage and ponding risks. Ask me for the Forma project ID and region, dynamically load its proposals, and let me select one. Sample the terrain, identify local low points, and display a simple drainage-risk heatmap in a GeometryView with a summary table. Add an ActionButton that publishes the colored heatmap to a new Forma proposal without modifying the selected source proposal.
Once the App Builder finishes creating the app, enter the Forma project ID and select a proposal in the Proposal Selection field. Review the drainage-risk heatmap and summary table, then use the publish action when the result looks right.

After the heatmap is published, return to the Forma Site Design project and refresh the page. The new proposal should appear in the proposals list with the colored heatmap ready for review.

tip
This prompt asks the generated app to create a new proposal so the selected source proposal stays unchanged. You can also update the prompt to modify an existing proposal instead, but do that only when you intend to change that proposal.
### Prompt 3: Place a building on terrain and publish it to a derived proposal[](https://docs.viktor.ai/docs/tutorials/integrate-forma-site-design/.md#prompt-3-place-a-building-on-terrain-and-publish-it-to-a-derived-proposal "Direct link to Prompt 3: Place a building on terrain and publish it to a derived proposal")
The third workflow helps you test a simple building on real Forma terrain. Change the building dimensions, rotation, and position in the generated app, then use the GeometryView to check the result. When the placement looks right, publish it to a new derived proposal so the selected source proposal stays unchanged.


### Terrain-aware building placement
Create a VIKTOR app for Forma Site Design using my OAuth integration "\[YOUR-FORMA-SITE-INTEGRATION-NAME-HERE]".
I want to enter a Forma project ID and region, select a proposal dynamically, download its terrain, and define one simple rectangular building with width, depth, height, rotation, and X/Y position inputs. Preview the terrain and generated building in a VIKTOR GeometryView. Add an ActionButton that creates the building as native Forma Basic Geometry and attaches it to a new derived proposal, resolving the latest proposal revision immediately before the write. Do not write to Forma during App Builder validation.
Once the App Builder finishes creating the app, enter the Forma project ID and region, then select the proposal you want to use. Change the building dimensions, height, rotation, and X/Y position to test different site options. Add a name for the new proposal, review the GeometryView, and create the building in Forma when the result looks right.

After the action finishes, return to Forma Site Design and refresh the project. Open the new proposal and check that the building was added to the selected terrain without changing the source proposal.

## 4. Limitations of the VIKTOR Forma Site Design integration[](https://docs.viktor.ai/docs/tutorials/integrate-forma-site-design/.md#4-limitations-of-the-viktor-forma-site-design-integration "Direct link to 4. Limitations of the VIKTOR Forma Site Design integration")
In this tutorial, VIKTOR communicates with Forma through its **HTTP APIs**, also commonly called **REST APIs**. You can think of these APIs as a background connection: the VIKTOR app can ask Forma to read or save supported project, proposal, terrain, geometry, and Library data. The VIKTOR integration does not control the live Forma workspace. For an overview, see Forma's [HTTP API extension type](https://aps.autodesk.com/en/docs/forma/v1/overview/extension-types/#http-api-s).
Here are some limitations of the integration:
* **The VIKTOR integration does not control the live canvas.** It cannot see what the user has selected, move the camera, or read the current scene state.
* **The VIKTOR integration does not start Forma's drawing tools.** It cannot ask the user to draw a point, line, polygon, or extrusion directly in the Forma scene.
* **The VIKTOR integration cannot always download the full geometry of existing elements.** If the workflow needs geometry from the model currently loaded in Forma, the server-side integration may not provide it. Persistent changes still require supported API operations and the appropriate edit permissions.
## To infinity and beyond\
Well done! You now have three starting points for creating VIKTOR apps that connect to Autodesk Forma Site Design. You have explored how to generate parametric geometry, analyze terrain, preview results in VIKTOR, and publish new outcomes to Forma.
Finally, the journey doesn't end here. Check out some of our other [tutorials](https://docs.viktor.ai/docs/tutorials/.md) or explore the [VIKTOR documentation](https://docs.viktor.ai/docs/welcome/.md) to learn more about building apps with VIKTOR.
---
# Tutorial - Integrate Rhino/Grasshopper
note
Estimated time: 45 minutes
Difficulty level: Intermediate
* [](https://www.viktor.ai/start-building-apps)
***Not a reader?** feel free to follow this tutorial as a video*
## Introduction[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#introduction "Direct link to Introduction")
Welcome to this tutorial on integrating Grasshopper with VIKTOR! In this tutorial, you will learn how to create a VIKTOR web app with a Grasshopper model running behind it by the following steps:
1. [Setup integration with Grasshopper](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#1-setup-integration-with-grasshopper)
2. [Build the VIKTOR app](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#2-build-the-viktor-app)
3. [Use your own Grasshopper model](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#3-use-your-own-grasshopper-model)
By the end of this tutorial, you will have created a simple VIKTOR application that creates a geometry and data view of a simple box, see the image below:

So, let's get started and learn how to create a VIKTOR app based on a Grasshopper model!
## Pre-requisites and downloads[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#pre-requisites-and-downloads "Direct link to Pre-requisites and downloads")
Prerequisites
* You have [installed VIKTOR](https://docs.viktor.ai/docs/getting-started/installation/.md) on your computer
* You have some experience with reading Python code
* You have some experience with Rhino/Grasshopper
Required Downloads
* [sample\_box\_grasshopper.gh](https://docs.viktor.ai/files/docs/grasshopper-tutorial/sample_box_grasshopper.gh)
SDK version
This code requires support for the GrasshopperAnalysis, which is available since SDK **v14.8.0**. Make sure use this SDK version or higher in your `requirements.txt` file.
## Explanation of setup[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#explanation-of-setup "Direct link to Explanation of setup")
Before diving into the steps, let's explain how the integration will work. See the following diagram:

The following will happen:
1. The user fills in input parameters in the **VIKTOR UI**
2. In **VIKTOR app.py** these input parameters will be sent together with a Grasshopper script (*sample\_box\_grasshopper.gh*) to the [worker](https://docs.viktor.ai/docs/manage-apps/software-integrations/.md).
3. The **Grasshopper worker** will run **Rhino/Grasshopper** (on your local machine), based on the Grasshopper script (*sample\_box\_grasshopper.gh*) and the input parameters.
4. The Grasshopper model generates output data, which is sent back by the **worker**.
5. In **VIKTOR app.py**, the output data is converted into a 3dm geometry file, which will be visualized in the **VIKTOR UI**.
Now let's setup everything to get this running! We will go through the diagram from right to left.
Rhino 8 - plug-ins & .NET
In order to install some older plug-ins, you may have had to set your .NET such that it is running in .NET Framework. If you did, please change it back to the default setting (.NET Core) for the integration to work using the `SetDotNetRuntime` in the Rhino command line.
## 1. Setup integration with Grasshopper[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#1-setup-integration-with-grasshopper "Direct link to 1. Setup integration with Grasshopper")
A worker (integration) is a program that connects a VIKTOR app with third-party software to execute tasks and send back results. In this case, the worker will start Rhino/Grasshopper with the input data and send the resulting output data back. Before we setup the worker, we must first install the Hops plugin for Grasshopper.
### Install Hops plugin[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#install-hops-plugin "Direct link to Install Hops plugin")
Hops is a plugin for Grasshopper, which will be used to make it possible to call the Grasshopper script externally, using a local Rhino Compute server. Follow these steps to install Hops:
1. Install Hops via the Package Manager in Rhino (type `PackageManager` on the Rhino command line and search for "Hops")

2. Make sure Rhino Compute will be launched at start up. In Grasshopper, go to `File -> Preferences` and check the following settings:

We recommend to uncheck *Hide Rhino.Compute Console Window*, because you can then easily see if Rhino Compute is running and debug when necessary.
The full documentation of Hops can be found in the [Rhino documentation](https://developer.rhino3d.com/guides/compute/hops-component/).
### Install Grasshopper worker[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#install-grasshopper-worker "Direct link to Install Grasshopper worker")
Follow these steps to install the worker:
* Personal worker
* Organization worker
A personal worker connects the Grasshopper installation on your own machine, for your own use. Personal workers are installed and managed with [VIKTOR Desktop](https://docs.viktor.ai/docs/create-apps/software-integrations/viktor-desktop/.md):
1. [Download and install VIKTOR Desktop](https://docs.viktor.ai/docs/create-apps/software-integrations/viktor-desktop/.md#download-and-install-viktor-desktop) and log in with your VIKTOR account, if you haven't done so already
2. In VIKTOR Desktop, click "Add" and select **Grasshopper**
3. Configure the worker where needed and start it
note
Grasshopper workers that were installed with the previous per-worker installer keep running, but new personal workers can only be added through [VIKTOR Desktop](https://docs.viktor.ai/docs/create-apps/software-integrations/viktor-desktop/.md#migrate-existing-workers-to-viktor-desktop).
An organization worker connects a Grasshopper installation on a machine managed by your organization, such as a virtual or remote machine, and is shared by the users of the app instance(s) you select.
caution
You need to be an environment administrator in order to install an organization worker.
1. Navigate to the "Integrations" tab in the Administrator panel
2. Click "Add integration"
3. Follow the steps provided in the modal

3.1. Select **Grasshopper**
3.2. Select the app instance(s) the integration should be available to
3.3. Download the worker .msi (Microsoft Installer) and run it on the machine of choice
3.4. Copy the generated **connection key** and paste it when the installer asks for it
Connection Key
The generated connection key **should be copied immediately** as VIKTOR will not preserve this data for security reasons.
localhost port
By default, the local RhinoCompute server runs on `http://localhost:6500/`, so this has been preselected in the worker setup. If you have configured RhinoCompute to a different port, please update this accordingly when configuring the worker.
Once the worker is enabled in VIKTOR Desktop, the app shows whether it is connected. If you installed the worker with the per-worker installer (as used for organization workers), the worker starts up automatically after installation and you will be presented with the worker terminal in which the message: **"Successfully connected to the server"** is displayed. In the top right corner in your viktor environment you should see a green indicator in your integrations overview, see the figure below.

Nice work! The integration is ready to use, let's test the VIKTOR app.
### (optional) Check out Grasshopper model[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#optional-check-out-grasshopper-model "Direct link to (optional) Check out Grasshopper model")
Before we start building the app, you might be curious to know what kind of Grasshopper model we will be integrating. If you want to check out the Grasshopper model, open the Grasshopper file (`sample_box_grasshopper.gh`) with the Grasshopper plugin and this should lead to the following view:

Let's take some time to check out what is happening in the Grasshopper script:

1. Three Hops input parameters (`width`, `length` and `height`) are defined based on the `Get Number` component of [Hops](https://developer.rhino3d.com/guides/compute/hops-component/#create-a-hops-function).
2. A simple box is created based on the width, length and height, which is subsequently meshed.
3. The mesh is baked into Rhino using the `Context Bake` component of Hops.
If you change the input parameters, you will see that a box is drawn in Rhino. With this setup, we are ready to run this Grasshopper file from a Python script.
## 2. Build the VIKTOR app[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#2-build-the-viktor-app "Direct link to 2. Build the VIKTOR app")
### Create an empty app[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#create-an-empty-app "Direct link to Create an empty app")
Let's create, install and start an empty app. This will be the starting point for the rest of the tutorial. But before we start, make sure to shut down any app that is running (like the demo app) by closing the command-line shell (for example Powershell) or end the process using `Ctrl + C`.
Follow these steps to create, install and start an empty app:
1. Open a terminal and run the following command to create the app on the VIKTOR platform and generate the initial code locally:
```
viktor-cli create-app "Grasshopper tutorial" --init --app-type editor
```
2. Open the newly created folder in your code editor and run `viktor-cli clean-start` in the terminal to install dependencies and connect the app to the platform.
If all went well, your empty app is installed and connected to your development workspace. **Do not close the terminal** as this will break the connection with your app. The terminal in your code editor should show something like this:
```
INFO : Connecting to cloud.viktor.ai...
INFO : Connection is established (use Ctrl+C to close)
INFO :
INFO : Navigate to the link below to see your app in the browser
INFO : https://cloud.viktor.ai/workspaces/XXX/app
INFO :
INFO : App code loaded, waiting for jobs...
```
Re-starting your app
* You only need to create an app template and install it once for each new app you want to make.
* The app will update automatically once you start adding code in `app.py`, as long as you don't close the terminal or your code editor.
* Did you close your code editor? Use `viktor-cli start` to start the app again. No need to install, clear, etc.
### Add input fields[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#add-input-fields "Direct link to Add input fields")
We will add 3 input fields to our app: `width`, `length` and `height` using the `NumberField`.
1. Open `app.py`, import viktor and add the relevant fields to your parametrization. In the end your `app.py` file should look like this:
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("## Grasshopper app \n This app parametrically generates and visualises a 3D model of a box using a Grasshopper script. \n\n Please fill in the following parameters:")
# Input fields
width = vkt.NumberField('Width', default=5)
length = vkt.NumberField('Length', default=6)
height = vkt.NumberField('Height', default=7)
class Controller(vkt.Controller):
parametrization = Parametrization
```
2. Refresh your app in the browser, and you should see the input fields appear.
### Install additional dependencies[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#install-additional-dependencies "Direct link to Install additional dependencies")
In the next step we will need the `rhino3dm` package. To be able to use this, we have to add it as dependency in the [requirements.txt](https://docs.viktor.ai/docs/create-apps/development-tools-and-tips/use-python-packages/.md) file so that the contents look like this:
```
viktor==14.37.0
rhino3dm
```
If your terminal is still running, close the connection using Ctrl+C.
Install the rhino3dm dependency:
```
viktor-cli install
```
And start your app:
```
viktor-cli start
```
### Add the Python code to run Grasshopper[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#add-the-python-code-to-run-grasshopper "Direct link to Add the Python code to run Grasshopper")
Now the app code can be extended to integrate the Grasshopper script.
First, place the `sample_box_grasshopper.gh` file in the 'my-grasshopper-app' folder.
Then change the code in `app.py` to the code below:
```
import viktor as vkt
import json
import rhino3dm
from pathlib import Path
class Parametrization(vkt.Parametrization):
intro = vkt.Text("## Grasshopper app \n This app parametrically generates and visualizes a 3D model of a box using a Grasshopper script. \n\n Please fill in the following parameters:")
# Input fields
width = vkt.NumberField('Width', default=5)
length = vkt.NumberField('Length', default=6)
height = vkt.NumberField('Height', default=7)
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.GeometryView("Geometry", duration_guess=10, x_axis_to_right=True, update_label='Run Grasshopper')
def run_grasshopper(self, params, **kwargs):
grasshopper_script_path = Path(__file__).parent / "sample_box_grasshopper.gh"
script = vkt.File.from_path(grasshopper_script_path)
input_parameters = dict(params)
# Run the Grasshopper analysis and obtain the output data
analysis = vkt.grasshopper.GrasshopperAnalysis(script=script, input_parameters=input_parameters)
analysis.execute(timeout=30)
output = analysis.get_output()
# Convert output data to mesh
file3dm = rhino3dm.File3dm()
obj = rhino3dm.CommonObject.Decode(json.loads(output["values"][0]["InnerTree"]['{0}'][0]["data"]))
file3dm.Objects.Add(obj)
# Write to geometry_file
geometry_file = vkt.File()
file3dm.Write(geometry_file.source, version=7)
return vkt.GeometryResult(geometry=geometry_file, geometry_type="3dm")
```
If you now refresh your app, you should see the following:

Now press the **Run Grasshopper** button (be sure that the worker, Rhino and Grasshopper are running). You should see that Rhino Compute is run by the worker which will result in the following:

Congratulations, you now have made a VIKTOR app with a Grasshopper model running behind it!
## 3. Use your own Grasshopper model[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#3-use-your-own-grasshopper-model "Direct link to 3. Use your own Grasshopper model")
If you would like to integrate your own Grasshopper model in VIKTOR, you can adapt the app you just created. Take the following steps:
### Extend your Grasshopper model[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#extend-your-grasshopper-model "Direct link to Extend your Grasshopper model")
As explained in [this section](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#optional-check-out-grasshopper-model), some specific things need to be defined in the Grasshopper model to make the integration work.
1. **Connect your specific input parameters by Hops components.** In order to update the parameters via Rhino Compute, create [Hops Get Components](https://developer.rhino3d.com/guides/compute/hops-component/#defining-inputs) for the parameters you want to update. As you can see highlighted in the image below, the names need to be *exactly* the same for the integration to work.

2. **Mesh your final geometry.** In order for Rhino Compute to successfully export your geometry you need to mesh it because Rhino Compute can only export a mesh. If you don't, your geometry will not appear in the environment.
3. **Add the Context Bake component.** The Grasshopper node [Context Bake](https://developer.rhino3d.com/guides/compute/hops-component/#defining-outputs) is needed to bake the model.
Flatten your inputs
It is recommended to flatten the inputs in your grasshopper script, especially for simpler/smaller scripts. For larger grasshopper scripts, this may still be true, but it may be more efficient to use the Tree structure as input.
Want to find out more? Check out the thread on the [community](https://community.viktor.ai/t/snippet-wednesday-grasshopper-tree-inputs/1572).
### Adjust the VIKTOR app code[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#adjust-the-viktor-app-code "Direct link to Adjust the VIKTOR app code")
In the VIKTOR app code **adjust the parametrization** to match with your required input parameters.
The rest of the code should not require any changes to work.
## To infinity and beyond[](https://docs.viktor.ai/docs/tutorials/integrate-grasshopper/.md#to-infinity-and-beyond "Direct link to To infinity and beyond")
Great work! You are now able to create an app that can integrate with an external installation of Grasshopper through a Grasshopper Worker!
Of course, the journey doesn't end here. Check out some of our other [tutorials](https://docs.viktor.ai/docs/tutorials/.md) or go to the [next section](https://docs.viktor.ai/docs/create-apps/.md) or try to connect your own Grasshopper script to your VIKTOR app!
---
# Tutorial - AutoCAD Plant 3D
info
Level: **Intermediate**
Time: **30–45 min**
Prerequisites:
* A VIKTOR account with access to the App Builder, or the VIKTOR CLI for local development.
* Access to an ACC project with published Plant 3D data and a viewable DWG.
* An Autodesk Platform Services OAuth 2.0 integration available in your VIKTOR environment.
Beta
The Plant 3D integration is in Beta. Validate the generated tables, quantities and viewer highlights against your source model before using the results in a project.
## Introduction[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#introduction "Direct link to Introduction")
In this tutorial, you will build apps that use published Plant 3D data from ACC / Forma to review equipment, color valves in a drawing, prepare a quantity takeoff and explore asset relationships. You will use four prompts in the App Builder, each creating a separate app with guided inputs, tables, charts and a drawing viewer.
If you prefer to write Python, open the **Local development** tab to build a 3D equipment overview app step by step with the VIKTOR CLI. The complete code is included.
## 1. Set up the integration[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#1-set-up-the-integration "Direct link to 1. Set up the integration")
First, you will set up the connection your apps will use to access Plant data in ACC / Forma. Follow the [APS OAuth integration setup](https://docs.viktor.ai/docs/create-apps/software-integrations/autodesk-platform-services/.md#creating-an-oauth-20-integration-admin), then [connect the same APS application to ACC](https://docs.viktor.ai/docs/create-apps/software-integrations/autodesk-platform-services/.md#integration-with-autodesk-construction-cloud-acc).
Next, check that your Plant project has been published to the AEC Data Model. Your apps will query these published data sets. Uploading a standalone DWG does not create a Plant data set. If you need to publish your project, follow Autodesk's [Query AutoCAD Plant 3D Project Data](https://aps.autodesk.com/en/docs/aecdatamodel/v1/tutorials/plant3d/query_plant3d_data) instructions.
Existing projects
Existing projects may not be processed automatically by the AEC Data Model. Publish the Plant project again, or publish an updated version, to trigger processing. Once processing is complete, [check for the published data sets in the next section](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#2-understand-the-two-plant-data-sets).
## 2. Understand the two Plant data sets[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#2-understand-the-two-plant-data-sets "Direct link to 2. Understand the two Plant data sets")
Plant 3D publishes two main data sets to the **AEC Data Model**. Each data set is represented by an **element group** with its own **element group ID**. The app uses that ID to query its records.
| Data set | What it contains |
| ---------------------- | ----------------------------------------------------------------------------------------------------------- |
| **P\&ID Data Set** | Process and instrumentation records, such as equipment, lines, valves, instruments and their relationships. |
| **3D Piping Data Set** | 3D model records, such as pipes, fittings, valves and equipment, with their published properties. |
The published data sets appear as separate entries in the ACC / Forma Files tool. A **P\&ID Data Set** looks like this:

A **3D Piping Data Set** appears alongside the published 3D drawings and folders:

Keep the default data-set names
The App Builder assumes the data sets use their default names: **P\&ID Data Set** and **3D Piping Data Set**. Do not rename these entries.
## 3. Work with selections and scope[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#3-work-with-selections-and-scope "Direct link to 3. Work with selections and scope")
The App Builder generates the inputs and code to read records through the **AEC Data Model API** and display the DWG with the **APS Viewer SDK**.
In the apps you will build:
1. Select a DWG from the Plant project's published folders using `AutodeskFileField`.
2. The App Builder uses the file's project and folder context to find the Plant publication root and discover its P\&ID and 3D Piping data sets.
3. Choose which data set to query from a dropdown.
4. Open the viewer to display the same selected DWG.
In the generated app, the DWG and data-set selections have different purposes:
| You select | The app uses it to |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
| **A DWG file in ACC / Forma** | Find the Plant publication from its project and folder context, and display that drawing in the APS viewer. |
| **A published Plant data set** | Read the equipment, pipes, valves or relationships needed for the report. These records can cover several drawings. |
### 3.1. Set the report scope[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#31-set-the-report-scope "Direct link to 3.1. Set the report scope")
The App Builder will use the scope specified in your prompt to determine which records the app retrieves:
* **Drawing scope:** records linked to one DWG (prompt 2).
* **Data-set scope:** matching records in one complete selected data set (prompts 1, 3 and 4).
* **Project scope:** records across several selected data sets in a project.
We recommend starting with drawing or data-set scope so you can verify the results more easily before expanding to several data sets (project scope).
## 4. Choose your approach[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#4-choose-your-approach "Direct link to 4. Choose your approach")
* Prompt guide
* Local development
To build your first app, click the arrow on a prompt to open it in the App Builder. Before submitting the prompt, replace `[YOUR-APS-INTEGRATION-NAME-HERE]` with the exact name of your configured integration. Connect that integration in the generated app, then follow its input and button instructions.
### Prompt 1: Review equipment across one P\&ID data set[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#prompt-1-review-equipment-across-one-pid-data-set "Direct link to Prompt 1: Review equipment across one P\&ID data set")
The first app creates an equipment inventory for one published P\&ID data set. The App Builder uses the prompt to generate the app's inputs, API queries and result views. The app queries the AEC Data Model API for Equipment and its child classes in the selected data set. You do not need to write the query yourself. Use the table to review asset IDs and Tags, and the bar chart to compare counts by concrete class: the specific equipment type, such as a pump or vessel.


### Plant 3D P\&ID equipment overview
Create a Plant 3D P\&ID equipment overview app using the Plant 3D guide in the knowledge base. Let me select an ACC 2D P\&ID DWG file with AutodeskFileField, click "Find data sets" to discover published P\&ID Data Sets, and select one. Query only Equipment class and its subclasses through the AEC Data Model API, requesting IDs, Tag, and concrete class. Display equipment records in a VIKTOR TableView and show counts by concrete class in a Plotly bar chart.
Add an APS Viewer using the APS Viewer SDK to display the selected 2D DWG. Use exactly one AutodeskFileField for both the drawing viewer and data-set discovery. Keep the equipment report scoped to the complete selected P\&ID data set. Add short vkt.Text instructions beside each input and button explaining what to select, what each button does, and the order of use. Clearly label the report scope and the drawing shown in the viewer. Use integration name "\[YOUR-APS-INTEGRATION-NAME-HERE]".
When the app is ready, select a published 2D P\&ID DWG and open the viewer first. The viewer can display the drawing before you load a data set. Its colors come from the DWG; prompt 2 adds colors based on queried properties in a 3D drawing.

Click **Find data sets**, choose a **P\&ID Data Set**, then load the equipment. Open the table to inspect Tags and classes across the selected data set.
Open the chart to compare the equipment counts by concrete class. It uses the same records as the table.

The report covers the selected data set even when the viewer shows only one of its drawings. To request a drawing-only equipment report, replace the scope instruction with: **“Retrieve only equipment linked to the selected DWG.”**
### Prompt 2: Color valves in one drawing[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#prompt-2-color-valves-in-one-drawing "Direct link to Prompt 2: Color valves in one drawing")
Build a valve review app for one 3D Plant drawing. Review valve properties in a table, compare counts by body type in a pie chart, and locate the valves by color in the APS viewer.
The table, pie chart and viewer use the same valves linked to the selected DWG. Each body type has one color, shared by the chart and viewer legend.


### Plant 3D valve overview
Create a Plant 3D valve overview using the Plant 3D guide in the App Builder and my APS OAuth 2.0 integration "\[YOUR-APS-INTEGRATION-NAME-HERE]". Let me select an ACC DWG with AutodeskFileField, click Find data sets and select its 3D Piping Data Set. Use the AEC Data Model API to retrieve only valves linked to that drawing and their PnP ID, Tag, Spec and published Valve Body Type. Show a VIKTOR table and a Plotly count pie chart grouped by body type.
Add a viewer using the APS Viewer SDK and color the drawing’s valves with the same color map as the chart. Resolve published property IDs and verified source-to-viewer mappings. Label missing body types “Not specified” and report unmapped valves. Never replace empty drawing results with the full data set. Add short vkt.Text instructions for every input and button, including the order of use and drawing scope.
When the app is ready, select the DWG and data set, then retrieve the valves. If the generated app has separate viewer setup buttons, load the available 3D views, select the display and property views, then load the viewer map. This connects the report records to the objects that can be colored.

Open the pie chart to compare valve body types in the selected drawing.

If you find “Not specified” in the results, the property is missing. If you find “Unmapped”, the report record could not be matched to a viewer object. Keep these records visible in the table even when they cannot receive a viewer color.
### Prompt 3: Prepare a data-set quantity takeoff[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#prompt-3-prepare-a-data-set-quantity-takeoff "Direct link to Prompt 3: Prepare a data-set quantity takeoff")
The next example creates a quantity takeoff app for a 3D Piping Data Set. Use it to total pipe lengths by their assigned piping specification (**Spec**) and nominal pipe size (**nominal diameter**), and count fittings and valves by concrete class. Review the quantities in VIKTOR tables and Plotly charts.
The report covers the complete selected data set, while the viewer displays one DWG.


### Plant 3D quantity takeoff
Create a Plant 3D quantity takeoff app using the Plant 3D guide in the knowledge base. Use my "\[YOUR-APS-INTEGRATION-NAME-HERE]" integration. Let me select an ACC DWG with AutodeskFileField, click Find data sets and select one 3D Piping Data Set. Query pipes, fittings and valves through the AEC Data Model API with only the properties needed for the report. Show pipe lengths grouped by Spec and nominal diameter, and component counts by concrete class, in VIKTOR tables and Plotly charts.
Add a viewer using the APS Viewer SDK for the selected DWG. Keep the report scoped to the complete selected data set, independently of the viewer drawing. Use published Length units, count each source asset once and keep missing or invalid values visible alongside valid totals. Add short vkt.Text instructions for every input and button, including the order of use and report scope.
When the app is ready, select a data set and generate the report. Inspect the contributing records and their published units before using the totals. A missing length does not remove a pipe from the record count, and an invalid value must not hide valid subtotals.

Open the pipe-length chart to compare specifications and sizes. Component counts are a separate quantity; they are not added to pipe lengths.

The component chart covers the selected data set. Its valve count can therefore differ from the drawing-only count in prompt 2.

### Prompt 4: Explore asset relationships across a data set[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#prompt-4-explore-asset-relationships-across-a-data-set "Direct link to Prompt 4: Explore asset relationships across a data set")
The final example creates an asset relationship explorer for a Plant 3D data set. Find an asset by its Tag, review related objects and their roles in a VIKTOR table, and see the connections in a Plotly diagram. Use the APS viewer to inspect the selected DWG.
The table and diagram use relationships from the selected data set. Choose how far to follow them with the depth input: one **hop** follows one relationship link, while four hops can reach objects through up to four links.


### Plant 3D asset relationship explorer
Create a Plant 3D asset relationship explorer using the Plant 3D guide in the knowledge base and integration "\[YOUR-APS-INTEGRATION-NAME-HERE]". Let me select an ACC DWG with AutodeskFileField, click Find data sets and select a published Plant 3D data set. Let me enter an asset Tag and select the matching asset if several share that Tag. Add a relationship depth input from 1 to 5 hops, defaulting to 4, and expand from each newly found peer within the same data set. Use only verified published relationship classes and endpoint roles. Avoid repeated expansion of visited assets and duplicate edges. Show both endpoints in a VIKTOR TableView with their PnP IDs, Tags, classes, roles, relationship type and hop depth.
Show the selected asset and its related objects in a Plotly diagram with distinct symbols by asset class, colors by relationship type, labelled connections and source properties on hover. Keep unresolved endpoints visible and do not infer flow direction or physical routing. Set a node limit and clearly report when results are limited. Add an independent DWG viewer using the APS Viewer SDK. Add short vkt.Text instructions for each input and button, and explain that relationships cover the selected data set while the viewer displays the selected drawing.
When the app is ready, select the DWG and data set, enter an asset Tag, then find and select the matching asset. Open the DWG viewer to inspect the drawing.

Choose how many relationship links to follow and how many objects to show, then explore the results. The table lists the related objects and their roles. Use the graph to see how they connect, and hover over an object to view its properties.

A higher depth does not guarantee more results: expansion stops when there are no new peers or the node limit is reached. The graph shows published relationships, not pipe routing or flow direction.
### Create a new VIKTOR app[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#create-a-new-viktor-app "Direct link to Create a new VIKTOR app")
tip
Want to start with the finished app? Jump to the [complete app.py](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#complete-code). The phases below build that same file step by step.
Let's build a 3D version of the equipment app from prompt 1. This example uses a **3D Piping Data Set** instead of a P\&ID Data Set. Select a 3D Plant DWG for the viewer, discover the project's published data sets, then choose a 3D Piping Data Set. Load its equipment into a table and a class-count chart. The report covers the selected data set; the viewer displays the selected 3D drawing.
Keep all Python code in one `app.py`. In later blocks, `...` marks code from an earlier phase. Keep that code instead of replacing it with dots. Highlighted lines show what you add.
[Install the VIKTOR CLI](https://docs.viktor.ai/docs/getting-started/installation/.md) if needed, then create an editor app:
```
viktor-cli create-app "Plant 3D Equipment Tutorial" --init --app-type editor --registered-name plant3d-equipment-tutorial
```
Open the new app folder in your code editor.
### Configure the app and dependencies[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#configure-the-app-and-dependencies "Direct link to Configure the app and dependencies")
Keep your registered name if you chose a different one. Replace the integration placeholder with the exact OAuth integration name configured in your VIKTOR environment:
viktor.config.toml
```
app_type = "editor"
python_version = "3.12"
registered_name = "plant3d-equipment-tutorial"
oauth2_integrations = ["[YOUR-APS-INTEGRATION-NAME-HERE]"]
```
Add these packages to `requirements.txt`:
requirements.txt
```
viktor==14.37.0
requests==2.32.5
plotly>=5.24,<7
aps-viewer-sdk==0.1.4
```
VIKTOR provides the inputs, buttons and result views. Requests reads the Autodesk APIs, Plotly creates the chart, and the APS Viewer SDK displays the DWG.
### 1. Add the inputs and app structure[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#1-add-the-inputs-and-app-structure "Direct link to 1. Add the inputs and app structure")
Start `app.py` with the imports, selection helpers and inputs below. Replace `OAUTH2_INTEGRATION` with the same integration name used in the configuration.
The file picker selects a DWG. **Find data sets** fills a separate dropdown, and **Load equipment** retrieves the report. Hidden fields keep discovered choices and report rows between button clicks. The buttons will call the Controller methods added in the next phases.
app.py
```
import json
from collections import Counter
from collections.abc import Iterator
from datetime import datetime, timezone
from typing import Any
from urllib.parse import quote
import plotly.graph_objects as go
import requests
import viktor as vkt
from aps_viewer_sdk import APSViewer
OAUTH2_INTEGRATION = "[YOUR-APS-INTEGRATION-NAME-HERE]"
NO_DATASET = "__choose_dataset__"
def selection_key(params: Any) -> list[str]:
selected = params.plant_drawing
return [selected.project_id, selected.urn, params.plant_dataset or ""] if selected else []
def dataset_choices(params: Any, **kwargs: Any) -> list[Any]:
discovery = json.loads(params.datasets_json or "{}")
selected = params.plant_drawing
key = [selected.project_id, selected.urn] if selected else []
options = discovery.get("groups", []) if discovery.get("drawing") == key else []
choices = [vkt.OptionListElement(NO_DATASET, label="Choose a data set")]
choices += [vkt.OptionListElement(item["id"], label=item["label"]) for item in options]
if params.plant_dataset and params.plant_dataset not in {item.value for item in choices}:
choices.append(vkt.OptionListElement(params.plant_dataset, label="Saved selection: click Find data sets"))
return choices
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# Plant 3D equipment overview\nReview equipment across one published 3D Piping Data Set. The drawing viewer is independent.")
drawing_help = vkt.Text("**1. Select a drawing.** Browse to a published Plant DWG in ACC. This file supplies the project context and the viewer.")
plant_drawing = vkt.AutodeskFileField("ACC DWG", oauth2_integration=OAUTH2_INTEGRATION)
discover_help = vkt.Text("**2. Find data sets.** Discover the 3D Piping Data Sets published for this Plant project.")
find = vkt.SetParamsButton("Find data sets", method="find_datasets", longpoll=True)
dataset_help = vkt.Text("**3. Select one data set.** Equipment records and class counts cover this complete data set, not only the selected drawing.")
plant_dataset = vkt.OptionField("3D Piping Data Set", options=dataset_choices, default=NO_DATASET)
load_help = vkt.Text("**4. Load equipment.** Read equipment IDs, Tags and concrete classes, then open the table or chart. Load again after changing a source selection.")
load = vkt.SetParamsButton("Load equipment", method="load_equipment", longpoll=True)
viewer_help = vkt.Text("**Drawing viewer.** Open Selected drawing after choosing a DWG. The viewer works without loading equipment; it does not restrict the report.")
status_text = vkt.HiddenField("Status")
status = vkt.OutputField("Report status", value=vkt.Lookup("status_text"))
datasets_json = vkt.HiddenField("Data set choices")
report_json = vkt.HiddenField("Equipment report")
class Controller(vkt.Controller):
parametrization = Parametrization
```
### 2. Connect to the Autodesk APIs[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#2-connect-to-the-autodesk-apis "Direct link to 2. Connect to the Autodesk APIs")
Add these constants and functions above `selection_key()`. `gql()` sends a request to the AEC Data Model API. `pages()` follows each returned cursor so the app reads all matching records.
app.py
```
...
AEC_GRAPHQL_URL = "https://developer.api.autodesk.com/aec/graphql"
PUBLICATION_FOLDERS = {"pid_dwg", "plant_3d_models"}
DATASET_NAMES = {"3D Piping Data Set"}
HUBS_QUERY = 'query PlantHubs($pagination: PaginationInput) { hubs(pagination: $pagination) { pagination { cursor } results { id } } }'
PROJECTS_QUERY = 'query PlantProjects($hubId: ID!, $pagination: PaginationInput) { projects(hubId: $hubId, pagination: $pagination) { pagination { cursor } results { id alternativeIdentifiers { dataManagementAPIProjectId } } } }'
FOLDERS_QUERY = 'query PlantFolders($projectId: ID!, $folderId: ID!, $pagination: PaginationInput) { foldersByFolder(projectId: $projectId, folderId: $folderId, pagination: $pagination) { pagination { cursor } results { id name } } }'
GROUPS_QUERY = 'query PlantDatasetGroups( $projectId: ID!, $folderId: ID!, $filter: ElementGroupFilterInput, $pagination: PaginationInput ) { elementGroupsByFolder( projectId: $projectId, folderId: $folderId, filter: $filter, pagination: $pagination ) { pagination { cursor } results { id name alternativeIdentifiers { fileUrn fileVersionUrn } } } }'
DEFINITIONS_QUERY = 'query PlantDefinitions($groupId: ID!, $pagination: PaginationInput) { propertyDefinitionsByElementGroup( elementGroupId: $groupId, pagination: $pagination ) { pagination { cursor } results { id name specification units { name } } } }'
ELEMENTS_QUERY = 'query PlantElements( $groupId: ID!, $filter: ElementFilterInput, $pagination: PaginationInput, $propertyFilter: PropertyFilterInput ) { elementsByElementGroup( elementGroupId: $groupId, filter: $filter, pagination: $pagination ) { pagination { cursor } results { id name alternativeIdentifiers { externalElementId } properties(filter: $propertyFilter, pagination: {limit: 100}) { pagination { cursor } results { name value displayValue definition { id name specification units { name } } } } } } }'
PROPERTIES_QUERY = 'query PlantProperties( $elementId: ID!, $propertyFilter: PropertyFilterInput, $pagination: PaginationInput ) { elementAtTip(elementId: $elementId) { properties(filter: $propertyFilter, pagination: $pagination) { pagination { cursor } results { name value displayValue definition { id name specification units { name } } } } } }'
def gql( query: str, token: str, region: str, variables: dict[str, Any] ) -> dict[str, Any]:
response = requests.post(
AEC_GRAPHQL_URL,
headers={
"Authorization": f"Bearer {token}",
"Content-Type": "application/json",
"Region": region,
},
json={"query": query, "variables": variables},
timeout=60,
)
response.raise_for_status()
body = response.json()
if body.get("errors"):
messages = [error.get("message", "Unknown error") for error in body["errors"]]
raise RuntimeError("AEC query failed: " + "; ".join(messages))
data = body.get("data")
if not isinstance(data, dict):
raise RuntimeError("AEC query returned no data object.")
return data
def pages( query: str, path: tuple[str, ...], token: str, region: str, variables: dict[str, Any], limit: int = 25, cursor: str | None = None, ) -> Iterator[dict[str, Any]]:
seen = {cursor} if cursor else set()
while True:
pagination: dict[str, Any] = {"limit": limit}
if cursor:
pagination["cursor"] = cursor
block = gql(query, token, region, {**variables, "pagination": pagination})
for key in path:
block = block[key]
if not isinstance(block, dict) or not isinstance(block.get("results"), list):
raise RuntimeError("AEC query returned no result page.")
yield from block["results"]
cursor = block["pagination"]["cursor"]
if not cursor:
return
if cursor in seen:
raise RuntimeError("AEC query returned a repeated cursor.")
seen.add(cursor)
```
### 3. Find the published data sets[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#3-find-the-published-data-sets "Direct link to 3. Find the published data sets")
Add these module functions above `selection_key()`. They locate the selected DWG's Plant project and find its published 3D Piping Data Sets. This discovery reads publication metadata; it does not load the project's equipment records.
app.py
```
...
def dm_get(path: str, token: str) -> dict[str, Any]:
response = requests.get(
"https://developer.api.autodesk.com/data/v1/" + path,
headers={"Authorization": f"Bearer {token}"}, timeout=60,
)
response.raise_for_status()
return response.json()
def parent_id(resource: dict[str, Any]) -> str | None:
parent = resource.get("relationships", {}).get("parent", {}).get("data")
return parent.get("id") if isinstance(parent, dict) else None
def plant_root(selected: Any, token: str) -> str:
prefix = f"projects/{quote(selected.project_id, safe='')}/"
item = dm_get(prefix + "items/" + quote(selected.urn, safe=""), token)["data"]
folder_id = parent_id(item)
seen: set[str] = set()
while folder_id and len(seen) < 12:
if folder_id in seen:
raise vkt.UserError("The drawing folder path contains a cycle.")
seen.add(folder_id)
folder = dm_get(prefix + "folders/" + quote(folder_id, safe=""), token)["data"]
parent = parent_id(folder)
if folder["attributes"]["name"].casefold() in PUBLICATION_FOLDERS:
if not parent:
break
return parent
folder_id = parent
raise vkt.UserError(
"Select a published DWG below PID_DWG or Plant_3D_Models. "
"This app cannot locate a Plant project for this file."
)
def aec_project_id(token: str, region: str, dm_project_id: str) -> str:
for hub in pages(HUBS_QUERY, ("hubs",), token, region, {}, limit=20):
for project in pages(
PROJECTS_QUERY, ("projects",), token, region, {"hubId": hub["id"]}, limit=20,
):
alternative = project.get("alternativeIdentifiers") or {}
if alternative.get("dataManagementAPIProjectId") == dm_project_id:
return project["id"]
raise vkt.UserError("The selected ACC project is not available in AEC Data Model.")
def discover_datasets(params: Any, token: str) -> tuple[str, list[dict[str, Any]]]:
selected = params.plant_drawing
if not selected:
raise vkt.UserError("Select a Plant drawing first.")
version = selected.get_latest_version(token)
if not str(version.attributes.get("displayName", "")).lower().endswith(".dwg"):
raise vkt.UserError("Select a Plant DWG file.")
region = selected.get_region(token)
root_id = plant_root(selected, token)
project_id = aec_project_id(token, region, selected.project_id)
groups: dict[str, dict[str, Any]] = {}
for folder in pages(
FOLDERS_QUERY, ("foldersByFolder",), token, region,
{"projectId": project_id, "folderId": root_id},
):
if folder["name"].casefold() not in PUBLICATION_FOLDERS:
continue
for group in pages(
GROUPS_QUERY, ("elementGroupsByFolder",), token, region,
{"projectId": project_id, "folderId": folder["id"],
"filter": {"searchType": "ALL"}},
):
if group["name"] in DATASET_NAMES:
groups[group["id"]] = {**group, "folderName": folder["name"]}
if not groups:
raise vkt.UserError("No published Plant data set was found for this drawing's project.")
return region, list(groups.values())
```
Now add `find_datasets()` inside the existing Controller. It saves the choices for the dropdown and clears the previous report when discovery runs again:
app.py
```
class Parametrization(vkt.Parametrization):
...
class Controller(vkt.Controller):
parametrization = Parametrization
...
def find_datasets(self, params: Any, **kwargs: Any) -> Any:
token = vkt.external.OAuth2Integration(OAUTH2_INTEGRATION).get_access_token()
region, groups = discover_datasets(params, token)
drawing = params.plant_drawing
choices = [{"id": group["id"], "label": f"{group['folderName']} / {group['name']}"} for group in groups]
return vkt.SetParamsResult({
"datasets_json": json.dumps({"drawing": [drawing.project_id, drawing.urn], "region": region, "groups": choices}),
"plant_dataset": NO_DATASET,
"report_json": "{}",
"status_text": "Select a 3D Piping Data Set, then click Load equipment.",
})
```
### 4. Load equipment from the selected data set[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#4-load-equipment-from-the-selected-data-set "Direct link to 4. Load equipment from the selected data set")
Add these module functions above `selection_key()`. The first reads the published property dictionary. The second retrieves matching elements and follows both element and property pages.
app.py
```
...
def definitions(token: str, region: str, group_id: str) -> list[dict[str, Any]]:
return list(pages(
DEFINITIONS_QUERY, ("propertyDefinitionsByElementGroup",), token, region,
{"groupId": group_id}, limit=100,
))
def elements( token: str, region: str, group_id: str, rsql: str | None = None, verified_display_names: list[str] | None = None, page_size: int = 25, ) -> list[dict[str, Any]]:
property_filter = {"names": verified_display_names} if verified_display_names is not None else None
variables = {
"groupId": group_id,
"filter": {"query": rsql} if rsql else None,
"propertyFilter": property_filter,
}
output: dict[str, dict[str, Any]] = {}
for element in pages(
ELEMENTS_QUERY, ("elementsByElementGroup",), token, region, variables, limit=page_size,
):
block = element["properties"]
properties = list(block["results"])
cursor = block["pagination"]["cursor"]
if cursor:
properties.extend(pages(
PROPERTIES_QUERY, ("elementAtTip", "properties"), token, region,
{"elementId": element["id"], "propertyFilter": property_filter},
limit=100, cursor=cursor,
))
if not properties:
raise RuntimeError(
"An element has no extracted properties. Check the property filter and publication."
)
element["properties"] = {"results": properties}
if element["id"] in output and output[element["id"]] != element:
raise RuntimeError("An element changed during extraction. Run the scan again.")
output[element["id"]] = element
return list(output.values())
```
Add the following property and identity helpers below them. They read values by their full property ID, identify the concrete class and count each logical equipment asset once.
app.py
```
...
def property_id(key: str) -> str:
return f"autodesk.plant3d.parameter:{key}-1.0.0"
def literal(value: str) -> str:
return "'" + value.replace("\\", "\\\\").replace("'", "\\'") + "'"
def selector(key: str) -> str:
return "property.id." + property_id(key)
def class_filter(class_token: str) -> str:
return f"{selector('tableNames')}=contains={literal(class_token)}"
def property_record(element: dict[str, Any], definition_id: str) -> dict[str, Any] | None:
matches = [
prop for prop in element["properties"]["results"]
if prop["definition"]["id"] == definition_id
]
if len(matches) > 1:
raise ValueError(f"Ambiguous property {definition_id} on {element['id']}.")
return matches[0] if matches else None
def raw(element: dict[str, Any], key: str) -> Any:
prop = property_record(element, property_id(key))
return prop["value"] if prop else None
def missing_value(value: Any) -> bool:
return value is None or (isinstance(value, str) and value.strip().lower() in {"", "null"})
def class_name(element: dict[str, Any]) -> str | None:
value = raw(element, "pnpClassName")
if not missing_value(value):
return str(value).strip()
chain = raw(element, "tableNames")
if isinstance(chain, str) and not missing_value(chain):
return next((part.strip() for part in chain.split(",") if part.strip()), None)
value = raw(element, "className")
return None if missing_value(value) else str(value).strip()
def plant_id(value: Any) -> str | None:
if isinstance(value, bool):
return None
if isinstance(value, int):
return str(value) if value > 0 else None
if isinstance(value, str) and value.isascii() and value.isdigit() and int(value) > 0:
return str(int(value))
return None
def unique_assets(rows: list[dict[str, Any]]) -> dict[str, dict[str, Any]]:
result: dict[str, dict[str, Any]] = {}
for row in rows:
key = plant_id(raw(row, "pnpId"))
if key is None:
raise ValueError(f"Missing or invalid pnpId on {row['id']}.")
if key in result and result[key]["id"] != row["id"]:
raise ValueError(f"More than one element has pnpId {key} in this group.")
result[key] = row
return result
```
The equipment query uses `Table Names` with `=contains=` because that property contains an object's class inheritance chain. This includes Equipment and its child classes.
Add `load_equipment()` inside Controller. It requests the identity, class and Tag properties, then saves the rows for the table and chart:
app.py
```
class Parametrization(vkt.Parametrization):
...
class Controller(vkt.Controller):
parametrization = Parametrization
...
def load_equipment(self, params: Any, **kwargs: Any) -> Any:
drawing = params.plant_drawing
discovery = json.loads(params.datasets_json or "{}")
key = [drawing.project_id, drawing.urn] if drawing else []
if not key or discovery.get("drawing") != key:
raise vkt.UserError("Select a DWG and click Find data sets.")
group = next((item for item in discovery.get("groups", []) if item["id"] == params.plant_dataset), None)
if group is None:
raise vkt.UserError("Select a discovered 3D Piping Data Set.")
token = vkt.external.OAuth2Integration(OAUTH2_INTEGRATION).get_access_token()
dictionary = definitions(token, discovery["region"], group["id"])
required = {property_id(key) for key in ("pnpId", "pnpClassName", "tableNames")}
if required - {item["id"] for item in dictionary}:
raise vkt.UserError("The data set is missing Plant identity or class definitions.")
wanted = required | {property_id("tag"), property_id("className")}
names = sorted({item["name"] for item in dictionary if item["id"] in wanted})
source = elements(token, discovery["region"], group["id"], class_filter("Equipment"), names, page_size=500)
rows = [{"id": row["id"], "pnp_id": raw(row, "pnpId"), "tag": raw(row, "tag"), "class": class_name(row)}
for row in unique_assets(source).values()]
missing = " Tag is not published." if property_id("tag") not in {item["id"] for item in dictionary} else ""
report = {"selection": selection_key(params), "label": group["label"], "rows": rows,
"loaded_at": datetime.now(timezone.utc).isoformat(), "note": missing}
return vkt.SetParamsResult({"report_json": json.dumps(report), "status_text": f"Data set scope: {group['label']} | {len(rows)} equipment records.{missing}"})
```
### 5. Add the equipment table and chart[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#5-add-the-equipment-table-and-chart "Direct link to 5. Add the equipment table and chart")
Add these methods inside the same Controller. `loaded()` checks that the saved report matches the current selections. Both views use those same saved rows, so switching tabs does not repeat the Autodesk query.
app.py
```
class Parametrization(vkt.Parametrization):
...
class Controller(vkt.Controller):
parametrization = Parametrization
...
def loaded(self, params: Any) -> dict[str, Any]:
report = json.loads(params.report_json or "{}")
if report and report.get("selection") != selection_key(params):
raise vkt.UserError("Source selection changed. Find data sets and load equipment again.")
return report
@vkt.TableView("Equipment records - data set", duration_guess=1)
def equipment_table(self, params: Any, **kwargs: Any) -> Any:
report = self.loaded(params)
rows = [[row["id"], row["pnp_id"], row["tag"], row["class"]] for row in report.get("rows", [])]
if not rows:
message = "No equipment found in the selected data set." if report else "Select a data set and click Load equipment."
rows = [[None, None, None, message]]
return vkt.TableResult(rows, column_headers=["AEC ID", "PnP ID", "Tag", "Concrete class"])
@vkt.PlotlyView("Equipment counts - data set", duration_guess=1)
def equipment_chart(self, params: Any, **kwargs: Any) -> Any:
report = self.loaded(params)
counts = Counter(row["class"] or "Not specified" for row in report.get("rows", []))
labels = sorted(counts, key=lambda label: (-counts[label], label))
figure = go.Figure(go.Bar(x=labels, y=[counts[label] for label in labels], text=[counts[label] for label in labels],
textposition="outside", marker_color="#007bc2"))
figure.update_layout(title="Equipment count by concrete class", template="plotly_white",
xaxis_title="Concrete class", yaxis_title="Equipment count", yaxis={"dtick": 1})
if not report:
figure.add_annotation(text="Select a data set and click Load equipment.", showarrow=False, x=0.5, y=0.5, xref="paper", yref="paper")
elif not counts:
figure.add_annotation(text="No equipment found in the selected data set.", showarrow=False, x=0.5, y=0.5, xref="paper", yref="paper")
return vkt.PlotlyResult(figure.to_json())
```
### 6. Add the independent drawing viewer[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#6-add-the-independent-drawing-viewer "Direct link to 6. Add the independent drawing viewer")
Add this WebView method inside Controller. It only needs the selected DWG and a current access token. It can display the model before data-set discovery or equipment loading.
app.py
```
class Parametrization(vkt.Parametrization):
...
class Controller(vkt.Controller):
parametrization = Parametrization
...
@vkt.WebView("Selected drawing - independent", duration_guess=20)
def drawing(self, params: Any, **kwargs: Any) -> Any:
selected = params.plant_drawing
if not selected:
return vkt.WebResult(html="Select an ACC DWG to open the drawing viewer.
")
token = vkt.external.OAuth2Integration(OAUTH2_INTEGRATION).get_access_token()
version = selected.get_latest_version(token)
if not str(version.attributes.get("displayName", "")).lower().endswith(".dwg"):
raise vkt.UserError("Select a DWG file.")
viewer = APSViewer(urn=version.urn, token=token, region=selected.get_region(token), views_selector=True)
return vkt.WebResult(html=viewer.write())
```
This viewer uses the DWG's source colors. Prompt 2 adds the record-to-viewer mapping needed to apply colors from queried properties.
### 7. Run the app[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#7-run-the-app "Direct link to 7. Run the app")
After adding all the code, run this command from your app folder:
```
viktor-cli clean-start
```
Open the development URL printed by the CLI, then:
1. Connect your configured Autodesk integration.
2. Select a published Plant DWG in ACC.
3. Open **Selected drawing** and choose **3D View** to inspect the model first.
4. Click **Find data sets** and select one **3D Piping Data Set**.
5. Click **Load equipment**, then open the equipment table and chart.



After changing a source selection, find the data sets and load the equipment again. Empty equipment results remain valid results; they do not trigger a broader project scan.
### Complete code[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#complete-code "Direct link to Complete code")
Show complete app.py
app.py
```
import json
from collections import Counter
from collections.abc import Iterator
from datetime import datetime, timezone
from typing import Any
from urllib.parse import quote
import plotly.graph_objects as go
import requests
import viktor as vkt
from aps_viewer_sdk import APSViewer
OAUTH2_INTEGRATION = "[YOUR-APS-INTEGRATION-NAME-HERE]"
NO_DATASET = "__choose_dataset__"
AEC_GRAPHQL_URL = "https://developer.api.autodesk.com/aec/graphql"
PUBLICATION_FOLDERS = {"pid_dwg", "plant_3d_models"}
DATASET_NAMES = {"3D Piping Data Set"}
HUBS_QUERY = 'query PlantHubs($pagination: PaginationInput) { hubs(pagination: $pagination) { pagination { cursor } results { id } } }'
PROJECTS_QUERY = 'query PlantProjects($hubId: ID!, $pagination: PaginationInput) { projects(hubId: $hubId, pagination: $pagination) { pagination { cursor } results { id alternativeIdentifiers { dataManagementAPIProjectId } } } }'
FOLDERS_QUERY = 'query PlantFolders($projectId: ID!, $folderId: ID!, $pagination: PaginationInput) { foldersByFolder(projectId: $projectId, folderId: $folderId, pagination: $pagination) { pagination { cursor } results { id name } } }'
GROUPS_QUERY = 'query PlantDatasetGroups( $projectId: ID!, $folderId: ID!, $filter: ElementGroupFilterInput, $pagination: PaginationInput ) { elementGroupsByFolder( projectId: $projectId, folderId: $folderId, filter: $filter, pagination: $pagination ) { pagination { cursor } results { id name alternativeIdentifiers { fileUrn fileVersionUrn } } } }'
DEFINITIONS_QUERY = 'query PlantDefinitions($groupId: ID!, $pagination: PaginationInput) { propertyDefinitionsByElementGroup( elementGroupId: $groupId, pagination: $pagination ) { pagination { cursor } results { id name specification units { name } } } }'
ELEMENTS_QUERY = 'query PlantElements( $groupId: ID!, $filter: ElementFilterInput, $pagination: PaginationInput, $propertyFilter: PropertyFilterInput ) { elementsByElementGroup( elementGroupId: $groupId, filter: $filter, pagination: $pagination ) { pagination { cursor } results { id name alternativeIdentifiers { externalElementId } properties(filter: $propertyFilter, pagination: {limit: 100}) { pagination { cursor } results { name value displayValue definition { id name specification units { name } } } } } } }'
PROPERTIES_QUERY = 'query PlantProperties( $elementId: ID!, $propertyFilter: PropertyFilterInput, $pagination: PaginationInput ) { elementAtTip(elementId: $elementId) { properties(filter: $propertyFilter, pagination: $pagination) { pagination { cursor } results { name value displayValue definition { id name specification units { name } } } } } }'
def gql( query: str, token: str, region: str, variables: dict[str, Any] ) -> dict[str, Any]:
response = requests.post(
AEC_GRAPHQL_URL,
headers={
"Authorization": f"Bearer {token}",
"Content-Type": "application/json",
"Region": region,
},
json={"query": query, "variables": variables},
timeout=60,
)
response.raise_for_status()
body = response.json()
if body.get("errors"):
messages = [error.get("message", "Unknown error") for error in body["errors"]]
raise RuntimeError("AEC query failed: " + "; ".join(messages))
data = body.get("data")
if not isinstance(data, dict):
raise RuntimeError("AEC query returned no data object.")
return data
def pages( query: str, path: tuple[str, ...], token: str, region: str, variables: dict[str, Any], limit: int = 25, cursor: str | None = None, ) -> Iterator[dict[str, Any]]:
seen = {cursor} if cursor else set()
while True:
pagination: dict[str, Any] = {"limit": limit}
if cursor:
pagination["cursor"] = cursor
block = gql(query, token, region, {**variables, "pagination": pagination})
for key in path:
block = block[key]
if not isinstance(block, dict) or not isinstance(block.get("results"), list):
raise RuntimeError("AEC query returned no result page.")
yield from block["results"]
cursor = block["pagination"]["cursor"]
if not cursor:
return
if cursor in seen:
raise RuntimeError("AEC query returned a repeated cursor.")
seen.add(cursor)
def dm_get(path: str, token: str) -> dict[str, Any]:
response = requests.get(
"https://developer.api.autodesk.com/data/v1/" + path,
headers={"Authorization": f"Bearer {token}"}, timeout=60,
)
response.raise_for_status()
return response.json()
def parent_id(resource: dict[str, Any]) -> str | None:
parent = resource.get("relationships", {}).get("parent", {}).get("data")
return parent.get("id") if isinstance(parent, dict) else None
def plant_root(selected: Any, token: str) -> str:
prefix = f"projects/{quote(selected.project_id, safe='')}/"
item = dm_get(prefix + "items/" + quote(selected.urn, safe=""), token)["data"]
folder_id = parent_id(item)
seen: set[str] = set()
while folder_id and len(seen) < 12:
if folder_id in seen:
raise vkt.UserError("The drawing folder path contains a cycle.")
seen.add(folder_id)
folder = dm_get(prefix + "folders/" + quote(folder_id, safe=""), token)["data"]
parent = parent_id(folder)
if folder["attributes"]["name"].casefold() in PUBLICATION_FOLDERS:
if not parent:
break
return parent
folder_id = parent
raise vkt.UserError(
"Select a published DWG below PID_DWG or Plant_3D_Models. "
"This app cannot locate a Plant project for this file."
)
def aec_project_id(token: str, region: str, dm_project_id: str) -> str:
for hub in pages(HUBS_QUERY, ("hubs",), token, region, {}, limit=20):
for project in pages(
PROJECTS_QUERY, ("projects",), token, region, {"hubId": hub["id"]}, limit=20,
):
alternative = project.get("alternativeIdentifiers") or {}
if alternative.get("dataManagementAPIProjectId") == dm_project_id:
return project["id"]
raise vkt.UserError("The selected ACC project is not available in AEC Data Model.")
def discover_datasets(params: Any, token: str) -> tuple[str, list[dict[str, Any]]]:
selected = params.plant_drawing
if not selected:
raise vkt.UserError("Select a Plant drawing first.")
version = selected.get_latest_version(token)
if not str(version.attributes.get("displayName", "")).lower().endswith(".dwg"):
raise vkt.UserError("Select a Plant DWG file.")
region = selected.get_region(token)
root_id = plant_root(selected, token)
project_id = aec_project_id(token, region, selected.project_id)
groups: dict[str, dict[str, Any]] = {}
for folder in pages(
FOLDERS_QUERY, ("foldersByFolder",), token, region,
{"projectId": project_id, "folderId": root_id},
):
if folder["name"].casefold() not in PUBLICATION_FOLDERS:
continue
for group in pages(
GROUPS_QUERY, ("elementGroupsByFolder",), token, region,
{"projectId": project_id, "folderId": folder["id"],
"filter": {"searchType": "ALL"}},
):
if group["name"] in DATASET_NAMES:
groups[group["id"]] = {**group, "folderName": folder["name"]}
if not groups:
raise vkt.UserError("No published Plant data set was found for this drawing's project.")
return region, list(groups.values())
def definitions(token: str, region: str, group_id: str) -> list[dict[str, Any]]:
return list(pages(
DEFINITIONS_QUERY, ("propertyDefinitionsByElementGroup",), token, region,
{"groupId": group_id}, limit=100,
))
def elements( token: str, region: str, group_id: str, rsql: str | None = None, verified_display_names: list[str] | None = None, page_size: int = 25, ) -> list[dict[str, Any]]:
property_filter = {"names": verified_display_names} if verified_display_names is not None else None
variables = {
"groupId": group_id,
"filter": {"query": rsql} if rsql else None,
"propertyFilter": property_filter,
}
output: dict[str, dict[str, Any]] = {}
for element in pages(
ELEMENTS_QUERY, ("elementsByElementGroup",), token, region, variables, limit=page_size,
):
block = element["properties"]
properties = list(block["results"])
cursor = block["pagination"]["cursor"]
if cursor:
properties.extend(pages(
PROPERTIES_QUERY, ("elementAtTip", "properties"), token, region,
{"elementId": element["id"], "propertyFilter": property_filter},
limit=100, cursor=cursor,
))
if not properties:
raise RuntimeError(
"An element has no extracted properties. Check the property filter and publication."
)
element["properties"] = {"results": properties}
if element["id"] in output and output[element["id"]] != element:
raise RuntimeError("An element changed during extraction. Run the scan again.")
output[element["id"]] = element
return list(output.values())
def property_id(key: str) -> str:
return f"autodesk.plant3d.parameter:{key}-1.0.0"
def literal(value: str) -> str:
return "'" + value.replace("\\", "\\\\").replace("'", "\\'") + "'"
def selector(key: str) -> str:
return "property.id." + property_id(key)
def class_filter(class_token: str) -> str:
return f"{selector('tableNames')}=contains={literal(class_token)}"
def property_record(element: dict[str, Any], definition_id: str) -> dict[str, Any] | None:
matches = [
prop for prop in element["properties"]["results"]
if prop["definition"]["id"] == definition_id
]
if len(matches) > 1:
raise ValueError(f"Ambiguous property {definition_id} on {element['id']}.")
return matches[0] if matches else None
def raw(element: dict[str, Any], key: str) -> Any:
prop = property_record(element, property_id(key))
return prop["value"] if prop else None
def missing_value(value: Any) -> bool:
return value is None or (isinstance(value, str) and value.strip().lower() in {"", "null"})
def class_name(element: dict[str, Any]) -> str | None:
value = raw(element, "pnpClassName")
if not missing_value(value):
return str(value).strip()
chain = raw(element, "tableNames")
if isinstance(chain, str) and not missing_value(chain):
return next((part.strip() for part in chain.split(",") if part.strip()), None)
value = raw(element, "className")
return None if missing_value(value) else str(value).strip()
def plant_id(value: Any) -> str | None:
if isinstance(value, bool):
return None
if isinstance(value, int):
return str(value) if value > 0 else None
if isinstance(value, str) and value.isascii() and value.isdigit() and int(value) > 0:
return str(int(value))
return None
def unique_assets(rows: list[dict[str, Any]]) -> dict[str, dict[str, Any]]:
result: dict[str, dict[str, Any]] = {}
for row in rows:
key = plant_id(raw(row, "pnpId"))
if key is None:
raise ValueError(f"Missing or invalid pnpId on {row['id']}.")
if key in result and result[key]["id"] != row["id"]:
raise ValueError(f"More than one element has pnpId {key} in this group.")
result[key] = row
return result
def selection_key(params: Any) -> list[str]:
selected = params.plant_drawing
return [selected.project_id, selected.urn, params.plant_dataset or ""] if selected else []
def dataset_choices(params: Any, **kwargs: Any) -> list[Any]:
discovery = json.loads(params.datasets_json or "{}")
selected = params.plant_drawing
key = [selected.project_id, selected.urn] if selected else []
options = discovery.get("groups", []) if discovery.get("drawing") == key else []
choices = [vkt.OptionListElement(NO_DATASET, label="Choose a data set")]
choices += [vkt.OptionListElement(item["id"], label=item["label"]) for item in options]
if params.plant_dataset and params.plant_dataset not in {item.value for item in choices}:
choices.append(vkt.OptionListElement(params.plant_dataset, label="Saved selection: click Find data sets"))
return choices
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# Plant 3D equipment overview\nReview equipment across one published 3D Piping Data Set. The drawing viewer is independent.")
drawing_help = vkt.Text("**1. Select a drawing.** Browse to a published Plant DWG in ACC. This file supplies the project context and the viewer.")
plant_drawing = vkt.AutodeskFileField("ACC DWG", oauth2_integration=OAUTH2_INTEGRATION)
discover_help = vkt.Text("**2. Find data sets.** Discover the 3D Piping Data Sets published for this Plant project.")
find = vkt.SetParamsButton("Find data sets", method="find_datasets", longpoll=True)
dataset_help = vkt.Text("**3. Select one data set.** Equipment records and class counts cover this complete data set, not only the selected drawing.")
plant_dataset = vkt.OptionField("3D Piping Data Set", options=dataset_choices, default=NO_DATASET)
load_help = vkt.Text("**4. Load equipment.** Read equipment IDs, Tags and concrete classes, then open the table or chart. Load again after changing a source selection.")
load = vkt.SetParamsButton("Load equipment", method="load_equipment", longpoll=True)
viewer_help = vkt.Text("**Drawing viewer.** Open Selected drawing after choosing a DWG. The viewer works without loading equipment; it does not restrict the report.")
status_text = vkt.HiddenField("Status")
status = vkt.OutputField("Report status", value=vkt.Lookup("status_text"))
datasets_json = vkt.HiddenField("Data set choices")
report_json = vkt.HiddenField("Equipment report")
class Controller(vkt.Controller):
parametrization = Parametrization
def find_datasets(self, params: Any, **kwargs: Any) -> Any:
token = vkt.external.OAuth2Integration(OAUTH2_INTEGRATION).get_access_token()
region, groups = discover_datasets(params, token)
drawing = params.plant_drawing
choices = [{"id": group["id"], "label": f"{group['folderName']} / {group['name']}"} for group in groups]
return vkt.SetParamsResult({
"datasets_json": json.dumps({"drawing": [drawing.project_id, drawing.urn], "region": region, "groups": choices}),
"plant_dataset": NO_DATASET,
"report_json": "{}",
"status_text": "Select a 3D Piping Data Set, then click Load equipment.",
})
def load_equipment(self, params: Any, **kwargs: Any) -> Any:
drawing = params.plant_drawing
discovery = json.loads(params.datasets_json or "{}")
key = [drawing.project_id, drawing.urn] if drawing else []
if not key or discovery.get("drawing") != key:
raise vkt.UserError("Select a DWG and click Find data sets.")
group = next((item for item in discovery.get("groups", []) if item["id"] == params.plant_dataset), None)
if group is None:
raise vkt.UserError("Select a discovered 3D Piping Data Set.")
token = vkt.external.OAuth2Integration(OAUTH2_INTEGRATION).get_access_token()
dictionary = definitions(token, discovery["region"], group["id"])
required = {property_id(key) for key in ("pnpId", "pnpClassName", "tableNames")}
if required - {item["id"] for item in dictionary}:
raise vkt.UserError("The data set is missing Plant identity or class definitions.")
wanted = required | {property_id("tag"), property_id("className")}
names = sorted({item["name"] for item in dictionary if item["id"] in wanted})
source = elements(token, discovery["region"], group["id"], class_filter("Equipment"), names, page_size=500)
rows = [{"id": row["id"], "pnp_id": raw(row, "pnpId"), "tag": raw(row, "tag"), "class": class_name(row)}
for row in unique_assets(source).values()]
missing = " Tag is not published." if property_id("tag") not in {item["id"] for item in dictionary} else ""
report = {"selection": selection_key(params), "label": group["label"], "rows": rows,
"loaded_at": datetime.now(timezone.utc).isoformat(), "note": missing}
return vkt.SetParamsResult({"report_json": json.dumps(report), "status_text": f"Data set scope: {group['label']} | {len(rows)} equipment records.{missing}"})
def loaded(self, params: Any) -> dict[str, Any]:
report = json.loads(params.report_json or "{}")
if report and report.get("selection") != selection_key(params):
raise vkt.UserError("Source selection changed. Find data sets and load equipment again.")
return report
@vkt.TableView("Equipment records - data set", duration_guess=1)
def equipment_table(self, params: Any, **kwargs: Any) -> Any:
report = self.loaded(params)
rows = [[row["id"], row["pnp_id"], row["tag"], row["class"]] for row in report.get("rows", [])]
if not rows:
message = "No equipment found in the selected data set." if report else "Select a data set and click Load equipment."
rows = [[None, None, None, message]]
return vkt.TableResult(rows, column_headers=["AEC ID", "PnP ID", "Tag", "Concrete class"])
@vkt.PlotlyView("Equipment counts - data set", duration_guess=1)
def equipment_chart(self, params: Any, **kwargs: Any) -> Any:
report = self.loaded(params)
counts = Counter(row["class"] or "Not specified" for row in report.get("rows", []))
labels = sorted(counts, key=lambda label: (-counts[label], label))
figure = go.Figure(go.Bar(x=labels, y=[counts[label] for label in labels], text=[counts[label] for label in labels],
textposition="outside", marker_color="#007bc2"))
figure.update_layout(title="Equipment count by concrete class", template="plotly_white",
xaxis_title="Concrete class", yaxis_title="Equipment count", yaxis={"dtick": 1})
if not report:
figure.add_annotation(text="Select a data set and click Load equipment.", showarrow=False, x=0.5, y=0.5, xref="paper", yref="paper")
elif not counts:
figure.add_annotation(text="No equipment found in the selected data set.", showarrow=False, x=0.5, y=0.5, xref="paper", yref="paper")
return vkt.PlotlyResult(figure.to_json())
@vkt.WebView("Selected drawing - independent", duration_guess=20)
def drawing(self, params: Any, **kwargs: Any) -> Any:
selected = params.plant_drawing
if not selected:
return vkt.WebResult(html="Select an ACC DWG to open the drawing viewer.
")
token = vkt.external.OAuth2Integration(OAUTH2_INTEGRATION).get_access_token()
version = selected.get_latest_version(token)
if not str(version.attributes.get("displayName", "")).lower().endswith(".dwg"):
raise vkt.UserError("Select a DWG file.")
viewer = APSViewer(urn=version.urn, token=token, region=selected.get_region(token), views_selector=True)
return vkt.WebResult(html=viewer.write())
```
## Next steps[](https://docs.viktor.ai/docs/tutorials/integrate-plant3d/.md#next-steps "Direct link to Next steps")
Use these apps as a starting point for your own Plant 3D tasks. Ask the App Builder to review different assets or properties, change how results are grouped, or color objects by another property. Make one change at a time and check the results. Specify which drawings or data sets the report should cover.
Continue with the [Autodesk Forma / ACC tutorial](https://docs.viktor.ai/docs/tutorials/integrate-autodesk-construction-cloud/.md) or explore the other [VIKTOR tutorials](https://docs.viktor.ai/docs/tutorials/.md).
---
# Tutorial - Creating and analyzing a SCIA model
note
Estimated time: 60 minutes
* [](https://www.viktor.ai/start-building-apps)
## Introduction[](https://docs.viktor.ai/docs/tutorials/integrate-scia/.md#introduction "Direct link to Introduction")
This tutorial explains how a SCIA model can be created within VIKTOR, which can be used for analysis using an external coupling. The SCIA model that we will be constructing consists of a foundation slab with piles.
* The starting app for this tutorial can be downloaded [here](https://docs.viktor.ai/files/docs/scia-tutorial.zip).
* The end result can be downloaded [here](https://docs.viktor.ai/files/docs/scia-tutorial-complete.zip).
Before you can use the starting app, you first need to register it on the VIKTOR platform. Open a terminal and run:
```
viktor-cli create-app "SCIA tutorial"
```
Note the registered name printed by the command. Extract the downloaded starting app zip and open `viktor.config.toml` and add the `registered_name` with the name of the app ('scia-tutorial'). From within the app folder, install and start the app:
```
viktor-cli clean-start
```
In the browser, click the "Example" entity to open its editor and verify the app is installed and running as expected.
## Folder structure[](https://docs.viktor.ai/docs/tutorials/integrate-scia/.md#folder-structure "Direct link to Folder structure")
The app has the following folder structure:
```
scia-tutorial
├── app.py
├── model.esa
├── requirements.txt
└── viktor.config.toml
```
caution
The example template SCIA file (model.esa) in this tutorial has been made in SCIA 19.0. The file cannot be opened nor run with versions < 19.0 (and is not guaranteed to work for > 19.0).
If you are using a version of SCIA other than 19.0, a template file must be created for (and the worker must run) this specific version. This can be done with the following procedure:
1. Open a new project in your SCIA version of choice
2. Make sure that the material that will be used is present in the materials library
3. Setup the XML I/O document to export the desired results (see the [SCIA documentation](https://help.scia.net/19.0/en/pod/optimiser/xml_documents.htm))
4. Save the empty file as *model.esa*
5. Replace the existing esa file with the just created one in the foundation folder
Open `app.py` and have a look at the code that we have set up for you. Note that the code already creates an empty SCIA model and some basic class structure. We will extend the code and add specific SCIA objects, step-by-step, throughout this tutorial.
## Creating the corner nodes[](https://docs.viktor.ai/docs/tutorials/integrate-scia/.md#creating-the-corner-nodes "Direct link to Creating the corner nodes")
If we assume that one of the corner points is located in the origin, the other three corner point locations can easily be calculated using `width_x` and `width_y`. Open `app.py` and add the following code `create_scia_model`:
```
def create_scia_model(self, params) -> vkt.scia.SciaModel:
model = vkt.scia.SciaModel()
'''
STRUCTURE
'''
# create nodes at the slab corners
width_x = params.geometry.slab.width_x * 1e-03
width_y = params.geometry.slab.width_y * 1e-03
n1 = model.create_node('n1', 0, 0, 0) # origin
n2 = model.create_node('n2', 0, width_y, 0)
n3 = model.create_node('n3', width_x, width_y, 0)
n4 = model.create_node('n4', width_x, 0, 0)
return model
```
note
The corner nodes are defined in **clockwise direction**, since this order will be used later to create a 3D extrusion object.
While setting up a SCIA model in VIKTOR, the 3D visualization is a very helpful feature to verify that the written logic does indeed create the model as desired. Therefore, we will extend `create_visualization_geometries` to get and show the just created nodes. This can easily be done by calling the `nodes` attribute of the `SciaModel`:
```
def create_visualization_geometries(self, params, scia_model):
geometries = []
for node in scia_model.nodes:
node_obj = vkt.Sphere(vkt.Point(node.x, node.y, node.z), params.geometry.slab.width_y * 1e-05)
node_obj.material = vkt.Material('node', color=vkt.Color(0, 255, 0))
geometries.append(node_obj)
return geometries
```
 *Corner nodes*
## Creating the piles[](https://docs.viktor.ai/docs/tutorials/integrate-scia/.md#creating-the-piles "Direct link to Creating the piles")
For the purpose of this tutorial, some parameters like the number of piles and the distance between the piles and the edge are fixed. The locations of these piles however, depend on the dimensions of the slab:
```
...
import numpy as np
import itertools
def create_scia_model(self, params) -> vkt.scia.Model:
...
# create the pile nodes
number_of_piles_x = 4
number_of_piles_y = 3
pile_edge_distance = 0.3
pile_length = params.geometry.piles.length
start_x = pile_edge_distance
end_x = width_x - pile_edge_distance
x = np.linspace(start_x, end_x, number_of_piles_x)
start_y = pile_edge_distance
end_y = width_y - pile_edge_distance
y = np.linspace(start_y, end_y, number_of_piles_y)
pile_positions = np.array(list(itertools.product(x, y)))
pile_top_nodes = []
pile_bottom_nodes = []
for pile_id, (pile_x, pile_y) in enumerate(pile_positions, 1):
n_top = model.create_node(f'K:p{pile_id}_t', pile_x, pile_y, 0)
n_bottom = model.create_node(f'K:p{pile_id}_b', pile_x, pile_y, -pile_length)
pile_top_nodes.append(n_top)
pile_bottom_nodes.append(n_bottom)
return model
```
Since we already loop through all the nodes in the `create_visualization_geometries` method (`for node in scia_model.nodes:`), the nodes located at the pile ends will automatically be visualized when the app is (automatically) restarted.
 *Pile nodes*
The top and bottom nodes of the piles can now be used along with the pile diameter defined in the `Parametrization` to create a circular cross-section and beam elements. The cross-section in turn needs a `SciaMaterial` as input, which **needs to be defined in the .esa model** that is used.
note
The `Material` from the SCIA package is imported with a different name to prevent conflicts with the `Material` import from `viktor.geometry`.
```
def create_scia_model(self, params) -> vkt.scia.Model:
...
# create pile beams
pile_diameter = params.geometry.piles.diameter * 1e-03
material = vkt.scia.Material(0, 'C30/37')
cross_section = model.create_circular_cross_section('concrete_pile', material, pile_diameter)
pile_beams = []
for pile_id, (n_top, n_bottom) in enumerate(zip(pile_top_nodes, pile_bottom_nodes), 1):
pile_beam = model.create_beam(n_top, n_bottom, cross_section)
pile_beams.append(pile_beam)
return model
```
For the visualization of the piles, a [`CircularExtrusion`](https://docs.viktor.ai/sdk/api/geometry/.md#_CircularExtrusion) is used. This object needs a diameter and [`Line`](https://docs.viktor.ai/sdk/api/geometry/.md#_Line) object which specifies the direction of the beam in terms of a start and end [`Point`](https://docs.viktor.ai/sdk/api/geometry/.md#_Point).
```
def create_visualization_geometries(self, params, scia_model):
...
# pile beams
pile_diameter = params.geometry.piles.diameter * 1e-03
for beam in scia_model.beams:
point_top = vkt.Point(beam.begin_node.x, beam.begin_node.y, beam.begin_node.z)
point_bottom = vkt.Point(beam.end_node.x, beam.end_node.y, beam.end_node.z)
beam_obj = vkt.CircularExtrusion(pile_diameter, vkt.Line(point_top, point_bottom))
beam_obj.material = vkt.Material('beam', roughness=1, opacity=0.3)
geometries.append(beam_obj)
...
```
 *Pile beams*
## Creating the slab[](https://docs.viktor.ai/docs/tutorials/integrate-scia/.md#creating-the-slab "Direct link to Creating the slab")
The corner nodes that were created earlier can be used to create the concrete slab object. Extend the `create_scia_model` method with the following lines:
```
def create_scia_model(self, params) -> vkt.scia.Model:
...
# create the concrete slab
material = vkt.scia.Material(0, 'concrete_slab')
thickness = params.geometry.slab.thickness * 1e-03
corner_nodes = [n1, n2, n3, n4]
slab = model.create_plane(corner_nodes, thickness, name='foundation slab', material=material)
return model
```
Again we can verify the position and dimensions of the created slab by means of visualization:
```
def create_visualization_geometries(self, params, scia_model):
...
corner_points = [
vkt.Point(scia_model.nodes[0].x, scia_model.nodes[0].y, scia_model.nodes[0].z),
vkt.Point(scia_model.nodes[1].x, scia_model.nodes[1].y, scia_model.nodes[1].z),
vkt.Point(scia_model.nodes[2].x, scia_model.nodes[2].y, scia_model.nodes[2].z),
vkt.Point(scia_model.nodes[3].x, scia_model.nodes[3].y, scia_model.nodes[3].z),
vkt.Point(scia_model.nodes[0].x, scia_model.nodes[0].y, scia_model.nodes[0].z)
]
thickness = params.geometry.slab.thickness * 1e-03
slab_obj = vkt.Extrusion(corner_points, vkt.Line(vkt.Point(0, 0, -thickness/2), vkt.Point(0, 0, thickness/2)))
slab_obj.material = vkt.Material('slab', roughness=1, opacity=0.3)
geometries.append(slab_obj)
...
```
 *Slab*
## Creating the supports[](https://docs.viktor.ai/docs/tutorials/integrate-scia/.md#creating-the-supports "Direct link to Creating the supports")
Since the foundation will be completely underground, the following supports have to be attached:
1. Point supports ([`PointSupport`](https://docs.viktor.ai/sdk/api/external/scia/.md#_PointSupport)) at the bottom of each pile:
```
def create_scia_model(self, params) -> vkt.scia.Model:
...
'''
SUPPORTS
'''
# create pile point supports
freedom_v = (
vkt.scia.PointSupport.Freedom.FREE,
vkt.scia.PointSupport.Freedom.FREE,
vkt.scia.PointSupport.Freedom.FLEXIBLE,
vkt.scia.PointSupport.Freedom.FREE,
vkt.scia.PointSupport.Freedom.FREE,
vkt.scia.PointSupport.Freedom.FREE
)
kv = 400 * 1e06
stiffness_v = (0, 0, kv, 0, 0, 0)
for pile_id, pile_beam in enumerate(pile_beams, 1):
n_bottom = pile_beam.end_node
model.create_point_support(f'Sn:p{pile_id}', n_bottom, vkt.scia.PointSupport.Type.STANDARD,
freedom_v, stiffness_v, vkt.scia.PointSupport.CSys.GLOBAL)
return model
```
2. Line supports ([`LineSupport`](https://docs.viktor.ai/sdk/api/external/scia/.md#_LineSupport)) on the piles:
```
def create_scia_model(self, params) -> vkt.scia.Model:
...
# create pile line supports
kh = 10 * 1e06
for pile_id, pile_beam in enumerate(pile_beams, 1):
model.create_line_support_on_beam(pile_beam, x=vkt.scia.LineSupport.Freedom.FLEXIBLE, stiffness_x = kh,
y=vkt.scia.LineSupport.Freedom.FLEXIBLE, stiffness_y = kh,
z=vkt.scia.LineSupport.Freedom.FREE, rx=vkt.scia.LineSupport.Freedom.FREE,
ry=vkt.scia.LineSupport.Freedom.FREE, rz=vkt.scia.LineSupport.Freedom.FREE,
c_sys=vkt.scia.LineSupport.CSys.GLOBAL)
return model
```
3. Line supports ([`LineSupport`](https://docs.viktor.ai/sdk/api/external/scia/.md#_LineSupport)) on the slab edges:
```
def create_scia_model(self, params) -> vkt.scia.Model:
...
# create the slab supports
stiffness_x = 50 * 1e06
stiffness_y = 50 * 1e06
for edge in (1, 3):
model.create_line_support_on_plane((slab, edge),
x=vkt.scia.LineSupport.Freedom.FLEXIBLE, stiffness_x=stiffness_x,
y=vkt.scia.LineSupport.Freedom.FREE,
z=vkt.scia.LineSupport.Freedom.FREE,
rx=vkt.scia.LineSupport.Freedom.FREE,
ry=vkt.scia.LineSupport.Freedom.FREE,
rz=vkt.scia.LineSupport.Freedom.FREE)
for edge in (2, 4):
model.create_line_support_on_plane((slab, edge),
x=vkt.scia.LineSupport.Freedom.FREE,
y=vkt.scia.LineSupport.Freedom.FLEXIBLE, stiffness_y=stiffness_y,
z=vkt.scia.LineSupport.Freedom.FREE,
rx=vkt.scia.LineSupport.Freedom.FREE,
ry=vkt.scia.LineSupport.Freedom.FREE,
rz=vkt.scia.LineSupport.Freedom.FREE)
return model
```
## Creating the load combinations[](https://docs.viktor.ai/docs/tutorials/integrate-scia/.md#creating-the-load-combinations "Direct link to Creating the load combinations")
Adding a load combination to the SCIA model is done in three steps, similarly as in the SCIA interface:
1. Create a load group ([`LoadGroup`](https://docs.viktor.ai/sdk/api/external/scia/.md#_LoadGroup))
2. Create a load case ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#_LoadCase))
3. Create a load combination ([`LoadCombination`](https://docs.viktor.ai/sdk/api/external/scia/.md#_LoadCombination))
```
def create_scia_model(self, params) -> vkt.scia.Model:
...
'''
SETS
'''
# create the load group
lg = model.create_load_group('LG1', vkt.scia.LoadGroup.LoadOption.VARIABLE, vkt.scia.LoadGroup.RelationOption.STANDARD,
vkt.scia.LoadGroup.LoadTypeOption.CAT_G)
# create the load case
lc = model.create_variable_load_case('LC1', 'first load case', lg, vkt.scia.LoadCase.VariableLoadType.STATIC,
vkt.scia.LoadCase.Specification.STANDARD, vkt.scia.LoadCase.Duration.SHORT)
# create the load combination
load_cases = {
lc: 1
}
model.create_load_combination('C1', vkt.scia.LoadCombination.Type.ENVELOPE_SERVICEABILITY, load_cases)
return model
```
## Creating the load(s)[](https://docs.viktor.ai/docs/tutorials/integrate-scia/.md#creating-the-loads "Direct link to Creating the load(s)")
The last component of a complete SCIA model is the actual load that is applied on the structure. In this example, a simple uniform surface load is placed on the slab:
```
def create_scia_model(self, params) -> vkt.scia.Model:
...
'''
LOADS
'''
# create the load
force = params.loads.input.uniform_load * 1e03
force *= -1 # in negative Z-direction
model.create_surface_load('SF:1', lc, slab, vkt.scia.SurfaceLoad.Direction.Z, vkt.scia.SurfaceLoad.Type.FORCE, force,
vkt.scia.SurfaceLoad.CSys.GLOBAL, vkt.scia.SurfaceLoad.Location.LENGTH)
return model
```
## Downloading the SCIA model[](https://docs.viktor.ai/docs/tutorials/integrate-scia/.md#downloading-the-scia-model "Direct link to Downloading the SCIA model")
It is always helpful to generate the XML representation of the SCIA model and to manually load this input in the SCIA interface. This will help in verifying that, for example, all the loads are defined correctly in terms of placement and magnitude. In the app we will add a feature to download the necessary files.
In order to be able to view the created model in the SCIA interface, the following three files are needed:
1. Empty SCIA model (`*.esa`)
2. Definition file (`*.def`)
3. Input file (`*.xml`)
Now let's fill the download methods that we defined earlier in `Foundation`:
```
from pathlib import Path
...
class Foundation(vkt.Controller):
...
def download_scia_input_esa(self, params, **kwargs):
scia_input_esa = self.get_scia_input_esa()
return vkt.DownloadResult(scia_input_esa, 'model.esa')
def download_scia_input_xml(self, params, **kwargs):
scia_model = self.create_scia_model(params)
input_xml, _ = scia_model.generate_xml_input()
return vkt.DownloadResult(input_xml, 'test.xml')
def download_scia_input_def(self, params, **kwargs):
m = vkt.scia.Model()
_, input_def = m.generate_xml_input()
return vkt.DownloadResult(input_def, 'viktor.xml.def')
def get_scia_input_esa(self) -> vkt.File:
return vkt.File.from_path(Path(__file__).parent / 'model.esa')
```
note
pathlib's `Path` object is VIKTOR's [recommended](https://docs.viktor.ai/docs/create-apps/managing-files/.md) way of defining a path.
You can now download the files from within VIKTOR.
## Viewing the model in SCIA[](https://docs.viktor.ai/docs/tutorials/integrate-scia/.md#viewing-the-model-in-scia "Direct link to Viewing the model in SCIA")
caution
SCIA 19.0 is required if using the example file.
When the files are obtained, the empty .esa model can be opened in SCIA. This model will now be updated with the created input .xml file. In SCIA Engineer:
1. Click on `File` -> `Update` -> `XML file`
2. Select the `test.xml` file
note
It is important that the .xml and the .def files are located in the same directory, and the filename of the .def should not be changed. If this name is changed, make sure to also change the reference to this .def file in the input .xml file.
The updated SCIA model should look like this:
 *SCIA model generated by VIKTOR*
## Set up integration with SCIA[](https://docs.viktor.ai/docs/tutorials/integrate-scia/.md#set-up-integration-with-scia "Direct link to Set up integration with SCIA")
### Install SCIA worker[](https://docs.viktor.ai/docs/tutorials/integrate-scia/.md#install-scia-worker "Direct link to Install SCIA worker")
Follow these steps to install the worker:
* Personal worker
* Organization worker
A personal worker connects the SCIA installation on your own machine, for your own use. Personal workers are installed and managed with [VIKTOR Desktop](https://docs.viktor.ai/docs/create-apps/software-integrations/viktor-desktop/.md):
1. [Download and install VIKTOR Desktop](https://docs.viktor.ai/docs/create-apps/software-integrations/viktor-desktop/.md#download-and-install-viktor-desktop) and log in with your VIKTOR account, if you haven't done so already
2. In VIKTOR Desktop, click "Add" and select **SCIA**
3. Start the worker. You can view its logs inside VIKTOR Desktop, and the editor shows when your worker is online
note
SCIA workers that were installed with the previous per-worker installer keep running, but new personal workers can only be added through [VIKTOR Desktop](https://docs.viktor.ai/docs/create-apps/software-integrations/viktor-desktop/.md#migrate-existing-workers-to-viktor-desktop).
An organization worker connects a SCIA installation on a machine managed by your organization, such as a virtual or remote machine, and is shared by the users of the app instance(s) you select.
caution
You need to be an environment administrator in order to install an organization worker.
1. Navigate to the "Integrations" tab in the Administrator panel
2. Click "Add integration"
3. Follow the steps provided in the modal

3.1. Select **SCIA**
3.2. Select the app instance(s) the integration should be available to
3.3. Download the worker .msi (Microsoft Installer) and run it on the machine of choice
3.4. Copy the generated **connection key** and paste it when the installer asks for it
Connection Key
The generated connection key **should be copied immediately** as VIKTOR will not preserve this data for security reasons.
### Add the Python code to run SCIA[](https://docs.viktor.ai/docs/tutorials/integrate-scia/.md#add-the-python-code-to-run-scia "Direct link to Add the Python code to run SCIA")
The three files that are used for the verification above, can now be used as input for the external analysis.
note
An I/O document has to be defined in the `.esa` file, which has to be named "output". If not defined, the worker will not be able to write this expected document and fails to execute.
In this example, the empty `model.esa` has the following structure of the I/O document:
 *I/O document of the esa model*
Let's create a second view, which is a combination of geometry and data (results). Set the duration of this view to 60 seconds, which indicates that it concerns a long-running job with a manual update button. This button will be connected to the SCIA analysis:
```
class Foundation(vkt.Controller):
...
@vkt.GeometryAndDataView("SCIA result", duration_guess=60, x_axis_to_right=True)
def run_scia(self, params, **kwargs):
scia_model = self.create_scia_model(params)
# create input files
input_xml, input_def = scia_model.generate_xml_input()
input_esa = self.get_scia_input_esa()
# analyze SCIA model
scia_analysis = vkt.scia.SciaAnalysis(input_xml, input_def, input_esa)
scia_analysis.execute(300) # timeout after 5 minutes
data_result = vkt.DataGroup()
geometries = self.create_visualization_geometries(params, scia_model)
return vkt.GeometryAndDataResult(geometries, data_result)
```
After execution, the result can easily be called and parsed as desired.
The "Reactions" results (defined in the I/O document) of the load combination C1 can be parsed from the analysis result using the provided output parser as is shown in the snippet below:
```
class Foundation(vkt.Controller):
...
@vkt.GeometryAndDataView(...)
def run_scia(self, params, **kwargs):
scia_model = self.create_scia_model(params)
# create input files
input_xml, input_def = scia_model.generate_xml_input()
input_esa = self.get_scia_input_esa()
# analyze SCIA model
scia_analysis = vkt.scia.SciaAnalysis(input_xml, input_def, input_esa)
scia_analysis.execute(300) # timeout after 5 minutes
scia_result = scia_analysis.get_xml_output_file()
# parse analysis result
result = vkt.scia.OutputFileParser.get_result(scia_result, "Reactions", parent='Combinations - C1')
reactions = result['Nodal reactions']
max_rz = float(max(reactions['R_z']))
data_result = vkt.DataGroup(
vkt.DataItem('SCIA results', ' ', subgroup=vkt.DataGroup(
vkt.DataItem('Maximum pile reaction', max_rz, suffix='N', number_of_decimals=2)
))
)
geometries = self.create_visualization_geometries(params, scia_model)
return vkt.GeometryAndDataResult(geometries, data_result)
```
The pile reactions as seen from within the SCIA interface show a maximum of 3.3 kN (depending on your load input):
 *SCIA analysis result in SCIA*
From the result obtained in VIKTOR we can validate that we indeed obtained the maximum reaction force of this load combination:
 *SCIA analysis result obtained in VIKTOR*
---
# Tutorial - Integrate STAAD.Pro
note
Estimated time: 55 minutes
Difficulty level: Intermediate
* [](https://www.viktor.ai/start-building-apps)
## Introduction[](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#introduction "Direct link to Introduction")
STAAD.Pro is one of the most widely used software tools for structural engineering. It offers a range of features for modeling and design, along with a robust API called OpenSTAAD that enables you to automate a workflow. In this tutorial, you will learn how to create a VIKTOR web app that integrates STAAD.Pro behind the scenes.
Here are the main sections we will cover:
1. [Build a VIKTOR app.](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#create-a-new-viktor-app)
2. [Create a simple parametric model.](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#lets-create-our-3d-model)
3. [Calculate the member end forces of your model.](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#working-with-openstaad-in-python)
4. [Display the member end forces in your VIKTOR app.](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#lets-integrate-the-worker-in-our-viktor-app)
Here is a sneak peek at how the app will look:

### Prerequisites and downloads[](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#prerequisites-and-downloads "Direct link to Prerequisites and downloads")
PREREQUISITES
You have [installed VIKTOR](https://docs.viktor.ai/docs/getting-started/installation/.md) on your computer
You have some experience with reading Python code
You have some experience with STAAD.Pro
Before using the OpenSTAAD API in Python, ensure you have the official Bentley [`openstaadpy`](https://github.com/BentleySystems/openstaadpy) package installed in your *main Python development environment*. If it is not installed, you can add it using pip:
```
pip install git+https://github.com/BentleySystems/openstaadpy.git
```
## Create a new VIKTOR app[](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#create-a-new-viktor-app "Direct link to Create a new VIKTOR app")
Let's create, install and start an empty app. This will be the starting point for the rest of the tutorial. But before we start, make sure to shut down any app that is running (like the demo app) by closing the command-line shell (for example Powershell) or end the process using `Ctrl + C`.
Follow these steps to create, install and start an empty app:
1. Open a terminal and run the following command to create the app on the VIKTOR platform and generate the initial code locally:
```
viktor-cli create-app sample-staad-integration --init --app-type editor
```
2. Open the newly created folder in your code editor and run `viktor-cli clean-start` in the terminal to install dependencies and connect the app to the platform.
If all went well, your empty app is installed and connected to your development workspace. **Do not close the terminal** as this will break the connection with your app. The terminal in your code editor should show something like this:
```
INFO : Connecting to cloud.viktor.ai...
INFO : Connection is established (use Ctrl+C to close)
INFO :
INFO : Navigate to the link below to see your app in the browser
INFO : https://cloud.viktor.ai/workspaces/XXX/app
INFO :
INFO : App code loaded, waiting for jobs...
```
RE-STARTING YOUR APP
You only need to create an app template and install it once for each new app you want to make. as long as you don't close the terminal or your code editor, the app will update automatically once you save code in `app.py`. Did you close your code editor? Use `viktor-cli start` to start the app again. No need to install, clear, etc.
### Configure the VIKTOR app[](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#configure-the-viktor-app "Direct link to Configure the VIKTOR app")
Before we start building the app logic, let's configure the `viktor.config.toml` file to declare the Python worker integration. Open the `viktor.config.toml` file in your project and make sure it includes the following configuration:
```
app_type = "editor"
python_version = "3.13"
registered_name = "sample-staad-integration"
worker_integrations = [
"python",
]
```
The `worker_integrations` key tells VIKTOR that this app will use a Python worker to execute external scripts. This is essential for running STAAD.Pro analysis through the worker environment.
### Let's define a simple frame[](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#lets-define-a-simple-frame "Direct link to Let's define a simple frame")
To create a basic steel structure, we use a parametric method by setting the frame's `length` and `height` as adjustable variables. The `create_frame_data` function defines the frame's topology through **nodes** and **lines** to represent its geometry. By modifying the `length` and `height`, we can produce various configurations of the frame.
In the following sections, we will demonstrate how this function integrates with the `Controller` class, activated when new inputs are provided by the `Parametrization` class. You can extend your `app.py` to look something like this:
```
import viktor as vkt
import json
def create_frame_data(length, height, cross_section="IPE400"):
nodes = {
1: {"node_id": 1, "x": 0, "z": 0, "y": 0},
2: {"node_id": 2, "x": 0, "z": length, "y": 0},
3: {"node_id": 3, "x": 0, "z": 0, "y": height},
4: {"node_id": 4, "x": 0, "z": length, "y": height},
5: {"node_id": 5, "x": length, "z": 0, "y": 0},
6: {"node_id": 6, "x": length, "z": length, "y": 0},
7: {"node_id": 7, "x": length, "z": 0, "y": height},
8: {"node_id": 8, "x": length, "z": length, "y": height},
}
lines = {
1: {"line_id": 1, "node_i": 1, "node_j": 3},
2: {"line_id": 2, "node_i": 2, "node_j": 4},
3: {"line_id": 3, "node_i": 3, "node_j": 4},
4: {"line_id": 4, "node_i": 6, "node_j": 8},
5: {"line_id": 5, "node_i": 5, "node_j": 7},
6: {"line_id": 6, "node_i": 3, "node_j": 7},
7: {"line_id": 7, "node_i": 4, "node_j": 8},
8: {"line_id": 8, "node_i": 7, "node_j": 8},
9: {"line_id": 9, "node_i": 1, "node_j": 4},
10: {"line_id": 10, "node_i": 5, "node_j": 8},
}
return nodes, lines, cross_section
class Parametrization(vkt.Parametrization):
pass
class Controller(vkt.Controller):
parametrization = Parametrization
```
## Let's create our 3D model[](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#lets-create-our-3d-model "Direct link to Let's create our 3D model")
VIKTOR makes it easy to create various types of input fields for your application logic. You can use text fields, number fields, option fields, and many more to gather information from the user. You can find all available input components in the [VIKTOR documentation](https://docs.viktor.ai/docs/create-apps/user-input/.md). This range of components lets you build clear and structured user interfaces without complex coding.
The inputs defined in your `Parametrization` class are automatically available in the `params` object. You can retrieve a field's value, such as `frame_length`, by calling `params.frame_length`. This way, the parameter definitions stay decoupled from the rest of your logic, and you can easily access or modify the user input throughout your code.
Now that we have our input fields, components, and our function to create the structure's topology, the next step is to build a 3D model of the frame, as shown in the code below. For this, we also use a convenient component called `GeometryView`. You can find more information about working with 3D geometry in VIKTOR in the [documentation](https://docs.viktor.ai/docs/create-apps/results-and-visualizations/threed-model/.md).
```
import viktor as vkt
import json
from io import BytesIO
from pathlib import Path
from viktor.geometry import Point, Line, RectangularExtrusion
def create_frame_data(length, height, cross_section="IPE400"):
...
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# STAAD.Pro - Member End Forces App")
inputs_title = vkt.Text("""## Frame Geometry
Fill in the following parameters to create the steel structure:"""
)
frame_length = vkt.NumberField("Frame Length", min=0.3, default=8, suffix="m")
frame_height = vkt.NumberField("Frame Height", min=1, default=6, suffix="m")
line_break = vkt.LineBreak()
section_title = vkt.Text("""## Frame Cross-Section
Select a cross section for the frame elements:"""
)
cross_sect = vkt.OptionField(
"Cross-Section", options=["IPE400", "IPE200"], default="IPE400"
)
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.GeometryView("3D Model", duration_guess=1, x_axis_to_right=True)
def create_render(self, params, **kwargs):
nodes, lines, _ = create_frame_data(
length=params.frame_length,
height=params.frame_height,
cross_section=params.cross_sect,
)
sections_group = []
for line_id, line_data in lines.items():
node_i = nodes[line_data["node_i"]]
node_j = nodes[line_data["node_j"]]
point_i = vkt.Point(node_i["x"], node_i["z"], node_i["y"])
point_j = vkt.Point(node_j["x"], node_j["z"], node_j["y"])
line = vkt.Line(point_i, point_j)
section_size = float(params.cross_sect[3:]) / 1000
section = vkt.RectangularExtrusion(
section_size, section_size, line, identifier=str(line_id)
)
sections_group.append(section)
return vkt.GeometryResult(geometry=sections_group)
```
Great! You can now modify the frame's dimensions and select a different cross-section, and the model will update to reflect the new geometry. Your browser should display an app that looks like this:

Since you're here to learn how to integrate STAAD.Pro, let's move on and start using the OpenSTAAD API!
## Working with OpenSTAAD in Python[](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#working-with-openstaad-in-python "Direct link to Working with OpenSTAAD in Python")
Let's create a new Python file called `run_staad_model.py` in the same directory and add the `run_staad` function. This function contains the logic to create our STAAD.Pro model using Python. The first step is to initialize the program with `subprocess` and then connect to STAAD.Pro using the official Bentley [`openstaadpy`](https://github.com/BentleySystems/openstaadpy) package. Copy the snippet below, and make sure to update the `staad_path` to match your STAAD.Pro version. You can run this code in **your Python environment**, and it will launch STAAD.Pro and connect you to the OpenSTAAD API.
info
If STAAD.Pro is running on a remote server, the `staad_path` needs to match the STAAD.Pro location on the server where the worker is running.
For older STAAD.Pro versions (<2025), use the COM-based workflow with `pywin32` and `comtypes` instead of `openstaadpy`. You can find a complete guide [here](https://www.viktor.ai/blog/186/how-to-use-python-to-automate-staad-pro).
```
import json
import subprocess
import time
from datetime import datetime
from pathlib import Path
from openstaadpy import os_analytical
def run_staad() -> None:
# Replace with your version and file path.
staad_path = Path(r"C:\Program Files\Bentley\Engineering\STAAD.Pro 2025\STAAD\Bentley.Staad.exe")
if not staad_path.is_file():
raise FileNotFoundError(f"STAAD.Pro executable was not found at: {staad_path}")
# Launch STAAD.Pro
staad_process = subprocess.Popen([str(staad_path)])
print(f"Launching STAAD.Pro from: {staad_path}")
time.sleep(30)
# Connect to OpenSTAAD using openstaadpy
staad = os_analytical.connect()
staad.SetSilentMode(True)
```
### Create the structure in STAAD.Pro[](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#create-the-structure-in-staadpro "Direct link to Create the structure in STAAD.Pro")
Next, let's extend the `run_staad` function to add nodes, beams, and supports. We'll load the nodes and lines geometry from the `inputs.json` file, then create the nodes and beams in STAAD.Pro, followed by defining the material properties and the cross-section for the frame. Here's how all this looks in code:
```
def run_staad() -> None:
# Define constants for units and settings
length_unit_meter = 4
force_unit_kilonewton = 5
section_table_european = 7
# Launch STAAD.Pro and connect as before...
# Load input data
input_path = Path.cwd() / "inputs.json"
with input_path.open(encoding="utf-8") as json_file:
nodes, lines, section_name = json.load(json_file)
# Convert node and line IDs to integers
nodes = {int(node_id): values for node_id, values in nodes.items()}
lines = {int(line_id): values for line_id, values in lines.items()}
# Create a new STAAD file
timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
std_file_path = Path.cwd() / f"Structure_{timestamp}.std"
staad.NewSTAADFile(str(std_file_path), length_unit_meter, force_unit_kilonewton)
time.sleep(8)
# Get geometry, property, support, and load objects
geometry = staad.Geometry
prop = staad.Property
support = staad.Support
load = staad.Load
# Create nodes
for node_id, coordinates in nodes.items():
geometry.CreateNode(
int(node_id),
float(coordinates["x"]),
float(coordinates["y"]),
float(coordinates["z"])
)
# Create beams
for line_id, line_data in lines.items():
geometry.CreateBeam(
int(line_id),
int(line_data["node_i"]),
int(line_data["node_j"])
)
# Create beam property from section table
property_id = prop.CreateBeamPropertyFromTable(
section_table_european, section_name, 0, 0.0, 0.0
)
member_ids = list(lines.keys())
# Assign material and property to all members
raw_property = prop._property
raw_property.SetMaterialName("STEEL")
for member_id in member_ids:
raw_property.AssignBeamProperty(int(member_id), property_id)
raw_property.AssignMaterialToMember("STEEL", int(member_id))
# Create supports
fixed_support_id = support.CreateSupportFixed()
for node_id in [1, 2, 5, 6]:
support._support.AssignSupportToNode(int(node_id), fixed_support_id)
```
### Run the analysis[](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#run-the-analysis "Direct link to Run the analysis")
Now you can save the model and run the analysis. By default, we will create a load case that includes only the self-weight of the structure. After the analysis, we can extract the member end forces and save the results in a `.json` file to be used later in our VIKTOR app.
```
def run_staad():
# Previous code...
# Define constants
self_weight_direction_global_y = 2
results_local = 0
start_end = 0
final_end = 1
# Create load case and add self-weight
load_case = load.CreateNewPrimaryLoad("Self Weight")
load.SetLoadActive(load_case)
load.AddSelfWeightInXYZ(self_weight_direction_global_y, -1.0)
# Update structure before analysis
staad.UpdateStructure()
time.sleep(2)
# Run analysis
staad.Command.PerformAnalysis(6)
time.sleep(2)
# Save model
staad.SaveModel(True)
time.sleep(2)
# Start analysis
staad.Analyze()
# Wait for analysis to complete with timeout
analysis_deadline = time.time() + 300
while staad.IsAnalyzing():
if time.time() > analysis_deadline:
raise TimeoutError("STAAD.Pro analysis did not finish within the timeout.")
print("...Analyzing")
time.sleep(2)
time.sleep(3)
# Check analysis status
analysis_status = staad.GetAnalysisStatus()
print(f"Analysis status: {analysis_status}")
if analysis_status["ReturnValue"] not in [2, 3]:
raise RuntimeError(f"STAAD.Pro analysis did not complete successfully: {analysis_status}")
time.sleep(3)
# Extract results
output = staad.Output
# GetMemberEndForces returns FX, FY, FZ, MX, MY, and MZ (in order)
end_forces = [
output.GetMemberEndForces(int(line_id), final_end, int(load_case), results_local)
for line_id in lines
]
end_headers = [f"Beam:{lines[line_id]['line_id']}/Node:{lines[line_id]['node_j']}" for line_id in lines]
# Retrieve start forces and headers
start_forces = [
output.GetMemberEndForces(int(line_id), start_end, int(load_case), results_local)
for line_id in lines
]
start_headers = [f"Beam:{lines[line_id]['line_id']}/Node:{lines[line_id]['node_i']}" for line_id in lines]
# Combine forces and headers
forces = end_forces + start_forces
headers = end_headers + start_headers
# Save to JSON file
output_path = Path.cwd() / "output.json"
with output_path.open("w", encoding="utf-8") as json_file:
json.dump({"forces": forces, "headers": headers}, json_file)
# Clean up
staad.Quit()
staad_process.terminate()
# Run the function
if __name__ == "__main__":
run_staad()
```
After running your `run_staad_model.py` in your Python environment, you should end up with a model like the following:

## Let's Integrate the worker in our VIKTOR app[](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#lets-integrate-the-worker-in-our-viktor-app "Direct link to Let's Integrate the worker in our VIKTOR app")
A worker is a simple program that lets you connect the app you have in the cloud to a server on which in this case STAAD.Pro and Python can run to execute scripts and analyses on models. Once we have a worker set up, we can connect our app! If you do not have access to a server with STAAD.Pro on it, do not worry, you can replicate this process on your local machine for the development of your applications.
Don't have the worker installed yet?
The connection between VIKTOR and STAAD.Pro is managed by the generic worker. You can install the worker on your local machine to test the integration by following **[this guide](https://docs.viktor.ai/docs/create-apps/software-integrations/staadpro/.md)**.
### Set up the worker environment[](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#set-up-the-worker-environment "Direct link to Set up the worker environment")
Before running the worker, make sure that the Python environment on your worker machine (local or remote) has the necessary dependencies installed. Install the `openstaadpy` package in your worker environment:
```
pip install git+https://github.com/BentleySystems/openstaadpy.git
```
### Integrate the worker in the Controller[](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#integrate-the-worker-in-the-controller "Direct link to Integrate the worker in the Controller")
In the `Controller` of our VIKTOR app, we need to set up the communication with the worker. To call the worker, we use the `PythonAnalysis` class, which allows us to send inputs (files and objects) to the worker. In this example, we will send the `inputs.json` and `run_staad_model.py` to be executed in the Python environment set up for the worker. This environment can be on your own computer or a remote server. When `run_staad_model.py` is executed, it will generate the `output.json` file, and the worker will handle transferring this file from the server environment to our VIKTOR app. Here's how it looks in the code:
```
import json
from io import BytesIO
from pathlib import Path
from viktor.core import File
from viktor.external.python import PythonAnalysis
class Controller(vkt.Controller):
# Previous code...
@vkt.TableView("Member End Forces", duration_guess=10, update_label="Run STAAD.Pro Analysis")
def run_staad(self, params, **kwargs):
nodes, lines, cross_section = create_frame_data(
length=params.frame_length,
height=params.frame_height,
cross_section=params.cross_sect,
)
input_json = json.dumps([nodes, lines, cross_section])
script_path = Path(__file__).parent / "run_staad_model.py"
staad_analysis = PythonAnalysis(
script=File.from_path(script_path),
files=[("inputs.json", BytesIO(input_json.encode("utf-8")))],
output_filenames=["output.json"],
)
staad_analysis.execute(timeout=300)
output_file = staad_analysis.get_output_file("output.json")
output_raw = output_file.getvalue()
if isinstance(output_raw, bytes):
output_raw = output_raw.decode("utf-8")
output = json.loads(output_raw)
forces = [[round(force, 2) for force in row] for row in output["forces"]]
return vkt.TableResult(
forces,
row_headers=output["headers"],
column_headers=[
"FX [kN]",
"FY [kN]",
"FZ [kN]",
"MX [kN m]",
"MY [kN m]",
"MZ [kN m]",
],
)
```
Now you're ready to test your app. Make sure your worker is running, then try generating the model. After the analysis, your app should look like this:

## Would you like to see the complete code?[](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#would-you-like-to-see-the-complete-code "Direct link to Would you like to see the complete code?")
We have a convenient GitHub repository with the [STAAD.Pro integration app](https://github.com/viktor-platform/sample-staad-integration/tree/main). If you have a version of STAAD.Pro installed on your computer, you can try out the proof-of-concept app to get an idea of how such an app works and behaves.
## Your turn to build[](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md#your-turn-to-build "Direct link to Your turn to build")
You now have everything you need to start building applications that integrate STAAD.Pro into your VIKTOR apps. You can also:
* Explore how to [create and analyze transmission towers in STAAD.Pro](https://www.viktor.ai/blog/188/create-and-analyze-transmission-towers-easily-in-staad-pro) ([GitHub repo](https://github.com/viktor-platform/staad-transmission-tower))
* Learn how to [automate baseplate analysis in STAAD.Pro with Python](https://www.viktor.ai/blog/191/how-to-automate-baseplate-analysis-in-staad-pro-with-python) ([GitHub repo](https://github.com/viktor-platform/STAAD-baseplate))
* Explore other [integration tutorials](https://docs.viktor.ai/docs/tutorials/.md#intermediate-level) to learn how to connect more structural or geotechnical software to your apps
---
# Tutorial - Create an interactive map
info
Level: **Beginners**
Time: **20 min**
Prerequisites:
* You have an account and completed the installation process. No account? Get one [here](https://www.viktor.ai/start-building-apps)
* You have some experience with reading Python code
* [](https://www.viktor.ai/start-building-apps)
***Not a reader?** feel free to follow this tutorial as a video*
## Introduction[](https://docs.viktor.ai/docs/tutorials/interactive-maps/.md#introduction "Direct link to Introduction")
Welcome to this tutorial on how to create a web app that displays data on map, using VIKTOR and Python!
As an engineer or data scientist, you may work with geo-located data. Visualizing this on a map is probably the best way to make this data insightful!
In this tutorial, we will explore how to visualize points, lines, and polygons in a map with VIKTOR and python. We will also see how you can make this map interactive and ask users to provide a location. We will cover:
1. [Create an empty app template](https://docs.viktor.ai/docs/tutorials/interactive-maps/.md#2-create-install-and-start-an-empty-app)
2. [Adding a map](https://docs.viktor.ai/docs/tutorials/interactive-maps/.md#3-adding-a-map)
3. [Showing data on the map](https://docs.viktor.ai/docs/tutorials/interactive-maps/.md#4-showing-data-on-the-map)
4. [Let's make it interactive!](https://docs.viktor.ai/docs/tutorials/interactive-maps/.md#5-lets-make-it-interactive)
5. [Using custom markers and colors](https://docs.viktor.ai/docs/tutorials/interactive-maps/.md#6-but-wait-there-is-more)
By the end of this tutorial you will be able to place points, lines and polygons in a VIKTOR app and have a basic understanding of how you can use maps to enhance your visuals! It will look similar to the gif below:
Need help?
Are you encountering an error? Take a look at the [**complete app code**](https://docs.viktor.ai/docs/tutorials/interactive-maps/.md#complete-app-code).
Also know that you can always ask for help at our [**Community Forum**](https://community.viktor.ai/), where our developers are ready to help with any question related to the installation, coding and more.
## 1. Create, install and start an empty app[](https://docs.viktor.ai/docs/tutorials/interactive-maps/.md#1-create-install-and-start-an-empty-app "Direct link to 1. Create, install and start an empty app")
Let's create, install and start an empty app. This will be the starting point for the rest of the tutorial. But before we start, make sure to shut down any app that is running (like the demo app) by closing the command-line shell (for example Powershell) or end the process using `Ctrl + C`.
Follow these steps to create, install and start an empty app:
1. Open a terminal and run the following command to create the app on the VIKTOR platform and generate the initial code locally:
```
viktor-cli create-app "Map tutorial" --init --app-type editor
```
2. Open the newly created folder in your code editor and run `viktor-cli clean-start` in the terminal to install dependencies and connect the app to the platform.
If all went well, your empty app is installed and connected to your development workspace. **Do not close the terminal** as this will break the connection with your app. The terminal in your code editor should show something like this:
```
INFO : Connecting to cloud.viktor.ai...
INFO : Connection is established (use Ctrl+C to close)
INFO :
INFO : Navigate to the link below to see your app in the browser
INFO : https://cloud.viktor.ai/workspaces/XXX/app
INFO :
INFO : App code loaded, waiting for jobs...
```
Re-starting your app
* You only need to create an app template and install it once for each new app you want to make.
* The app will update automatically once you start adding code in `app.py`, as long as you don't close the terminal or your code editor.
* Did you close your code editor? Use `viktor-cli start` to start the app again. No need to install, clear, etc.
Did you encounter any errors?
* Always make sure to check the spelling of everything you placed in the command-line, a small mistake and the command you are trying to run may not be recognised!
* If you are encountering:
```
ERROR:
Exiting because of an error: no requirements.txt file
PS C:\Users\\viktor-apps>
```
Then you are not in the correct folder! check the command-line and navigate to the map-tutorial folder.
* If you are encountering:
```
Error: App definition is not compatible with the data currently stored in the database. Use the command 'viktor-cli clear' to clear the database.
PS C:\Users\\viktor-apps\map-tutorial>
```
That means you have not cleared the database yet! Use the `viktor-cli clear` to clear and then you can use `viktor-cli start` to start the app. No need to install it again!
Not seeing any of these errors? Head over to our community! There is a good chance another developer encountered it and solved it too!
## 2. Adding a map[](https://docs.viktor.ai/docs/tutorials/interactive-maps/.md#2-adding-a-map "Direct link to 2. Adding a map")
The app we will be making during this tutorial will display flight paths for air traffic. It will also include functionality for visualizing a no-flight zone.
To begin, we will add the map to our app using a [`MapView`](https://docs.viktor.ai/sdk/api/views/.md#_MapView). Remember that we always add views in the `Controller` class.
We will also create a list called `features`, containing everything we want to show on the map. The list is empty for now, but we will fill it in the following steps.
1. Open `app.py` and make sure your code looks like this. Notice that all the required import statements are already included. This will save us some back-and-forth along the way. If you like you can use the searchbar on the top-right of this page to get some more information on those features:
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
pass
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.MapView('Flight Analysis')
def generate_map(self, params, **kwargs):
features = []
return vkt.MapResult(features)
```
2. Go to your cloud environment (e.g. [cloud.viktor.ai](https://cloud.viktor.ai/workspaces)) and open the development card. Great! You will be able to see the map.

## 3. Showing data on the map[](https://docs.viktor.ai/docs/tutorials/interactive-maps/.md#3-showing-data-on-the-map "Direct link to 3. Showing data on the map")
We will draw a polygon on the map to mark the no-fly zone using [`MapPolygon`](https://docs.viktor.ai/sdk/api/views/.md#_MapPolygon). To create this polygon, we must first define its corner using [`MapPoints`](https://docs.viktor.ai/sdk/api/views/.md#_MapPoint).
1. Go to `app.py` and modify the code under the `MapView` so it looks like this:
```
@vkt.MapView('Flight Analysis')
def generate_map(self, params, **kwargs):
features = []
# Draw no-fly zone
no_fly_zone = vkt.MapPolygon([
vkt.MapPoint(54.814614, -26.785331),
vkt.MapPoint(54.610949, -15.190123),
vkt.MapPoint(50.824269, -15.429211),
vkt.MapPoint(50.864828, -26.741683)],
)
features.append(no_fly_zone)
return vkt.MapResult(features)
```
2. Go to your app in the browser and refresh the page. Awesome! You should now be able to see the no-fly zone we just made

## 4. Let's make it interactive\
In this part of the tutorial, we will add some interactivity. We will define a flight path by letting the user choose the departing and arriving airport by clicking on the map!
We will do this using [`GeoPointField`](https://docs.viktor.ai/sdk/api/parametrization/.md#_GeoPointField). We just want to let you know that there is also [`GeoPolylineField`](https://docs.viktor.ai/sdk/api/parametrization/.md#_GeoPolylineField) and [`GeoPolygonField`](https://docs.viktor.ai/sdk/api/parametrization/.md#_GeoPolygonField) that you can use in your app.
Also, we will add a [`Text`](https://docs.viktor.ai/sdk/api/parametrization/.md#_Text) description that helps the users understand what they need to do.
1. Under your `Parametrization` class add these fields, and don’t forget to delete `pass`:
```
...
class Parametrization(vkt.Parametrization):
intro = vkt.Text("""
# ✈️ Flight Analysis App!
In this app, you can analyze a flight path and whether it passes through a no-fly zone.
**Select two points** corresponding to the airports of departure and arrival.
""")
dep_airport = vkt.GeoPointField('Departing Airport')
arr_airport = vkt.GeoPointField('Arriving Airport')
```
2. Refresh the app and take a look. You will notice the new `GeoFields` and the description. Give them a try.
3. Maybe you already noticed this, but the markers disappear after clicking the map. To solve the problem, let’s add the points to our `features` list in the `MapView` list.
Note that we will add an `if-statement` before adding them so the app does not give an error when the user hasn't clicked on the map yet (e.g. `params.dep_airport = None`)
Under the line `features.append(no_fly_zone)` add:
```
...
features.append(no_fly_zone) # <--- this line is for your reference
if params.dep_airport:
dep_point = vkt.MapPoint.from_geo_point(params.dep_airport)
features.append(dep_point)
if params.arr_airport:
arr_point = vkt.MapPoint.from_geo_point(params.arr_airport)
features.append(arr_point)
```
4. Since we are looking to analyze the flight, we also need to add a flight path. Let’s connect the dots 😉. Under the lines we just added, add:
```
if params.dep_airport and params.arr_airport:
flight_path = vkt.MapLine(dep_point, arr_point)
features.append(flight_path)
```
5. Refresh your app and take a look. Fantastic, you have now made an app to add flight paths to a map and see whether they enter a no-fly zone. You have done a great job! 🥳

## 5. But wait... there is more\
We made a beautiful app together, but let’s make it even better by adding some color, custom pins, and descriptive labels.
Pins & Colors
Here you can find a list of all [pins](https://docs.viktor.ai/sdk/api/views/.md#_MapPoint) and [colors](https://docs.viktor.ai/sdk/api/core/.md#_Color).
1. Let’s make it clear that it is a no-fly zone by making it red and adding a description that the user will see when clicking on the map. Do this by adding these lines of code where you define the `no_fly_zone`:
```
no_fly_zone = vkt.MapPolygon([
vkt.MapPoint(54.814614, -26.785331),
vkt.MapPoint(54.610949, -15.190123),
vkt.MapPoint(50.824269, -15.429211),
vkt.MapPoint(50.864828, -26.741683)],
color=vkt.Color.red(), # <--- add this line
title="No-fly zone", # <--- add this line
description="⛔ This is a no-fly zone. Stay out of this zone!" # <--- add this line
)
```
2. We will make airport pins blue and change their icon. Find where we define `dep_point` and `arr_point` and modify the code like this:
```
dep_point = vkt.MapPoint.from_geo_point(params.dep_airport, icon='triangle', color=vkt.Color.blue())
```
```
arr_point = vkt.MapPoint.from_geo_point(params.arr_airport, icon='triangle-down', color=vkt.Color.blue())
```
3. Refresh your app and play with it.
Congratulations! You made a wonderful interactive map and even personalized it by using custom icons and colors. You have done a great job and can be proud of yourself! 😎
By now, your app should look like this:

## Complete app code[](https://docs.viktor.ai/docs/tutorials/interactive-maps/.md#complete-app-code "Direct link to Complete app code")
Were you able to do everything in this tutorial without error? If not, you can always take a look at the full code:
**Complete code**
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("""
# ✈️ Flight Analysis App!
In this app, you can analyze a flight path and whether it passes through a no-fly zone.
**Select two points** corresponding to the airports of departure and arrival.
""")
dep_airport = vkt.GeoPointField('Departing Airport')
arr_airport = vkt.GeoPointField('Arriving Airport')
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.MapView('Flight Analysis')
def generate_map(self, params, **kwargs):
features = []
# Draw no-fly zone
no_fly_zone = vkt.MapPolygon([
vkt.MapPoint(54.814614, -26.785331),
vkt.MapPoint(54.610949, -15.190123),
vkt.MapPoint(50.824269, -15.429211),
vkt.MapPoint(50.864828, -26.741683)],
color=vkt.Color.red(),
title="No-fly zone",
description="⛔ This is a no-fly zone. Stay out of this zone!"
)
features.append(no_fly_zone)
# Draw airports
if params.dep_airport:
dep_point = vkt.MapPoint.from_geo_point(params.dep_airport, icon='triangle', color=vkt.Color.blue())
features.append(dep_point)
if params.arr_airport:
arr_point = vkt.MapPoint.from_geo_point(params.arr_airport, icon='triangle-down', color=vkt.Color.blue())
features.append(arr_point)
# Draw flight path
if params.dep_airport and params.arr_airport:
flight_path = vkt.MapLine(dep_point, arr_point)
features.append(flight_path)
return vkt.MapResult(features)
```
## Want to learn how VIKTOR works?[](https://docs.viktor.ai/docs/tutorials/interactive-maps/.md#want-to-learn-how-viktor-works "Direct link to Want to learn how VIKTOR works?")
If you are interested in how VIKTOR works behind the scenes, for example how it processes your input, expand the tabs below!
#### How does it work?[](https://docs.viktor.ai/docs/tutorials/interactive-maps/.md#how-does-it-work "Direct link to How does it work?")
How does the Parametrization work?
In the **Parameterization** class you can add input fields that allow the user to provide input to your app, and there are more than 20 [different input fields](https://docs.viktor.ai/docs/create-apps/user-input/.md) you can use, including numbers, text, colors, images and files.
Inside the Parametrization class, you can also format the [layout of your app](https://docs.viktor.ai/docs/create-apps/layout-and-styling/.md) by adding sections, tabs, steps and pages.
To show your Parametrization in the app, we need to add the line `parametrization = Parametrization` inside the `Controller` class, because it is the controller that determines what is shown and not.
How does the Parametrization get saved?
So you may be wondering, how do you get the information from the parametrization to my controller? Well, we do this automatically for you. The values of all parameters are stored in a single variable called `params` , which is accessible inside the Controller class.
These variables are stored in a `Munch`; this is similar to a dictionary, but work with point denotation.
Example:
* Let's say we have a variable called `height` as a NumberField in our `Parameterization`.
* To use it in a method in the `Controller`, define it as: `def my_method(self, params, **kwargs)`
* You can now make calculations inside that method using our height parameter as `params.height`!
How does the Controller work?
The **Controller** class is the place where you add everything you want to calculate and show.
As explained in this tutorial, we show results in a `View` and we always add views in our controller. You can even add several views in a single app by adding them to the controller class... and yes, we have [many Views](https://docs.viktor.ai/docs/create-apps/results-and-visualizations/.md),for showing graphs, maps, 3D models, reports, images and more.
In the Controller, you also do or call your calculation. Remember that the user input given in the parametrization, is accessible inside the Controller class in the variable The `params`.
## What's next[](https://docs.viktor.ai/docs/tutorials/interactive-maps/.md#whats-next "Direct link to What's next")
Very impressive! You have now learned the basics of the VIKTOR `MapView`. In this tutorial, we have only scratched the surface of what you can do using maps. So don’t stop your journey there!
If you like an extra challenge, here are some ideas:
* Make the no-fly zone interactive using a `GeoPolygonField`
* Make the flight path red when it crosses the no-fly zone and green when it doesn’t
* Create a flight path that passes several points using a `GeoPolylineField`
* Calculate the distance of the flight path and show it on the map
Or just follow some of our other [tutorials](https://docs.viktor.ai/docs/tutorials/.md)
More about maps
You can find more information about how to use maps in the [maps guide](https://docs.viktor.ai/docs/create-apps/results-and-visualizations/map/.md). Also check more about [input fields for maps](https://docs.viktor.ai/docs/create-apps/user-input/map-features/.md)
---
# Tutorial - 3D models
info
Level: **Intermediate**
Time: **30 min**
Prerequisites:
* You have an account and completed the installation process. No account? Get one [here](https://www.viktor.ai/start-building-apps)
* You have some experience with reading Python code
* [](https://www.viktor.ai/start-building-apps)
## Introduction[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#introduction "Direct link to Introduction")
As a designer or engineer, creating 3D models is an essential part of your work. 3D models can help you visualize and communicate complex concepts in a way that is easy to understand. In this tutorial, we will explore how to create 3D models in VIKTOR using Python.
By the end of this tutorial, you will have the skills and knowledge needed to create your own 3D models in VIKTOR using Python. We will start with simple shapes and gradually work our way up to more complex models. Whether you are a beginner or an experienced designer, this tutorial will provide you with a solid foundation in 3D modeling with VIKTOR.
This tutorial consists of six different sections:
1. [Create an empty app](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#1-create-install-and-start-an-empty-app)
2. [Set up the basis](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#2-set-up-the-basis)
3. [Drawing the bridge deck](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#3-drawing-the-bridge-deck)
4. [Adding supports](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#4-adding-supports)
5. [The finishing touches](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#5-the-finishing-touches)
6. [The complete app code](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#complete-app-code)
To give you an idea of what you will be creating, here's a GIF of the application you will me making throughout this tutorial:
 *What the app looks like once you complete this tutorial*
Need help?
Are you encountering an error? Take a look at the [**complete app code**](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#complete-app-code).
Also know that you can always ask for help at our [**Community Forum**](https://community.viktor.ai/), where our developers are ready to help with any question related to the installation, coding and more.
## 1. Create, install and start an empty app[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#1-create-install-and-start-an-empty-app "Direct link to 1. Create, install and start an empty app")
Let's create, install and start an empty app. This will be the starting point for the rest of the tutorial. But before we start, make sure to shut down any app that is running (like the demo app) by closing the command-line shell (for example Powershell) or end the process using `Ctrl + C`.
Follow these steps to create, install and start an empty app:
1. Open a terminal and run the following command to create the app on the VIKTOR platform and generate the initial code locally:
```
viktor-cli create-app "Model tutorial" --init --app-type editor
```
2. Open the newly created folder in your code editor and run `viktor-cli clean-start` in the terminal to install dependencies and connect the app to the platform.
If all went well, your empty app is installed and connected to your development workspace. **Do not close the terminal** as this will break the connection with your app. The terminal in your code editor should show something like this:
```
INFO : Connecting to cloud.viktor.ai...
INFO : Connection is established (use Ctrl+C to close)
INFO :
INFO : Navigate to the link below to see your app in the browser
INFO : https://cloud.viktor.ai/workspaces/XXX/app
INFO :
INFO : App code loaded, waiting for jobs...
```
Re-starting your app
* You only need to create an app template and install it once for each new app you want to make.
* The app will update automatically once you start adding code in `app.py`, as long as you don't close the terminal or your code editor.
* Did you close your code editor? Use `viktor-cli start` to start the app again. No need to install, clear, etc.
Did you encounter any errors?
* Always make sure to check the spelling of everything you placed in the command-line, a small mistake and the command you are trying to run may not be recognised!
* If you are encountering:
```
ERROR:
Exiting because of an error: no requirements.txt file
PS C:\Users\\viktor-apps>
```
Then you are not in the correct folder! check the command-line and navigate to the 3D-model-tutorial folder.
* If you are encountering:
```
Error: App definition is not compatible with the data currently stored in the database. Use the command 'viktor-cli clear' to clear the database.
PS C:\Users\\viktor-apps\3D-model-tutorial>
```
That means you have not cleared the database yet! Use the `viktor-cli clear` to clear and then you can use `viktor-cli start` to start the app. No need to install it again!
Not seeing any of these errors? Head over to our community! There is a good chance another developer encountered it and solved it too!
## 2. Set up the basis[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#2-set-up-the-basis "Direct link to 2. Set up the basis")
In this tutorial we will make a 3D model. In this example case you will be modelling a bridge including a simplified version of the river running underneath it, the sloped embankment on the side of the river and the supports underneath the bridge. 🌉
Let's start easy and create a simple bridge deck and a river running underneath it, and some input fields to change the dimensions.
### Input fields[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#input-fields "Direct link to Input fields")
We will add 4 inputfields to define the dimensions of our bridge, our app: `length`, `width`, `height` and `deck_thickness`. We will use a [`Numberfield`](https://docs.viktor.ai/sdk/api/parametrization/.md#_NumberField), for each.
1. Open `app.py`, and add the relevant fields to your parametrization. It is always good to give people some context using [`Text`](https://docs.viktor.ai/docs/create-apps/inform-end-user/text-blocks/.md) elements. Don't forget to import the necessary fields. In the end your `app.py` file should look like this:
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# 3D model app 🌉\n This app parametrically generates and visualises a 3D model of a bridge")
txt_deck = vkt.Text('### Deck layout ') # texts can be used for explanation in the user-interface
length = vkt.NumberField("Deck length", min=6, default=100, suffix='m')
width = vkt.NumberField("Deck width", min=2, default=20, suffix='m')
deck_thickness = vkt.NumberField("Deck thickness", min=0.5, default=1, suffix='m')
height = vkt.NumberField("Bridge height", min=2, default=10, suffix='m')
class Controller(vkt.Controller):
parametrization = Parametrization
```
2. Refresh your app, and you should see the input fields there.
### Basic set up & the river[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#basic-set-up--the-river "Direct link to Basic set up & the river")
We don’t need a bridge if there is no river. So, let’s start with making the river step by step and set up the basis for the next parts, so we can explain some concepts.
1. We want to show a 3D model, so we will create a [`GeometryView`](https://docs.viktor.ai/docs/create-apps/results-and-visualizations/threed-model/.md) inside your `controller` like this:
```
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.GeometryView("3D", x_axis_to_right=True)
def visualize_bridge(self, params, **kwargs):
return vkt.GeometryResult(geometry_group)
```
2. Inside `visualize_bridge`, we'll create a empty [`Group`](https://docs.viktor.ai/sdk/api/geometry/.md#_Group) to store all elements we want to show:
```
# Create an empty group to hold all the geometry
geometry_group = vkt.Group([])
```
3. Now we'll define the measurements of the river and bridge's surroundings. We don’t want to make new input field for that, so we will just use the bridge measurements for this. Inside `visualize_bridge`:
```
# Measurements environment
env_width = params.length
env_thick = params.deck_thickness # Thickness of water and embankment
water_width = params.length - 2 * params.height # Assuming embankment at 45 deg
```
4. Then, create a [`Material`](https://docs.viktor.ai/sdk/api/geometry/.md#_Material) so we can make the water blue, and let's make it a bit transparent. Inside `visualize_bridge`:
```
# Create materials
mat_water = vkt.Material('Water', color=vkt.Color.blue(), opacity=0.7)
```
5. Next, create the water by drawing a box is using [`SquareBeam`](https://docs.viktor.ai/sdk/api/geometry/.md#_SquareBeam) and add it to the `Group` we made before. Inside `visualize_bridge` add:
```
# Draw water
water = vkt.SquareBeam(water_width, env_width, env_thick, material=mat_water)
```
6. The last step is return the geometry, so it is visualized:
```
geometry_group.add([water])
```
7. Update your app, and you will see the river
### All code until now[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#all-code-until-now "Direct link to All code until now")
Click here to see **all code until now**
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# 3D model app 🌉\n This app parametrically generates and visualises a 3D model of a bridge")
txt_deck = vkt.Text('### Deck layout ') # texts can be used for explanation in the user-interface
length = vkt.NumberField("Deck length", min=6, default=100, suffix='m')
width = vkt.NumberField("Deck width", min=2, default=20, suffix='m')
deck_thickness = vkt.NumberField("Deck thickness", min=0.5, default=1, suffix='m')
height = vkt.NumberField("Bridge height", min=2, default=10, suffix='m')
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.GeometryView("3D", x_axis_to_right=True)
def visualize_bridge(self, params, **kwargs):
# Create an empty group to hold all the geometry
geometry_group = vkt.Group([])
# Measurements environment
env_width = params.length
env_thick = params.deck_thickness # Thickness of water and embankment
water_width = params.length - 2 * params.height # Assuming embankment at 45 deg
# Create materials
mat_water = vkt.Material('Water', color=vkt.Color.blue(), opacity=0.7)
# Draw water
water = vkt.SquareBeam(water_width, env_width, env_thick, material=mat_water)
geometry_group.add([water])
return vkt.GeometryResult(geometry_group)
```
## 3. Drawing the bridge deck[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#3-drawing-the-bridge-deck "Direct link to 3. Drawing the bridge deck")
Now that we have the basis for drawing our 3D models, and a beautiful river 😉, we can quickly create the bridge:
### Adding the deck[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#adding-the-deck "Direct link to Adding the deck")
We'll create the bridge inside the `GeometryView`, like we did before.
1. Create the deck, using the `SquareBeam` function as well, and give the deck a width, length and thickness.
```
deck = vkt.SquareBeam(params.length, params.width, params.deck_thickness)
```
2. `SquareBeam` creates a box with its centre at the origin (0, 0, 0). In order to move the deck to the correct position let's use [`translate`](https://docs.viktor.ai/sdk/api/geometry/.md#_TransformableObject)
```
deck.translate((0, 0, params.height))
```
3. Now we will create the deck top, you can interpret this top as the asphalt layer of the bridge. But first, let's define a new material. This time we'll define the `Color` using RGB values:
```
mat_deck_top = vkt.Material('Deck top', color=vkt.Color(60, 60, 60))
```
4. Again, use `SquareBeam` and `translate` it in the z-direction:
```
deck_top = vkt.SquareBeam(params.length, params.width, params.deck_thickness / 4, material=mat_deck_top)
deck_top.translate((0, 0, params.height + 5/8*params.deck_thickness))
```
5. Add the created elements to the geometry `Group` so they get visualized:
```
geometry_group.add([deck, deck_top])
```
6. Refresh your application, you should see the water and the bridge in 3D view.
## 5. Adding supports[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#5-adding-supports "Direct link to 5. Adding supports")
That's a really beautiful bridge, but something feels wrong, it looks like the bridge is flying, so we are now going to generate some supports for it, parametrically of course.
### The plan[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#the-plan "Direct link to The plan")
Before going into the code, let's discuss the plan. We will make a V-shaped support and place it on several locations according to a 'grid', as shown here:

### Input fields[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#input-fields-1 "Direct link to Input fields")
With that said, let's jump into the code.
1. We will add 2 input fields to our app: `support_amount`, `support_piles_amount`. These inputs will define how many supports we want. Inside the `parametrization` class add the following three lines of code:
```
txt_support = vkt.Text('### Support layout', flex=100)
support_amount = vkt.NumberField("Number of supports", default=2, min=1)
support_piles_amount = vkt.NumberField("Number of piles per support", min=2, default=3)
```
2. Refresh your app and you should see the new input fields.
### Create one support[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#create-one-support "Direct link to Create one support")
Next let's make the bridge supports. The supports each consist of two columns in a V-formation placed on a support box. As before, we will draw the different element inside the `GeometryView`
1. Inside your `GeometryView` before the `return`, we will define the pile diameter and the grid size. Note that we did not create an input field to define the diameter (but feel free), so we will make it equal to ½ of the deck thickness:
```
pile_diameter = params.deck_thickness / 2
grid_size_x = water_width / params.support_amount
grid_size_y = (params.width - pile_diameter) / (params.support_piles_amount - 1)
```
2. Draw one column and use [`mirror_object`](https://docs.viktor.ai/sdk/api/geometry/.md#_mirror_object) to get the V-shape. We draw the column by extruding a circle along a line using [`CircularExtrusion`](https://docs.viktor.ai/sdk/api/geometry/.md#_CircularExtrusion):
```
# Draw columns
top_point = vkt.Point(-grid_size_x/2, 0, params.height)
bottom_point = vkt.Point(0, 0, 0)
column_line = vkt.Line(top_point, bottom_point)
column_1 = vkt.CircularExtrusion(pile_diameter, column_line)
column_2 = vkt.geometry.mirror_object(column_1, vkt.Point(0, 0, 0), (1, 0, 0))
```
3. Let's now add the box at the base to complete our support:
```
# Draw base
column_base = vkt.SquareBeam(3 * pile_diameter, pile_diameter, 2*pile_diameter)
```
4. For the next step, it is convenient to put the 3 elements we just made in a new `Group`:
```
support = vkt.Group([column_1, column_2, column_base])
```
5. Let's see our progress by temporarily adding the `support` to our `geometry_group` and updating your app:
```
geometry_group.add([support])
```
6. Before continuing, eliminate the line of code we added in the last step.
### Repeating the supports[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#repeating-the-supports "Direct link to Repeating the supports")
We will now use the support we draw in the last section and repeat it according to our grid. As before, we will continue to work inside our `GeometryView`.
Improve the speed of your app
When we hear repeating, our Python minds immediately think in a for loop. But in VIKTOR, we do **not use a for loop** for making repetitive geometries. This will make you app unnecessary slow. For this `Pattern`, `LinearPattern`, and `BidirectionalPattern` are better suited. This can reduce the loading time from minutes to seconds in larger models.
1. First, place the `support` in the corner of the grid using `translate`:
```
support.translate((-water_width/2 + grid_size_x/2, -params.width/2 + pile_diameter/2, 0))
```
2. Now, we will copy the support using [`BidirectionalPattern`](https://docs.viktor.ai/sdk/api/geometry/.md#_BidirectionalPattern). While this may seem like a difficult function at first, the implementation is surprisingly easy:
```
all_supports = vkt.BidirectionalPattern(
base_object=support,
direction_1=[1, 0, 0],
direction_2=[0, 1, 0],
number_of_elements_1=params.support_amount,
number_of_elements_2=params.support_piles_amount,
spacing_1=grid_size_x,
spacing_2=grid_size_y
)
```
3. Let's add `all_supports` to `geometry_group` so we visualize them
```
# Adding geometry group to geometry result
geometry_group.add(all_supports)
```
4. Refresh your app, and look how amazing your bridge is looking!
### All code until now[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#all-code-until-now-1 "Direct link to All code until now")
Click here to see **all code until now**
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# 3D model app 🌉\n This app parametrically generates and visualises a 3D model of a bridge")
txt_deck = vkt.Text('### Deck layout ') # texts can be used for explanation in the user-interface
length = vkt.NumberField("Deck length", min=6, default=100, suffix='m')
width = vkt.NumberField("Deck width", min=2, default=20, suffix='m')
deck_thickness = vkt.NumberField("Deck thickness", min=0.5, default=1, suffix='m')
height = vkt.NumberField("Bridge height", min=2, default=10, suffix='m')
txt_support = vkt.Text('### Support layout', flex=100)
support_amount = vkt.NumberField("Number of supports", default=2, min=1)
support_piles_amount = vkt.NumberField("Number of piles per support", min=2, default=3)
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.GeometryView("3D", x_axis_to_right=True)
def visualize_bridge(self, params, **kwargs):
# Create an empty group to hold all the geometry
geometry_group = vkt.Group([])
# ===============================
# Draw Environment
# ===============================
# Measurements environment
env_width = params.length
env_thick = params.deck_thickness # Thickness of water and embankment
water_width = params.length - 2 * params.height # Assuming embankment at 45 deg
# Create materials
mat_water = vkt.Material('Water', color=vkt.Color.blue(), opacity=0.7)
mat_deck_top = vkt.Material('Deck top', color=vkt.Color(60, 60, 60))
# Draw water
water = vkt.SquareBeam(water_width, env_width, env_thick, material=mat_water)
geometry_group.add([water])
# ===============================
# Create Bridge
# ===============================
# Draw deck
deck = vkt.SquareBeam(params.length, params.width, params.deck_thickness)
deck.translate((0, 0, params.height))
deck_top = vkt.SquareBeam(params.length, params.width, params.deck_thickness / 4, material=mat_deck_top)
deck_top.translate((0, 0, params.height + 5/8*params.deck_thickness))
geometry_group.add([deck, deck_top])
# Define grid
pile_diameter = params.deck_thickness / 2
grid_size_x = water_width / params.support_amount
grid_size_y = (params.width - pile_diameter) / (params.support_piles_amount - 1)
# Draw columns
top_point = vkt.Point(-grid_size_x/2, 0, params.height)
bottom_point = vkt.Point(0, 0, 0)
column_line = vkt.Line(top_point, bottom_point)
column_1 = vkt.CircularExtrusion(pile_diameter, column_line)
column_2 = vkt.geometry.mirror_object(column_1, vkt.Point(0, 0, 0), (1, 0, 0))
# Draw base
column_base = vkt.SquareBeam(3 * pile_diameter, pile_diameter, 2*pile_diameter)
# Pattern supports
support = vkt.Group([column_1, column_2, column_base])
support.translate((-water_width/2 + grid_size_x/2, -params.width/2 + pile_diameter/2, 0))
all_supports = vkt.BidirectionalPattern(
base_object=support,
direction_1=[1, 0, 0],
direction_2=[0, 1, 0],
number_of_elements_1=params.support_amount,
number_of_elements_2=params.support_piles_amount,
spacing_1=grid_size_x,
spacing_2=grid_size_y
)
# Adding geometry group to geometry result
geometry_group.add(all_supports)
return vkt.GeometryResult(geometry_group)
```
## 5. The finishing touches[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#5-the-finishing-touches "Direct link to 5. The finishing touches")
You already made an amazing parametric bridge and learned the basics of creating 3D models in VIKTOR. In this chapter we just want to show you some little extras that can be useful during your app development journey.
### Drawing the embankment[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#drawing-the-embankment "Direct link to Drawing the embankment")
We already learned that you can move things using `translate`. This is because everything you draw is a [`TransformableObject`](https://docs.viktor.ai/sdk/api/geometry/.md#_TransformableObject). Besides `translate` you can also use other transformations, like [`rotate`](https://docs.viktor.ai/sdk/api/geometry/.md#TransformableObject.rotate), [`mirror`](https://docs.viktor.ai/sdk/api/geometry/.md#TransformableObject.mirror) and [`scale`](https://docs.viktor.ai/sdk/api/geometry/.md#TransformableObject.scale). Let’s give this a try drawing the embankments.
1. In your `GeometryView`, let's add a new `Material`:
```
mat_grass = vkt.Material('Grass', color=vkt.Color.green())
```
2. Then, we will create, `rotate`, and `translate` the embankment, and make a copy of it :
```
# Draw embankment (assuming embankment at 45 deg)
embankment_1 = vkt.SquareBeam(1.4 * params.height, env_width, env_thick, material=mat_grass)
embankment_1.rotate(-math.pi / 4, direction=[0, 1, 0])
embankment_1.translate(((water_width+params.height)/2, 0, params.height/2))
embankment_2 = vkt.geometry.mirror_object(embankment_1, vkt.Point(0, 0, 0), (1, 0, 0))
```
3. As allways, add the objects to `geometry_group`:
```
geometry_group.add([embankment_1, embankment_2])
```
4. Don't forget to import:
```
import math
```
5. Reload you app and see what happened
### A colorful bridge[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#a-colorful-bridge "Direct link to A colorful bridge")
Until now, we did not give the bridge a color, which by is shown grey by default. We already learned that you can make a `Material` and give it a `Color`, but did you know that we can ask the user to give it a color too? To demonstrate this, let’s:
1. Create an ColorField:
```
bridge_color = vkt.ColorField('Bridge Color', default=vkt.Color(200, 200, 200))
```
2. Create a material
```
mat_bridge = vkt.Material('Bridge', color=params.bridge_color)
```
3. Assign this material to any (or all) of `deck`, `column_1` and `column_base`. By adding `material=mat_bridge` to the `SquareBeam` and `CircularExtrusion` functions that generate these elements.
4. Reload and play with you app
## Complete app code[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#complete-app-code "Direct link to Complete app code")
Were you able to do everything in this tutorial without error? If not, you can always look at the full code:
**Complete code**
```
import viktor as vkt
import math
class Parametrization(vkt.Parametrization):
intro = vkt.Text("# 3D model app 🌉\n This app parametrically generates and visualises a 3D model of a bridge")
txt_deck = vkt.Text('### Deck layout ') # texts can be used for explanation in the user-interface
length = vkt.NumberField("Deck length", min=6, default=100, suffix='m')
width = vkt.NumberField("Deck width", min=2, default=20, suffix='m')
deck_thickness = vkt.NumberField("Deck thickness", min=0.5, default=1, suffix='m')
height = vkt.NumberField("Bridge height", min=2, default=10, suffix='m')
txt_support = vkt.Text('### Support layout', flex=100)
support_amount = vkt.NumberField("Number of supports", default=2, min=1)
support_piles_amount = vkt.NumberField("Number of piles per support", min=2, default=3)
bridge_color = vkt.ColorField('Bridge Color', default=vkt.Color(200, 200, 200))
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.GeometryView("3D", x_axis_to_right=True)
def visualize_bridge(self, params, **kwargs):
# Create an empty group to hold all the geometry
geometry_group = vkt.Group([])
# Measurements environment
env_width = params.length
env_thick = params.deck_thickness # Thickness of water and embankment
water_width = params.length - 2 * params.height # Assuming embankment at 45 deg
# Create materials
mat_water = vkt.Material('Water', color=vkt.Color.blue(), opacity=0.7)
mat_deck_top = vkt.Material('Deck top', color=vkt.Color(60, 60, 60))
mat_grass = vkt.Material('Grass', color=vkt.Color.green())
mat_bridge = vkt.Material('Bridge', color=params.bridge_color)
# ===============================
# Draw environment
# ===============================
# Draw water
water = vkt.SquareBeam(water_width, env_width, env_thick, material=mat_water)
geometry_group.add([water])
# Draw embankment (at 45 deg)
embankment_1 = vkt.SquareBeam(1.4 * params.height, env_width, env_thick, material=mat_grass)
embankment_1.rotate(-math.pi / 4, direction=[0, 1, 0])
embankment_1.translate(((water_width+params.height)/2, 0, params.height/2))
embankment_2 = vkt.geometry.mirror_object(embankment_1, vkt.Point(0, 0, 0), (1, 0, 0))
# Add created geometries to geometry group
geometry_group.add([embankment_1, embankment_2])
# ===============================
# Create Bridge
# ===============================
# Draw deck
deck = vkt.SquareBeam(params.length, params.width, params.deck_thickness, material=mat_bridge)
deck.translate((0, 0, params.height))
deck_top = vkt.SquareBeam(params.length, params.width, params.deck_thickness / 4, material=mat_deck_top)
deck_top.translate((0, 0, params.height + 5/8*params.deck_thickness))
geometry_group.add([deck, deck_top])
# Define grid
pile_diameter = params.deck_thickness / 2
grid_size_x = water_width / params.support_amount
grid_size_y = (params.width - pile_diameter) / (params.support_piles_amount - 1)
# Draw columns
top_point = vkt.Point(-grid_size_x/2, 0, params.height)
bottom_point = vkt.Point(0, 0, 0)
column_line = vkt.Line(top_point, bottom_point)
column_1 = vkt.CircularExtrusion(pile_diameter, column_line, material=mat_bridge)
column_2 = vkt.geometry.mirror_object(column_1, vkt.Point(0, 0, 0), (1, 0, 0))
# Draw base
column_base = vkt.SquareBeam(3 * pile_diameter, pile_diameter, 2*pile_diameter, material=mat_bridge)
support = vkt.Group([column_1, column_2, column_base])
support.translate((-water_width/2 + grid_size_x/2, -params.width/2 + pile_diameter/2, 0))
all_supports = vkt.BidirectionalPattern(
base_object=support,
direction_1=[1, 0, 0],
direction_2=[0, 1, 0],
number_of_elements_1=params.support_amount,
number_of_elements_2=params.support_piles_amount,
spacing_1=grid_size_x,
spacing_2=grid_size_y
)
# Adding geometry group to geometry result
geometry_group.add(all_supports)
return vkt.GeometryResult(geometry_group)
```
## Want to learn how VIKTOR works?[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#want-to-learn-how-viktor-works "Direct link to Want to learn how VIKTOR works?")
If you are interested in how VIKTOR works behind the scenes, for example how it processes your input, expand the tabs below!
#### How does it work?[](https://docs.viktor.ai/docs/tutorials/intermediate-3d-model/.md#how-does-it-work "Direct link to How does it work?")
How does the Parametrization work?
In the **Parameterization** class you can add input fields that allow the user to provide input to your app, and there are more than 20 [different input fields](https://docs.viktor.ai/docs/create-apps/user-input/.md) you can use, including numbers, text, colors, images and files.
Inside the Parametrization class, you can also format the [layout of your app](https://docs.viktor.ai/docs/create-apps/layout-and-styling/.md) by adding sections, tabs, steps and pages.
To show your Parametrization in the app, we need to add the line `parametrization = Parametrization` inside the `Controller` class, because it is the controller that determines what is shown and not.
How does the Parametrization get saved?
So you may be wondering, how do you get the information from the parametrization to my controller? Well, we do this automatically for you. The values of all parameters are stored in a single variable called `params` , which is accessible inside the Controller class.
These variables are stored in a `Munch`; this is similar to a dictionary, but work with point denotation.
Example:
* Let's say we have a variable called `height` as a NumberField in our `Parameterization`.
* To use it in a method in the `Controller`, define it as: `def my_method(self, params, **kwargs)`
* You can now make calculations inside that method using our height parameter as `params.height`!
How does the Controller work?
The **Controller** class is the place where you add everything you want to calculate and show.
As explained in this tutorial, we show results in a `View` and we always add views in our controller. You can even add several views in a single app by adding them to the controller class... and yes, we have [many Views](https://docs.viktor.ai/docs/create-apps/results-and-visualizations/.md),for showing graphs, maps, 3D models, reports, images and more.
In the Controller, you also do or call your calculation. Remember that the user input given in the parametrization, is accessible inside the Controller class in the variable The `params`.
## To infinity and beyond\
Well done! You are now able to create an app that can parametrically design a 3D model which includes rectangular as well as circular extrusions with mirror, rotate and pattern possibilities!
Obviously there is way more to discover about VIKTOR and its 3D modelling capabilities. Check those out in [our documentation](https://docs.viktor.ai/sdk/api/geometry/.md)
Finally, the journey doesn't end here. Check out some of our other [tutorials](https://docs.viktor.ai/docs/tutorials/.md) or go to the [next section](https://docs.viktor.ai/docs/create-apps/.md) where you can see the different paths you can follow in your journey to learn more about VIKTOR.
---
# Tutorial - Data Analysis with Plotly and Pandas
info
Level: **Beginners**
Time: **20 min**
Prerequisites:
* You have an account and completed the installation process. No account? Get one [here](https://www.viktor.ai/start-building-apps)
* You have some experience with reading Python code
* [](https://www.viktor.ai/start-building-apps)
***Not a reader?** feel free to follow this tutorial as a video*
## Introduction[](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#introduction "Direct link to Introduction")
In this tutorial we’ll make a VIKTOR app to process, visualize and summarize data from a `.csv`.
We’ll do this by using two well-known Python libraries: Pandas and Plotly.
Visualizing data is one of the best ways to find trends and patterns. By plotting or grouping the data, we can quickly find these trends and make better business decisions! It is also an excellent way to present results to stakeholders like your manager or another business unit.
In this tutorial you will learn how to:
1. [Create an empty app template](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#1-create-install-and-start-an-empty-app)
2. [Extract the data from a .csv](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#2-extract-data-from-csv)
3. [Add input fields](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#3-add-input-fields)
4. [Plot the data using Plotly](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#4-plot-the-data)
5. [Add a data summary](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#5-add-a-data-summary)
By the end of this tutorial you will be able to create a colorful chart that can be used for analysis and saved for reports to help explain data. You will understand how to automate the process in VIKTOR and it will look similar to the gif below:
Need help?
Are you encountering an error? Take a look at the [**complete app code**](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#complete-code).
Also know that you can always ask for help at our [**Community Forum**](https://community.viktor.ai/), where our developers are ready to help with any question related to the installation, coding and more.
## 1. Create, install and start an empty app[](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#1-create-install-and-start-an-empty-app "Direct link to 1. Create, install and start an empty app")
Let's create, install and start an empty app. This will be the starting point for the rest of the tutorial. But before we start, make sure to shut down any app that is running (like the demo app) by closing the command-line shell (for example Powershell) or end the process using `Ctrl + C`.
Follow these steps to create, install and start an empty app:
1. Open a terminal and run the following command to create the app on the VIKTOR platform and generate the initial code locally:
```
viktor-cli create-app "Graph tutorial" --init --app-type editor
```
2. Open the newly created folder in your code editor and run `viktor-cli clean-start` in the terminal to install dependencies and connect the app to the platform.
If all went well, your empty app is installed and connected to your development workspace. The terminal in your code editor should show something like this:
```
INFO : Connecting to cloud.viktor.ai...
INFO : Connection is established (use Ctrl+C to close)
INFO :
INFO : Navigate to the link below to see your app in the browser
INFO : https://cloud.viktor.ai/workspaces/XXX/app
INFO :
INFO : App code loaded, waiting for jobs...
```
4. We want to use Pandas and Plotly in this app. Open `requirements.txt` and add `plotly` and `pandas` under your `viktor` version (don't change that line):
```
viktor==X.X.X <-- Don't modify this line
plotly
pandas
```
Now disconnect your app by closing the connection using Ctrl+C to be able to install these new dependencies. You do this by entering the following command:
```
viktor-cli install
```
And reconnecting the app by entering the command:
```
viktor-cli start
```
Re-starting your app
* You only need to create an app template and install it once for each new app you want to make.
* The app will update automatically once you start adding code in `app.py`, as long as you don't close the terminal or your code editor.
* Did you close your code editor? Use `viktor-cli start` to start the app again. No need to install, clear, etc.
Did you encounter any errors?
* Always make sure to check the spelling of everything you placed in the command-line, a small mistake and the command you are trying to run may not be recognised!
* If you are encountering:
```
ERROR:
Exiting because of an error: no requirements.txt file
PS C:\Users\\viktor-apps>
```
Then you are not in the correct folder! check the command-line and navigate to the data-analysis-tutorial folder.
* If you are encountering:
```
Error: App definition is not compatible with the data currently stored in the database. Use the command 'viktor-cli clear' to clear the database.
PS C:\Users\\viktor-apps\data-analysis-tutorial>
```
That means you have not cleared the database yet! Use the `viktor-cli clear` to clear and then you can use `viktor-cli start` to start the app. No need to install it again!
Not seeing any of these errors? Head over to our community! There is a good chance another developer encountered it and solved it too!
## 2. Extract data from .csv[](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#2-extract-data-from-csv "Direct link to 2. Extract data from .csv")
For this tutorial, we will dive into a dataset that contains the car sales data of a showroom.
The CEO has asked you to create a tool so that they can compare which type of cars were sold. He did not specify what he wanted to compare so we will make this tool so that we compare any two properties of the sold cars as well as give some additional data/information that might be interesting.
1. Download the dataset [here](https://docs.viktor.ai/files/docs/graph-tutorial/car-sales.csv).
2. Make sure the file name is `car-sales.csv`
3. Add the file to your app folder (`data-analysis-tutorial`)
4. We'll create the function `extract_data` to access the data using Pandas, and add all the necessary imports so that we don't need to do this later. Open `app.py` and make sure the first part of the code looks like this:
```
import viktor as vkt
import pandas as pd
import plotly.graph_objects as go
from pathlib import Path
def extract_data():
parent_folder = Path(__file__).parent
file_path = parent_folder/"car-sales.csv"
data = pd.read_csv(file_path, sep=';')
return data
class Parametrization(vkt.Parametrization): # <--- this line is for your reference
```
## 3. Add Input fields[](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#3-add-input-fields "Direct link to 3. Add Input fields")
We want the CEO to interact with the app. For this, we will add two [`OptionFields`](https://docs.viktor.ai/sdk/api/parametrization/.md#_OptionField). One to determine the variable on the X-axis and the other for the Y-axis. Also, we will make sure that the showed options correspond to the columns of the data set.
Remember, we always add input fields in the `Parametrization` class.
1. In the `app.py` file make sure the code in the `Parametrization` class looks like this:
```
...
class Parametrization(vkt.Parametrization):
introduction = vkt.Text(
"""
# 📊 Data Analysis App!
In this app you can summarise data and visualise it in a PlotlyView.
The app will summarise some data in the DataView and allow the user to choose a column to analyse to create the Plotly chart.
"""
)
# Add some input field for the user
main_column = vkt.OptionField('Choose main property', options=extract_data().columns.values.tolist())
count_column = vkt.OptionField('Choose property to analyse', options=extract_data().columns.values.tolist())
class Controller(vkt.Controller): # <--- this line is for your reference
```
2. Go to your cloud environment (e.g. [cloud.viktor.ai](https://cloud.viktor.ai/workspaces)) and open the development card. Great! You will be able to see your input fields.
 *How the app should look after the parametrization*
## 4. Plot the data[](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#4-plot-the-data "Direct link to 4. Plot the data")
Now, we'll make a bar chart to show the data. We will create the plot using Plotly, which is a well known plotting library. In VIKTOR, we show Plotly graphs in a [`PlotlyView`](https://docs.viktor.ai/sdk/api/views/.md#_PlotlyView).
We'll use the function `extract_data` to extract the data form the .csv, and Pandas to process it.
Remember, we allways add views in our `Controller` class.
1. In `app.py`, find the `Controller` class and make it look like this:
```
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.PlotlyView('Bar chart')
def generate_plotly_view(self, params, **kwargs):
# Extract and edit data to make it easy to plot
data = extract_data()
edited_data = data.groupby(params.main_column)[params.count_column].value_counts().unstack().fillna(0)
# Make the bar chart
fig = go.Figure()
for column in edited_data.columns:
fig.add_trace(go.Bar(x=edited_data.index, y=edited_data[column], name=column))
# Edit the bar chart
fig.update_layout(barmode='stack',xaxis_title=params.main_column,yaxis_title='Amount Sold')
return vkt.PlotlyResult(fig)
```
2. Refresh your app. Nice! You should now see a beautiful stacked bar chart of the data after you fill in the inputs. What you will also notice is that when you hover the mouse over one of the bars, Plotly will tell you the exact amount of cars with those two properties!
 *The app is almost finished! It should look similar to this*
## 5. Add a data summary[](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#5-add-a-data-summary "Direct link to 5. Add a data summary")
Fantastic, we have a fully functioning app 🎉. But that doesn't mean we cannot make it better.
Let's now add a summary with the most important data next to our graph. We'll show the total number of cars sold and the selected column's best-performing and least-performing property.
Thanks to Pandas, we can easily compute the totals per column and find the highest and lowest value with just a single line per value. For this, we need to modify the `generate_plotly_view` method.
Here are the required steps. The code is below.
1. Replace the `@PlotlyView` in your code for a [`@PlotlyAndDataView`](https://docs.viktor.ai/sdk/api/views/.md#_PlotlyAndDataView), so we can also display data next to the plot.
2. Create a [`DataGroup`](https://docs.viktor.ai/sdk/api/views/.md#_DataGroup) with the [`DataItems`](https://docs.viktor.ai/sdk/api/views/.md#_DataItem) we want to display.
3. Make sure you return a [`PlotlyAndDataResult`](https://docs.viktor.ai/sdk/api/views/.md#_PlotlyAndDataResult) with the plot and the `Datagroup`
Here is the code for your reference:
```
...
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.PlotlyAndDataView('Bar chart') # <--- Change the PlotlyView to PlotlyAndDataView
def generate_plotly_view(self, params, **kwargs):
# Extract and edit data to make it easy to plot
data = extract_data()
edited_data = data.groupby(params.main_column)[params.count_column].value_counts().unstack().fillna(0)
# Make the bar chart
fig = go.Figure()
for column in edited_data.columns:
fig.add_trace(go.Bar(x=edited_data.index, y=edited_data[column], name=column))
# Edit the bar chart
fig.update_layout(barmode='stack', xaxis_title=params.main_column, yaxis_title='Amount Sold')
# Create a summary with the data # <--- add this line
summary = vkt.DataGroup( # <--- add this line
vkt.DataItem("Total Sold" , len(data)), # <--- add this line
vkt.DataItem("Most Occurring", edited_data.sum().idxmax()), # <--- add this line
vkt.DataItem("Least Occurring", edited_data.sum().idxmin()), # <--- add this line
)
return vkt.PlotlyAndDataResult(fig, summary) # <--- Modify this line (PlotlyResult to PlotlyAndDataResult)
```
Refresh your app. You can now see the data on the right of the chart, and you can hide it using the arrow so you can focus on the bar chart!
Now select the 'Make' as main property and 'body-style' to analyse and try to find the best selling convertible and best selling car! You should find that the Alfa-Romero Convertible is the best selling Convertible and that the Toyota Hatchbacks are the overall best selling automobile!
Can you also find the amount of cars with a diesel powered turbo engine? Which type of engine and fuel combination are your best seller?
By now, your app should look like this:
 *The app should now look like this*
## Complete code[](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#complete-code "Direct link to Complete code")
Were you able to do everything in this tutorial without error? If not, you can always look at the full code:
**Complete code**
```
import viktor as vkt
import pandas as pd
import plotly.graph_objects as go
from pathlib import Path
def extract_data():
parent_folder = Path(__file__).parent
file_path = parent_folder / "car-sales.csv"
data = pd.read_csv(file_path, sep=';')
return data
class Parametrization(vkt.Parametrization):
introduction = vkt.Text(
"""
# 📊 Data Analysis App!
In this app you can summarise data and visualise it in a PlotlyView.
The app will summarise some data in the DataView and allow the user to choose a column to analyse to create the Plotly chart.
"""
)
# Add some input field for the user
main_column = vkt.OptionField('Choose main property', options=extract_data().columns.values.tolist())
count_column = vkt.OptionField('Choose property to analyse', options=extract_data().columns.values.tolist())
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.PlotlyAndDataView('Bar chart')
def generate_plotly_view(self, params, **kwargs):
# Extract and edit data to make it easy to plot
data = extract_data()
edited_data = data.groupby(params.main_column)[params.count_column].value_counts().unstack().fillna(0)
# Make the bar chart
fig = go.Figure()
for column in edited_data.columns:
fig.add_trace(go.Bar(x=edited_data.index, y=edited_data[column], name=column))
# Edit the bar chart
fig.update_layout(barmode='stack', xaxis_title=params.main_column, yaxis_title='Amount Sold')
# Create a summary with the data
summary = vkt.DataGroup(
vkt.DataItem("Total Sold" , len(data)),
vkt.DataItem("Most Occurring", edited_data.sum().idxmax()),
vkt.DataItem("Least Occurring", edited_data.sum().idxmin()),
)
return vkt.PlotlyAndDataResult(fig, summary)
```
## Want to learn how VIKTOR works?[](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#want-to-learn-how-viktor-works "Direct link to Want to learn how VIKTOR works?")
If you are interested in how VIKTOR works behind the scenes, for example how it processes your input, expand the tabs below!
#### How does it work?[](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#how-does-it-work "Direct link to How does it work?")
How does the Parametrization work?
In the **Parameterization** class you can add input fields that allow the user to provide input to your app, and there are more than 20 [different input fields](https://docs.viktor.ai/docs/create-apps/user-input/.md) you can use, including numbers, text, colors, images and files.
Inside the Parametrization class, you can also format the [layout of your app](https://docs.viktor.ai/docs/create-apps/layout-and-styling/.md) by adding sections, tabs, steps and pages.
To show your Parametrization in the app, we need to add the line `parametrization = Parametrization` inside the `Controller` class, because it is the controller that determines what is shown and not.
How does the Parametrization get saved?
So you may be wondering, how do you get the information from the parametrization to my controller? Well, we do this automatically for you. The values of all parameters are stored in a single variable called `params` , which is accessible inside the Controller class.
These variables are stored in a `Munch`; this is similar to a dictionary, but work with point denotation.
Example:
* Let's say we have a variable called `height` as a NumberField in our `Parameterization`.
* To use it in a method in the `Controller`, define it as: `def my_method(self, params, **kwargs)`
* You can now make calculations inside that method using our height parameter as `params.height`!
How does the Controller work?
The **Controller** class is the place where you add everything you want to calculate and show.
As explained in this tutorial, we show results in a `View` and we always add views in our controller. You can even add several views in a single app by adding them to the controller class... and yes, we have [many Views](https://docs.viktor.ai/docs/create-apps/results-and-visualizations/.md),for showing graphs, maps, 3D models, reports, images and more.
In the Controller, you also do or call your calculation. Remember that the user input given in the parametrization, is accessible inside the Controller class in the variable The `params`.
## What's next?[](https://docs.viktor.ai/docs/tutorials/plots-and-data/.md#whats-next "Direct link to What's next?")
Very Impressive! you have mastered the basics on how you can use VIKTOR for data analysis. In this tutorial, we have only scratched the surface of what you can do with data so don't stop there!
If you like an extra challenge, here are some ideas you can add:
* Try analysing another dataset's columns, perhaps by uploading a set using the [`Filefield`](https://docs.viktor.ai/sdk/api/parametrization/.md#_FileField)
* extend the `DataGroup` to have an average and standard deviation of the property
* Try to add another chart such as a hierarchy or pie chart suing a second `PlotlyView`
* Display several charts on a single view using [subplots](https://plotly.com/python/subplots/)
Or just follow some of our other [tutorials](https://docs.viktor.ai/docs/tutorials/.md)
More about plotting
You can find more information about how to make plots in the [plotting guide](https://docs.viktor.ai/docs/create-apps/results-and-visualizations/plots-charts-graphs/.md). Also check more about the possibilities of the [DataView](https://docs.viktor.ai/docs/create-apps/results-and-visualizations/data-and-tables/.md)
---
# Tutorial - Post-process ETABS data
info
Level: **Beginners**
Time: **20 min**
Prerequisites:
* You have an account and completed the installation process. No account? Get one [here](https://www.viktor.ai/start-building-apps)
* You have some experience with reading Python code
* [](https://www.viktor.ai/start-building-apps)
In this tutorial, you will build a VIKTOR app to process and visualize outputs from ETABS. You'll see how to export these outputs from ETABS into a file, upload them into VIKTOR and post-process reaction loads for various load combinations. Along the way, you will work with Plotly and Pandas, using the flexible tools and building blocks that VIKTOR offers.
Here is what we'll cover:
1. [Creating an app to take in a file](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#1-basic-setup)
2. [Processing the uploaded `.xlsx` file exported from ETABS](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#2-process-the-xlsx-file)
3. [Adding processed data into a field so that the user can select from the results](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#3-allow-user-selection-of-load-combinations)
4. [Visualizing results based on those selections](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#4-visualize-reaction-loads-with-plotly)
By the end of this tutorial, you will be able to generate a heatmap of the reaction loads for your structure by selecting specific load cases. This will allow you to gain valuable insights from your results and easily share them with your clients and team. Additionally, you will learn how to automate this process using VIKTOR. The final result will look like the figure below:

## 1. Basic setup[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#1-basic-setup "Direct link to 1. Basic setup")
### Create an empty app[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#create-an-empty-app "Direct link to Create an empty app")
Let's create, install and start an empty app. This will be the starting point for the rest of the tutorial. But before we start, make sure to shut down any app that is running (like the demo app) by closing the command-line shell (for example Powershell) or end the process using `Ctrl + C`.
Follow these steps to create, install and start an empty app:
1. Open a terminal and run the following command to create the app on the VIKTOR platform and generate the initial code locally:
```
viktor-cli create-app "Data tutorial" --init --app-type editor
```
2. Open the newly created folder in your code editor and run `viktor-cli clean-start` in the terminal to install dependencies and connect the app to the platform.
If all went well, your empty app is installed and connected to your development workspace. The terminal in your code editor should show something like this:
```
INFO : Connecting to cloud.viktor.ai...
INFO : Connection is established (use Ctrl+C to close)
INFO :
INFO : Navigate to the link below to see your app in the browser
INFO : https://cloud.viktor.ai/workspaces/XXX/app
INFO :
INFO : App code loaded, waiting for jobs...
```
Re-starting your app
* You only need to create an app template and install it once for each new app you want to make.
* The app will update automatically once you start adding code in `app.py`, as long as you don't close the terminal or your code editor.
* Did you close your code editor? Use `viktor-cli start` to start the app again. No need to install, clear, etc.
### Adding useful Python packages[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#adding-useful-python-packages "Direct link to Adding useful Python packages")
We want to use the Python packages Pandas, Openpyxl, and Plotly in this app. Open `requirements.txt` and add `plotly`, `openpyxl` and `pandas` under your `viktor` version (don't change that line):
```
viktor==X.X.X <-- Don't modify this line
plotly
pandas
openpyxl
```
Next, close the connection to your app in the terminal (if the app has been connected automatically). You can do this by using Ctrl+C. Open a new terminal and install the new dependencies (like `plotly` and `pandas`) in your Python environment by running this terminal:
```
viktor-cli install
```
And after that connect your app to the VIKTOR platform again:
```
viktor-cli start
```
**Keep the terminal open**, as closing it will disconnect your app.
### Adding input fields[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#adding-input-fields "Direct link to Adding input fields")
Let's add some text and input fields for the user to upload their file into. We will include a `FileField` to upload our `.xlsx` file and an `OptionField` to select a load combination from our Excel file.
Feel free to copy and paste the **highlighted** lines of code in `app.py`, save the file and refresh the app in the browser. You should now see the input fields you just added to the code.
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
intro = vkt.Text("""
# ETABS reaction heatmap
This app allows you to inspect results from an uploaded ETABS output file. Export your ETABS model results to an .xlsx file and upload it below. After uploading your Excel file, select the load combination you want to visualize.
Ensure the file includes the tables:
- **Joint Reactions**
- **Objects and Elements - Joints**
""")
xlsx_file = vkt.FileField("Upload ETABS exported .xlsx")
lb = vkt.LineBreak()
selected_load_combo = vkt.OptionField("Select available load combos", options=[])
class Controller(vkt.Controller):
parametrization = Parametrization
```
The result should look like the image below. Now that the inputs are sorted, we will continue with processing the ETABS data.

## 2. Process the XLSX file[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#2-process-the-xlsx-file "Direct link to 2. Process the XLSX file")
### Sample ETABS exported `.xlsx` file[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#sample-etabs-exported-xlsx-file "Direct link to sample-etabs-exported-xlsx-file")
For this tutorial, you can use this sample [Excel file](https://docs.viktor.ai/files/docs/simple-etabs-data-tutorial/etabs_tutorial.xlsx) but don't worry; at the end of this tutorial, we will guide you on how to export this data from ETABS and create your own file.
### Processing the uploaded xlsx file[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#processing-the-uploaded-xlsx-file "Direct link to Processing the uploaded xlsx file")
The next step is to process the data from the uploaded Excel file. It's a good idea to do this processing in a separate function, that we'll name `process_etabs_file`. This function will extract the unique load combinations (which will be used later in our `OptionField`) and the joint reactions. The goal is to combine this data with the joint coordinates to create a DataFrame that can be used to plot the heatmap in the Plotly view. Below is the logic in the code, along with a breakdown. Add the highlighted lines of code to `app.py` and save the file.
```
import viktor as vkt
import pandas as pd
def process_etabs_file(uploaded_file):
# Read the file into a dataframe
sheet_names = ["Joint Reactions", "Objects and Elements - Joints"]
with uploaded_file.open_binary() as fr:
dataframes = pd.read_excel(fr, sheet_name=sheet_names, skiprows=1)
# Process the 'Joint Reactions' dataframe
loads_df = dataframes["Joint Reactions"].dropna(subset=["Unique Name", "Output Case"]).copy()
# Process the 'Objects and Elements - Joints' dataframe
cords = dataframes["Objects and Elements - Joints"].dropna(
subset=["Element Name", "Object Name", "Global X", "Global Y", "Global Z"]
).copy()
cords = cords.rename(columns={"Object Name": "Unique Name"})
# Get unique load case names as a list
unique_output_cases = loads_df["Output Case"].unique().tolist()
# Merge loads and cords dataframe
merged_df = pd.merge(loads_df, cords, on="Unique Name", how="inner")
return unique_output_cases, merged_df.reset_index(drop=True)
class Parametrization(vkt.Parametrization):
intro = vkt.Text("""
# ETABS reaction heatmap
This app allows you to inspect results from an uploaded ETABS output file. Export your ETABS model results to an .xlsx file and upload it below. After uploading your Excel file, select the load combination you want to visualize.
Ensure the file includes the tables:
- **Joint Reactions**
- **Objects and Elements - Joints**
""")
xlsx_file = vkt.FileField("Upload ETABS exported .xlsx")
lb = vkt.LineBreak()
selected_load_combo = vkt.OptionField("Select available load combos", options=[])
class Controller(vkt.Controller):
parametrization = Parametrization
```
### How this works[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#how-this-works "Direct link to How this works")
1. In the top of the file we import Pandas, which we'll use to load the file content into dataframes
2. The function reads the excel file and extract the necessary sheets: **Joint Reactions** and **Objects and Elements - Joints**.
3. Then we filter for and remove the rows that we want based on the required data, keeping columns `Global X`, `Global Y`, and `Global Z`.
4. Finally, merge the processed **Joint Reactions** data with the joint coordinates using the `Unique Name` column as the key. This merged DataFrame includes all the necessary information to plot a heatmap.
5. This functions returns two things at once, the unique load combinations and the merged dataframe.
## 3. Allow user selection of load combinations[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#3-allow-user-selection-of-load-combinations "Direct link to 3. Allow user selection of load combinations")
With the function to process the uploaded file done, we can now use that processed data in the `Parametrization`. We will allow users to select a load combination from the unique load combinations. To get the unique load combinations into the `OptionField`, we can use a callback function. Let's call it `get_load_combos`. It will get the unique load combinations from `read_file` and update our `OptionField` to display a dropdown with the correct options. Add the highlighted lines of code to `app.py` and don't forget to reference the `get_load_combos` in the `selected_load_combo` field.
```
import viktor as vkt
import pandas as pd
def process_etabs_file(uploaded_file):
# Read the file into a dataframe
sheet_names = ["Joint Reactions", "Objects and Elements - Joints"]
with uploaded_file.open_binary() as fr:
dataframes = pd.read_excel(fr, sheet_name=sheet_names, skiprows=1)
# Process the 'Joint Reactions' dataframe
loads_df = dataframes["Joint Reactions"].dropna(subset=["Unique Name", "Output Case"]).copy()
# Process the 'Objects and Elements - Joints' dataframe
cords = dataframes["Objects and Elements - Joints"].dropna(
subset=["Element Name", "Object Name", "Global X", "Global Y", "Global Z"]
).copy()
cords = cords.rename(columns={"Object Name": "Unique Name"})
# Get unique load case names as a list
unique_output_cases = loads_df["Output Case"].unique().tolist()
# Merge loads and cords dataframe
merged_df = pd.merge(loads_df, cords, on="Unique Name", how="inner")
return unique_output_cases, merged_df.reset_index(drop=True)
def get_load_combos(params, **kwargs):
if params.xlsx_file:
load_combos, _ = process_etabs_file(params.xlsx_file) # Only use the first returned item, the load_combos
return load_combos
return []
class Parametrization(vkt.Parametrization):
intro = vkt.Text("""
# ETABS reaction heatmap
This app allows you to inspect results from an uploaded ETABS output file. Export your ETABS model results to an .xlsx file and upload it below. After uploading your Excel file, select the load combination you want to visualize.
Ensure the file includes the tables:
- **Joint Reactions**
- **Objects and Elements - Joints**
""")
xlsx_file = vkt.FileField("Upload ETABS exported .xlsx")
lb = vkt.LineBreak()
selected_load_combo = vkt.OptionField("Select available load combos", options=get_load_combos)
class Controller(vkt.Controller):
parametrization = Parametrization
```
By replacing the `options=[]` with a reference to the callback function (`options=get_load_combos`) we fill the field with the processed load combos from the file (if there is a file uploaded).
## 4. Visualize reaction loads with Plotly[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#4-visualize-reaction-loads-with-plotly "Direct link to 4. Visualize reaction loads with Plotly")
Once the user selected a load combination, we filter the data to focus on the selected load combination. Then we use Plotly to generate an interactive heat map. To visualize a Plotly figure in a VIKTOR app we can add a `PloltyView` method to the `Controller`.
We will add a scatter plot to represent each joint from the ETABS data, with its color indicating the magnitude of the reaction load (FZ) in kN. This visualization allows you to clearly observe how loads are distributed across the base floor, making it easier to analyze and interpret the results.
Copy the **highlighted** piece of code and add it to `app.py`. Don't forget importing ploty on line 3!
```
import viktor as vkt
import pandas as pd
import plotly.graph_objects as go
def process_etabs_file(uploaded_file):
# Read the file into a dataframe
sheet_names = ["Joint Reactions", "Objects and Elements - Joints"]
with uploaded_file.open_binary() as fr:
dataframes = pd.read_excel(fr, sheet_name=sheet_names, skiprows=1)
# Process the 'Joint Reactions' dataframe
loads_df = dataframes["Joint Reactions"].dropna(subset=["Unique Name", "Output Case"]).copy()
# Process the 'Objects and Elements - Joints' dataframe
cords = dataframes["Objects and Elements - Joints"].dropna(
subset=["Element Name", "Object Name", "Global X", "Global Y", "Global Z"]
).copy()
cords = cords.rename(columns={"Object Name": "Unique Name"})
# Get unique load case names as a list
unique_output_cases = loads_df["Output Case"].unique().tolist()
# Merge loads and cords dataframe
merged_df = pd.merge(loads_df, cords, on="Unique Name", how="inner")
return unique_output_cases, merged_df.reset_index(drop=True)
def get_load_combos(params, **kwargs):
if params.xlsx_file:
load_combos, _ = process_etabs_file(params.xlsx_file) # Only use the first returned item, the load_combos
return load_combos
return []
class Parametrization(vkt.Parametrization):
intro = vkt.Text("""
# ETABS reaction heatmap
This app allows you to inspect results from an uploaded ETABS output file. Export your ETABS model results to an .xlsx file and upload it below. After uploading your Excel file, select the load combination you want to visualize.
Ensure the file includes the tables:
- **Joint Reactions**
- **Objects and Elements - Joints**
""")
xlsx_file = vkt.FileField("Upload ETABS exported .xlsx")
lb = vkt.LineBreak()
selected_load_combo = vkt.OptionField("Select available load combos", options=get_load_combos)
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.PlotlyView("Heatmap")
def plot_heat_map(params,**kwargs):
if params.selected_load_combo:
_, merged_df = process_etabs_file(params.xlsx_file)
# Filter the dataframe based on the selected load combination
filtered_df = merged_df[merged_df["Output Case"] == params.selected_load_combo]
FZ_min, FZ_max = filtered_df["FZ"].min(), filtered_df["FZ"].max()
# Create plotly scatter plot
fig = go.Figure(
data=go.Scatter(
x=filtered_df["Global X"],
y=filtered_df["Global Y"],
mode='markers+text',
marker=dict(
size=16,
color=filtered_df["FZ"],
colorscale=[
[0, "green"],
[0.5, "yellow"],
[1, "red"]
],
colorbar=dict(title="FZ (kN)"),
cmin=FZ_min,
cmax=FZ_max
),
text=[f"{fz:.1f}" for fz in filtered_df["FZ"]],
textposition="top right"
)
)
# Style the plot
fig.update_layout(
title=f"Heatmap for Output Case: {params.selected_load_combo}",
xaxis_title="X (m)",
yaxis_title="Y (m)",
plot_bgcolor='rgba(0,0,0,0)',
)
fig.update_xaxes(
linecolor='LightGrey',
tickvals=filtered_df["Global X"],
ticktext=[f"{x / 1000:.3f}" for x in filtered_df["Global X"]],
)
fig.update_yaxes(
linecolor='LightGrey',
tickvals=filtered_df["Global Y"],
ticktext=[f"{y / 1000:.3f}" for y in filtered_df["Global Y"]],
)
return vkt.PlotlyResult(fig)
else:
return vkt.PlotlyResult({})
```
### This code explained[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#this-code-explained "Direct link to This code explained")
1. At the top of the file, we import Plotly, which we'll use to create the plot
2. At the top of the function, we use `process_etabs_file` again, but this time we only use the second returned item, the merged dataframe.
3. The dataframe is filtered, based on the selected option in `params.selected_load_combo`. We also find the lowest and highest values for FZ.
4. Using Plotly, we create a scatter plot based on the filtered dataframe. Using the lowest and highest values for F the colors are determined for each point.
5. Finally, we apply some styling to the figure, like adding a title, setting linecolors and text for the tickmarks
### The resulting app[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#the-resulting-app "Direct link to The resulting app")
Refresh your app in the browser. You will now see the empty graph appear on the right side of the screen. You can now upload the Excel sheet with ETABS loads in the upload field. After that select one of the load combinations, and a heatmap will display the magnitudes, color-coded, along with the joint locations. You can try any combination and test it with any ETABS model. Our final app will look like this:

## Complete code[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#complete-code "Direct link to Complete code")
Were you able to do everything in this tutorial without error? If not, you can always look at the full code:
```
import viktor as vkt
import pandas as pd
import plotly.graph_objects as go
def process_etabs_file(uploaded_file):
# Read the file into a dataframe
sheet_names = ["Joint Reactions", "Objects and Elements - Joints"]
with uploaded_file.open_binary() as fr:
dataframes = pd.read_excel(fr, sheet_name=sheet_names, skiprows=1)
# Process the 'Joint Reactions' dataframe
loads_df = dataframes["Joint Reactions"].dropna(subset=["Unique Name", "Output Case"]).copy()
# Process the 'Objects and Elements - Joints' dataframe
cords = dataframes["Objects and Elements - Joints"].dropna(
subset=["Element Name", "Object Name", "Global X", "Global Y", "Global Z"]
).copy()
cords = cords.rename(columns={"Object Name": "Unique Name"})
# Get unique load case names as a list
unique_output_cases = loads_df["Output Case"].unique().tolist()
# Merge loads and cords dataframe
merged_df = pd.merge(loads_df, cords, on="Unique Name", how="inner")
return unique_output_cases, merged_df.reset_index(drop=True)
def get_load_combos(params, **kwargs):
if params.xlsx_file:
load_combos, _ = process_etabs_file(params.xlsx_file)
return load_combos
return []
class Parametrization(vkt.Parametrization):
intro = vkt.Text("""
# ETABS reaction heatmap
This app allows you to inspect results from an uploaded ETABS output file. Export your ETABS model results to an .xlsx file and upload it below. After uploading your Excel file, select the load combination you want to visualize.
Ensure the file includes the tables:
- **Joint Reactions**
- **Objects and Elements - Joints**
""")
xlsx_file = vkt.FileField("Upload ETABS exported .xlsx")
lb = vkt.LineBreak()
selected_load_combo = vkt.OptionField("Select available load combos", options=get_load_combos)
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.PlotlyView("Heatmap")
def plot_heat_map(params,**kwargs):
if params.selected_load_combo:
_, merged_df = process_etabs_file(params.xlsx_file)
# Filter the dataframe based on the selected load combination
filtered_df = merged_df[merged_df["Output Case"] == params.selected_load_combo]
FZ_min, FZ_max = filtered_df["FZ"].min(), filtered_df["FZ"].max()
# Create plotly scatter plot
fig = go.Figure(
data=go.Scatter(
x=filtered_df["Global X"],
y=filtered_df["Global Y"],
mode='markers+text',
marker=dict(
size=16,
color=filtered_df["FZ"],
colorscale=[
[0, "green"],
[0.5, "yellow"],
[1, "red"]
],
colorbar=dict(title="FZ (kN)"),
cmin=FZ_min,
cmax=FZ_max
),
text=[f"{fz:.1f}" for fz in filtered_df["FZ"]],
textposition="top right"
)
)
# Style the plot
fig.update_layout(
title=f"Heatmap for Output Case: {params.selected_load_combo}",
xaxis_title="X (m)",
yaxis_title="Y (m)",
plot_bgcolor='rgba(0,0,0,0)',
)
fig.update_xaxes(
linecolor='LightGrey',
tickvals=filtered_df["Global X"],
ticktext=[f"{x / 1000:.3f}" for x in filtered_df["Global X"]],
)
fig.update_yaxes(
linecolor='LightGrey',
tickvals=filtered_df["Global Y"],
ticktext=[f"{y / 1000:.3f}" for y in filtered_df["Global Y"]],
)
return vkt.PlotlyResult(fig)
else:
return vkt.PlotlyResult({})
```
## Export your own results from ETABS[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#export-your-own-results-from-etabs "Direct link to Export your own results from ETABS")
If you want to try this app with your own data, first run your analysis and then export the reaction loads from your ETABS model. Navigate to `File menu > Export > ETABS Tables to Excel` within ETABS, and select the **Joint Reactions** and **Objects and Elements - Joints** tables, as shown in the figure below:

warning
Ensure that your exported Excel file contains these specific sheets. Without them, the app won’t be able to read and process the data correctly. Set the model units to international system units. The model expects the loads in kN and in millimeters (mm).
## What's next?[](https://docs.viktor.ai/docs/tutorials/process-etabs-data/.md#whats-next "Direct link to What's next?")
In this tutorial, you learned how to post-process results exported from ETABS. Your next goal could be to implement automation using the CSI API from your VIKTOR app. To achieve this, the best place to start is the following [tutorial](https://docs.viktor.ai/docs/tutorials/integrate-etabs-sap2000/.md).
If you want to explore more use cases where VIKTOR shines, feel free to check out our other [tutorials](https://docs.viktor.ai/docs/tutorials/.md)!
---
# Tutorial - Post-process STAAD.Pro data
note
Level: **Beginners**
Time: **20 min**
Prerequisites:
* You have an account and completed the installation process. No account? Get one [here](https://www.viktor.ai/start-building-apps)
* You have some experience with reading Python code
* [](https://www.viktor.ai/start-building-apps)
In this tutorial, you will build a VIKTOR app to process and visualize outputs from STAAD.PRO. You’ll learn how to export these outputs from STAAD.PRO into a VIKTOR web app and post-process design ratios for various cross-sections. Filtering, grouping, and visualizing these design ratio outputs is not possible directly in STAAD.PRO, and there is no native way to export these results directly to Excel. This tutorial will guide you through overcoming these limitations while exploring the powerful tools and building blocks that VIKTOR and Pandas provide.
Here is what we'll cover:
* [Create an app with an input block to receive STAAD.PRO data](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#1-basic-setup)
* [Create the structure of our app with steps](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#2-creating-the-structure-of-our-app)
* [Process the STAAD.PRO data](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#3-process-the-staadpro-data)
* [Allow user selection, grouping, and filtering of cross-sections](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#4-allow-user-selection-of-cross-sections)
* [Visualize results based on those selections](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#5-visualize-design-ratios-with-viktor)
By the end of this tutorial, you will be able to generate a table with a heatmap displaying design ratios for your structure by filtering or grouping specific cross-sections. You will also have the opportunity to test this using your own data by following the steps outlined in the final section of the tutorial. This will help you gain valuable insights from your results and effectively share them with your clients and team.

## 1. Basic setup[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#1-basic-setup "Direct link to 1. Basic setup")
Let’s create, install, and start a blank app template. We’ll use this blank template as the base for our design ratios app. Before we begin, ensure that any running app (like the demo app) is stopped. You can do this by closing the command-line shell (e.g., PowerShell) or by canceling the process with `Ctrl + C`.
1. Open a terminal and run the following command to create the app on the VIKTOR platform and generate the initial code locally:
```
viktor-cli create-app "STAAD data tutorial" --init --app-type editor
```
2. Open the newly created folder in your code editor and run `viktor-cli clean-start` in the terminal to install dependencies and connect the app to the platform.
If all went well, your empty app is installed and connected to your development workspace. **Do not close the terminal** as this will break the connection with your app. The terminal in your code editor should show something like this:
```
INFO : Connecting to cloud.viktor.ai...
INFO : Connection is established:
INFO :
INFO : https://cloud.viktor.ai/workspaces/XXX/app <--- navigate here to find your app
INFO :
INFO : The connection can be closed using Ctrl+C
INFO : App is ready
```
RE-STARTING YOUR APP
You only need to create an app template and install it once for each new app you want to make. The app will update automatically once you start adding code in `app.py`, as long as you don't close the terminal or your code editor. Did you close your code editor? Use `viktor-cli start` to start the app again. No need to install, clear, etc.
### Adding useful Python packages[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#adding-useful-python-packages "Direct link to Adding useful Python packages")
We want to use Pandas and VIKTOR as our only dependencies in this app. Open `requirements.txt` and add `pandas` under your `viktor` version (do not change that line):
```
viktor==X.X.X # Don’t modify this line
pandas
```
Next, close the connection to your app in the terminal (if the app has been connected automatically). You can do this by using `Ctrl+C`. Open a new terminal and install the new dependencies (like `pandas`) in your Python environment by running this command:
```
viktor-cli install
```
And after that, connect your app to the VIKTOR platform again:
```
viktor-cli start
```
**Keep the terminal open**, as closing it will disconnect your app.
## 2. Creating the structure of our app[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#2-creating-the-structure-of-our-app "Direct link to 2. Creating the structure of our app")
In this step, we will create the structure of our app by organizing it into steps using `vkt.Step`. This will help us separate the application into inputs and outputs. In the first step, we input the data coming from STAAD.PRO with the `vkt.Table`, and in the second step, we filter and group the results with a `TableView`.
Later, we will add a `TableView` and the logic for the filtering and grouping components on step 2.
Feel free to copy and paste the highlighted lines of code into `app.py`, save the file, and refresh the app in the browser. You should now see the input fields you just added to the code.
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
step_1 = vkt.Step("Step 1 - Input Your Data!")
step_1.intro = vkt.Text("""
# STAAD Design Ratio Analyzer
This app allows you to visualize a heat map from your STAAD.PRO model results.
You can filter and group them based on cross sections and visualize how they are distributed.""")
step_1.table_input = vkt.Text("""
## 1.0 Create the Input Table!
Paste the design ratio data from your STAAD.PRO model!""")
step_1.table = vkt.Table("### Beam Design Analysis")
step_1.table.col_beam = vkt.TextField("Beam")
step_1.table.col_analysis_property = vkt.TextField("Analysis Property")
step_1.table.col_design_property = vkt.TextField("Design Property")
step_1.table.col_actual_ratio = vkt.NumberField("Actual Ratio")
step_1.table.col_allowable_ratio = vkt.NumberField("Allowable Ratio")
step_1.table.col_normalized_ratio = vkt.NumberField("Normalized Ratio")
step_1.table.col_clause = vkt.TextField("Clause")
step_1.table.col_load_case = vkt.TextField("L/C")
step_1.table.col_ax = vkt.TextField("Ax in²")
step_1.table.col_iz = vkt.TextField("Iz in⁴")
step_1.table.col_iy = vkt.TextField("Iy in⁴")
step_1.table.col_ix = vkt.TextField("Ix in⁴")
step_2 = vkt.Step("Step 2 - Post-Processing")
step_2.process = vkt.Text("""
## 2.0 Filter and Group
Group or filter by a specific cross section.
Use the options below to customize your view.
If you want to list all cross-sections after selecting one, you can select the "All" option!
""")
step_2.group = vkt.BooleanField("### Group by Cross-Section")
step_2.ln_break = vkt.LineBreak()
step_2.cross_section = vkt.OptionField(
"### Filter by Cross-Section", options=["Empty Options"]
)
class Controller(vkt.Controller):
parametrization = Parametrization()
```
### How this works[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#how-this-works "Direct link to How this works")
* We organized our app into two steps using `vkt.Step`:
* **Step 1** is for inputting data. We added introductory text using `vkt.Text` and created a table called `step_1.table` using `vkt.Table`. This table replicates the columns from the design ratio table in STAAD.PRO.
* **Step 2** is for post-processing. This step includes the following features:
* **Filtering**:
* We use **`vkt.OptionField`** to show a list of cross-sections that the user can select.
* Only design ratios of the selected cross-section will be displayed.
* **Grouping**:
* We use **`vkt.BooleanField`** to let the user group the design ratios by cross-section.
* When grouping is enabled, the app displays only the **maximum design ratio** for each cross-section.
* The `Controller` class sets `parametrization = Parametrization()` to link our parametrization to the controller.
The result should look like the image below. Now that the inputs are ready, we will move on to process the STAAD.PRO data.

## 3. Process the STAAD.PRO data[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#3-process-the-staadpro-data "Direct link to 3. Process the STAAD.PRO data")
### Sample STAAD.PRO design ratio data[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#sample-staadpro-design-ratio-data "Direct link to Sample STAAD.PRO design ratio data")
For this tutorial, you can use this in [TXT format](https://docs.viktor.ai/files/docs/simple-staadpro-tutorial/sample_data.txt), which you can copy and paste into our `vkt.Table`. However, you can use your **own** design ratio data from STAAD.PRO. At the end of this tutorial, we will guide you on how to get this data from STAAD.PRO.
info
The last section of this tutorial shows how to get this data from STAAD.PRO. For now, you can use the sample `.TXT` file to complete and test the app!
### Processing the STAAD.PRO data[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#processing-the-staadpro-data "Direct link to Processing the STAAD.PRO data")
The next step is to process the data from the `vkt.Table`. It's a good idea to do this processing in a separate function, which we'll name `generate_dataframe`. This function will convert the table data into a **Pandas DataFrame** and rename the columns for easier access.
Below is the logic in the code, along with a breakdown. Add the highlighted lines of code to `app.py` and save the file.
```
import viktor as vkt
import pandas as pd
def generate_dataframe(table_data):
df = pd.DataFrame([dict(item) for item in table_data])
df.rename(
columns={
"col_beam": "Beam",
"col_analysis_property": "Analysis Property",
"col_design_property": "Design Property",
"col_actual_ratio": "Actual Ratio",
"col_allowable_ratio": "Allowable Ratio",
"col_normalized_ratio": "Normalized Ratio (Actual/Allowable)",
"col_clause": "Clause",
"col_load_case": "L/C",
"col_ax": "Ax in²",
"col_iz": "Iz in⁴",
"col_iy": "Iy in⁴",
"col_ix": "Ix in⁴",
},
inplace=True,
)
return df
class Parametrization(vkt.Parametrization):
step_1 = vkt.Step("Step 1 - Input Your Data!")
step_1.intro = vkt.Text("""
# STAAD Design Ratio Analyzer
This app allows you to visualize a heat map from your STAAD.PRO model results.
You can filter and group them based on cross sections and visualize how they are distributed.""")
step_1.table_input = vkt.Text("""
## 1.0 Create the Input Table!
Paste the design ratio data from your STAAD.PRO model!""")
step_1.table = vkt.Table("### Beam Design Analysis")
step_1.table.col_beam = vkt.TextField("Beam")
step_1.table.col_analysis_property = vkt.TextField("Analysis Property")
step_1.table.col_design_property = vkt.TextField("Design Property")
step_1.table.col_actual_ratio = vkt.NumberField("Actual Ratio")
step_1.table.col_allowable_ratio = vkt.NumberField("Allowable Ratio")
step_1.table.col_normalized_ratio = vkt.NumberField("Normalized Ratio")
step_1.table.col_clause = vkt.TextField("Clause")
step_1.table.col_load_case = vkt.TextField("L/C")
step_1.table.col_ax = vkt.TextField("Ax in²")
step_1.table.col_iz = vkt.TextField("Iz in⁴")
step_1.table.col_iy = vkt.TextField("Iy in⁴")
step_1.table.col_ix = vkt.TextField("Ix in⁴")
step_2 = vkt.Step("Step 2 - Post-Processing")
step_2.process = vkt.Text("""
## 2.0 Filter and Group
Group or filter by a specific cross section.
Use the options below to customize your view.
If you want to list all cross-sections after selecting one, you can select the "All" option!
""")
step_2.group = vkt.BooleanField("### Group by Cross-Section")
step_2.ln_break = vkt.LineBreak()
step_2.cross_section = vkt.OptionField(
"### Filter by Cross-Section", options=["Empty Options"]
)
class Controller(vkt.Controller):
parametrization = Parametrization()
```
### How this works[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#how-this-works-1 "Direct link to How this works")
* At the top of the file, we import `pandas`, which we'll use to manipulate the data.
* The function `generate_dataframe` converts the table data from the `Parametrization` into a `DataFrame` and renames the columns to more readable names.
* This function returns the `DataFrame`, which will be used later to process and visualize the data.
## 4. Allow user selection of cross-sections[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#4-allow-user-selection-of-cross-sections "Direct link to 4. Allow user selection of cross-sections")
Now that we have implemented the `generate_dataframe` function, we can use the resulting DataFrame to create a list of cross sections. To do this, we can get the unique cross-section names from the "Design Property" column and convert them into a list. This list will be used in our `OptionField`. You can update the code as shown in the code snippet below!
```
import viktor as vkt
import pandas as pd
def generate_dataframe(table_data):
df = pd.DataFrame([dict(item) for item in table_data])
df.rename(
columns={
"col_beam": "Beam",
"col_analysis_property": "Analysis Property",
"col_design_property": "Design Property",
"col_actual_ratio": "Actual Ratio",
"col_allowable_ratio": "Allowable Ratio",
"col_normalized_ratio": "Normalized Ratio (Actual/Allowable)",
"col_clause": "Clause",
"col_load_case": "L/C",
"col_ax": "Ax in²",
"col_iz": "Iz in⁴",
"col_iy": "Iy in⁴",
"col_ix": "Ix in⁴",
},
inplace=True,
)
return df
def get_cross_sections(params, **kwargs):
if params.step_1.table:
df = generate_dataframe(params.step_1.table)
secs = df["Design Property"].unique().tolist()
secs.append("All")
return secs
return ["No data available! Please add table input."]
class Parametrization(vkt.Parametrization):
step_1 = vkt.Step("Step 1 - Input Your Data!")
step_1.intro = vkt.Text("""
# STAAD Design Ratio Analyzer
This app allows you to visualize a heat map from your STAAD.PRO model results.
You can filter and group them based on cross sections and visualize how they are distributed.""")
step_1.table_input = vkt.Text("""
## 1.0 Create the Input Table!
Paste the design ratio data from your STAAD.PRO model!""")
step_1.table = vkt.Table("### Beam Design Analysis")
step_1.table.col_beam = vkt.TextField("Beam")
step_1.table.col_analysis_property = vkt.TextField("Analysis Property")
step_1.table.col_design_property = vkt.TextField("Design Property")
step_1.table.col_actual_ratio = vkt.NumberField("Actual Ratio")
step_1.table.col_allowable_ratio = vkt.NumberField("Allowable Ratio")
step_1.table.col_normalized_ratio = vkt.NumberField("Normalized Ratio")
step_1.table.col_clause = vkt.TextField("Clause")
step_1.table.col_load_case = vkt.TextField("L/C")
step_1.table.col_ax = vkt.TextField("Ax in²")
step_1.table.col_iz = vkt.TextField("Iz in⁴")
step_1.table.col_iy = vkt.TextField("Iy in⁴")
step_1.table.col_ix = vkt.TextField("Ix in⁴")
step_2 = vkt.Step("Step 2 - Post-Processing")
step_2.process = vkt.Text("""
## 2.0 Filter and Group
Group or filter by a specific cross section.
Use the options below to customize your view.
If you want to list all cross-sections after selecting one, you can select the "All" option!
""")
step_2.group = vkt.BooleanField("### Group by Cross-Section")
step_2.ln_break = vkt.LineBreak()
step_2.cross_section = vkt.OptionField(
"### Filter by Cross-Section", options=get_cross_sections
)
class Controller(vkt.Controller):
parametrization = Parametrization()
```
### How this works[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#how-this-works-2 "Direct link to How this works")
* The `get_cross_sections` function reads the DataFrame and extracts the unique values from the 'Design Property' column.
* These unique cross-sections are returned as a list to be used as options in the `cross_section` `OptionField`. We also append "All" to the list to allow viewing all cross sections.
* By setting `options=get_cross_sections` in the `OptionField`, we fill the field with the cross sections from the data (if there is data input).
## 5. Visualize design ratios with VIKTOR[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#5-visualize-design-ratios-with-viktor "Direct link to 5. Visualize design ratios with VIKTOR")
After the user inputs data into the `vkt.Table`, we want to create clear visualizations and add functionality to the `vkt.BooleanField` and `vkt.OptionField` for grouping and filtering.
To do this, we will add a `TableView` that shows the design ratios in a table, sorted and colored based on their values. The logic for this will be implemented in the `table_design_ratios` method inside the `Controller` class.
In addition, we will use a complementary function called `get_cell_color` to assign a color based on the design ratio values. This will allow us to create a heatmap within the table.
Copy the highlighted piece of code and add it to `app.py`.
```
import viktor as vkt
import pandas as pd
def generate_dataframe(table_data):
df = pd.DataFrame([dict(item) for item in table_data])
df.rename(
columns={
"col_beam": "Beam",
"col_analysis_property": "Analysis Property",
"col_design_property": "Design Property",
"col_actual_ratio": "Actual Ratio",
"col_allowable_ratio": "Allowable Ratio",
"col_normalized_ratio": "Normalized Ratio (Actual/Allowable)",
"col_clause": "Clause",
"col_load_case": "L/C",
"col_ax": "Ax in²",
"col_iz": "Iz in⁴",
"col_iy": "Iy in⁴",
"col_ix": "Ix in⁴",
},
inplace=True,
)
return df
def get_cross_sections(params, **kwargs):
if params.step_1.table:
df = generate_dataframe(params.step_1.table)
secs = df["Design Property"].unique().tolist()
secs.append("All")
return secs
return ["No data available! Please add table input."]
class Parametrization(vkt.Parametrization):
step_1 = vkt.Step("Step 1 - Input Your Data!")
step_1.intro = vkt.Text("""
# STAAD Design Ratio Analyzer
This app allows you to visualize a heat map from your STAAD.PRO model results.
You can filter and group them based on cross sections and visualize how they are distributed.""")
step_1.table_input = vkt.Text("""
## 1.0 Create the Input Table!
Paste the design ratio data from your STAAD.PRO model!""")
step_1.table = vkt.Table("### Beam Design Analysis")
step_1.table.col_beam = vkt.TextField("Beam")
step_1.table.col_analysis_property = vkt.TextField("Analysis Property")
step_1.table.col_design_property = vkt.TextField("Design Property")
step_1.table.col_actual_ratio = vkt.NumberField("Actual Ratio")
step_1.table.col_allowable_ratio = vkt.NumberField("Allowable Ratio")
step_1.table.col_normalized_ratio = vkt.NumberField("Normalized Ratio")
step_1.table.col_clause = vkt.TextField("Clause")
step_1.table.col_load_case = vkt.TextField("L/C")
step_1.table.col_ax = vkt.TextField("Ax in²")
step_1.table.col_iz = vkt.TextField("Iz in⁴")
step_1.table.col_iy = vkt.TextField("Iy in⁴")
step_1.table.col_ix = vkt.TextField("Ix in⁴")
step_2 = vkt.Step("Step 2 - Post-Processing", views=["table_design_ratios"])
step_2.process = vkt.Text("""
## 2.0 Filter and Group
Group or filter by a specific cross section.
Use the options below to customize your view.
If you want to list all cross-sections after selecting one, you can select the "All" option!
""")
step_2.group = vkt.BooleanField("### Group by Cross-Section")
step_2.ln_break = vkt.LineBreak()
step_2.cross_section = vkt.OptionField(
"### Filter by Cross-Section", options=get_cross_sections
)
class Controller(vkt.Controller):
parametrization = Parametrization()
@vkt.TableView(label="Design Ratios by Cross Section")
def table_design_ratios(self, params, **kwargs):
if not params.step_1.table or len(params.step_1.table) == 0:
return vkt.TableResult([["No data available! Please add table input."]])
df = generate_dataframe(params.step_1.table)
# Group or filter the data based on user selection
if params.step_2.group:
# For each cross section, get the row with the maximum normalized ratio
df = df.loc[
df.groupby("Design Property")[
"Normalized Ratio (Actual/Allowable)"
].idxmax()
].reset_index(drop=True)
if params.step_2.cross_section and params.step_2.cross_section != "All":
df = df[df["Design Property"] == params.step_2.cross_section]
# Drop unnecessary columns
df.drop(
["Ax in²", "Iz in⁴", "Iy in⁴", "Ix in⁴", "Analysis Property", "Clause"],
axis=1,
inplace=True,
)
# Sort the DataFrame by Normalized Ratio in descending order
df.sort_values(
by="Normalized Ratio (Actual/Allowable)", ascending=False, inplace=True
)
# Create table data with color-coded cells
data = []
for _, row in df.iterrows():
ratio = row["Normalized Ratio (Actual/Allowable)"]
color = self.get_cell_color(ratio)
row_data = row.tolist()
row_data[4] = vkt.TableCell(ratio, background_color=color)
data.append(row_data)
return vkt.TableResult(
data, column_headers=df.columns.tolist(), enable_sorting_and_filtering=True
)
def get_cell_color(self, ratio):
if ratio >= 1:
return vkt.Color(210, 0, 0) # Red
elif ratio >= 0.85:
return vkt.Color(255, 165, 0) # Orange
else:
return vkt.Color(0, 210, 0) # Green
```
### How this works[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#how-this-works-3 "Direct link to How this works")
* We added the `table_design_ratios` method decorated with `@vkt.TableView`, which returns a `TableResult` to be displayed in the app.
* We specified `views=["table_design_ratios"]` in `step_2`, so the `TableView` will appear in Step 2.
* We check if there's data available; if not, we return a message indicating that to the user.
* Depending on the user's selection of `group` and `cross_section`, we group or filter the DataFrame.
* If `group` is selected, we group the data by "Design Property" and keep the row with the maximum "Normalized Ratio (Actual/Allowable)" for each group.
* If a `cross_section` is selected and it's not "All", we filter the DataFrame to only include that cross-section.
* We drop unnecessary columns to keep the table clean.
* We sort the DataFrame by "Normalized Ratio (Actual/Allowable)" in descending order.
* For each row, we create a `TableCell` for the "Normalized Ratio" column, setting the background color based on the value using the `get_cell_color` function.
* The `get_cell_color` function determines the color based on the ratio value:
* Ratios >= 1 are colored red (overutilized)
* Ratios >= 0.85 and < 1 are colored orange (approaching maximum capacity)
* Ratios < 0.85 are colored green (underutilized)
## The resulting app[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#the-resulting-app "Direct link to The resulting app")
Refresh your app in the browser. You will now see the table view appear in Step 2 of your app. For testing, feel free to copy the rows of the TXT file from [section 3](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#3-process-the-staadpro-data), then create a new row in the table. Click the top-left checkbox, press `Ctrl + V`, and you will see your rows being populated. After that, you can choose to group or filter the results by cross-section and analyze them.

note
Ensure that there are no empty rows in the `vkt.Table`; otherwise, the app will complain. You can right-click on an empty row and delete it.
You can use the **"Group by Cross-Section"** toggle to view the maximum design ratios for each cross-section. Alternatively, you can use the **"Filter by Cross-Section"** dropdown to focus on a specific cross-section and see how its design ratios are distributed. This provides flexibility in analyzing the data based on your needs.
## Complete code[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#complete-code "Direct link to Complete code")
Were you able to do everything in this tutorial without error? If not, you can always look at the full code:
```
import viktor as vkt
import pandas as pd
def generate_dataframe(table_data):
df = pd.DataFrame([dict(item) for item in table_data])
df.rename(
columns={
"col_beam": "Beam",
"col_analysis_property": "Analysis Property",
"col_design_property": "Design Property",
"col_actual_ratio": "Actual Ratio",
"col_allowable_ratio": "Allowable Ratio",
"col_normalized_ratio": "Normalized Ratio (Actual/Allowable)",
"col_clause": "Clause",
"col_load_case": "L/C",
"col_ax": "Ax in²",
"col_iz": "Iz in⁴",
"col_iy": "Iy in⁴",
"col_ix": "Ix in⁴",
},
inplace=True,
)
return df
def get_cross_sections(params, **kwargs):
if params.step_1.table:
df = generate_dataframe(params.step_1.table)
secs = df["Design Property"].unique().tolist()
secs.append("All")
return secs
return ["No data available! Please add table input."]
class Parametrization(vkt.Parametrization):
step_1 = vkt.Step("Step 1 - Input Your Data!")
step_1.intro = vkt.Text("""
# STAAD Design Ratio Analyzer
This app allows you to visualize a heat map from your STAAD.PRO model results.
You can filter and group them based on cross sections and visualize how they are distributed.""")
step_1.table_input = vkt.Text("""
## 1.0 Create the Input Table!
Paste the design ratio data from your STAAD.PRO model!""")
step_1.table = vkt.Table("### Beam Design Analysis")
step_1.table.col_beam = vkt.TextField("Beam")
step_1.table.col_analysis_property = vkt.TextField("Analysis Property")
step_1.table.col_design_property = vkt.TextField("Design Property")
step_1.table.col_actual_ratio = vkt.NumberField("Actual Ratio")
step_1.table.col_allowable_ratio = vkt.NumberField("Allowable Ratio")
step_1.table.col_normalized_ratio = vkt.NumberField("Normalized Ratio")
step_1.table.col_clause = vkt.TextField("Clause")
step_1.table.col_load_case = vkt.TextField("L/C")
step_1.table.col_ax = vkt.TextField("Ax in²")
step_1.table.col_iz = vkt.TextField("Iz in⁴")
step_1.table.col_iy = vkt.TextField("Iy in⁴")
step_1.table.col_ix = vkt.TextField("Ix in⁴")
step_2 = vkt.Step("Step 2 - Post-Processing", views=["table_design_ratios"])
step_2.process = vkt.Text("""
## 2.0 Filter and Group
Group or filter by a specific cross section.
Use the options below to customize your view.
If you want to list all cross-sections after selecting one, you can select the "All" option!
""")
step_2.group = vkt.BooleanField("### Group by Cross-Section")
step_2.ln_break = vkt.LineBreak()
step_2.cross_section = vkt.OptionField(
"### Filter by Cross-Section", options=get_cross_sections
)
class Controller(vkt.Controller):
parametrization = Parametrization()
@vkt.TableView(label="Design Ratios by Cross Section")
def table_design_ratios(self, params, **kwargs):
if not params.step_1.table or len(params.step_1.table) == 0:
return vkt.TableResult([["No data available! Please add table input."]])
df = generate_dataframe(params.step_1.table)
# Group or filter the data based on user selection
if params.step_2.group:
# For each cross section, get the row with the maximum normalized ratio
df = df.loc[
df.groupby("Design Property")[
"Normalized Ratio (Actual/Allowable)"
].idxmax()
].reset_index(drop=True)
if params.step_2.cross_section and params.step_2.cross_section != "All":
df = df[df["Design Property"] == params.step_2.cross_section]
# Drop unnecessary columns
df.drop(
["Ax in²", "Iz in⁴", "Iy in⁴", "Ix in⁴", "Analysis Property", "Clause"],
axis=1,
inplace=True,
)
# Sort the DataFrame by Normalized Ratio in descending order
df.sort_values(
by="Normalized Ratio (Actual/Allowable)", ascending=False, inplace=True
)
# Create table data with color-coded cells
data = []
for _, row in df.iterrows():
ratio = row["Normalized Ratio (Actual/Allowable)"]
color = self.get_cell_color(ratio)
row_data = row.tolist()
row_data[4] = vkt.TableCell(ratio, background_color=color)
data.append(row_data)
return vkt.TableResult(
data, column_headers=df.columns.tolist(), enable_sorting_and_filtering=True
)
def get_cell_color(self, ratio):
if ratio >= 1:
return vkt.Color(210, 0, 0) # Red
elif ratio >= 0.85:
return vkt.Color(255, 165, 0) # Orange
else:
return vkt.Color(0, 210, 0) # Green
```
## Export your own results from STAAD.PRO[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#export-your-own-results-from-staadpro "Direct link to Export your own results from STAAD.PRO")
To export the design ratios from your STAAD.PRO app, first run your analysis and design check. Then, right-click > **Tables** > **Design Results**, and simply copy and paste the data into the `vkt.Table` component in the app. Make sure there are no empty rows, and you are all set!
You can see how this process works in the animation below.

## What's next?[](https://docs.viktor.ai/docs/tutorials/process-staad-data/.md#whats-next "Direct link to What's next?")
In this tutorial, you learned how to post-process results exported from STAAD.PRO. Your next goal could be to implement automation using the STAAD.PRO API from your VIKTOR app. To achieve this, the best place to start is the following [tutorial](https://docs.viktor.ai/docs/tutorials/integrate-staadpro/.md).
---
# How to convert a Python Project to a VIKTOR app
info
Level: **Beginners**
Time: **30 min**
Prerequisites:
* You have some experience with reading Python code
* You have completed the installation and onboarding process of the VIKTOR platform
* You have a Python project or script that you would like to convert to a VIKTOR app
***Not a reader?** feel free to follow this tutorial as a video*
## Introduction[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#introduction "Direct link to Introduction")
Most Python projects start off with a simple script to help with a task, whether it is for automating or calculation purposes. These scripts can evolve into valuable tools that can have value far beyond your own use.
In general, what keeps these scripts from being utilized by others is that it often does not have a user-friendly way of being operated (for example an intuitive interface), it generally requires an extensive user manual, and that distribution is nearly impossible, as these scripts almost always require a set of dependencies that need to be installed, not mentioning the rights that need to be allocated to the user to be able to install these programs and packages.
The VIKTOR platform allows one to overcome these challenges by providing a platform, SDK and integration possibilities. In this piece we will provide a guide to easily convert your script into a VIKTOR web application, which will allow others to also share the value that you created, without the bottlenecks usually encountered.
In this guide, we will explore how to convert your Python project to a VIKTOR app. We will cover:
1. [Where to start](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#where-to-start)
2. [Let's convert your script!](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#lets-convert-your-script)
3. [What's next?](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#whats-next)
By the end of this guide, you will have a clear understanding how to convert your Python project to a VIKTOR app.
info
If you do not have a suitable Python script, consider writing something that you are familiar with such as a basic plot. This will remove the chance of knowledge gaps that you would have if you are given a script and allows you to focus on the VIKTOR elements.
Throughout the guide, we added some links with additional information; but don't let them distract you too much. Stay focused on understanding the content. After this, you will know everything you need to convert your Python project to an app.
## Where to start[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#where-to-start "Direct link to Where to start")
Faster alternative with the App Builder
You can also convert your Python script directly using the [App Builder](https://docs.viktor.ai/docs/app-builder/.md) — upload your script as context and it will generate the VIKTOR app for you.
For the sake of this guide it is important to understand the fundamentals and typical layout of a VIKTOR app. These fundamentals are, however, elaborated upon earlier during the VIKTOR onboarding. So, if you want to directly get started in the steps to convert your script to an app, skip to the [Let’s convert your script!](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#lets-convert-your-script)!
### VIKTOR framework fundamentals[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#viktor-framework-fundamentals "Direct link to VIKTOR framework fundamentals")
As the goal with this guide is to help you convert your script to a VIKTOR app, it is helpful to understand the fundamentals that make up the VIKTOR framework. In an attempt to give the clearest overview of the fundamentals, without oversimplifying, let us start with what we believe a good starting point is in understanding the VIKTOR framework. There are three aspects that are important to keep in mind when converting your script to an app, which are:
1. **Input:** The variables that can be adjusted for a calculation
2. **Results:** Results can either be presented visually or downloaded in a given file format.
3. **Stateless and containerized calculation:** A stateless calculation’s outcomes are not influenced by previous events, except if part of the calculation’s outcome is to alter the input (which will then alter the outcome of the next calculation). A deployed app also runs in isolation, which is what is meant by being containerized.
These three points are important to remember when considering converting a script to a VIKTOR application.
### VIKTOR code layout[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#viktor-code-layout "Direct link to VIKTOR code layout")
Now that we know how VIKTOR’s framework fundamentally works, let us look at an example of a VIKTOR app to explain a typical VIKTOR app code layout:

Be aware that this is just an example to explain the fundamentals from a code’s perspective, and that the VIKTOR platform provides an endless number of possibilities.
Noting above’s example, let us try to connect the fundamentals to this example.
#### Input[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#input "Direct link to Input")
As a fundamental, the VIKTOR platform forces the developer to determine what the input variables of the calculation should be. This is done by defining all input parameters in the `Parametrization` class. There is an extensive amount of input, so this should not limit the developer. Refer to the [User input, fields and buttons](https://docs.viktor.ai/docs/create-apps/user-input/.md) section in the documentation for a clear overview of the possibilities.

#### Results[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#results "Direct link to Results")
Whether the result of the calculation is a visualization of sorts or a download, this is a result of a method that is defined in the `Controller` class. A download is simply a file of bytes or strings, so any format can be downloaded. For visualizations, the following is possible:
* **Images** (PNG, JPEG, SVG, GIF): these formats need to be saved to memory by using `BytesIO`, `StringIO` or VIKTOR’s `File`
* **Maps**
* **3D geometries** (any object that can be converted to a glb/gltf format, or by using the primitive geometries available in the VIKTOR SDK)
* **PDFs**
* Any result in **HTML**
* **Plotly**
Refer to the [Results and visualizations](https://docs.viktor.ai/docs/create-apps/results-and-visualizations/.md) section in the documentation to read up more on this.

#### Stateless calculation[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#stateless-calculation "Direct link to Stateless calculation")
Any method that produces a result, presents a visualization, or produces a download must contain some logic. This logic can be defined directly in the method, split up into different methods, or defined in functions or classes in other files or directories within the app project. The requirement is that the code is written in such a way that the input provided (which can be retrieved from the `params` argument of the `Controller` class) always produces the same result when the input remains unchanged.
In the event where a stateful event is wanted, the VIKTOR platform provides a `Storage` capability that allows developers to write data to a storage database that can be retrieved for the next calculation.
#### Containerized calculation[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#containerized-calculation "Direct link to Containerized calculation")
As the intent of building a web app is to run it on a server rather than locally, the app with all its logic and files needs to be able to run in an isolated environment. Therefore, one needs to make sure that the entire development is done within the project folder, and that, when referring to files and folders, that these paths are referenced relatively.

#### *Other things to consider…*[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#other-things-to-consider "Direct link to other-things-to-consider")
* If your code is written such that files are written to your local drive, it is suggested to convert this to saving the file to memory, or to use the VIKTOR SDK `Storage` functionality to store the file to a database.
* If the Python code uses system dependencies or software that cannot be installed using `pip install`, we suggest using the integrations we provide. Or rewrite your code to use code that does not require these dependencies.
## Let’s convert your script\
Now that we know the VIKTOR platform from fundamentals, and we have an idea how the code structure works for a VIKTOR application, let’s take that knowledge to convert a script to a VIKTOR application.

Take the following steps:
### 1. Create a VIKTOR app project.[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#1-create-a-viktor-app-project "Direct link to 1. Create a VIKTOR app project.")
To create a new VIKTOR application project, use the `viktor-cli` to generate a project file structure automatically. The command to use is:
```
viktor-cli create-app --app-type editor
```
### 2. Collect all requirements of the python script.[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#2-collect-all-requirements-of-the-python-script "Direct link to 2. Collect all requirements of the python script.")
A good place to start would be to collect a list of all the python packages that are being used in the script. Some examples of frequently used Python packages are:
* Numpy
* Scipy
* Matplotlib
* Pandas
* Etc.
Add these packages to the `requirements.txt` file.
info
If the Python script only works for a given Python version, make sure to indicate this in the `viktor.config.toml` file.
### 3. Convert script to a function.[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#3-convert-script-to-a-function "Direct link to 3. Convert script to a function.")
A script can be converted to a VIKTOR app in many ways. One of the simpler ways of converting a script would be to rewrite the code such that it can run by calling a single function. This would entail you only need to consider what should be the result of the calculation, and then make sure that the result that you want to produce is returned by the function. E.g. if the result of the code is to produce a matplotlib plot, return a matplotlib figure, or if the result is a pandas dataframe, return that. If your code writes a file to a local drive, rewrite the code such that it returns the file as an object saved to memory, e.g. `BytesIO`, `StringIO` or `File`.
### 4. Create a view/download in the VIKTOR Controller[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#4-create-a-viewdownload-in-the-viktor-controller "Direct link to 4. Create a view/download in the VIKTOR Controller")
In this step we will create a view or download functionality that can be seen in the interface of the VIKTOR app. Here are the steps:
To use the newly created function in your VIKTOR app, import the function into the `app.py` file where the bare-bones VIKTOR app code structure resides.
Depending on whether you would like to create a download functionality or visualization, follow the steps described in the subsection:
#### 4.1 Download[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#41-download "Direct link to 4.1 Download")
Here are the steps for a download functionality:
1. Create a download button: In the `Parametrization`, create a field with a `DownloadButton`, similar to the code snippet presented below:
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
download_btn = vkt.DownloadButton('Download file', method='download_file')
```
2. In the `Controller`, create a method with the same name as defined in the `method` argument (in the given example, `download_file`). Here is an example how this would look like:
```
import viktor as vkt
class Controller(vkt.Controller):
parametrization = Parametrization
def download_file(self, params, **kwargs):
return vkt.DownloadResult(file_content='', file_name='my_file.txt')
```
3. Add your function to the method. The `file_content` that the VIKTOR platform expects is either string, bytes, `File` or `BytesIO`. Therefore, make sure to convert the type produced by the function if it does not suit any of the given types.
```
import viktor as vkt
from .my_project import my_function # assuming that your function is within another file
# Assuming that your function is within this project
def my_function():
...
return
class Controller(vkt.Controller):
parametrization = Parametrization
def download_file(self, params, **kwargs):
result = my_function()
return vkt.DownloadResult(file_content=result, file_name='my_file.txt')
```
#### 4.2 Visualization[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#42-visualization "Direct link to 4.2 Visualization")
Here are the steps for a visualization:
1. Determine what type of visualization you want to create from the result of your function.
2. In the `Controller`, create a method with your name of choice. The result to be returned by the method is dependent on the type of visualization.
3. Add a decorator to your method that suits your visualization.
4. Add your function to the method. Depending on the View, the result may differ. Therefore, make sure to check the documentation for that given view, and convert the type produced by the function to the format that is expected.
Here is an example of the result of the four steps:
```
import viktor as vkt
from .my_project import my_function # assuming that your function is within another file
# Assuming that your function is within this project
def my_function():
...
return
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.WebView("My View")
def create_plot(self, params, **kwargs):
my_result = my_function()
return vkt.WebResult(my_result)
```
Here is a table overview of the steps, with the possible options:
| Steps | Image | Map | 3D Geometry | PDF | HTML | Plotly |
| ----------------------------------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| 1. Determine type of visualization | This could be static plots such as Matplotlib, Seaborn, etc. or other type of images. | GeoJSONs or locations that can be visualized on a map | Any type of geometry that can be converted to glb/gltf, or some simple parameters that can be converted to simple VIKTOR geometries. | Word and Excel files can be converted to PDFs within VIKTOR! | HTML or URLs can be imbedded. | Plotly is a Python package with which you can create dynamic plots. |
| 2. Create method with correct return type | `ImageResult` | `MapResult` or `GeoJSONResult` | `GeometryResult` | `PDFResult` | `WebResult` | `PlotlyResult` |
| 3. Add decorator to your method | `ImageView` | `MapView` or `GeoJSONView` | `GeometryView` | `PDFView` | `WebView` | `PlotlyView` |
| 4. Add your function to the method. | `BytesIO` for PNG, JPG/JPEG and GIF, `StringIO` for SVG | `MapView`: a list of VIKTOR map objects
`GeoJSONView`: a GeoJSON dict | This could either be a VIKTOR `Group` object, consisting of VIKTOR primitive Geometry objects, or...
a glTF/GLB or 3DM file as a VIKTOR `File` ojbect | You could reference a PDF from a URL, a path, or, probably the most common one, as a VIKTOR `File` | The HTML could be retrieved from a URL, static file as a path, or as an HTML string | A Plotly `Figure` object |
If all went well, you will now have an application that displays the result of your function.
### 5. Create fields as input for calculation.[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#5-create-fields-as-input-for-calculation "Direct link to 5. Create fields as input for calculation.")
We’ve created a visualization, but ideally, we would like to make the app dynamic based on input. To do this, the following steps can be followed:
1. Start by determining which variables you would like the user of the app to change. Add these variables as input to the function you’ve created from your script.
2. Add fields to the parametrization that correspond with these variables. For example, if there are three variables named `a`, `b` and `c` that can be adjusted, we can add these fields to the `Parametrization` as well:
| Variable | Type | Field |
| -------- | ------------------ | ----------- |
| a | Float | NumberField |
| b | Options of strings | OptionField |
| c | File | FileField |
| Etc. | | |
```
class Parametrization(vkt.Parametrization):
a = vkt.NumberField('a')
b = vkt.OptionField('b', options=['apple', 'pear', 'lemon'])
c = vkt.FileField('Upload file')
```
3. Add the parameters to the function. You may have noticed that the methods defined in the `Controller` have a `params` argument. You can access the parameters from that variable. Here is an example:
```
import viktor as vkt
from .my_project import my_function # assuming that your function is within another file
# Assuming that your function is within this project
def my_function(a, b, c):
...
return
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.WebView("My View")
def create_plot(self, params, **kwargs):
result = my_function(
a=params.a,
b=params.b,
c=params.c
)
return vkt.WebResult(result)
```
## What's next?[](https://docs.viktor.ai/docs/tutorials/python-script-to-app/.md#whats-next "Direct link to What's next?")
And that's it! By following these steps, one should be able to convert a Python script to a VIKTOR app in no time.
The VIKTOR platform provides much, much more in terms of functionalities and features. Therefore, if you want to explore the possibilities to improve your app, consider consulting the documentation. Topics that are of great interest to developers are:
* [Layout and styling](https://docs.viktor.ai/docs/create-apps/layout-and-styling/.md)
* [Informing the end-user](https://docs.viktor.ai/docs/create-apps/inform-end-user/text-blocks/.md)
* [Managing files](https://docs.viktor.ai/docs/create-apps/managing-files/downloading-files/.md)
* [Software integrations](https://docs.viktor.ai/docs/create-apps/software-integrations/.md)
* and so much [more...](https://docs.viktor.ai/docs/welcome/.md)
There are also resources other than the documentation available that could help in the app development journey, such as:
* [Blog posts](https://www.viktor.ai/blog/category/all/1)
* [Other examples of apps](https://www.viktor.ai/apps-gallery/category/all/tag/all/1)
* [White-papers (especially the one on "Building successful applications")](https://www.viktor.ai/white-papers)
* [The community, for interactive discussions](https://community.viktor.ai/)
---
# Tutorial - Spreadsheet Calculator
info
Level: **Beginners**
Time: **20 min**
Prerequisites:
* You have an account and completed the installation process. No account? Get one [here](https://www.viktor.ai/start-building-apps)
* You have some experience with reading Python code
* [](https://www.viktor.ai/start-building-apps)
***Not a reader?** feel free to follow this tutorial as a video*
## Introduction[](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#introduction "Direct link to Introduction")
Welcome to the spreadsheet calculations tutorial! In most branches of engineering, spreadsheets are the golden standard for sharing results and knowledge in a clear, well organised way. In this tutorial you will learn how to implement an existing calculation from an excel sheet into a VIKTOR web application.
For this, the example we will use is a simply supported beam under load and all the calculations will be performed in the spreadsheet. In this tutorial we will cover:
1. [Create, install and start an empty app](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#1-create-install-and-start-an-empty-app)
2. [The Excel spreadsheet](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#2-the-excel-spreadsheet)
3. [Adding inputs and views](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#3-adding-inputs-and-views)
4. [Downloading the spreadsheet](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#4-download-the-spreadsheet)
By the end of this tutorial, you will have created a VIKTOR application that generates calculations from a spreadsheet and that will allow the user to download the results to share with colleagues. You can test the final result below:
Faster alternative with the App Builder
You can also generate a VIKTOR app directly from your spreadsheet using the [App Builder](https://docs.viktor.ai/docs/app-builder/.md) — upload the Excel file as context and the agent will convert it into a VIKTOR app for for you.
## 1. Create, install and start an empty app[](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#1-create-install-and-start-an-empty-app "Direct link to 1. Create, install and start an empty app")
Need help?
Are you encountering an error? Take a look at the [**complete app code**](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#5-all-code-together).
Also know that you can always ask for help at our [**Community Forum**](https://community.viktor.ai/), where our developers are ready to help with any question related to the installation, coding and more.
Let's create, install and start an empty app. This will be the starting point for the rest of the tutorial. But before we start, make sure to shut down any app that is running (like the demo app) by closing the command-line shell (for example Powershell) or end the process using `Ctrl + C`.
Follow these steps to create, install and start an empty app:
1. Open a terminal and run the following command to create the app on the VIKTOR platform and generate the initial code locally:
```
viktor-cli create-app "Spreadsheet tutorial" --init --app-type editor
```
2. Open the newly created folder in your code editor and run `viktor-cli clean-start` in the terminal to install dependencies and connect the app to the platform.
If all went well, your empty app is installed and connected to your development workspace. **Do not close the terminal** as this will break the connection with your app. The terminal in your code editor should show something like this:
```
INFO : Connecting to cloud.viktor.ai...
INFO : Connection is established (use Ctrl+C to close)
INFO :
INFO : Navigate to the link below to see your app in the browser
INFO : https://cloud.viktor.ai/workspaces/XXX/app
INFO :
INFO : App code loaded, waiting for jobs...
```
Re-starting your app
* You only need to create an app template and install it once for each new app you want to make.
* The app will update automatically once you start adding code in `app.py`, as long as you don't close the terminal or your code editor.
* Did you close your code editor? Use `viktor-cli start` to start the app again. No need to install, clear, etc.
**Did you encounter any errors?**
* Always make sure to check the spelling of everything you placed in the command-line, a small mistake and the command you are trying to run may not be recognised!
* If you are encountering:
```
ERROR:
Exiting because of an error: no requirements.txt file
PS C:\Users\\viktor-apps>
```
Then you are not in the correct folder! check the command-line and navigate to the spreadsheet-tutorial folder.
* If you are encountering:
```
Error: App definition is not compatible with the data currently stored in the database. Use the command 'viktor-cli clear' to clear the database.
PS C:\Users\\viktor-apps\spreadsheet-tutorial>
```
That means you have not cleared the database yet! Use the `viktor-cli clear` to clear and then you can use `viktor-cli start` to start the app. No need to install it again!
Not seeing any of these errors? Head over to our community! There is a good chance another developer encountered it and solved it too!
## 2. The Excel spreadsheet[](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#2-the-excel-spreadsheet "Direct link to 2. The Excel spreadsheet")
As mentioned previously, this example will be of a simply supported beam under load. If you would like to use or modify the example spreadsheet used for this tutorial, you can download it [here](https://docs.viktor.ai/files/docs/spreadsheet-calculator-tutorial/beam_calculation.xls) \[1]. You will need to add your spreadsheet to the root directory/folder, in this case the one we made when we made the empty app named 'spreadsheet-tutorial'.
\[1] source: [https://stuff.mit.edu](https://stuff.mit.edu/afs/athena/course/2/2.75/fundamentals/FUNdaMENTALs%20Book%20pdf/FUNdaMENTALS%20Design%20Spreadsheets/Topic%208%20Structures%20Design%20Spreadsheets/Beam_simply_supported.xls) (04-05-2020)
The app should now have the following folder structure:
```
spreadsheet-tutorial
├── tests
├── app.py
├── beam_calculation.xls
├── CHANGELOG.md
├── README.md
├── requirements.txt
└── viktor.config.toml
```
To be able to use a spreadsheet as a calculation tool within a VIKTOR app, a few modifications must be performed to the spreadsheet file (more elaboration on this can be found [here](https://docs.viktor.ai/docs/create-apps/documents-and-spreadsheets/spreadsheet-calculator/.md#calculation-sheet-set-up)). Open `beam_calculation.xls` and add two sheets: `viktor-input-sheet` and `viktor-output-sheet`. These sheets contain the input and output values respectively. In the `viktor-input-sheet`, add the following data:

The values from `viktor-input-sheet` should now be used in the `Analysis` sheet. For example, cell C22 below refers to the "L" parameter defined in the `viktor-input-sheet` sheet:

In the `viktor-output-sheet` the desired output parameters are defined, with their values taken from the `Analysis` sheet:

You should now be able to change the values on the `viktor-input-sheet`, resulting in changed values in the `viktor-output-sheet`. If you got lost along the way, or want to take the easy route, download the fully adjusted spreadsheet [here](https://docs.viktor.ai/files/docs/spreadsheet-calculator-tutorial-complete/beam_calculation.xls).
### Coupling the spreadsheet[](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#coupling-the-spreadsheet "Direct link to Coupling the spreadsheet")
The spreadsheet is now ready to be used within the app. VIKTOR provides a helper class specifically for this task: [`SpreadsheetCalculation`](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#_SpreadsheetCalculation). The first thing that needs to be done is to make sure that we can get to the spreadsheet. For this you may add the function `fill_spreadsheet` as described below. The `app.py` file should now look like this:
```
import viktor as vkt
from pathlib import Path
SPREADSHEET_PATH = Path(__file__).parent / "beam_calculation.xls"
def fill_spreadsheet(params) -> vkt.spreadsheet.SpreadsheetCalculation:
inputs = [
vkt.spreadsheet.SpreadsheetCalculationInput('L', params.beam.length),
vkt.spreadsheet.SpreadsheetCalculationInput('W', params.beam.width),
vkt.spreadsheet.SpreadsheetCalculationInput('H', params.beam.height),
vkt.spreadsheet.SpreadsheetCalculationInput('E', params.beam.E),
vkt.spreadsheet.SpreadsheetCalculationInput('aw', params.loads.aw),
vkt.spreadsheet.SpreadsheetCalculationInput('wa', params.loads.wa),
vkt.spreadsheet.SpreadsheetCalculationInput('wL', params.loads.wL)
]
return vkt.spreadsheet.SpreadsheetCalculation.from_path(SPREADSHEET_PATH, inputs=inputs)
class Parametrization(vkt.Parametrization):
pass
class Controller(vkt.Controller):
parametrization = Parametrization
```
Great! Now that we are ready to process the excel sheet, let's start with providing the user with the possibility to enter inputs for that sheet.
## 3. Adding inputs and views[](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#3-adding-inputs-and-views "Direct link to 3. Adding inputs and views")
Our app is still a bit empty, lets change that! First, lets add some inputs to our parametrization so that our user can make changes to the calculations. To reduce the clutter in our app, lets make a [`Section`](https://docs.viktor.ai/sdk/api/parametrization/.md#_Section) for this and fill it with the parameters of the beam. The end result can be downloaded [here](https://docs.viktor.ai/files/docs/spreadsheet-calculator-tutorial-complete.zip). Additionally, we will also add an [`Image`](https://docs.viktor.ai/sdk/api/parametrization/.md#_Image) to our parametrization that will allow the user to check the locations and orientations of the parameters. For this we need to make two more modifications to our app.
First, add a new folder called 'assets' to our 'spreadsheet-tutorial' app folder. You need to add the beam schematic from the top of the Analysis sheet to this folder (can also be downloaded here: [beam\_schematic.png](https://docs.viktor.ai/files/docs/spreadsheet-calculator-tutorial/beam_schematic.png). The resulting folder structure would look like this:
```
spreadsheet-tutorial
├── tests
├── assets
│ └── beam_schematic.png
├── app.py
├── beam_calculation.xls
├── CHANGELOG.md
├── README.md
├── requirements.txt
└── viktor.config.toml
```
In the `viktor.config.toml` file remove the hashtag in order to add: `assets_path = "assets"` to the config. The full config file should now look like this:
```
# For all available configuration settings, please go to:
# https://docs.viktor.ai/docs/create-apps/references/viktor-config-toml
app_type = 'editor'
assets_path = 'assets'
# packages = []
python_version = "3.14"
# welcome_text = 'welcome.md'
registered_name = 'spreadsheet-tutorial'
```
Update the `Parametrization` to show the required input fields:
```
...
class Parametrization(vkt.Parametrization):
beam = vkt.Section('Beam')
beam.schematic = vkt.Image(path="beam_schematic.png")
beam.length = vkt.NumberField('Length (L)', suffix='mm', default=80, max=100)
beam.width = vkt.NumberField('Width (W)', suffix='mm', default=10)
beam.height = vkt.NumberField('Height (H)', suffix='mm', default=10)
beam.E = vkt.NumberField('Modulus of Elasticity (E)', default=200000, suffix='N/mm2')
```
This will allow you to change the parameters of the beam which are used in our spreadsheet calculations. But you may also want to change the way we load the beam. Lets also add some input fields for that in a new `Section`.
```
...
class Parametrization(vkt.Parametrization):
beam = vkt.Section('Beam')
beam.schematic = vkt.Image(path="beam_schematic.png")
beam.length = vkt.NumberField('Length (L)', suffix='mm', default=80, max=100)
beam.width = vkt.NumberField('Width (W)', suffix='mm', default=10)
beam.height = vkt.NumberField('Height (H)', suffix='mm', default=10)
beam.E = vkt.NumberField('Modulus of Elasticity (E)', default=200000, suffix='N/mm2')
loads = vkt.Section('Loads')
loads.aw = vkt.NumberField('Starting point of load (aw)', suffix='mm', default=9)
loads.lb = vkt.LineBreak()
loads.wa = vkt.NumberField('Distributed load amplitude (wa)', suffix='N/mm', flex=40, default=5)
loads.wL = vkt.NumberField('Distributed load amplitude (wL)', suffix='N/mm', flex=40, default=5)
```
### Showing results and a schematic[](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#showing-results-and-a-schematic "Direct link to Showing results and a schematic")
If all went well, you should now be able to see all the inputs for the beam and loads in your app. Now let's display some results and a handy schematic so that the user knows what all the inputs mean and which way we have defined as positive and negative (coordinate system). For the results, let's add a [`TableView`](https://docs.viktor.ai/sdk/api/views/.md#_TableView) to our controller. You will need to use the method we made earlier to grab the results from the spreadsheet.
```
...
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.TableView("Outputs")
def spreadsheet_calculation(self, params, **kwargs) -> vkt.TableResult:
sheet = fill_spreadsheet(params)
result = sheet.evaluate()
column_headers = [vkt.TableHeader("Value", num_decimals=2), "Unit", "Description"]
row_headers = [
"maximum_deflection",
"maximum_bending_stress",
]
data = [
[result.values["maximum_deflection"], "microns", ""],
[result.values["maximum_bending_stress"], "N/mm2", "Maximum bending stress along the beam"],
]
return vkt.TableResult(data, row_headers=row_headers, column_headers=column_headers)
```
After reloading the app, you should now be able to see the maximum deflection and maximum bending stress in the app.
tip
If you get stuck, you can always try to have a quick peek at the [complete code](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#6-all-code-together) at the end of this tutorial
Beautiful! If all went well you should now be able to use the schematic as a reference to define your loads and dimensions of the beam and see the maximum stress and deflection in the `DataView`.
### Adding plots for analysis[](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#adding-plots-for-analysis "Direct link to Adding plots for analysis")
To perform some analysis, lets add a plot to show the curvature along the beam. All the data points for this are already in the excel file so you will only need to extract and plot this data. The data we are using for this example is the deflection data but you can use any other data that the sheet provides as the `pandas` dataframe will have all the data. We can then make a figure using the `plotly.express` package and display this figure in our application.
First, let's add the `plotly`, `pandas` and `openpyxl` packages to our app by updating the `requirements.txt` to:
```
viktor==...
plotly
pandas
openpyxl
```
Second, let's add the imports and the `PlotlyView` to the controller:
```
import viktor as vkt
import pandas as pd
import plotly.express as px
from pathlib import Path
...
class Controller(vkt.Controller):
...
@vkt.PlotlyView('Beam Curvature')
def beam_curvature(self, params, **kwargs):
sheet = fill_spreadsheet(params)
result = sheet.evaluate(include_filled_file=True)
evaluated_file = vkt.File.from_data(result.file_content)
with evaluated_file.open_binary() as fp:
data_df = pd.read_excel(fp, sheet_name='Data')
deflection_data = data_df['Deflection (microns)'].head(params.beam.length+1)
fig = px.line(deflection_data, title='Beam deflection', labels={'value': 'Deflection (microns)', 'index': 'Length (mm)'})
return vkt.PlotlyResult(fig)
```
## 4. Download the spreadsheet[](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#4-download-the-spreadsheet "Direct link to 4. Download the spreadsheet")
Now that we have all the functionality for our spreadsheet calculations, we can download the result as a spreadsheet to share with our colleagues in our next meeting.
```
...
class Parametrization(vkt.Parametrization):
...
calculation_sheet = vkt.Section('Download')
calculation_sheet.button = vkt.DownloadButton('Download', 'download_spreadsheet')
```
Then, to our controller class we need to add the method `download_spreadsheet` to download the spreadsheet.
```
...
class Controller(vkt.Controller):
...
def download_spreadsheet(self, params, **kwargs):
sheet = fill_spreadsheet(params)
result = sheet.evaluate(include_filled_file=True)
return vkt.DownloadResult(result.file_content, 'evaluated_beam.xlsx')
```
Give it a quick test to make sure you made no mistakes and everything works. Now admire the beautiful app you have made!
## 5. All code together[](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#5-all-code-together "Direct link to 5. All code together")
Congratulations!!!
This is concludes the tutorial, you have now built a fully functional app to perform spreadsheet calculations. Enjoy!!!
**Complete app.py code**
```
import viktor as vkt
import pandas as pd
import plotly.express as px
from pathlib import Path
SPREADSHEET_PATH = Path(__file__).parent / "beam_calculation.xls"
def fill_spreadsheet(params) -> vkt.spreadsheet.SpreadsheetCalculation:
inputs = [
vkt.spreadsheet.SpreadsheetCalculationInput('L', params.beam.length),
vkt.spreadsheet.SpreadsheetCalculationInput('W', params.beam.width),
vkt.spreadsheet.SpreadsheetCalculationInput('H', params.beam.height),
vkt.spreadsheet.SpreadsheetCalculationInput('E', params.beam.E),
vkt.spreadsheet.SpreadsheetCalculationInput('aw', params.loads.aw),
vkt.spreadsheet.SpreadsheetCalculationInput('wa', params.loads.wa),
vkt.spreadsheet.SpreadsheetCalculationInput('wL', params.loads.wL)
]
return vkt.spreadsheet.SpreadsheetCalculation.from_path(SPREADSHEET_PATH, inputs=inputs)
class Parametrization(vkt.Parametrization):
beam = vkt.Section('Beam')
beam.schematic = vkt.Image(path="beam_schematic.png")
beam.length = vkt.NumberField('Length (L)', suffix='mm', default=80, max=100)
beam.width = vkt.NumberField('Width (W)', suffix='mm', default=10)
beam.height = vkt.NumberField('Height (H)', suffix='mm', default=10)
beam.E = vkt.NumberField('Modulus of Elasticity (E)', default=200000, suffix='N/mm2')
loads = vkt.Section('Loads')
loads.aw = vkt.NumberField('Starting point of load (aw)', suffix='mm', default=9)
loads.lb = vkt.LineBreak()
loads.wa = vkt.NumberField('Distributed load amplitude (wa)', suffix='N/mm', flex=40, default=5)
loads.wL = vkt.NumberField('Distributed load amplitude (wL)', suffix='N/mm', flex=40, default=5)
calculation_sheet = vkt.Section('Download')
calculation_sheet.button = vkt.DownloadButton('Download', 'download_spreadsheet')
class Controller(vkt.Controller):
parametrization = Parametrization
@vkt.TableView("Outputs")
def spreadsheet_calculation(self, params, **kwargs) -> vkt.TableResult:
sheet = fill_spreadsheet(params)
result = sheet.evaluate()
column_headers = [vkt.TableHeader("Value", num_decimals=2), "Unit", "Description"]
row_headers = [
"maximum_deflection",
"maximum_bending_stress",
]
data = [
[result.values["maximum_deflection"], "microns", ""],
[result.values["maximum_bending_stress"], "", "Maximum bending stress along the beam"],
]
return vkt.TableResult(data, row_headers=row_headers, column_headers=column_headers)
@vkt.PlotlyView('Beam Curvature')
def beam_curvature(self, params, **kwargs):
sheet = fill_spreadsheet(params)
result = sheet.evaluate(include_filled_file=True)
evaluated_file = vkt.File.from_data(result.file_content)
with evaluated_file.open_binary() as fp:
data_df = pd.read_excel(fp, sheet_name='Data')
deflection_data = data_df['Deflection (microns)'].head(params.beam.length+1)
fig = px.line(deflection_data, title='Beam deflection', labels={'value': 'Deflection (microns)', 'index':'Length (mm)'})
return vkt.PlotlyResult(fig)
def download_spreadsheet(self, params, **kwargs):
sheet = fill_spreadsheet(params)
result = sheet.evaluate(include_filled_file=True)
return vkt.DownloadResult(result.file_content, 'evaluated_beam.xlsx')
```
The full app-repository can be downloaded [here](https://docs.viktor.ai/files/docs/spreadsheet-calculator-tutorial-complete.zip).
## Want to learn how VIKTOR works?[](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#want-to-learn-how-viktor-works "Direct link to Want to learn how VIKTOR works?")
If you are interested in how VIKTOR works behind the scenes, for example how it processes your input, expand the tabs below!
#### How does it work?[](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#how-does-it-work "Direct link to How does it work?")
How does the Parametrization work?
In the **Parameterization** class you can add input fields that allow the user to provide input to your app, and there are more than 20 [different input fields](https://docs.viktor.ai/docs/create-apps/user-input/.md) you can use, including numbers, text, colors, images and files.
Inside the Parametrization class, you can also format the [layout of your app](https://docs.viktor.ai/docs/create-apps/layout-and-styling/.md) by adding sections, tabs, steps and pages.
To show your Parametrization in the app, we need to add the line `parametrization = Parametrization` inside the `Controller` class, because it is the controller that determines what is shown and not.
How does the Parametrization get saved?
So you may be wondering, how do you get the information from the parametrization to my controller? Well, we do this automatically for you. The values of all parameters are stored in a single variable called `params` , which is accessible inside the Controller class.
These variables are stored in a `Munch`; this is similar to a dictionary, but work with point denotation.
Example:
* Let's say we have a variable called `height` as a NumberField in our `Parameterization`.
* To use it in a method in the `Controller`, define it as: `def my_method(self, params, **kwargs)`
* You can now make calculations inside that method using our height parameter as `params.height`!
How does the Controller work?
The **Controller** class is the place where you add everything you want to calculate and show.
As explained in this tutorial, we show results in a `View` and we always add views in our controller. You can even add several views in a single app by adding them to the controller class... and yes, we have [many Views](https://docs.viktor.ai/docs/create-apps/results-and-visualizations/.md), for showing graphs, maps, 3D models, reports, images and more.
In the Controller, you also do or call your calculation. Remember that the user input given in the parametrization, is accessible inside the Controller class in the variable The `params`.
## What's next[](https://docs.viktor.ai/docs/tutorials/spreadsheet-calculator/.md#whats-next "Direct link to What's next")
Very impressive! You have now learned the basics of working with external files and programs. In this tutorial, we have only scratched the surface of what you can do these integrations. So don’t stop your journey there!
If you like an extra challenge, here are some ideas:
* Convert your excel sheet to a pdf and show it in a `PDFView`
* Try to adjust the geometry to show the deformation of the beam
* Or even try to re-write the logic of your Excel file to a python script to use directly in the app code!
If you enjoyed this spreadsheet tutorial and want to explore some of the possibilities with Excel and VIKTOR, check out some of our other [tutorials](https://docs.viktor.ai/docs/tutorials/.md)
More about excel sheets
You can find more information about how to use excel sheets in the [documents and spreadsheets guide](https://docs.viktor.ai/docs/create-apps/documents-and-spreadsheets/spreadsheet-calculator/.md). Also check more about [documents and spreadsheets in general](https://docs.viktor.ai/docs/create-apps/documents-and-spreadsheets/.md)
---
# Device compatibility
VIKTOR web applications are easy to distribute and use by others. There are, however, some restrictions in place in terms of supported platforms and software.
## Supported browsers[](https://docs.viktor.ai/docs/use-apps/.md#supported-browsers "Direct link to Supported browsers")
VIKTOR app use is supported (and regularly tested) on the following browsers:
* Chrome (Windows, Mac, Linux)
* Firefox (Windows, Mac, Linux)
We support the latest versions of these browsers. If you encounter problems running our web application, check that your browser version is not outdated or that the browser you are using is not discontinued.
## Supported screen sizes[](https://docs.viktor.ai/docs/use-apps/.md#supported-screen-sizes "Direct link to Supported screen sizes")
The VIKTOR platform is built with desktop users in mind. While larger tablets might be able to display VIKTOR effectively in landscape mode, some features might not work as expected.
## Using VIKTOR apps on tablets[](https://docs.viktor.ai/docs/use-apps/.md#using-viktor-apps-on-tablets "Direct link to Using VIKTOR apps on tablets")
Using a VIKTOR app on a tablet is not officially supported, but might work depending on your usecase. We advice to test your specific usecase when you are considering use on a tablet. Some considerations:
* screen size: if the tablet has a sufficiently large screen, the viktor interface probably scales well enough to work in landscape mode.
* browser: chrome on android probably works, but is not actively tested.
* input device: on a tablet, a touch screen is used instead of a mouse. This difference is not actively tested, but it seems that most functionality correctly works.
Some things you can do to make the most of the limited screen size:
* choose a flat app structure (`simple` or `editor`). This eliminates the entity tree and simplifies navigation.
* separate your input on pages with only input or only output. Again, this makes the interface simpler.
## Using VIKTOR on mobile phones[](https://docs.viktor.ai/docs/use-apps/.md#using-viktor-on-mobile-phones "Direct link to Using VIKTOR on mobile phones")
Using VIKTOR apps from a mobile phone is not supported. Although it is technically possible to access the application from the web, the small screen makes the interface practically unusable.
---
# Integrate your app in other software
Sometimes it can be useful to integrate your VIKTOR app with other software, for example to:
* Obtain data from an entity in your VIKTOR app, to be used in your calculation software
* Push data from your BIM software (plugin) to one of your VIKTOR apps
* Collect environment activity, to be shown in your own custom dashboard
* Perform some calculation on the VIKTOR app to be further processed in your dedicated software
There are 2 ways to do this:
* Using the [SDK API](https://docs.viktor.ai/docs/api/sdk/.md)
* Using the [REST API](https://docs.viktor.ai/docs/api/rest)
For more information on the different APIs and when to use what, please refer to the [API documentation](https://docs.viktor.ai/docs/api/.md)
To let an external AI agent discover and run your apps rather than integrating them in code, see [Connect agents via MCP](https://docs.viktor.ai/docs/create-apps/mcp/.md) (beta).
---
# VIKTOR SDK
The VIKTOR SDK is a Python package that gives your app everything it needs to become a VIKTOR app: ready-made components and helpful utilities that you use to build your app. You install it on your computer and use it in your Python code.
That’s why you put import viktor as vkt at the start of your app.py file — it tells Python that you want to use the tools from the VIKTOR SDK in your app.
There are two types of documentation to guide you:
* **General documentation** – written in plain language and full of examples. It's great if you're new to the SDK or just want to understand how it works.
* **SDK Reference documentation** – a more detailed, technical guide that lists all the functions and options you can use. Think of it as a dictionary for the SDK: you can use it to look up something specific whenever you need it.
Together, these documents help you understand the SDK and give you the tools to create your own VIKTOR apps.
* **Upgrading your SDK version**
Keeping your VIKTOR SDK up to date is important to make sure your apps can use the latest features, improvements, and bug fixes.
[Learn more](https://docs.viktor.ai/docs/publish-apps/upgrade-viktor-version/.md)
[ ](https://docs.viktor.ai/docs/publish-apps/upgrade-viktor-version/.md)
## General SDK documentation[](https://docs.viktor.ai/docs/viktor-sdk/.md#general-sdk-documentation "Direct link to General SDK documentation")
Before you start diving into the details it’s good to learn the general concepts of VIKTOR.
[](https://docs.viktor.ai/docs/getting-started/fundamentals/basic-app-structure/.md)
### [Basic app structure](https://docs.viktor.ai/docs/getting-started/fundamentals/basic-app-structure/.md)
[* App file structure* Inputs (parametrization)* Results & visualizations](https://docs.viktor.ai/docs/getting-started/fundamentals/basic-app-structure/.md)
[](https://docs.viktor.ai/docs/getting-started/fundamentals/app-types/.md)
### [App types](https://docs.viktor.ai/docs/getting-started/fundamentals/app-types/.md)
[* Editor type* Simple type* Tree type](https://docs.viktor.ai/docs/getting-started/fundamentals/app-types/.md)
### VIKTOR components[](https://docs.viktor.ai/docs/viktor-sdk/.md#viktor-components "Direct link to VIKTOR components")
Learn about the different types of fields and visualizations VIKTOR has to offer.
[](https://docs.viktor.ai/docs/create-apps/user-input/.md)
### [Inputs](https://docs.viktor.ai/docs/create-apps/user-input/.md)
[Add fields, sliders, uploads, etc so users can give your app the information it needs.](https://docs.viktor.ai/docs/create-apps/user-input/.md)
[](https://docs.viktor.ai/docs/create-apps/results-and-visualizations/.md)
### [Results](https://docs.viktor.ai/docs/create-apps/results-and-visualizations/.md)
[Show plots, charts, 3D models, tables and maps to visualize the results.](https://docs.viktor.ai/docs/create-apps/results-and-visualizations/.md)
[](https://docs.viktor.ai/docs/create-apps/layout-and-styling/.md)
### [Layouts](https://docs.viktor.ai/docs/create-apps/layout-and-styling/.md)
[Arrange how inputs, results, and other elements appear to make your app easy and intuitive to use.](https://docs.viktor.ai/docs/create-apps/layout-and-styling/.md)
## SDK Reference[](https://docs.viktor.ai/docs/viktor-sdk/.md#sdk-reference "Direct link to SDK Reference")
For a complete list of all functions, classes, and options in the SDK, check out the [SDK Reference documentation](https://docs.viktor.ai/sdk/api/.md).
A list of all notable changes per SDK version can be found in the [Changelog](https://docs.viktor.ai/sdk/changelog).
---
# Welcome to VIKTOR!
VIKTOR is a platform that makes it easy to create powerful and user-friendly apps. Create apps to automate your workflow, integrate with different software packages, and get better insights into your project through interactive visualizations.
> "Automate the boring, engineer the awesome!" - VIKTOR
## [Getting started](https://docs.viktor.ai/docs/getting-started/.md)
[New to VIKTOR? This is the place to start!](https://docs.viktor.ai/docs/getting-started/.md)
[](https://docs.viktor.ai/docs/getting-started/.md)
## [Develop apps](https://docs.viktor.ai/docs/create-apps/.md)
[Learn everything about building your own app.](https://docs.viktor.ai/docs/create-apps/.md)
[](https://docs.viktor.ai/docs/create-apps/.md)
### [Manage projects](https://docs.viktor.ai/docs/manage-projects/.md)
[Learn how to manage projects in VIKTOR.](https://docs.viktor.ai/docs/manage-projects/.md)
### [Administrators](https://docs.viktor.ai/docs/manage-apps/.md)
[Everything you need to know as an administrator.](https://docs.viktor.ai/docs/manage-apps/.md)
## Other resources[](https://docs.viktor.ai/docs/welcome/.md#other-resources "Direct link to Other resources")
* **What's new in VIKTOR**
Find out about the latest features.
[.](https://docs.viktor.ai/docs/whats-new)
* **Community**
Join our community and ask for support, share ideas and learn about the latest features.
[.](https://community.viktor.ai/)
* **Apps Gallery**
Explore the app gallery, download the code, and use it to create your apps.
[.](https://www.viktor.ai/apps-gallery/category/all/discipline/all/integration/all/1)
---
# SDK Reference
Welcome to the SDK reference page. Here you will find the detailed API reference of the VIKTOR SDK which you can use to build your applications.
* A list of all notable changes per SDK version can be found in the [Changelog](https://docs.viktor.ai/sdk/changelog).
* All deprecations & upgrades can be found in [Upgrades](https://docs.viktor.ai/sdk/upgrades).
To upgrade the version used in your app, please look at [this guide](https://docs.viktor.ai/docs/publish-apps/upgrade-viktor-version/.md).
---
# viktor.api\_v1
## API[](https://docs.viktor.ai/sdk/api/api-v1/.md#_API "Direct link to API")
* *class *viktor.api\_v1.API(*environment=None*, *token=None*)[](#API "Link to this definition")
Bases: `_API`
Starting point of making an API call to, for example, retrieve properties of an entity.
Can be initialized:
> 1. within a VIKTOR app, without init-arguments, to perform API calls to any data within the corresponding workspace.
>
> 2. **(new in v14.9.0)** within a VIKTOR app, with token argument, to perform API calls to any data within the environment (cross-workspace).
>
> 3. **(new in v14.9.0)** outside a VIKTOR app, with token and environment arguments, to perform API calls to any data within the specified environment.
Note that the permissions of a user (group) are reflected on the permissions of this API call, e.g. if a user only has read-navigate or read-basic permission, calling the params (read-all) of the object using this API will NOT work for this specific user.
Example for case 1 (inside app, within context of current workspace):
```
from viktor.api_v1 import API
api = API()
current_entity = api.get_entity(entity_id)
parent = current_entity.parent()
parent_params = parent.last_saved_params
```
Example for case 2 (inside app, outside context of current workspace):
```
from viktor.api_v1 import API
api = API(token=os.environ["TOKEN"])
for workspace in api.get_workspaces():
for entity in workspace.get_root_entities():
entity_params = entity.last_saved_params
```
Example for case 3 (external to VIKTOR platform):
```
from viktor.api_v1 import API
if __name__ == "__main__":
api = API(token=os.environ["TOKEN"], environment="cloud.us1.viktor.ai")
for workspace in api.get_workspaces():
for entity in workspace.get_root_entities():
entity_params = entity.last_saved_params
```
* get\_workspace(*id\_*)[](#API.get_workspace "Link to this definition")
New in v14.9.0
Get the workspace with given id. (Requires a token to be set on the API class)
* Parameters:
**id** – workspace\_id
* Return type:
[`Workspace`](#Workspace "viktor.api_v1.Workspace")
- get\_workspaces(*\**, *app\_name=None*, *include\_archived=False*)[](#API.get_workspaces "Link to this definition")
New in v14.9.0
Get the workspaces in the environment. (Requires a token to be set on the API class)
* Parameters:
* **app\_name** (`str` | `None`) – Filter the workspaces by app name.
* **include\_archived** (`bool`) – True to include the archived workspaces. (Only permitted for Organization Admins)
* Return type:
[`WorkspaceList`](#WorkspaceList "viktor.api_v1.WorkspaceList")
Can be used to iterate over the workspaces:
> ```
> api = API(token=os.environ["TOKEN"])
> for workspace in api.get_workspaces():
> for entity in workspace.get_root_entities():
> ...
> ```
* get\_entity\_type(*id\_*, *\**, *workspace\_id=None*)[](#API.get_entity_type "Link to this definition")
New in v14.9.0
Get the entity type with given id.
* Parameters:
* **id** – entity\_type\_id
* **workspace\_id** (`int`) – (optional) Provide workspace id if you want to access entity types outside the context of the app.
* Return type:
[`EntityType`](#EntityType "viktor.api_v1.EntityType")
- get\_entity\_types(*\**, *workspace\_id=None*)[](#API.get_entity_types "Link to this definition")
New in v14.9.0
Get the entity types.
* Parameters:
**workspace\_id** (`int`) – (optional) Provide id if you want to access resource from outside the context of the app
* Return type:
[`EntityTypeList`](#EntityTypeList "viktor.api_v1.EntityTypeList")
* get\_entity(*id\_*, *\**, *privileged=False*, *workspace\_id=None*)[](#API.get_entity "Link to this definition")
Reference the entity with given id, without contacting the API.
* Parameters:
* **id** – entity\_id
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`Entity`](#Entity "viktor.api_v1.Entity")
- get\_entities\_by\_type(*entity\_type\_name*, *\**, *include\_params=True*, *privileged=False*, *workspace\_id=None*)[](#API.get_entities_by_type "Link to this definition")
Get all entities of the given type.
* Parameters:
* **entity\_type\_name** (`str`) – entity type to get all entities for.
* **workspace\_id** (`int`) – (optional) Provide id if you want to access resource from outside the context of the app
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`EntityList`](#EntityList "viktor.api_v1.EntityList")
* get\_root\_entities(*\**, *include\_params=True*, *entity\_type\_names=None*, *privileged=False*, *workspace\_id=None*)[](#API.get_root_entities "Link to this definition")
Get the root entities.
* Parameters:
* **include\_params** (`bool`) – True to include the parameters of the root entities.
* **entity\_type\_names** (`List`\[`str`]) – Only filters the entities of the defined type(s) (default = None, returns all).
* **workspace\_id** (`int`) – (optional) Provide id if you want to access resource from outside the context of the app
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`EntityList`](#EntityList "viktor.api_v1.EntityList")
- get\_entity\_parent(*entity\_id*, *\**, *privileged=False*, *workspace\_id=None*)[](#API.get_entity_parent "Link to this definition")
Get the parent entity of the entity with given id.
* Parameters:
* **workspace\_id** (`int`) – (optional) Provide id if you want to access resource from outside the context of the app
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`Entity`](#Entity "viktor.api_v1.Entity")
* get\_entity\_children(*entity\_id*, *\**, *include\_params=True*, *entity\_type\_names=None*, *privileged=False*, *workspace\_id=None*)[](#API.get_entity_children "Link to this definition")
Get the child entities of the entity with given id.
* Parameters:
* **include\_params** (`bool`) – True to include the parameters of the child entities.
* **entity\_type\_names** (`List`\[`str`]) – Only filters the entities of the defined type(s) (default = None, returns all).
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`EntityList`](#EntityList "viktor.api_v1.EntityList")
- get\_entity\_siblings(*entity\_id*, *\**, *include\_params=True*, *entity\_type\_names=None*, *privileged=False*, *workspace\_id=None*)[](#API.get_entity_siblings "Link to this definition")
Get the sibling entities of the entity with given id.
* Parameters:
* **include\_params** (`bool`) – True to include the parameters of the sibling entities.
* **entity\_type\_names** (`List`\[`str`]) – Only filters the entities of the defined type(s) (default = None, returns all).
* **workspace\_id** (`int`) – (optional) Provide id if you want to access resource from outside the context of the app
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`EntityList`](#EntityList "viktor.api_v1.EntityList")
* get\_entity\_revisions(*entity\_id*, *\**, *privileged=False*, *workspace\_id=None*)[](#API.get_entity_revisions "Link to this definition")
Get all revisions of the entity with given id.
* Parameters:
* **entity\_id** (`int`) – id of the entity to get the revisions from.
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`EntityRevisionList`](#EntityRevisionList "viktor.api_v1.EntityRevisionList")
- get\_entity\_file(*entity\_id*, *\**, *privileged=False*, *workspace\_id=None*)[](#API.get_entity_file "Link to this definition")
Get the file of the entity with given id.
* Parameters:
* **entity\_id** (`int`) – id of the entity to get the file from.
* **workspace\_id** (`int`) – (optional) Provide id if you want to access resource from outside the context of the app
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* Returns:
File object (SourceType.URL)
* Raises:
**ValueError** – if file does not have a file associated with it.
* get\_current\_user()[](#API.get_current_user "Link to this definition")
Get the current user in the environment.
* Return type:
[`User`](#User "viktor.api_v1.User")
- create\_child\_entity(*parent\_entity\_id*, *entity\_type\_name*, *name*, *\**, *params=None*, *privileged=False*, *workspace\_id=None*, *\*\*kwargs*)[](#API.create_child_entity "Link to this definition")
Create a child entity with given name and type from parent entity with given id.
Warning
It is currently not possible to create a file-type entity
Warning
Be aware that changes made using this method might not be reflected in subsequent API calls (e.g. API.get\_entity\_children) within the same job because of memoization.
* Parameters:
* **parent\_entity\_id** (`int`) – id of the parent entity to create the child from.
* **entity\_type\_name** (`str`) – type of the entity to be created (type must be a child-type of the parent entity).
* **name** (`str`) – name of the entity to be created.
* **params** (`dict` | `Munch`) – params to be stored on the newly created entity.
* **workspace\_id** (`int`) – (optional) Provide id if you want to access resource from outside the context of the app
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`Entity`](#Entity "viktor.api_v1.Entity")
* delete\_entity(*entity\_id*, *\**, *privileged=False*, *workspace\_id=None*)[](#API.delete_entity "Link to this definition")
Delete the entity with given id.
* Parameters:
* **entity\_id** (`int`) – id of the entity to be deleted.
* **workspace\_id** (`int`) – (optional) Provide id if you want to access resource from outside the context of the app
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
`None`
- rename\_entity(*entity\_id*, *name*, *\**, *privileged=False*, *workspace\_id=None*)[](#API.rename_entity "Link to this definition")
Rename the entity with given id (creates a revision).
Warning
Be aware that changes made using this method might not be reflected in subsequent API calls (e.g. Entity.name) within the same job because of memoization.
* Parameters:
* **entity\_id** (`int`) – id of the entity to rename.
* **name** (`str`) – name of the newly created entity revision.
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`Entity`](#Entity "viktor.api_v1.Entity")
* set\_entity\_params(*entity\_id*, *params*, *\**, *privileged=False*, *workspace\_id=None*)[](#API.set_entity_params "Link to this definition")
Create a new revision of the entity with given id, storing given params.
Warning
Be aware that changes made using this method might not be reflected in subsequent API calls (e.g. Entity.last\_saved\_params) within the same job because of memoization.
* Parameters:
* **entity\_id** (`int`) – id of the entity to create a revision for.
* **params** (`dict` | `Munch`) – params to be stored on the newly created entity revision.
* **workspace\_id** (`int`) – (optional) Provide id if you want to access resource from outside the context of the app
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`Entity`](#Entity "viktor.api_v1.Entity")
## App[](https://docs.viktor.ai/sdk/api/api-v1/.md#_App "Direct link to App")
* *class *viktor.api\_v1.App(*api*, *id\_*, *name*, *\*\*\_kwargs*)[](#App "Link to this definition")
New in v14.9.0
Warning
Do not instantiate this class directly, it is created by the API.
* Parameters:
* **api** (`_API`) – API instance
* **id** – ID of the App
* **name** (`str`) – Name of the App
## AppVersion[](https://docs.viktor.ai/sdk/api/api-v1/.md#_AppVersion "Direct link to AppVersion")
* *class *viktor.api\_v1.AppVersion(*api*, *id\_*, *tag*, *status*, *app\_type*, *sdk\_version*, *python\_version*, *created\_at*, *\*\*\_kwargs*)[](#AppVersion "Link to this definition")
New in v14.9.0
Warning
Do not instantiate this class directly, it is created by the API.
* Parameters:
* **api** (`_API`) – API instance
* **id** – ID of the AppVersion
* **tag** (`str`) – Tag of the AppVersion
* **status** (`str`) – Status of the AppVersion publish
* **app\_type** (`str`) – Type of App as defined in the App definition
* **sdk\_version** (`str`) – Version of the SDK
* **python\_version** (`str`) – Version of the python
* **created\_at** (`str`) – Timestamp of when AppVersion was created.
## ChatConversation[](https://docs.viktor.ai/sdk/api/api-v1/.md#_ChatConversation "Direct link to ChatConversation")
* *class *viktor.api\_v1.ChatConversation(*\**, *api*, *workspace\_id*, *entity\_id*, *latest\_exchange\_id*)[](#ChatConversation "Link to this definition")
New in v14.21.0
Warning
Do not instantiate this class directly, it is created by the API.
* get\_messages()[](#ChatConversation.get_messages "Link to this definition")
Get the full history of the conversation as a list of messages.
Each message in the list has the following format:
```
{
'role': str, # user | assistant
'content': str, # the actual message
}
```
* Return type:
`list`\[`dict`\[`str`, `str`]]
## Entity[](https://docs.viktor.ai/sdk/api/api-v1/.md#_Entity "Direct link to Entity")
* *class *viktor.api\_v1.Entity(*api*, *workspace\_id*, *origin\_id*, *operations*, *resolved=None*)[](#Entity "Link to this definition")
Warning
Do not instantiate this class directly, it is created by the API.
* children(*\**, *include\_params=True*, *entity\_type\_names=None*, *privileged=False*)[](#Entity.children "Link to this definition")
Get the child entities.
* Parameters:
* **include\_params** (`bool`) – True to include the parameters of the child entities.
* **entity\_type\_names** (`List`\[`str`]) – Only filters the entities of the defined type(s) (default = None, returns all).
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`EntityList`](#EntityList "viktor.api_v1.EntityList")
- compute(*method\_name*, *\**, *params*, *timeout=None*)[](#Entity.compute "Link to this definition")
New in v14.12.0
Run a callable entity controller method (view-method, button-method, step-method or preprocess-method) and return the result.
* Parameters:
* **method\_name** (`str`) – Name of the controller method to call
* **params** (`dict` | `Munch`) – Params to call the method with
* **timeout** (`int`) – Maximum job duration after which it will time out
* Return type:
`dict`
* Returns:
Return value of the controller method
* create\_child(*entity\_type\_name*, *name*, *\**, *params=None*, *privileged=False*, *\*\*kwargs*)[](#Entity.create_child "Link to this definition")
Create a child entity with given name and type.
Warning
It is currently not possible to create a file-type entity
Warning
Be aware that changes made using this method might not be reflected in subsequent API calls (e.g. API.get\_entity\_children) within the same job because of internal caching.
* Parameters:
* **entity\_type\_name** (`str`) – type of the entity to be created (type must be a child-type of the parent entity).
* **name** (`str`) – name of the entity to be created.
* **params** (`dict` | `Munch`) – params to be stored on the newly created entity.
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`Entity`](#Entity "viktor.api_v1.Entity")
- delete(*\**, *privileged=False*)[](#Entity.delete "Link to this definition")
Delete the entity.
* Parameters:
**privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
`None`
* *property *entity\_type*: [EntityType](#EntityType "viktor.api_v1.EntityType")*[](#Entity.entity_type "Link to this definition")
EntityType of the entity.
- get\_file()[](#Entity.get_file "Link to this definition")
Get the file of the entity.
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* Returns:
File object (SourceType.URL)
* Raises:
**ValueError** – if file does not have a file associated with it.
* *property *id*: int*[](#Entity.id "Link to this definition")
id of the entity.
- *property *last\_saved\_params*: munch.Munch*[](#Entity.last_saved_params "Link to this definition")
Get the params of the last saved entity revision.
* *property *last\_saved\_summary*: munch.Munch*[](#Entity.last_saved_summary "Link to this definition")
Get the summary of the last saved entity revision.
- *property *name*: str*[](#Entity.name "Link to this definition")
Name of the entity.
* parent(*\**, *privileged=False*)[](#Entity.parent "Link to this definition")
Get the parent of the entity.
* Parameters:
**privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`Entity`](#Entity "viktor.api_v1.Entity")
- rename(*name*, *\**, *privileged=False*)[](#Entity.rename "Link to this definition")
Rename the entity (creates a revision).
Warning
Be aware that changes made using this method might not be reflected in subsequent API calls (e.g. Entity.name) within the same job because of memoization.
* Parameters:
* **name** (`str`) – name of the newly created entity revision.
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`Entity`](#Entity "viktor.api_v1.Entity")
* revisions()[](#Entity.revisions "Link to this definition")
Get all revisions of the entity.
* Return type:
[`EntityRevisionList`](#EntityRevisionList "viktor.api_v1.EntityRevisionList")
- set\_params(*params*, *\**, *privileged=False*)[](#Entity.set_params "Link to this definition")
Create a new revision of the entity, storing given params.
Warning
Be aware that changes made using this method might not be reflected in subsequent API calls (e.g. Entity.last\_saved\_params) within the same job because of memoization.
* Parameters:
* **params** (`dict` | `Munch`) – params to be stored on the newly created entity revision.
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`Entity`](#Entity "viktor.api_v1.Entity")
* siblings(*\**, *include\_params=True*, *entity\_type\_names=None*, *privileged=False*)[](#Entity.siblings "Link to this definition")
Get the sibling entities.
* Parameters:
* **include\_params** (`bool`) – True to include the parameters of the sibling entities.
* **entity\_type\_names** (`List`\[`str`]) – Only filters the entities of the defined type(s) (default = None, returns all).
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`EntityList`](#EntityList "viktor.api_v1.EntityList")
## EntityList[](https://docs.viktor.ai/sdk/api/api-v1/.md#_EntityList "Direct link to EntityList")
* *class *viktor.api\_v1.EntityList(*api*, *workspace\_id*, *relation*, *origin*, *entity\_type\_names*, *include\_params*, *\**, *privileged=False*)[](#EntityList "Link to this definition")
Warning
Do not instantiate this class directly, it is created by the API.
Object which resembles a list of Entity objects.
Most commonly used list operations are supported:
```
# indexing
children = entity.children()
children[0] # first child entity
children[-1] # last child entity
# length
number_of_children = len(children)
# for loop
for child in children:
# perform operation on child
```
## EntityRevision[](https://docs.viktor.ai/sdk/api/api-v1/.md#_EntityRevision "Direct link to EntityRevision")
* *class *viktor.api\_v1.EntityRevision(*api*, *id\_*, *params*, *created\_date*, *previous\_revision\_id=None*)[](#EntityRevision "Link to this definition")
Warning
Do not instantiate this class directly, it is created by the API.
* Parameters:
* **params** (`Munch`) – Stored params in the entity’s revision.
* **created\_date** (`datetime`) – Date(time) of creation of the entity’s revision.
* **previous\_revision\_id** (`int` | `None`) – Id of the chronologically previous revision (for diffing), or None for the first.
## EntityRevisionList[](https://docs.viktor.ai/sdk/api/api-v1/.md#_EntityRevisionList "Direct link to EntityRevisionList")
* *class *viktor.api\_v1.EntityRevisionList(*api*, *entity*, *\**, *privileged=False*)[](#EntityRevisionList "Link to this definition")
Warning
Do not instantiate this class directly, it is created by the API.
Object which resembles a list of EntityRevision objects.
Most commonly used list operations are supported:
```
# indexing
revisions = entity.revisions()
revisions[0] # first revision
revisions[-1] # last revision
# length
number_of_revisions = len(revisions)
# for loop
for revision in revisions:
# perform operation on revision
```
## EntityType[](https://docs.viktor.ai/sdk/api/api-v1/.md#_EntityType "Direct link to EntityType")
* *class *viktor.api\_v1.EntityType(*api*, *id\_*, *class\_name*, *\*\*\_kwargs*)[](#EntityType "Link to this definition")
Warning
Do not instantiate this class directly, it is created by the API.
* Parameters:
* **id** – Unique ID of the entity type.
* **name** – Entity type name (not label).
## EntityTypeList[](https://docs.viktor.ai/sdk/api/api-v1/.md#_EntityTypeList "Direct link to EntityTypeList")
* *class *viktor.api\_v1.EntityTypeList(*api*, *workspace\_id*)[](#EntityTypeList "Link to this definition")
New in v14.9.0
Warning
Do not instantiate this class directly, it is created by the API.
Object which resembles a list of EntityType objects.
Most commonly used list operations are supported:
```
# indexing
entity_types = api.get_entity_types()
entity_types[0] # first entity_type
entity_types[-1] # last entity_type
# length
number_of_entity_types = len(entity_types)
# for loop
for entity_type in entity_types:
# perform operation on entity_type
```
## FileResource[](https://docs.viktor.ai/sdk/api/api-v1/.md#_FileResource "Direct link to FileResource")
* *class *viktor.api\_v1.FileResource(*workspace\_id*, *source\_id*, *api=None*)[](#FileResource "Link to this definition")
File resource stored in the file manager.
Warning
Do not instantiate this class directly, it will be returned in the parameter set when using a [`FileField`](https://docs.viktor.ai/sdk/api/parametrization/.md#FileField "viktor.parametrization.FileField") or [`MultiFileField`](https://docs.viktor.ai/sdk/api/parametrization/.md#MultiFileField "viktor.parametrization.MultiFileField").
* *property *file*: [File](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")*[](#FileResource.file "Link to this definition")
Returns the File object (URL-file) attached to the resource.
- *property *filename*: str*[](#FileResource.filename "Link to this definition")
Returns the filename of the resource (API call required!).
* open(*encoding=None*)[](#FileResource.open "Link to this definition")
New in v14.27.0
Open the file in text mode directly.
```
with params.my_file.open() as f:
content = f.read()
```
* Parameters:
**encoding** (`str`) – Text encoding (default: system encoding)
* Return type:
`TextIO`
* Returns:
Text file-like object
- open\_binary()[](#FileResource.open_binary "Link to this definition")
New in v14.27.0
Open the file in binary mode directly.
```
with params.my_file.open_binary() as f:
content = f.read()
```
* Return type:
`BinaryIO`
* Returns:
Binary file-like object
## Job[](https://docs.viktor.ai/sdk/api/api-v1/.md#_Job "Direct link to Job")
* *class *viktor.api\_v1.Job(*api*, *workspace\_id*, *id\_*)[](#Job "Link to this definition")
New in v14.12.0
Warning
Do not instantiate this class directly, it is created by the API.
* get\_result(*\**, *timeout=15*)[](#Job.get_result "Link to this definition")
Obtain the job result
* Return type:
`dict`
* Returns:
Job result
* Raises:
**TimeoutError** – If timeout is exceeded
## Label[](https://docs.viktor.ai/sdk/api/api-v1/.md#_Label "Direct link to Label")
* *class *viktor.api\_v1.Label(*api*, *id\_*, *name*, *description*, *color*, *\*\*\_kwargs*)[](#Label "Link to this definition")
New in v14.9.0
Warning
Do not instantiate this class directly, it is created by the API.
* Parameters:
* **api** (`_API`) – API instance
* **id** – ID of the Label
* **name** (`str`) – Name of the Label
* **description** (`str`) – Description of the Label
* **color** (`str`) – Color of the Label
## User[](https://docs.viktor.ai/sdk/api/api-v1/.md#_User "Direct link to User")
* *class *viktor.api\_v1.User(*api*, *\**, *id\_*, *first\_name*, *last\_name*, *email*, *job\_title*, *\*\*\_kwargs*)[](#User "Link to this definition")
User information.
Warning
Do not instantiate this class directly, it is created by the API.
* Parameters:
* **id** – user’s id
* **first\_name** (`str`) – user’s first name
* **last\_name** (`str`) – user’s last name
* **email** (`str`) – user’s email address
* **job\_title** (`str`) – user’s job title
- *property *full\_name*: str*[](#User.full_name "Link to this definition")
User’s full name (first name + last name).
## Workspace[](https://docs.viktor.ai/sdk/api/api-v1/.md#_Workspace "Direct link to Workspace")
* *class *viktor.api\_v1.Workspace(*api*, *id\_*, *name*, *description*, *visibility*, *created\_at*, *updated\_at*, *is\_archived*, *app*, *app\_version*, *labels*, *\*\*kwargs*)[](#Workspace "Link to this definition")
New in v14.9.0
Warning
Do not instantiate this class directly, it is created by the API.
Can be used to fetch additional data within the given workspace.
```
# Get workspace object
workspace: Workspace = api.get_workspace(workspace_id)
# Iterate over underlying data
for entity in workspace.get_root_entities():
...
for entity_type in workspace.get_entity_types():
...
```
* Parameters:
* **id** – Unique ID of the workspace.
* **name** (`str`) – Name of the workspace.
* **description** (`str`) – Descriptive text of the workspace content.
* **visibility** (`str`) – Visibility of the workspace. (Can be INTERNAL, PRIVATE, PUBLIC, or DEVELOPMENT)
* **created\_at** (`str`) – Timestamp of when workspace was created.
* **updated\_at** (`str`) – Timestamp of when workspace was last updated.
* **is\_archived** (`bool`) – Whether the workspace is archived.
* **app** (`dict` | `None`) – App assigned to the workspace. (Can be None for Development workspace)
* **app\_version** (`dict` | `None`) – Published AppVersion assigned to the workspace. (Can be None for Development workspace)
* **labels** (`List`\[`dict`]) – Labels assigned to the workspace.
- entity\_compute(*\**, *entity\_id*, *method\_name*, *params*, *timeout=None*)[](#Workspace.entity_compute "Link to this definition")
New in v14.12.0
Run a callable entity controller method (view-method, button-method, step-method or preprocess-method) and return the result.
* Parameters:
* **entity\_id** (`int`) – ID of the entity to call the method from
* **method\_name** (`str`) – Name of the controller method to call
* **params** (`dict` | `Munch`) – Params to call the method with
* **timeout** (`int`) – Maximum job duration after which it will time out
* Return type:
`dict`
* Returns:
Return value of the controller method
* get\_entity(*id\_*, *privileged=False*)[](#Workspace.get_entity "Link to this definition")
Reference the entity with given id, without contacting the API.
* Parameters:
* **id** – entity\_id
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`Entity`](#Entity "viktor.api_v1.Entity")
- get\_entity\_type(*id\_*)[](#Workspace.get_entity_type "Link to this definition")
Get the entity type with given id in the workspace.
* Return type:
[`EntityType`](#EntityType "viktor.api_v1.EntityType")
* get\_entity\_types()[](#Workspace.get_entity_types "Link to this definition")
Get the entity types in the workspace.
* Return type:
[`EntityTypeList`](#EntityTypeList "viktor.api_v1.EntityTypeList")
- get\_root\_entities(*\**, *include\_params=True*, *entity\_type\_names=None*, *privileged=False*)[](#Workspace.get_root_entities "Link to this definition")
Get the root entities.
* Parameters:
* **include\_params** (`bool`) – True to include the parameters of the root entities.
* **entity\_type\_names** (`List`\[`str`]) – Only filters the entities of the defined type(s) (default = None, returns all).
* **privileged** (`bool`) –
bypass the user access restrictions managed by the admin of an application.
Warning
If not used properly, (confidential) information which SHOULD NOT be accessible by a user may leak (for instance by including data in a view). Please consider the following when using this flag:
* Make sure the app’s admin is aware that the code circumvents certain permissions at specific places.
* Make sure to test the implementation thoroughly, to ensure no confidential data is leaked.
API calls can only bypass the restrictions if the key enable\_privileged\_api is set to true in viktor.config.toml. This is to provide an additional layer of security / awareness. Restrictions can only be bypassed when using the API module within a VIKTOR app and within the context of the current workspace.
* Return type:
[`EntityList`](#EntityList "viktor.api_v1.EntityList")
## WorkspaceList[](https://docs.viktor.ai/sdk/api/api-v1/.md#_WorkspaceList "Direct link to WorkspaceList")
* *class *viktor.api\_v1.WorkspaceList(*api*, *app\_name=None*, *include\_archived=False*)[](#WorkspaceList "Link to this definition")
New in v14.9.0
Warning
Do not instantiate this class directly, it is created by the API.
Object which resembles a list of Workspace objects.
Most commonly used list operations are supported:
```
# indexing
workspaces = api.get_workspaces()
workspaces[0] # first workspace
workspaces[-1] # last workspace
# length
number_of_workspaces = len(workspaces)
# for loop
for workspace in workspaces:
# perform operation on workspace
```
---
# viktor.core
## Color[](https://docs.viktor.ai/sdk/api/core/.md#_Color "Direct link to Color")
* *class *viktor.core.Color(*r: int*, *g: int*, *b: int*)[](#Color "Link to this definition")
Bases: [`Color`](#Color "viktor.core.Color")
Create an immutable instance of Color
* Parameters:
* **r** – red-value (0-255)
* **g** – green-value (0-255)
* **b** – blue-value (0-255)
**plotly / bokeh:** Color objects are directly compatible with plotly and bokeh:
```
import plotly.graph_objects as go
from bokeh.plotting import figure
color = vkt.Color(30, 144, 255)
# plotly
go.Scatter(x=x, y=y, mode='lines', line=dict(color=color, width=2))
# bokeh
p = figure()
p.line(x, y, line_color=color, line_width=2)
```
**matplotlib / seaborn:** Use the `.hex` property:
```
import matplotlib.pyplot as plt
import seaborn as sns
color = vkt.Color(30, 144, 255)
# ✓ CORRECT: Use .hex property for matplotlib and seaborn
ax.bar(x, height, color=color.hex)
sns.lineplot(x=x, y=y, color=color.hex)
# ❌ INCORRECT: matplotlib/seaborn do not accept Color objects directly
# ax.bar(x, height, color=color)
# sns.lineplot(x=x, y=y, color=color)
```
* *static *black()[](#Color.black "Link to this definition")
* Return type:
[`Color`](#Color "viktor.core.Color")
- *static *blue()[](#Color.blue "Link to this definition")
* Return type:
[`Color`](#Color "viktor.core.Color")
* *property *deltares*: int*[](#Color.deltares "Link to this definition")
- *static *deltares\_to\_rgb(*value*)[](#Color.deltares_to_rgb "Link to this definition")
Conversion from red-green-blue to Deltares-type color value.
* Parameters:
**value** (`int`) – Integer representation of the color as used in the Deltares software series.
* Return type:
`Tuple`\[`int`, `int`, `int`]
* *classmethod *from\_deltares(*value*)[](#Color.from_deltares "Link to this definition")
Color defined by Deltares-type integer.
* Parameters:
**value** (`int`) – Integer representation of the color as used in the Deltares software series.
* Return type:
[`Color`](#Color "viktor.core.Color")
- *classmethod *from\_hex(*hex\_value*)[](#Color.from_hex "Link to this definition")
Color defined by hexadecimal code.
* Return type:
[`Color`](#Color "viktor.core.Color")
* *static *green()[](#Color.green "Link to this definition")
* Return type:
[`Color`](#Color "viktor.core.Color")
- *property *hex*: str*[](#Color.hex "Link to this definition")
Hexadecimal representation of the color.
* *static *hex\_to\_rgb(*hex\_value*)[](#Color.hex_to_rgb "Link to this definition")
Conversion from hexadecimal to red-green-blue value
* Return type:
`Tuple`\[`int`, `int`, `int`]
- *static *lime()[](#Color.lime "Link to this definition")
* Return type:
[`Color`](#Color "viktor.core.Color")
* *static *random()[](#Color.random "Link to this definition")
Generate a random color.
* Return type:
[`Color`](#Color "viktor.core.Color")
- *static *red()[](#Color.red "Link to this definition")
* Return type:
[`Color`](#Color "viktor.core.Color")
* *property *rgb*: Tuple\[int, int, int]*[](#Color.rgb "Link to this definition")
- *static *rgb\_to\_deltares(*r*, *g*, *b*)[](#Color.rgb_to_deltares "Link to this definition")
Conversion from Deltares-type color value to red-green-blue value.
:return Integer representation of the color as used in the Deltares software series.
* Return type:
`int`
* *static *rgb\_to\_hex(*r*, *g*, *b*, *include\_hashtag=True*)[](#Color.rgb_to_hex "Link to this definition")
Conversion from red-green-blue to hexadecimal value
* Return type:
`str`
- *static *viktor\_black()[](#Color.viktor_black "Link to this definition")
* Return type:
[`Color`](#Color "viktor.core.Color")
* *static *viktor\_blue()[](#Color.viktor_blue "Link to this definition")
* Return type:
[`Color`](#Color "viktor.core.Color")
- *static *viktor\_yellow()[](#Color.viktor_yellow "Link to this definition")
* Return type:
[`Color`](#Color "viktor.core.Color")
* *static *white()[](#Color.white "Link to this definition")
* Return type:
[`Color`](#Color "viktor.core.Color")
## Controller[](https://docs.viktor.ai/sdk/api/core/.md#_Controller "Direct link to Controller")
* *class *viktor.core.Controller(*\*\*kwargs*)[](#Controller "Link to this definition")
The main function of the ViktorController is to “control” the information flow between the frontend (what is inputted by a user) and the application code (what is returned as a result of the user input).
**(new in v14.15.0)** The ‘label’ attribute is now optional.
* allow\_saving*: `bool` | `None`** = None*[](#Controller.allow_saving "Link to this definition")
**(new in v14.24.0)** Specify whether user is allowed to save entities of this entity-type. May only be set for root entity types in tree-type app.
- children*: `List`\[`str`] | `None`** = None*[](#Controller.children "Link to this definition")
Optional list of child entity-types.
* label*: `str` | `None`** = None*[](#Controller.label "Link to this definition")
Entity-type label.
- parametrization*: [`Parametrization`](https://docs.viktor.ai/sdk/api/parametrization/.md#Parametrization "viktor.parametrization.Parametrization") | `None`** = None*[](#Controller.parametrization "Link to this definition")
[`viktor.parametrization.Parametrization`](https://docs.viktor.ai/sdk/api/parametrization/.md#Parametrization "viktor.parametrization.Parametrization") that describes the entity-type.
* show\_children\_as*: `str` | `None`** = None*[](#Controller.show_children_as "Link to this definition")
When children are defined, specify how they are shown in the interface (‘Table’ | ‘Cards’).
- summary*: [`Summary`](https://docs.viktor.ai/sdk/api/views/.md#Summary "viktor.views.Summary") | `None`** = None*[](#Controller.summary "Link to this definition")
[`viktor.views.Summary`](https://docs.viktor.ai/sdk/api/views/.md#Summary "viktor.views.Summary") of the entity-type.
## File[](https://docs.viktor.ai/sdk/api/core/.md#_File "Direct link to File")
* *class *viktor.core.File(*\**, *data=None*, *path=None*, *url=None*, *\*\*kwargs*)[](#File "Link to this definition")
Creates a File object. Only 1 of data, path or url should be set, or File() for writable file. Or use the corresponding class-methods.
A File object can have one of the following 4 types:
> * SourceType.DATA: File object with in-memory data as its source
>
> > * Created with File.from\_data(…)
> >
> > * writable: False
>
> * SourceType.PATH: File object with an existing file (path) as its source
>
> > * Created with File.from\_path(…)
> >
> > * writable: False
>
> * SourceType.URL: File object with a URL as its source
>
> > * Created with File.from\_url(…)
> >
> > * writable: False
>
> * SourceType.WRITABLE: File object with a (temporary) writable file on disk as its source
>
> > * Created with File()
> >
> > * writable: True (writing always takes place at end of file)
Note: Reading from a File with SourceType.URL downloads (part of the) URL content to a (temporary) file on disk, so that re-reading (previously read) content within the same open-context does not require downloading twice. Opening the File object a second time DOES involve downloading the content anew. If such a File needs to be opened multiple times, consider copying the File locally ([`copy()`](#File.copy "viktor.core.File.copy")), so that downloading takes place only once.
Example usage:
> ```
> data_file = vkt.File.from_data("my content")
> path_file = vkt.File.from_path(Path(__file__).parent / "my_file.txt")
> url_file = vkt.File.from_url("https://...")
> writable_file = vkt.File()
>
> data_content = data_file.getvalue_binary() # bytes (b"my content")
> path_content = path_file.getvalue() # str
>
> with url_file.open() as r: # open in text-mode, so read -> str
> first_character = r.read(1) # downloads only partially
> all_other_characters = r.read() # downloads the rest
>
> with writable_file.open_binary() as w: # open as binary-mode, so read/write -> bytes
> w.write(b"my content")
>
> writable_content = writable_file.getvalue() # "my content"
> ```
* Parameters:
* **data** (`str` | `bytes` | `None`) – in-memory data source (also [`from_data()`](#File.from_data "viktor.core.File.from_data"))
* **path** (`str` | `bytes` | `PathLike` | `None`) – existing file path source (also [`from_path()`](#File.from_path "viktor.core.File.from_path"))
* **url** (`str` | `None`) – URL source (also [`from_url()`](#File.from_url "viktor.core.File.from_url"))
- *class *SourceType(*\*values*)[](#File.SourceType "Link to this definition")
Bases: `Enum`
* DATA*: [`SourceType`](#File.SourceType "viktor.core.File.SourceType")** = 1*[](#File.SourceType.DATA "Link to this definition")
- PATH*: [`SourceType`](#File.SourceType "viktor.core.File.SourceType")** = 2*[](#File.SourceType.PATH "Link to this definition")
* URL*: [`SourceType`](#File.SourceType "viktor.core.File.SourceType")** = 3*[](#File.SourceType.URL "Link to this definition")
- WRITABLE*: [`SourceType`](#File.SourceType "viktor.core.File.SourceType")** = 4*[](#File.SourceType.WRITABLE "Link to this definition")
* copy(*writable=False*)[](#File.copy "Link to this definition")
Make a local copy of the file to disk.
Example usages:
URL-file that needs to be opened multiple times:
```
# copying to path-file prevents re-downloading if opening more than once.
path_file = url_file.copy() # download the complete content locally
with path_file.open() as r: # no downloading
...
with path_file.open() as r: # no downloading
...
```
Make writable file from read-only file:
```
writable_file = read_only_file.copy(writable=True)
with writable_file.open() as w:
w.write("my content")
```
* Parameters:
**writable** (`bool`) – True to return writable file, False for read-only (default: False).
* Return type:
[`File`](#File "viktor.core.File")
* Returns:
File object (SourceType.WRITABLE if writable = True, else SourceType.PATH).
- *classmethod *from\_data(*data*)[](#File.from_data "Link to this definition")
Create a File object with in-memory data as its source.
* Return type:
[`File`](#File "viktor.core.File")
* *classmethod *from\_path(*path*)[](#File.from_path "Link to this definition")
Create a File object with an existing file (path) as its source.
* Return type:
[`File`](#File "viktor.core.File")
- *classmethod *from\_url(*url*, *\**, *headers=None*)[](#File.from_url "Link to this definition")
Create a File object with a URL as its source.
* Return type:
[`File`](#File "viktor.core.File")
* getvalue(*encoding=None*)[](#File.getvalue "Link to this definition")
Read the content (text) of the file in memory. For large files, open the file and read in chunks, to prevent the app from running out of memory.
* Return type:
`str`
- getvalue\_binary()[](#File.getvalue_binary "Link to this definition")
Read the content (binary) of the file in memory. For large files, open the file and read in chunks, to prevent the app from running out of memory.
* Return type:
`bytes`
* open(*encoding=None*)[](#File.open "Link to this definition")
Open the file in text-mode.
* Parameters:
**encoding** (`str`) – encoding used for reading the bytes -> str (default: default local encoding)
* Return type:
`TextIO`
* Returns:
opened text file
- open\_binary()[](#File.open_binary "Link to this definition")
Open the file in binary-mode.
* Return type:
`BinaryIO`
* Returns:
opened binary file
* *property *source*: str | None*[](#File.source "Link to this definition")
Source of the File object:
* SourceType.DATA -> None
* SourceType.PATH -> path of (readable) file on disk
* SourceType.URL -> url
* SourceType.WRITABLE -> path of (writable) file on disk
- *property *source\_type*: [SourceType](#File.SourceType "viktor.core.File.SourceType")*[](#File.source_type "Link to this definition")
Source type of the file.
* *property *writable*: bool*[](#File.writable "Link to this definition")
Whether the File is writable or not (only True for SourceType.WRITABLE).
## InitialEntity[](https://docs.viktor.ai/sdk/api/core/.md#_InitialEntity "Direct link to InitialEntity")
* *class *viktor.core.InitialEntity(*entity\_type\_name*, *name*, *\**, *params=None*, *children=None*, *show\_on\_dashboard=None*, *use\_as\_start\_page=None*)[](#InitialEntity "Link to this definition")
Construct an initial entity in the app.\_\_init\_\_py file.
```
import viktor as vkt
from .settings_database.controller import Controller as SettingsDatabaseController
from .project_folder.controller import Controller as ProjectFolderController
from .project.controller import Controller as ProjectController
initial_entities = [
vkt.InitialEntity('SettingsDatabase', name='Settings', params=...),
vkt.InitialEntity('ProjectFolder', name='Projects', children=[
vkt.InitialEntity('Project', 'Project X),
vkt.InitialEntity('Project', 'Project Y),
]),
]
```
* Parameters:
* **entity\_type\_name** (`str`) – Type of the initial entity.
* **name** (`str`) – Name of the initial entity.
* **params** (`dict` | `str`) – Optional params in dictionary format or path to a .json, relative to the app.\_\_init\_\_.py. Note that path traversal (beyond the root directory) is not permitted (e.g. “../../entity.json”).
* **children** (`List`\[[`InitialEntity`](#InitialEntity "viktor.core.InitialEntity")]) – Optional child entities.
* **show\_on\_dashboard** (`bool`) – Show/hide the entity on the dashboard. Only top-level entities can be shown (default: True)
New in v13.7.0
* **use\_as\_start\_page** (`bool`) – Appoint the entity as the start page (instead of the dashboard). Only top-level entities can be appointed (default: False)
New in v14.19.0
## ParamsFromFile[](https://docs.viktor.ai/sdk/api/core/.md#_ParamsFromFile "Direct link to ParamsFromFile")
* *class *viktor.core.ParamsFromFile(*\**, *max\_size=None*, *file\_types=None*)[](#ParamsFromFile "Link to this definition")
Decorator that can be used on a pre-process method during a file upload, to produce the parameter set that is stored in the database.
Warning
Prevent storing the complete file content on the properties if the file is large, as this may cause speed and/or stability issues. The file content can be retrieved at all times using the API whenever necessary.
Example with nothing to store:
```
class Controller(vkt.Controller):
...
@vkt.ParamsFromFile(...)
def process_file(self, file: vkt.File, **kwargs):
return {}
```
Example with parameters to store:
```
class Controller(vkt.Controller):
...
@vkt.ParamsFromFile(...)
def process_file(self, file: vkt.File, **kwargs):
# app specific parsing logic
file_content = file.getvalue() # or use reading in chunks, for large files
number_of_entries = ...
project_name = ...
# linking the parsed output to the parametrization fields (names in database)
return {
'tab': {
'section': {
'number_of_entries': number_of_entries,
'project_name': project_name
}
}
}
```
Warning
Loading the content of a large file in memory (file.getvalue()) may cause the app to crash (out-of-memory). Read the file content in chunks to avoid such memory issues (see [`File`](#File "viktor.core.File")).
Note
[`viktor.testing.mock_ParamsFromFile()`](https://docs.viktor.ai/sdk/api/testing/.md#mock_ParamsFromFile "viktor.testing.mock_ParamsFromFile") can be used to test methods decorated with ParamsFromFile.
* Parameters:
* **max\_size** (`int`) – optional restriction on file size in bytes (e.g. 10\_000\_000 = 10 MB).
* **file\_types** (`Sequence`\[`str`]) – optional restriction on file type(s) (e.g. \[‘.png’, ‘.jpg’, ‘.jpeg’]). Note that the extensions are filtered regardless of capitalization.
## Storage[](https://docs.viktor.ai/sdk/api/core/.md#_Storage "Direct link to Storage")
* *class *viktor.core.Storage[](#Storage "Link to this definition")
Starting point to communicate with the storage to, for example, set or retrieve analysis results.
**(new in v14.28.0)**: Storage.set() Key length has been increased from 64 to 256 characters.
The following actions are supported:
```
storage = vkt.Storage()
# Setting data on a key
storage.set('data_key_1', data=vkt.File.from_data('abc'), scope='entity')
storage.set('data_key_2', data=vkt.File.from_data('def'), scope='entity')
# Retrieve the data by key
storage.get('data_key_1', scope='entity')
# List available data keys (by prefix)
storage.list(scope='entity') # lists all files in current entity scope
storage.list(prefix='data_key_', scope='entity') # lists 'data_key_1', 'data_key_2', ... etc.
# Delete data by key
storage.delete('data_key_1', scope='entity')
```
For each of these methods, a scope can be defined to point to a specific section in the storage. These scopes ensure efficient arrangement and handling of data. The following scopes can be used:
> * entity : when data needs to be accessed within a specific entity
>
> * workspace : when data needs to be accessed workspace-wide
>
> * session **(new in v14.28.0)** : when data needs to be accessed within an editor session
* delete(*key*, *\**, *scope*, *entity=None*)[](#Storage.delete "Link to this definition")
Delete a key-value pair for the specified scope.
* Parameters:
* **key** (`str`) – Unique key from which the key-value pair should be deleted.
* **scope** (`str`) – Applicable scope, ‘entity’ | ‘workspace’ | ‘session’.
* **entity** ([`Entity`](https://docs.viktor.ai/sdk/api/api-v1/.md#Entity "viktor.api_v1.Entity")) – Applicable entity, used in combination with scope==’entity’ (default: current entity).
* Raises:
* **FileNotFoundError** – When trying to delete a file that does not exist in the defined storage scope.
* [**EntityNotFoundError**](https://docs.viktor.ai/sdk/api/errors/.md#EntityNotFoundError "viktor.errors.EntityNotFoundError") – When ‘entity’ no longer exists, or is not accessible.
* Return type:
`None`
- get(*key*, *\**, *scope*, *entity=None*)[](#Storage.get "Link to this definition")
Retrieve data from a key for the specified scope.
* Parameters:
* **key** (`str`) – Unique key from which the data should be retrieved.
* **scope** (`str`) – Applicable scope, ‘entity’ | ‘workspace’ | ‘session’.
* **entity** ([`Entity`](https://docs.viktor.ai/sdk/api/api-v1/.md#Entity "viktor.api_v1.Entity")) – Applicable entity, used in combination with scope==’entity’ (default: current entity).
* Raises:
* **FileNotFoundError** – When trying to retrieve a file that does not exist in the defined storage scope.
* [**EntityNotFoundError**](https://docs.viktor.ai/sdk/api/errors/.md#EntityNotFoundError "viktor.errors.EntityNotFoundError") – When ‘entity’ no longer exists, or is not accessible.
* Return type:
[`File`](#File "viktor.core.File")
* list(*\**, *prefix=None*, *scope*, *entity=None*)[](#Storage.list "Link to this definition")
List all available key-value pairs for the specified scope.
* Parameters:
* **prefix** (`str`) – List all data of which the keys start with the provided prefix. Using a prefix potentially results in much higher performance due to a more efficient lookup in case of many stored files.
* **scope** (`str`) – Applicable scope, ‘entity’ | ‘workspace’ | ‘session’.
* **entity** ([`Entity`](https://docs.viktor.ai/sdk/api/api-v1/.md#Entity "viktor.api_v1.Entity")) – Applicable entity, used in combination with scope==’entity’ (default: current entity).
* Raises:
[**EntityNotFoundError**](https://docs.viktor.ai/sdk/api/errors/.md#EntityNotFoundError "viktor.errors.EntityNotFoundError") – When ‘entity’ no longer exists, or is not accessible.
* Return type:
`Dict`\[`str`, [`File`](#File "viktor.core.File")]
- set(*key*, *data*, *\**, *scope*, *entity=None*)[](#Storage.set "Link to this definition")
Set data on a key for the specified scope.
* Parameters:
* **key** (`str`) – Unique key on which the data is set (max. 256 characters).
* **data** ([`File`](#File "viktor.core.File")) – Data to be stored.
* **scope** (`str`) – Applicable scope, ‘entity’ | ‘workspace’ | ‘session’.
* **entity** ([`Entity`](https://docs.viktor.ai/sdk/api/api-v1/.md#Entity "viktor.api_v1.Entity")) – Applicable entity, used in combination with scope==’entity’ (default: current entity).
* Raises:
[**EntityNotFoundError**](https://docs.viktor.ai/sdk/api/errors/.md#EntityNotFoundError "viktor.errors.EntityNotFoundError") – When ‘entity’ no longer exists, or is not accessible.
* Return type:
`None`
## UserMessage[](https://docs.viktor.ai/sdk/api/core/.md#_UserMessage "Direct link to UserMessage")
* *class *viktor.core.UserMessage[](#UserMessage "Link to this definition")
New in v14.0.0
A non-breaking message that is shown to the user in the web-interface.
Example usage:
```
vkt.UserMessage.warning("Show this warning")
vkt.UserMessage.info("Show this info")
vkt.UserMessage.success("Analysis successfully finished!")
```
* *classmethod *info(*message*)[](#UserMessage.info "Link to this definition")
Show an info message to the user.
* Return type:
`None`
- *classmethod *success(*message*)[](#UserMessage.success "Link to this definition")
Show a success message to the user.
* Return type:
`None`
* *classmethod *warning(*message*)[](#UserMessage.warning "Link to this definition")
Show a warning message to the user.
* Return type:
`None`
## ViktorController[](https://docs.viktor.ai/sdk/api/core/.md#_ViktorController "Direct link to ViktorController")
* viktor.core.ViktorController[](#ViktorController "Link to this definition")
alias of [`Controller`](#Controller "viktor.core.Controller")
## make\_data\_json\_serializable[](https://docs.viktor.ai/sdk/api/core/.md#_make_data_json_serializable "Direct link to make_data_json_serializable")
* viktor.core.make\_data\_json\_serializable(*input\_data*)[](#make_data_json_serializable "Link to this definition")
The python built-in json dump does not support all the desired types. This function converts those, thereby enabling broader json conversion.
* numpy number types -> equivalent python builtin
* datetime.datetime and datetime.date -> isoformat str
* tuple -> list (otherwise sub elements cannot be converted due to tuple immutability)
- Return type:
`Any`
## progress\_message[](https://docs.viktor.ai/sdk/api/core/.md#_progress_message "Direct link to progress_message")
* viktor.core.progress\_message(*message*, *percentage=None*)[](#progress_message "Link to this definition")
Send a user facing progress message informing the progress of an evaluation. Messages are truncated to 500 characters
* Parameters:
* **message** (`str`) – Message shown to the user
* **percentage** (`float`) – Value between 0 and 100 quantifying the progress
* Return type:
`None`
---
# viktor.errors
## BadRequestError[](https://docs.viktor.ai/sdk/api/errors/.md#_BadRequestError "Direct link to BadRequestError")
* *exception *viktor.errors.BadRequestError[](#BadRequestError "Link to this definition")
Bases: [`Error`](#Error "viktor.errors.Error")
Exception raised if BE API returns 400.
## ComputeError[](https://docs.viktor.ai/sdk/api/errors/.md#_ComputeError "Direct link to ComputeError")
* *exception *viktor.errors.ComputeError[](#ComputeError "Link to this definition")
Bases: [`Error`](#Error "viktor.errors.Error")
Exception raised if the job computation didn’t finish successfully.
## EntityCreateError[](https://docs.viktor.ai/sdk/api/errors/.md#_EntityCreateError "Direct link to EntityCreateError")
* *exception *viktor.errors.EntityCreateError[](#EntityCreateError "Link to this definition")
Bases: [`EntityError`](#EntityError "viktor.errors.EntityError")
Exception raised if creation of an entity failed.
## EntityDeleteError[](https://docs.viktor.ai/sdk/api/errors/.md#_EntityDeleteError "Direct link to EntityDeleteError")
* *exception *viktor.errors.EntityDeleteError[](#EntityDeleteError "Link to this definition")
Bases: [`EntityError`](#EntityError "viktor.errors.EntityError")
Exception raised if deletion of an entity failed.
## EntityError[](https://docs.viktor.ai/sdk/api/errors/.md#_EntityError "Direct link to EntityError")
* *exception *viktor.errors.EntityError[](#EntityError "Link to this definition")
Bases: [`Error`](#Error "viktor.errors.Error")
Base class exception for all entity errors raised in the API.
## EntityNotFoundError[](https://docs.viktor.ai/sdk/api/errors/.md#_EntityNotFoundError "Direct link to EntityNotFoundError")
* *exception *viktor.errors.EntityNotFoundError[](#EntityNotFoundError "Link to this definition")
Bases: [`EntityError`](#EntityError "viktor.errors.EntityError")
Exception raised if an entity is requested using the api module but does not exist.
## EntityReviseError[](https://docs.viktor.ai/sdk/api/errors/.md#_EntityReviseError "Direct link to EntityReviseError")
* *exception *viktor.errors.EntityReviseError[](#EntityReviseError "Link to this definition")
Bases: [`EntityError`](#EntityError "viktor.errors.EntityError")
Exception raised if creating a revision (e.g. set params, rename) of an entity failed.
## Error[](https://docs.viktor.ai/sdk/api/errors/.md#_Error "Direct link to Error")
* *exception *viktor.errors.Error[](#Error "Link to this definition")
Bases: `Exception`
## ExecutionError[](https://docs.viktor.ai/sdk/api/errors/.md#_ExecutionError "Direct link to ExecutionError")
* *exception *viktor.errors.ExecutionError[](#ExecutionError "Link to this definition")
Bases: [`Error`](#Error "viktor.errors.Error")
Exception raised if an error occurs during the execution of an external analysis.
## GEFClassificationError[](https://docs.viktor.ai/sdk/api/errors/.md#_GEFClassificationError "Direct link to GEFClassificationError")
* *exception *viktor.errors.GEFClassificationError[](#GEFClassificationError "Link to this definition")
Bases: `Exception`
Exception raised if an error occurs during classification of [`viktor.geo.GEFData`](https://docs.viktor.ai/sdk/api/geo/.md#GEFData "viktor.geo.GEFData").
## GEFParsingError[](https://docs.viktor.ai/sdk/api/errors/.md#_GEFParsingError "Direct link to GEFParsingError")
* *exception *viktor.errors.GEFParsingError[](#GEFParsingError "Link to this definition")
Bases: `Exception`
Exception raised if an error occurs during parsing of a [`viktor.geo.GEFFile`](https://docs.viktor.ai/sdk/api/geo/.md#GEFFile "viktor.geo.GEFFile").
## InputViolation[](https://docs.viktor.ai/sdk/api/errors/.md#_InputViolation "Direct link to InputViolation")
* *class *viktor.errors.InputViolation(*message*, *fields*)[](#InputViolation "Link to this definition")
New in v13.7.0
Annotate fields that should be marked as invalid in the interface, along with a message.
Example:
```
vkt.InputViolation("Width cannot be larger than height", fields=['width', 'height'])
```
* Parameters:
* **message** (`str`) – Message that is shown to the user.
* **fields** (`Sequence`\[`str`]) – Fields that are marked invalid in the interface. Note that these refer to the parametrization class attributes (e.g. ‘step\_1.field\_x’), and not the database location in case name is set.
## InternalError[](https://docs.viktor.ai/sdk/api/errors/.md#_InternalError "Direct link to InternalError")
* *exception *viktor.errors.InternalError[](#InternalError "Link to this definition")
Bases: [`Error`](#Error "viktor.errors.Error")
Exception applicable for incorrect internal VIKTOR logic. Please contact VIKTOR.
## LicenseError[](https://docs.viktor.ai/sdk/api/errors/.md#_LicenseError "Direct link to LicenseError")
* *exception *viktor.errors.LicenseError[](#LicenseError "Link to this definition")
Bases: [`Error`](#Error "viktor.errors.Error")
Exception raised if an external analysis cannot be executed due to license issues.
## ModelError[](https://docs.viktor.ai/sdk/api/errors/.md#_ModelError "Direct link to ModelError")
* *exception *viktor.errors.ModelError[](#ModelError "Link to this definition")
Bases: [`Error`](#Error "viktor.errors.Error")
Exception raised if an error occurs within the model of one of the bindings (e.g. SCIA, D-Settlement, …).
## ParsingError[](https://docs.viktor.ai/sdk/api/errors/.md#_ParsingError "Direct link to ParsingError")
* *exception *viktor.errors.ParsingError[](#ParsingError "Link to this definition")
Bases: [`Error`](#Error "viktor.errors.Error")
Exception raised if an error occurs during parsing.
## PermissionDeniedError[](https://docs.viktor.ai/sdk/api/errors/.md#_PermissionDeniedError "Direct link to PermissionDeniedError")
* *exception *viktor.errors.PermissionDeniedError[](#PermissionDeniedError "Link to this definition")
Bases: [`Error`](#Error "viktor.errors.Error")
Exception raised if a resource is requested using the api module but access is not permitted (403)
## PreconditionFailedError[](https://docs.viktor.ai/sdk/api/errors/.md#_PreconditionFailedError "Direct link to PreconditionFailedError")
* *exception *viktor.errors.PreconditionFailedError[](#PreconditionFailedError "Link to this definition")
Bases: [`Error`](#Error "viktor.errors.Error")
Exception raised if some precondition failed (412)
## ResourceNotFoundError[](https://docs.viktor.ai/sdk/api/errors/.md#_ResourceNotFoundError "Direct link to ResourceNotFoundError")
* *exception *viktor.errors.ResourceNotFoundError[](#ResourceNotFoundError "Link to this definition")
Bases: [`Error`](#Error "viktor.errors.Error")
Exception raised if a resource is requested using the api module but does not exist (404)
## SciaParsingError[](https://docs.viktor.ai/sdk/api/errors/.md#_SciaParsingError "Direct link to SciaParsingError")
* *exception *viktor.errors.SciaParsingError[](#SciaParsingError "Link to this definition")
Bases: `Exception`
Exception raised if an error occurs during parsing of SCIA output results.
## SpreadsheetError[](https://docs.viktor.ai/sdk/api/errors/.md#_SpreadsheetError "Direct link to SpreadsheetError")
* *exception *viktor.errors.SpreadsheetError[](#SpreadsheetError "Link to this definition")
Bases: `Exception`
Exception raised if an error occurs in the Excel or Spreadsheet service.
## SummaryError[](https://docs.viktor.ai/sdk/api/errors/.md#_SummaryError "Direct link to SummaryError")
* *exception *viktor.errors.SummaryError[](#SummaryError "Link to this definition")
Bases: `Exception`
Exception raised if an error occurs during the generation of the summary.
## UserError[](https://docs.viktor.ai/sdk/api/errors/.md#_UserError "Direct link to UserError")
* *exception *viktor.errors.UserError(*\*messages*, *input\_violations=None*)[](#UserError "Link to this definition")
Bases: `Exception`
New in v13.7.0
Exception that is shown to the user in the web-interface.
Example:
```
raise vkt.UserError("The design is not feasible")
```
By providing input\_violations you can mark specific fields as invalid:
```
violations = [
vkt.InputViolation("Width cannot be larger than height", fields=['width', 'height']),
vkt.InputViolation(...),
]
raise vkt.UserError("The design is not feasible", input_violations=violations)
```
* Parameters:
* **messages** (`Any`) – Messages to be shown to the user.
* **input\_violations** (`Sequence`\[[`InputViolation`](#InputViolation "viktor.errors.InputViolation")]) – Mark fields invalid in the interface, along with a message.
## ViewError[](https://docs.viktor.ai/sdk/api/errors/.md#_ViewError "Direct link to ViewError")
* *exception *viktor.errors.ViewError[](#ViewError "Link to this definition")
Bases: `Exception`
Exception raised if an error occurs during the generation of a view.
## WordFileError[](https://docs.viktor.ai/sdk/api/errors/.md#_WordFileError "Direct link to WordFileError")
* *exception *viktor.errors.WordFileError[](#WordFileError "Link to this definition")
Bases: `Exception`
Exception raised if an error occurs during rendering of a Word file.
## WorkerSessionAttachError[](https://docs.viktor.ai/sdk/api/errors/.md#_WorkerSessionAttachError "Direct link to WorkerSessionAttachError")
* *exception *viktor.errors.WorkerSessionAttachError(*\*messages*, *reason=''*)[](#WorkerSessionAttachError "Link to this definition")
Bases: [`WorkerSessionError`](#WorkerSessionError "viktor.errors.WorkerSessionError")
New in 14.33.0
Exception raised when `viktor.external.autocad.attach()`, `viktor.external.civil3d.attach()`, `viktor.external.etabs.attach()` or `viktor.external.sap2000.attach()` could not attach to a running instance. The session was not established; start a new one to continue.
* Parameters:
* **messages** (`Any`) – Human-readable messages describing the failure.
* **reason** (`str`) – Machine-readable cause: `"error_attach_no_instance"` (nothing running on the worker machine), `"error_attach_wrong_product"`, `"error_attach_refused"`, `"error_session_mode_not_supported"` (worker too old), `"no_worker_online"`, `"worker_kind_not_allowed"` (kind not enabled for the organization), `"error_timeout"` (no acknowledgement in time) or `"session_open_failed"` (unclassified). The set is open: handle an unknown reason as a generic attach failure.
## WorkerSessionError[](https://docs.viktor.ai/sdk/api/errors/.md#_WorkerSessionError "Direct link to WorkerSessionError")
* *exception *viktor.errors.WorkerSessionError[](#WorkerSessionError "Link to this definition")
Bases: [`Error`](#Error "viktor.errors.Error")
Exception raised when a worker session is lost (e.g. the bound worker disconnected, or the application it was driving was torn down). The session cannot be resumed. Start a new session to continue.
---
# viktor.external.autocad
## AutoCADConnection[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AutoCADConnection "Direct link to AutoCADConnection")
* *class *viktor.external.autocad.autocad.AutoCADConnection(*session*)[](#AutoCADConnection "Link to this definition")
Bases: `_HandleConnection`
New in 14.35.0
The `acad` object returned by [`connect()`](#connect "viktor.external.autocad.autocad.connect") or [`attach()`](#attach "viktor.external.autocad.autocad.attach"), used to control AutoCAD through its ActiveX Automation API. Each call returns the API result, or `[*out_params, ret]` when the call has output parameters. Objects returned by calls come back as opaque session-scoped handles, usable in further calls and as arguments; a property is read with call syntax (`line.Length()`) and written by plain assignment (`line.Layer = "STRUCTURE"`).
Some members are refused by the worker for security and session safety (raising [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError")), and filename arguments are confined to the session’s working directory: save with `SaveAs` and a relative filename.
The SDK sends calls to the worker in chunks. A result is read when your code first uses its value: in `==`, `if`, `float()`, `int()`, `str()`, `print()` or a loop. A failed call raises [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError") at that read, with the call and your line. Two things do not read a result: passing it to a later call, and unpacking it into names. So the example below sends all three calls in one chunk. `result is None` is always `False` on an unread result; use `== None`. Pass `defer=False` to [`connect()`](#connect "viktor.external.autocad.autocad.connect") / [`attach()`](#attach "viktor.external.autocad.autocad.attach") to send each call on its own.
```
circle = acad.ActiveDocument.ModelSpace.AddCircle([0, 0, 0], 1)
low, high, _ = circle.GetBoundingBox()
acad.ActiveDocument.ModelSpace.AddLine(low, high)
```
See [`batch()`](#AutoCADConnection.batch "viktor.external.autocad.autocad.AutoCADConnection.batch") when one loop makes more than a few hundred calls.
Warning
Do not instantiate this class directly; obtain it from [`connect()`](#connect "viktor.external.autocad.autocad.connect") or [`attach()`](#attach "viktor.external.autocad.autocad.attach").
* batch()[](#AutoCADConnection.batch "Link to this definition")
New in v14.37.0
Send all calls of the block to the worker as one job when the block ends. Without the block the SDK sends calls in chunks of a few hundred, each one round trip. The gain grows with the size of the block; below a few hundred calls it changes nothing. You cannot read a result inside the block: a read raises `RuntimeError`. So do `isinstance()`, `print()`, `str()` and `repr()` on a result. Read the results after the block. The block runs as one job under the session `timeout` (300 s by default). For a very large block, increase `timeout` in [`connect()`](#connect "viktor.external.autocad.autocad.connect") / [`attach()`](#attach "viktor.external.autocad.autocad.attach").
```
with sap.batch():
for x, y in points: # 5000 points
name, ret = sap.FrameObj.AddByCoord(x, y, 0, x, y, 3, "", "W12X26")
sap.FrameObj.SetGroupAssign(name, "Columns")
# 10000 calls went to the worker in one job
```
Needs a deferred connection (`defer=True`). Blocks cannot be nested. Calls made before the block are sent when the block starts.
* Return type:
`ContextManager`\[`None`, `bool` | `None`]
## attach[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_attach "Direct link to attach")
* viktor.external.autocad.autocad.attach(*timeout=300*, *defer=True*)[](#attach "Link to this definition")
New in 14.35.0
Attach to the AutoCAD instance already running on the worker machine and control it through the AutoCAD ActiveX Automation API, like [`connect()`](#connect "viktor.external.autocad.autocad.connect"), but without starting a fresh instance. Typical use: a personal worker on the engineer’s own machine, so the app acts on the drawing they have open on screen.
Warning
This is a BETA feature.
Requires a worker of kind `autocad`. Declare it in your [viktor.config.toml](https://docs.viktor.ai/docs/create-apps/references/viktor-config-toml/):
```
worker_integrations = [
"autocad",
]
```
Usage:
```
import viktor as vkt
with vkt.autocad.attach(timeout=60) as acad:
layer = acad.ActiveDocument.ActiveLayer.Name() # reads the drawing open in AutoCAD
acad.ActiveDocument.Regen(0) # changes show in the user's window
```
Closing the session detaches without exiting the instance. The app can change the attached drawing but not save it in place: saving requires `SaveAs` with a relative filename, which writes into the session directory.
Note
The ActiveX members you call on `acad` (e.g. `acad.ActiveDocument.ModelSpace.AddLine`) mirror the AutoCAD Object Model and are not listed here. Look them up in the AutoCAD ActiveX Reference Guide on [Autodesk’s developer documentation](https://www.autodesk.com/developer-network/platform-technologies/autocad), or in the `acadauto.chm` help file in your AutoCAD installation directory.
* Parameters:
* **timeout** (`int`) – timeout in seconds for one chunk of calls; also bounds the attach itself, so keep it at or above the platform’s 30 second bind window.
* **defer** (`bool`) – queue calls and send them to the worker in chunks; a result is fetched when your code first reads it (default: True). False sends every call at once and returns plain values.
New in v14.37.0
* Return type:
[`AutoCADConnection`](#AutoCADConnection "viktor.external.autocad.autocad.AutoCADConnection")
Exceptions which can be raised during execution:
> * [`viktor.errors.WorkerSessionAttachError`](https://docs.viktor.ai/sdk/api/errors/.md#WorkerSessionAttachError "viktor.errors.WorkerSessionAttachError"): the attach failed, e.g. no AutoCAD is running on the worker machine. `reason` names the cause; that set is open.
>
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error during a call. Error message provides more information.
>
> * [`viktor.errors.WorkerSessionError`](https://docs.viktor.ai/sdk/api/errors/.md#WorkerSessionError "viktor.errors.WorkerSessionError"): the session was lost after attaching (e.g. the user closed the AutoCAD instance). The session cannot be resumed; start a new one to continue.
>
> * TimeoutError: a chunk of calls took longer than `timeout`
## connect[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_connect "Direct link to connect")
* viktor.external.autocad.autocad.connect(*timeout=300*, *defer=True*)[](#connect "Link to this definition")
New in 14.35.0
Connect to AutoCAD running on a connected VIKTOR worker and control it through the AutoCAD ActiveX Automation API directly from your app, as shown below. Always starts a fresh instance: if AutoCAD is already open on the worker machine the session is refused — close it there, or use [`attach()`](#attach "viktor.external.autocad.autocad.attach") to act on it.
Warning
This is a BETA feature.
Requires a worker of kind `autocad`. Declare it in your [viktor.config.toml](https://docs.viktor.ai/docs/create-apps/references/viktor-config-toml/):
```
worker_integrations = [
"autocad",
]
```
Usage:
```
import viktor as vkt
with vkt.autocad.connect(timeout=60) as acad:
ms = acad.ActiveDocument.ModelSpace
line = ms.AddLine([0, 0, 0], [6, 0, 0]) # returns a session-scoped object handle
line.Layer = "STRUCTURE" # property write: plain assignment
length = line.Length() # property read: call syntax (note the parens)
acad.ActiveDocument.SaveAs("beam.dwg") # use a relative filename, not an absolute path
```
Note
The ActiveX members you call on `acad` (e.g. `acad.ActiveDocument.ModelSpace.AddLine`) mirror the AutoCAD Object Model and are not listed here. Look them up in the AutoCAD ActiveX Reference Guide on [Autodesk’s developer documentation](https://www.autodesk.com/developer-network/platform-technologies/autocad), or in the `acadauto.chm` help file in your AutoCAD installation directory.
* Parameters:
* **timeout** (`int`) – timeout in seconds for one chunk of calls. Opening the session waits for AutoCAD to be ready, so it must also cover starting AutoCAD up on the worker.
* **defer** (`bool`) – queue calls and send them to the worker in chunks; a result is fetched when your code first reads it (default: True). False sends every call at once and returns plain values.
New in v14.37.0
* Return type:
[`AutoCADConnection`](#AutoCADConnection "viktor.external.autocad.autocad.AutoCADConnection")
Exceptions which can be raised during execution:
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information. A host whose AutoCAD license is not activated also fails this way: AutoCAD blocks on an interactive sign-in dialog that the worker cannot answer, so starting it up times out.
>
> * [`viktor.errors.WorkerSessionError`](https://docs.viktor.ai/sdk/api/errors/.md#WorkerSessionError "viktor.errors.WorkerSessionError"): the session was lost (e.g. its AutoCAD instance was torn down). The session cannot be resumed; start a new one to continue.
>
> * TimeoutError: a chunk of calls took longer than `timeout`
AutoCAD enum values, generated from AutoCAD 26.0s (LMS Tech).
## Ac3DPolylineType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_Ac3DPolylineType "Direct link to Ac3DPolylineType")
* *class *viktor.external.autocad.enums.Ac3DPolylineType(*\*values*)[](#Ac3DPolylineType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `Ac3DPolylineType` values, mirroring the product API’s names so code reads like its docs.
* acCubicSpline3DPoly* = 2*[](#Ac3DPolylineType.acCubicSpline3DPoly "Link to this definition")
- acQuadSpline3DPoly* = 1*[](#Ac3DPolylineType.acQuadSpline3DPoly "Link to this definition")
* acSimple3DPoly* = 0*[](#Ac3DPolylineType.acSimple3DPoly "Link to this definition")
## AcARXDemandLoad[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcARXDemandLoad "Direct link to AcARXDemandLoad")
* *class *viktor.external.autocad.enums.AcARXDemandLoad(*\*values*)[](#AcARXDemandLoad "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcARXDemandLoad` values, mirroring the product API’s names so code reads like its docs.
* acDemanLoadDisable* = 0*[](#AcARXDemandLoad.acDemanLoadDisable "Link to this definition")
- acDemandLoadCmdInvoke* = 2*[](#AcARXDemandLoad.acDemandLoadCmdInvoke "Link to this definition")
* acDemandLoadOnObjectDetect* = 1*[](#AcARXDemandLoad.acDemandLoadOnObjectDetect "Link to this definition")
## AcActiveSpace[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcActiveSpace "Direct link to AcActiveSpace")
* *class *viktor.external.autocad.enums.AcActiveSpace(*\*values*)[](#AcActiveSpace "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcActiveSpace` values, mirroring the product API’s names so code reads like its docs.
* acModelSpace* = 1*[](#AcActiveSpace.acModelSpace "Link to this definition")
- acPaperSpace* = 0*[](#AcActiveSpace.acPaperSpace "Link to this definition")
## AcAlignment[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcAlignment "Direct link to AcAlignment")
* *class *viktor.external.autocad.enums.AcAlignment(*\*values*)[](#AcAlignment "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcAlignment` values, mirroring the product API’s names so code reads like its docs.
* acAlignmentAligned* = 3*[](#AcAlignment.acAlignmentAligned "Link to this definition")
- acAlignmentBottomCenter* = 13*[](#AcAlignment.acAlignmentBottomCenter "Link to this definition")
* acAlignmentBottomLeft* = 12*[](#AcAlignment.acAlignmentBottomLeft "Link to this definition")
- acAlignmentBottomRight* = 14*[](#AcAlignment.acAlignmentBottomRight "Link to this definition")
* acAlignmentCenter* = 1*[](#AcAlignment.acAlignmentCenter "Link to this definition")
- acAlignmentFit* = 5*[](#AcAlignment.acAlignmentFit "Link to this definition")
* acAlignmentLeft* = 0*[](#AcAlignment.acAlignmentLeft "Link to this definition")
- acAlignmentMiddle* = 4*[](#AcAlignment.acAlignmentMiddle "Link to this definition")
* acAlignmentMiddleCenter* = 10*[](#AcAlignment.acAlignmentMiddleCenter "Link to this definition")
- acAlignmentMiddleLeft* = 9*[](#AcAlignment.acAlignmentMiddleLeft "Link to this definition")
* acAlignmentMiddleRight* = 11*[](#AcAlignment.acAlignmentMiddleRight "Link to this definition")
- acAlignmentRight* = 2*[](#AcAlignment.acAlignmentRight "Link to this definition")
* acAlignmentTopCenter* = 7*[](#AcAlignment.acAlignmentTopCenter "Link to this definition")
- acAlignmentTopLeft* = 6*[](#AcAlignment.acAlignmentTopLeft "Link to this definition")
* acAlignmentTopRight* = 8*[](#AcAlignment.acAlignmentTopRight "Link to this definition")
## AcAlignmentPointAcquisition[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcAlignmentPointAcquisition "Direct link to AcAlignmentPointAcquisition")
* *class *viktor.external.autocad.enums.AcAlignmentPointAcquisition(*\*values*)[](#AcAlignmentPointAcquisition "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcAlignmentPointAcquisition` values, mirroring the product API’s names so code reads like its docs.
* acAlignPntAcquisitionAutomatic* = 0*[](#AcAlignmentPointAcquisition.acAlignPntAcquisitionAutomatic "Link to this definition")
- acAlignPntAcquisitionShiftToAcquire* = 1*[](#AcAlignmentPointAcquisition.acAlignPntAcquisitionShiftToAcquire "Link to this definition")
## AcAngleUnits[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcAngleUnits "Direct link to AcAngleUnits")
* *class *viktor.external.autocad.enums.AcAngleUnits(*\*values*)[](#AcAngleUnits "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcAngleUnits` values, mirroring the product API’s names so code reads like its docs.
* acDegreeMinuteSeconds* = 1*[](#AcAngleUnits.acDegreeMinuteSeconds "Link to this definition")
- acDegrees* = 0*[](#AcAngleUnits.acDegrees "Link to this definition")
* acGrads* = 2*[](#AcAngleUnits.acGrads "Link to this definition")
- acRadians* = 3*[](#AcAngleUnits.acRadians "Link to this definition")
## AcAttachmentPoint[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcAttachmentPoint "Direct link to AcAttachmentPoint")
* *class *viktor.external.autocad.enums.AcAttachmentPoint(*\*values*)[](#AcAttachmentPoint "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcAttachmentPoint` values, mirroring the product API’s names so code reads like its docs.
* acAttachmentPointBottomCenter* = 8*[](#AcAttachmentPoint.acAttachmentPointBottomCenter "Link to this definition")
- acAttachmentPointBottomLeft* = 7*[](#AcAttachmentPoint.acAttachmentPointBottomLeft "Link to this definition")
* acAttachmentPointBottomRight* = 9*[](#AcAttachmentPoint.acAttachmentPointBottomRight "Link to this definition")
- acAttachmentPointMiddleCenter* = 5*[](#AcAttachmentPoint.acAttachmentPointMiddleCenter "Link to this definition")
* acAttachmentPointMiddleLeft* = 4*[](#AcAttachmentPoint.acAttachmentPointMiddleLeft "Link to this definition")
- acAttachmentPointMiddleRight* = 6*[](#AcAttachmentPoint.acAttachmentPointMiddleRight "Link to this definition")
* acAttachmentPointTopCenter* = 2*[](#AcAttachmentPoint.acAttachmentPointTopCenter "Link to this definition")
- acAttachmentPointTopLeft* = 1*[](#AcAttachmentPoint.acAttachmentPointTopLeft "Link to this definition")
* acAttachmentPointTopRight* = 3*[](#AcAttachmentPoint.acAttachmentPointTopRight "Link to this definition")
## AcAttributeMode[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcAttributeMode "Direct link to AcAttributeMode")
* *class *viktor.external.autocad.enums.AcAttributeMode(*\*values*)[](#AcAttributeMode "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcAttributeMode` values, mirroring the product API’s names so code reads like its docs.
* acAttributeModeConstant* = 2*[](#AcAttributeMode.acAttributeModeConstant "Link to this definition")
- acAttributeModeInvisible* = 1*[](#AcAttributeMode.acAttributeModeInvisible "Link to this definition")
* acAttributeModeLockPosition* = 16*[](#AcAttributeMode.acAttributeModeLockPosition "Link to this definition")
- acAttributeModeMultipleLine* = 32*[](#AcAttributeMode.acAttributeModeMultipleLine "Link to this definition")
* acAttributeModeNormal* = 0*[](#AcAttributeMode.acAttributeModeNormal "Link to this definition")
- acAttributeModePreset* = 8*[](#AcAttributeMode.acAttributeModePreset "Link to this definition")
* acAttributeModeVerify* = 4*[](#AcAttributeMode.acAttributeModeVerify "Link to this definition")
## AcBlockConnectionType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcBlockConnectionType "Direct link to AcBlockConnectionType")
* *class *viktor.external.autocad.enums.AcBlockConnectionType(*\*values*)[](#AcBlockConnectionType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcBlockConnectionType` values, mirroring the product API’s names so code reads like its docs.
* acConnectBase* = 1*[](#AcBlockConnectionType.acConnectBase "Link to this definition")
- acConnectExtents* = 0*[](#AcBlockConnectionType.acConnectExtents "Link to this definition")
## AcBlockScaling[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcBlockScaling "Direct link to AcBlockScaling")
* *class *viktor.external.autocad.enums.AcBlockScaling(*\*values*)[](#AcBlockScaling "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcBlockScaling` values, mirroring the product API’s names so code reads like its docs.
* acAny* = 0*[](#AcBlockScaling.acAny "Link to this definition")
- acUniform* = 1*[](#AcBlockScaling.acUniform "Link to this definition")
## AcBoolean[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcBoolean "Direct link to AcBoolean")
* *class *viktor.external.autocad.enums.AcBoolean(*\*values*)[](#AcBoolean "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcBoolean` values, mirroring the product API’s names so code reads like its docs.
* acFalse* = 0*[](#AcBoolean.acFalse "Link to this definition")
- acTrue* = 1*[](#AcBoolean.acTrue "Link to this definition")
## AcBooleanType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcBooleanType "Direct link to AcBooleanType")
* *class *viktor.external.autocad.enums.AcBooleanType(*\*values*)[](#AcBooleanType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcBooleanType` values, mirroring the product API’s names so code reads like its docs.
* acIntersection* = 1*[](#AcBooleanType.acIntersection "Link to this definition")
- acSubtraction* = 2*[](#AcBooleanType.acSubtraction "Link to this definition")
* acUnion* = 0*[](#AcBooleanType.acUnion "Link to this definition")
## AcCellAlignment[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcCellAlignment "Direct link to AcCellAlignment")
* *class *viktor.external.autocad.enums.AcCellAlignment(*\*values*)[](#AcCellAlignment "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcCellAlignment` values, mirroring the product API’s names so code reads like its docs.
* acBottomCenter* = 8*[](#AcCellAlignment.acBottomCenter "Link to this definition")
- acBottomLeft* = 7*[](#AcCellAlignment.acBottomLeft "Link to this definition")
* acBottomRight* = 9*[](#AcCellAlignment.acBottomRight "Link to this definition")
- acMiddleCenter* = 5*[](#AcCellAlignment.acMiddleCenter "Link to this definition")
* acMiddleLeft* = 4*[](#AcCellAlignment.acMiddleLeft "Link to this definition")
- acMiddleRight* = 6*[](#AcCellAlignment.acMiddleRight "Link to this definition")
* acTopCenter* = 2*[](#AcCellAlignment.acTopCenter "Link to this definition")
- acTopLeft* = 1*[](#AcCellAlignment.acTopLeft "Link to this definition")
* acTopRight* = 3*[](#AcCellAlignment.acTopRight "Link to this definition")
## AcCellContentLayout[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcCellContentLayout "Direct link to AcCellContentLayout")
* *class *viktor.external.autocad.enums.AcCellContentLayout(*\*values*)[](#AcCellContentLayout "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcCellContentLayout` values, mirroring the product API’s names so code reads like its docs.
* acCellContentLayoutFlow* = 1*[](#AcCellContentLayout.acCellContentLayoutFlow "Link to this definition")
- acCellContentLayoutStackedHorizontal* = 2*[](#AcCellContentLayout.acCellContentLayoutStackedHorizontal "Link to this definition")
* acCellContentLayoutStackedVertical* = 4*[](#AcCellContentLayout.acCellContentLayoutStackedVertical "Link to this definition")
## AcCellContentType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcCellContentType "Direct link to AcCellContentType")
* *class *viktor.external.autocad.enums.AcCellContentType(*\*values*)[](#AcCellContentType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcCellContentType` values, mirroring the product API’s names so code reads like its docs.
* acCellContentTypeBlock* = 4*[](#AcCellContentType.acCellContentTypeBlock "Link to this definition")
- acCellContentTypeField* = 2*[](#AcCellContentType.acCellContentTypeField "Link to this definition")
* acCellContentTypeUnknown* = 0*[](#AcCellContentType.acCellContentTypeUnknown "Link to this definition")
- acCellContentTypeValue* = 1*[](#AcCellContentType.acCellContentTypeValue "Link to this definition")
## AcCellEdgeMask[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcCellEdgeMask "Direct link to AcCellEdgeMask")
* *class *viktor.external.autocad.enums.AcCellEdgeMask(*\*values*)[](#AcCellEdgeMask "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcCellEdgeMask` values, mirroring the product API’s names so code reads like its docs.
* acBottomMask* = 4*[](#AcCellEdgeMask.acBottomMask "Link to this definition")
- acLeftMask* = 8*[](#AcCellEdgeMask.acLeftMask "Link to this definition")
* acRightMask* = 2*[](#AcCellEdgeMask.acRightMask "Link to this definition")
- acTopMask* = 1*[](#AcCellEdgeMask.acTopMask "Link to this definition")
## AcCellMargin[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcCellMargin "Direct link to AcCellMargin")
* *class *viktor.external.autocad.enums.AcCellMargin(*\*values*)[](#AcCellMargin "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcCellMargin` values, mirroring the product API’s names so code reads like its docs.
* acCellMarginBottom* = 4*[](#AcCellMargin.acCellMarginBottom "Link to this definition")
- acCellMarginHorzSpacing* = 16*[](#AcCellMargin.acCellMarginHorzSpacing "Link to this definition")
* acCellMarginLeft* = 2*[](#AcCellMargin.acCellMarginLeft "Link to this definition")
- acCellMarginRight* = 8*[](#AcCellMargin.acCellMarginRight "Link to this definition")
* acCellMarginTop* = 1*[](#AcCellMargin.acCellMarginTop "Link to this definition")
- acCellMarginVertSpacing* = 32*[](#AcCellMargin.acCellMarginVertSpacing "Link to this definition")
## AcCellOption[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcCellOption "Direct link to AcCellOption")
* *class *viktor.external.autocad.enums.AcCellOption(*\*values*)[](#AcCellOption "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcCellOption` values, mirroring the product API’s names so code reads like its docs.
* kCellOptionNone* = 0*[](#AcCellOption.kCellOptionNone "Link to this definition")
- kInheritCellFormat* = 1*[](#AcCellOption.kInheritCellFormat "Link to this definition")
## AcCellProperty[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcCellProperty "Direct link to AcCellProperty")
* *class *viktor.external.autocad.enums.AcCellProperty(*\*values*)[](#AcCellProperty "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcCellProperty` values, mirroring the product API’s names so code reads like its docs.
* acAlignmentProperty* = 32*[](#AcCellProperty.acAlignmentProperty "Link to this definition")
- acAllCellProperties* = 524287*[](#AcCellProperty.acAllCellProperties "Link to this definition")
* acAutoScale* = 32768*[](#AcCellProperty.acAutoScale "Link to this definition")
- acBackgroundColor* = 128*[](#AcCellProperty.acBackgroundColor "Link to this definition")
* acBitProperties* = 245760*[](#AcCellProperty.acBitProperties "Link to this definition")
- acContentColor* = 64*[](#AcCellProperty.acContentColor "Link to this definition")
* acContentLayout* = 262144*[](#AcCellProperty.acContentLayout "Link to this definition")
- acContentProperties* = 33662*[](#AcCellProperty.acContentProperties "Link to this definition")
* acDataFormat* = 4*[](#AcCellProperty.acDataFormat "Link to this definition")
- acDataType* = 2*[](#AcCellProperty.acDataType "Link to this definition")
* acDataTypeAndFormat* = 6*[](#AcCellProperty.acDataTypeAndFormat "Link to this definition")
- acEnableBackgroundColor* = 16384*[](#AcCellProperty.acEnableBackgroundColor "Link to this definition")
* acFlowDirBtoT* = 131072*[](#AcCellProperty.acFlowDirBtoT "Link to this definition")
- acInvalidCellProperty* = 0*[](#AcCellProperty.acInvalidCellProperty "Link to this definition")
* acLock* = 1*[](#AcCellProperty.acLock "Link to this definition")
- acMarginBottom* = 8192*[](#AcCellProperty.acMarginBottom "Link to this definition")
* acMarginLeft* = 1024*[](#AcCellProperty.acMarginLeft "Link to this definition")
- acMarginRight* = 4096*[](#AcCellProperty.acMarginRight "Link to this definition")
* acMarginTop* = 2048*[](#AcCellProperty.acMarginTop "Link to this definition")
- acMergeAll* = 65536*[](#AcCellProperty.acMergeAll "Link to this definition")
* acRotation* = 8*[](#AcCellProperty.acRotation "Link to this definition")
- acScale* = 16*[](#AcCellProperty.acScale "Link to this definition")
* acTextHeight* = 512*[](#AcCellProperty.acTextHeight "Link to this definition")
- acTextStyle* = 256*[](#AcCellProperty.acTextStyle "Link to this definition")
## AcCellState[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcCellState "Direct link to AcCellState")
* *class *viktor.external.autocad.enums.AcCellState(*\*values*)[](#AcCellState "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcCellState` values, mirroring the product API’s names so code reads like its docs.
* acCellStateContentLocked* = 1*[](#AcCellState.acCellStateContentLocked "Link to this definition")
- acCellStateContentModified* = 32*[](#AcCellState.acCellStateContentModified "Link to this definition")
* acCellStateContentReadOnly* = 2*[](#AcCellState.acCellStateContentReadOnly "Link to this definition")
- acCellStateFormatLocked* = 4*[](#AcCellState.acCellStateFormatLocked "Link to this definition")
* acCellStateFormatModified* = 64*[](#AcCellState.acCellStateFormatModified "Link to this definition")
- acCellStateFormatReadOnly* = 8*[](#AcCellState.acCellStateFormatReadOnly "Link to this definition")
* acCellStateLinked* = 16*[](#AcCellState.acCellStateLinked "Link to this definition")
- acCellStateNone* = 0*[](#AcCellState.acCellStateNone "Link to this definition")
## AcCellType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcCellType "Direct link to AcCellType")
* *class *viktor.external.autocad.enums.AcCellType(*\*values*)[](#AcCellType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcCellType` values, mirroring the product API’s names so code reads like its docs.
* acBlockCell* = 2*[](#AcCellType.acBlockCell "Link to this definition")
- acTextCell* = 1*[](#AcCellType.acTextCell "Link to this definition")
* acUnknownCell* = 0*[](#AcCellType.acUnknownCell "Link to this definition")
## AcColor[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcColor "Direct link to AcColor")
* *class *viktor.external.autocad.enums.AcColor(*\*values*)[](#AcColor "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcColor` values, mirroring the product API’s names so code reads like its docs.
* acBlue* = 5*[](#AcColor.acBlue "Link to this definition")
- acByBlock* = 0*[](#AcColor.acByBlock "Link to this definition")
* acByLayer* = 256*[](#AcColor.acByLayer "Link to this definition")
- acCyan* = 4*[](#AcColor.acCyan "Link to this definition")
* acGreen* = 3*[](#AcColor.acGreen "Link to this definition")
- acMagenta* = 6*[](#AcColor.acMagenta "Link to this definition")
* acRed* = 1*[](#AcColor.acRed "Link to this definition")
- acWhite* = 7*[](#AcColor.acWhite "Link to this definition")
* acYellow* = 2*[](#AcColor.acYellow "Link to this definition")
## AcColorMethod[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcColorMethod "Direct link to AcColorMethod")
* *class *viktor.external.autocad.enums.AcColorMethod(*\*values*)[](#AcColorMethod "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcColorMethod` values, mirroring the product API’s names so code reads like its docs.
* acColorMethodByACI* = 195*[](#AcColorMethod.acColorMethodByACI "Link to this definition")
- acColorMethodByBlock* = 193*[](#AcColorMethod.acColorMethodByBlock "Link to this definition")
* acColorMethodByLayer* = 192*[](#AcColorMethod.acColorMethodByLayer "Link to this definition")
- acColorMethodByRGB* = 194*[](#AcColorMethod.acColorMethodByRGB "Link to this definition")
* acColorMethodForeground* = 197*[](#AcColorMethod.acColorMethodForeground "Link to this definition")
## AcCoordinateSystem[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcCoordinateSystem "Direct link to AcCoordinateSystem")
* *class *viktor.external.autocad.enums.AcCoordinateSystem(*\*values*)[](#AcCoordinateSystem "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcCoordinateSystem` values, mirroring the product API’s names so code reads like its docs.
* acDisplayDCS* = 2*[](#AcCoordinateSystem.acDisplayDCS "Link to this definition")
- acOCS* = 4*[](#AcCoordinateSystem.acOCS "Link to this definition")
* acPaperSpaceDCS* = 3*[](#AcCoordinateSystem.acPaperSpaceDCS "Link to this definition")
- acUCS* = 1*[](#AcCoordinateSystem.acUCS "Link to this definition")
* acWorld* = 0*[](#AcCoordinateSystem.acWorld "Link to this definition")
## AcDataLinkUpdateDirection[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDataLinkUpdateDirection "Direct link to AcDataLinkUpdateDirection")
* *class *viktor.external.autocad.enums.AcDataLinkUpdateDirection(*\*values*)[](#AcDataLinkUpdateDirection "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDataLinkUpdateDirection` values, mirroring the product API’s names so code reads like its docs.
* acUpdateDataFromSource* = 1*[](#AcDataLinkUpdateDirection.acUpdateDataFromSource "Link to this definition")
- acUpdateSourceFromData* = 2*[](#AcDataLinkUpdateDirection.acUpdateSourceFromData "Link to this definition")
## AcDataLinkUpdateOption[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDataLinkUpdateOption "Direct link to AcDataLinkUpdateOption")
* *class *viktor.external.autocad.enums.AcDataLinkUpdateOption(*\*values*)[](#AcDataLinkUpdateOption "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDataLinkUpdateOption` values, mirroring the product API’s names so code reads like its docs.
* acUpdateOptionIncludeXrefs* = 1048576*[](#AcDataLinkUpdateOption.acUpdateOptionIncludeXrefs "Link to this definition")
- acUpdateOptionNone* = 0*[](#AcDataLinkUpdateOption.acUpdateOptionNone "Link to this definition")
* acUpdateOptionOverwriteContentModifiedAfterUpdate* = 131072*[](#AcDataLinkUpdateOption.acUpdateOptionOverwriteContentModifiedAfterUpdate "Link to this definition")
- acUpdateOptionOverwriteFormatModifiedAfterUpdate* = 262144*[](#AcDataLinkUpdateOption.acUpdateOptionOverwriteFormatModifiedAfterUpdate "Link to this definition")
* acUpdateOptionUpdateFullSourceRange* = 524288*[](#AcDataLinkUpdateOption.acUpdateOptionUpdateFullSourceRange "Link to this definition")
## AcDimArcLengthSymbol[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDimArcLengthSymbol "Direct link to AcDimArcLengthSymbol")
* *class *viktor.external.autocad.enums.AcDimArcLengthSymbol(*\*values*)[](#AcDimArcLengthSymbol "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDimArcLengthSymbol` values, mirroring the product API’s names so code reads like its docs.
* acSymAbove* = 1*[](#AcDimArcLengthSymbol.acSymAbove "Link to this definition")
- acSymInFront* = 0*[](#AcDimArcLengthSymbol.acSymInFront "Link to this definition")
* acSymNone* = 2*[](#AcDimArcLengthSymbol.acSymNone "Link to this definition")
## AcDimArrowheadType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDimArrowheadType "Direct link to AcDimArrowheadType")
* *class *viktor.external.autocad.enums.AcDimArrowheadType(*\*values*)[](#AcDimArrowheadType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDimArrowheadType` values, mirroring the product API’s names so code reads like its docs.
* acArrowArchTick* = 4*[](#AcDimArrowheadType.acArrowArchTick "Link to this definition")
- acArrowBoxBlank* = 14*[](#AcDimArrowheadType.acArrowBoxBlank "Link to this definition")
* acArrowBoxFilled* = 15*[](#AcDimArrowheadType.acArrowBoxFilled "Link to this definition")
- acArrowClosed* = 2*[](#AcDimArrowheadType.acArrowClosed "Link to this definition")
* acArrowClosedBlank* = 1*[](#AcDimArrowheadType.acArrowClosedBlank "Link to this definition")
- acArrowDatumBlank* = 16*[](#AcDimArrowheadType.acArrowDatumBlank "Link to this definition")
* acArrowDatumFilled* = 17*[](#AcDimArrowheadType.acArrowDatumFilled "Link to this definition")
- acArrowDefault* = 0*[](#AcDimArrowheadType.acArrowDefault "Link to this definition")
* acArrowDot* = 3*[](#AcDimArrowheadType.acArrowDot "Link to this definition")
- acArrowDotBlank* = 12*[](#AcDimArrowheadType.acArrowDotBlank "Link to this definition")
* acArrowDotSmall* = 11*[](#AcDimArrowheadType.acArrowDotSmall "Link to this definition")
- acArrowIntegral* = 18*[](#AcDimArrowheadType.acArrowIntegral "Link to this definition")
* acArrowNone* = 19*[](#AcDimArrowheadType.acArrowNone "Link to this definition")
- acArrowOblique* = 5*[](#AcDimArrowheadType.acArrowOblique "Link to this definition")
* acArrowOpen* = 6*[](#AcDimArrowheadType.acArrowOpen "Link to this definition")
- acArrowOpen30* = 10*[](#AcDimArrowheadType.acArrowOpen30 "Link to this definition")
* acArrowOpen90* = 9*[](#AcDimArrowheadType.acArrowOpen90 "Link to this definition")
- acArrowOrigin* = 7*[](#AcDimArrowheadType.acArrowOrigin "Link to this definition")
* acArrowOrigin2* = 8*[](#AcDimArrowheadType.acArrowOrigin2 "Link to this definition")
- acArrowSmall* = 13*[](#AcDimArrowheadType.acArrowSmall "Link to this definition")
* acArrowUserDefined* = 20*[](#AcDimArrowheadType.acArrowUserDefined "Link to this definition")
## AcDimCenterType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDimCenterType "Direct link to AcDimCenterType")
* *class *viktor.external.autocad.enums.AcDimCenterType(*\*values*)[](#AcDimCenterType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDimCenterType` values, mirroring the product API’s names so code reads like its docs.
* acCenterLine* = 1*[](#AcDimCenterType.acCenterLine "Link to this definition")
- acCenterMark* = 0*[](#AcDimCenterType.acCenterMark "Link to this definition")
* acCenterNone* = 2*[](#AcDimCenterType.acCenterNone "Link to this definition")
## AcDimFit[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDimFit "Direct link to AcDimFit")
* *class *viktor.external.autocad.enums.AcDimFit(*\*values*)[](#AcDimFit "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDimFit` values, mirroring the product API’s names so code reads like its docs.
* acArrowsOnly* = 1*[](#AcDimFit.acArrowsOnly "Link to this definition")
- acBestFit* = 3*[](#AcDimFit.acBestFit "Link to this definition")
* acTextAndArrows* = 0*[](#AcDimFit.acTextAndArrows "Link to this definition")
- acTextOnly* = 2*[](#AcDimFit.acTextOnly "Link to this definition")
## AcDimFractionType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDimFractionType "Direct link to AcDimFractionType")
* *class *viktor.external.autocad.enums.AcDimFractionType(*\*values*)[](#AcDimFractionType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDimFractionType` values, mirroring the product API’s names so code reads like its docs.
* acDiagonal* = 1*[](#AcDimFractionType.acDiagonal "Link to this definition")
- acHorizontal* = 0*[](#AcDimFractionType.acHorizontal "Link to this definition")
* acNotStacked* = 2*[](#AcDimFractionType.acNotStacked "Link to this definition")
## AcDimHorizontalJustification[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDimHorizontalJustification "Direct link to AcDimHorizontalJustification")
* *class *viktor.external.autocad.enums.AcDimHorizontalJustification(*\*values*)[](#AcDimHorizontalJustification "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDimHorizontalJustification` values, mirroring the product API’s names so code reads like its docs.
* acFirstExtensionLine* = 1*[](#AcDimHorizontalJustification.acFirstExtensionLine "Link to this definition")
- acHorzCentered* = 0*[](#AcDimHorizontalJustification.acHorzCentered "Link to this definition")
* acOverFirstExtension* = 3*[](#AcDimHorizontalJustification.acOverFirstExtension "Link to this definition")
- acOverSecondExtension* = 4*[](#AcDimHorizontalJustification.acOverSecondExtension "Link to this definition")
* acSecondExtensionLine* = 2*[](#AcDimHorizontalJustification.acSecondExtensionLine "Link to this definition")
## AcDimLUnits[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDimLUnits "Direct link to AcDimLUnits")
* *class *viktor.external.autocad.enums.AcDimLUnits(*\*values*)[](#AcDimLUnits "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDimLUnits` values, mirroring the product API’s names so code reads like its docs.
* acDimLArchitectural* = 4*[](#AcDimLUnits.acDimLArchitectural "Link to this definition")
- acDimLDecimal* = 2*[](#AcDimLUnits.acDimLDecimal "Link to this definition")
* acDimLEngineering* = 3*[](#AcDimLUnits.acDimLEngineering "Link to this definition")
- acDimLFractional* = 5*[](#AcDimLUnits.acDimLFractional "Link to this definition")
* acDimLScientific* = 1*[](#AcDimLUnits.acDimLScientific "Link to this definition")
- acDimLWindowsDesktop* = 6*[](#AcDimLUnits.acDimLWindowsDesktop "Link to this definition")
## AcDimPrecision[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDimPrecision "Direct link to AcDimPrecision")
* *class *viktor.external.autocad.enums.AcDimPrecision(*\*values*)[](#AcDimPrecision "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDimPrecision` values, mirroring the product API’s names so code reads like its docs.
* acDimPrecisionEight* = 8*[](#AcDimPrecision.acDimPrecisionEight "Link to this definition")
- acDimPrecisionFive* = 5*[](#AcDimPrecision.acDimPrecisionFive "Link to this definition")
* acDimPrecisionFour* = 4*[](#AcDimPrecision.acDimPrecisionFour "Link to this definition")
- acDimPrecisionOne* = 1*[](#AcDimPrecision.acDimPrecisionOne "Link to this definition")
* acDimPrecisionSeven* = 7*[](#AcDimPrecision.acDimPrecisionSeven "Link to this definition")
- acDimPrecisionSix* = 6*[](#AcDimPrecision.acDimPrecisionSix "Link to this definition")
* acDimPrecisionThree* = 3*[](#AcDimPrecision.acDimPrecisionThree "Link to this definition")
- acDimPrecisionTwo* = 2*[](#AcDimPrecision.acDimPrecisionTwo "Link to this definition")
* acDimPrecisionZero* = 0*[](#AcDimPrecision.acDimPrecisionZero "Link to this definition")
## AcDimTextMovement[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDimTextMovement "Direct link to AcDimTextMovement")
* *class *viktor.external.autocad.enums.AcDimTextMovement(*\*values*)[](#AcDimTextMovement "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDimTextMovement` values, mirroring the product API’s names so code reads like its docs.
* acDimLineWithText* = 0*[](#AcDimTextMovement.acDimLineWithText "Link to this definition")
- acMoveTextAddLeader* = 1*[](#AcDimTextMovement.acMoveTextAddLeader "Link to this definition")
* acMoveTextNoLeader* = 2*[](#AcDimTextMovement.acMoveTextNoLeader "Link to this definition")
## AcDimToleranceJustify[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDimToleranceJustify "Direct link to AcDimToleranceJustify")
* *class *viktor.external.autocad.enums.AcDimToleranceJustify(*\*values*)[](#AcDimToleranceJustify "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDimToleranceJustify` values, mirroring the product API’s names so code reads like its docs.
* acTolBottom* = 0*[](#AcDimToleranceJustify.acTolBottom "Link to this definition")
- acTolMiddle* = 1*[](#AcDimToleranceJustify.acTolMiddle "Link to this definition")
* acTolTop* = 2*[](#AcDimToleranceJustify.acTolTop "Link to this definition")
## AcDimToleranceMethod[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDimToleranceMethod "Direct link to AcDimToleranceMethod")
* *class *viktor.external.autocad.enums.AcDimToleranceMethod(*\*values*)[](#AcDimToleranceMethod "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDimToleranceMethod` values, mirroring the product API’s names so code reads like its docs.
* acTolBasic* = 4*[](#AcDimToleranceMethod.acTolBasic "Link to this definition")
- acTolDeviation* = 2*[](#AcDimToleranceMethod.acTolDeviation "Link to this definition")
* acTolLimits* = 3*[](#AcDimToleranceMethod.acTolLimits "Link to this definition")
- acTolNone* = 0*[](#AcDimToleranceMethod.acTolNone "Link to this definition")
* acTolSymmetrical* = 1*[](#AcDimToleranceMethod.acTolSymmetrical "Link to this definition")
## AcDimUnits[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDimUnits "Direct link to AcDimUnits")
* *class *viktor.external.autocad.enums.AcDimUnits(*\*values*)[](#AcDimUnits "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDimUnits` values, mirroring the product API’s names so code reads like its docs.
* acDimArchitectural* = 6*[](#AcDimUnits.acDimArchitectural "Link to this definition")
- acDimArchitecturalStacked* = 4*[](#AcDimUnits.acDimArchitecturalStacked "Link to this definition")
* acDimDecimal* = 2*[](#AcDimUnits.acDimDecimal "Link to this definition")
- acDimEngineering* = 3*[](#AcDimUnits.acDimEngineering "Link to this definition")
* acDimFractional* = 7*[](#AcDimUnits.acDimFractional "Link to this definition")
- acDimFractionalStacked* = 5*[](#AcDimUnits.acDimFractionalStacked "Link to this definition")
* acDimScientific* = 1*[](#AcDimUnits.acDimScientific "Link to this definition")
- acDimWindowsDesktop* = 8*[](#AcDimUnits.acDimWindowsDesktop "Link to this definition")
## AcDimVerticalJustification[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDimVerticalJustification "Direct link to AcDimVerticalJustification")
* *class *viktor.external.autocad.enums.AcDimVerticalJustification(*\*values*)[](#AcDimVerticalJustification "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDimVerticalJustification` values, mirroring the product API’s names so code reads like its docs.
* acAbove* = 1*[](#AcDimVerticalJustification.acAbove "Link to this definition")
- acJIS* = 3*[](#AcDimVerticalJustification.acJIS "Link to this definition")
* acOutside* = 2*[](#AcDimVerticalJustification.acOutside "Link to this definition")
- acUnder* = 4*[](#AcDimVerticalJustification.acUnder "Link to this definition")
* acVertCentered* = 0*[](#AcDimVerticalJustification.acVertCentered "Link to this definition")
## AcDragDisplayMode[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDragDisplayMode "Direct link to AcDragDisplayMode")
* *class *viktor.external.autocad.enums.AcDragDisplayMode(*\*values*)[](#AcDragDisplayMode "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDragDisplayMode` values, mirroring the product API’s names so code reads like its docs.
* acDragDisplayAutomatically* = 2*[](#AcDragDisplayMode.acDragDisplayAutomatically "Link to this definition")
- acDragDisplayOnRequest* = 1*[](#AcDragDisplayMode.acDragDisplayOnRequest "Link to this definition")
* acDragDoNotDisplay* = 0*[](#AcDragDisplayMode.acDragDoNotDisplay "Link to this definition")
## AcDrawLeaderOrderType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDrawLeaderOrderType "Direct link to AcDrawLeaderOrderType")
* *class *viktor.external.autocad.enums.AcDrawLeaderOrderType(*\*values*)[](#AcDrawLeaderOrderType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDrawLeaderOrderType` values, mirroring the product API’s names so code reads like its docs.
* acDrawLeaderHeadFirst* = 0*[](#AcDrawLeaderOrderType.acDrawLeaderHeadFirst "Link to this definition")
- acDrawLeaderTailFirst* = 1*[](#AcDrawLeaderOrderType.acDrawLeaderTailFirst "Link to this definition")
## AcDrawMLeaderOrderType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDrawMLeaderOrderType "Direct link to AcDrawMLeaderOrderType")
* *class *viktor.external.autocad.enums.AcDrawMLeaderOrderType(*\*values*)[](#AcDrawMLeaderOrderType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDrawMLeaderOrderType` values, mirroring the product API’s names so code reads like its docs.
* acDrawContentFirst* = 0*[](#AcDrawMLeaderOrderType.acDrawContentFirst "Link to this definition")
- acDrawLeaderFirst* = 1*[](#AcDrawMLeaderOrderType.acDrawLeaderFirst "Link to this definition")
## AcDrawingAreaSCMCommand[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDrawingAreaSCMCommand "Direct link to AcDrawingAreaSCMCommand")
* *class *viktor.external.autocad.enums.AcDrawingAreaSCMCommand(*\*values*)[](#AcDrawingAreaSCMCommand "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDrawingAreaSCMCommand` values, mirroring the product API’s names so code reads like its docs.
* acEnableSCM* = 2*[](#AcDrawingAreaSCMCommand.acEnableSCM "Link to this definition")
- acEnableSCMOptions* = 1*[](#AcDrawingAreaSCMCommand.acEnableSCMOptions "Link to this definition")
* acEnter* = 0*[](#AcDrawingAreaSCMCommand.acEnter "Link to this definition")
## AcDrawingAreaSCMDefault[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDrawingAreaSCMDefault "Direct link to AcDrawingAreaSCMDefault")
* *class *viktor.external.autocad.enums.AcDrawingAreaSCMDefault(*\*values*)[](#AcDrawingAreaSCMDefault "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDrawingAreaSCMDefault` values, mirroring the product API’s names so code reads like its docs.
* acRepeatLastCommand* = 0*[](#AcDrawingAreaSCMDefault.acRepeatLastCommand "Link to this definition")
- acSCM* = 1*[](#AcDrawingAreaSCMDefault.acSCM "Link to this definition")
## AcDrawingAreaSCMEdit[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDrawingAreaSCMEdit "Direct link to AcDrawingAreaSCMEdit")
* *class *viktor.external.autocad.enums.AcDrawingAreaSCMEdit(*\*values*)[](#AcDrawingAreaSCMEdit "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDrawingAreaSCMEdit` values, mirroring the product API’s names so code reads like its docs.
* acEdRepeatLastCommand* = 0*[](#AcDrawingAreaSCMEdit.acEdRepeatLastCommand "Link to this definition")
- acEdSCM* = 1*[](#AcDrawingAreaSCMEdit.acEdSCM "Link to this definition")
## AcDrawingAreaShortCutMenu[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDrawingAreaShortCutMenu "Direct link to AcDrawingAreaShortCutMenu")
* *class *viktor.external.autocad.enums.AcDrawingAreaShortCutMenu(*\*values*)[](#AcDrawingAreaShortCutMenu "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDrawingAreaShortCutMenu` values, mirroring the product API’s names so code reads like its docs.
* acNoDrawingAreaShortCutMenu* = 0*[](#AcDrawingAreaShortCutMenu.acNoDrawingAreaShortCutMenu "Link to this definition")
- acUseDefaultDrawingAreaShortCutMenu* = 1*[](#AcDrawingAreaShortCutMenu.acUseDefaultDrawingAreaShortCutMenu "Link to this definition")
## AcDrawingDirection[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDrawingDirection "Direct link to AcDrawingDirection")
* *class *viktor.external.autocad.enums.AcDrawingDirection(*\*values*)[](#AcDrawingDirection "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDrawingDirection` values, mirroring the product API’s names so code reads like its docs.
* acBottomToTop* = 4*[](#AcDrawingDirection.acBottomToTop "Link to this definition")
- acByStyle* = 5*[](#AcDrawingDirection.acByStyle "Link to this definition")
* acLeftToRight* = 1*[](#AcDrawingDirection.acLeftToRight "Link to this definition")
- acRightToLeft* = 2*[](#AcDrawingDirection.acRightToLeft "Link to this definition")
* acTopToBottom* = 3*[](#AcDrawingDirection.acTopToBottom "Link to this definition")
## AcDynamicBlockReferencePropertyUnitsType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcDynamicBlockReferencePropertyUnitsType "Direct link to AcDynamicBlockReferencePropertyUnitsType")
* *class *viktor.external.autocad.enums.AcDynamicBlockReferencePropertyUnitsType(*\*values*)[](#AcDynamicBlockReferencePropertyUnitsType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcDynamicBlockReferencePropertyUnitsType` values, mirroring the product API’s names so code reads like its docs.
* acAngular* = 1*[](#AcDynamicBlockReferencePropertyUnitsType.acAngular "Link to this definition")
- acArea* = 3*[](#AcDynamicBlockReferencePropertyUnitsType.acArea "Link to this definition")
* acDistance* = 2*[](#AcDynamicBlockReferencePropertyUnitsType.acDistance "Link to this definition")
- acNoUnits* = 0*[](#AcDynamicBlockReferencePropertyUnitsType.acNoUnits "Link to this definition")
## AcEntityName[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcEntityName "Direct link to AcEntityName")
* *class *viktor.external.autocad.enums.AcEntityName(*\*values*)[](#AcEntityName "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcEntityName` values, mirroring the product API’s names so code reads like its docs.
* ac3dFace* = 1*[](#AcEntityName.ac3dFace "Link to this definition")
- ac3dPolyline* = 2*[](#AcEntityName.ac3dPolyline "Link to this definition")
* ac3dSolid* = 3*[](#AcEntityName.ac3dSolid "Link to this definition")
- acArc* = 4*[](#AcEntityName.acArc "Link to this definition")
* acAttribute* = 5*[](#AcEntityName.acAttribute "Link to this definition")
- acAttributeReference* = 6*[](#AcEntityName.acAttributeReference "Link to this definition")
* acBlockReference* = 7*[](#AcEntityName.acBlockReference "Link to this definition")
- acCircle* = 8*[](#AcEntityName.acCircle "Link to this definition")
* acDgnUnderlay* = 47*[](#AcEntityName.acDgnUnderlay "Link to this definition")
- acDim3PointAngular* = 41*[](#AcEntityName.acDim3PointAngular "Link to this definition")
* acDimAligned* = 9*[](#AcEntityName.acDimAligned "Link to this definition")
- acDimAngular* = 10*[](#AcEntityName.acDimAngular "Link to this definition")
* acDimArcLength* = 44*[](#AcEntityName.acDimArcLength "Link to this definition")
- acDimDiametric* = 12*[](#AcEntityName.acDimDiametric "Link to this definition")
* acDimOrdinate* = 13*[](#AcEntityName.acDimOrdinate "Link to this definition")
- acDimRadial* = 14*[](#AcEntityName.acDimRadial "Link to this definition")
* acDimRadialLarge* = 45*[](#AcEntityName.acDimRadialLarge "Link to this definition")
- acDimRotated* = 15*[](#AcEntityName.acDimRotated "Link to this definition")
* acDwfUnderlay* = 46*[](#AcEntityName.acDwfUnderlay "Link to this definition")
- acEllipse* = 16*[](#AcEntityName.acEllipse "Link to this definition")
* acExternalReference* = 42*[](#AcEntityName.acExternalReference "Link to this definition")
- acGroup* = 37*[](#AcEntityName.acGroup "Link to this definition")
* acHatch* = 17*[](#AcEntityName.acHatch "Link to this definition")
- acLeader* = 18*[](#AcEntityName.acLeader "Link to this definition")
* acLine* = 19*[](#AcEntityName.acLine "Link to this definition")
- acMInsertBlock* = 38*[](#AcEntityName.acMInsertBlock "Link to this definition")
* acMLeader* = 48*[](#AcEntityName.acMLeader "Link to this definition")
- acMLine* = 40*[](#AcEntityName.acMLine "Link to this definition")
* acMtext* = 21*[](#AcEntityName.acMtext "Link to this definition")
- acNurbSurface* = 51*[](#AcEntityName.acNurbSurface "Link to this definition")
* acPViewport* = 35*[](#AcEntityName.acPViewport "Link to this definition")
- acPdfUnderlay* = 50*[](#AcEntityName.acPdfUnderlay "Link to this definition")
* acPoint* = 22*[](#AcEntityName.acPoint "Link to this definition")
- acPolyfaceMesh* = 39*[](#AcEntityName.acPolyfaceMesh "Link to this definition")
* acPolyline* = 23*[](#AcEntityName.acPolyline "Link to this definition")
- acPolylineLight* = 24*[](#AcEntityName.acPolylineLight "Link to this definition")
* acPolymesh* = 25*[](#AcEntityName.acPolymesh "Link to this definition")
- acRaster* = 26*[](#AcEntityName.acRaster "Link to this definition")
* acRay* = 27*[](#AcEntityName.acRay "Link to this definition")
- acRegion* = 28*[](#AcEntityName.acRegion "Link to this definition")
* acShape* = 29*[](#AcEntityName.acShape "Link to this definition")
- acSolid* = 30*[](#AcEntityName.acSolid "Link to this definition")
* acSpline* = 31*[](#AcEntityName.acSpline "Link to this definition")
- acSubDMesh* = 49*[](#AcEntityName.acSubDMesh "Link to this definition")
* acTable* = 43*[](#AcEntityName.acTable "Link to this definition")
- acText* = 32*[](#AcEntityName.acText "Link to this definition")
* acTolerance* = 33*[](#AcEntityName.acTolerance "Link to this definition")
- acTrace* = 34*[](#AcEntityName.acTrace "Link to this definition")
* acXline* = 36*[](#AcEntityName.acXline "Link to this definition")
## AcExtendOption[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcExtendOption "Direct link to AcExtendOption")
* *class *viktor.external.autocad.enums.AcExtendOption(*\*values*)[](#AcExtendOption "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcExtendOption` values, mirroring the product API’s names so code reads like its docs.
* acExtendBoth* = 3*[](#AcExtendOption.acExtendBoth "Link to this definition")
- acExtendNone* = 0*[](#AcExtendOption.acExtendNone "Link to this definition")
* acExtendOtherEntity* = 2*[](#AcExtendOption.acExtendOtherEntity "Link to this definition")
- acExtendThisEntity* = 1*[](#AcExtendOption.acExtendThisEntity "Link to this definition")
## AcFormatOption[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcFormatOption "Direct link to AcFormatOption")
* *class *viktor.external.autocad.enums.AcFormatOption(*\*values*)[](#AcFormatOption "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcFormatOption` values, mirroring the product API’s names so code reads like its docs.
* acForEditing* = 1*[](#AcFormatOption.acForEditing "Link to this definition")
- acForExpression* = 2*[](#AcFormatOption.acForExpression "Link to this definition")
* acIgnoreMtextFormat* = 8*[](#AcFormatOption.acIgnoreMtextFormat "Link to this definition")
- acUseMaximumPrecision* = 4*[](#AcFormatOption.acUseMaximumPrecision "Link to this definition")
* kFormatOptionNone* = 0*[](#AcFormatOption.kFormatOptionNone "Link to this definition")
## AcGradientPatternType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcGradientPatternType "Direct link to AcGradientPatternType")
* *class *viktor.external.autocad.enums.AcGradientPatternType(*\*values*)[](#AcGradientPatternType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcGradientPatternType` values, mirroring the product API’s names so code reads like its docs.
* acPreDefinedGradient* = 0*[](#AcGradientPatternType.acPreDefinedGradient "Link to this definition")
- acUserDefinedGradient* = 1*[](#AcGradientPatternType.acUserDefinedGradient "Link to this definition")
## AcGridLineStyle[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcGridLineStyle "Direct link to AcGridLineStyle")
* *class *viktor.external.autocad.enums.AcGridLineStyle(*\*values*)[](#AcGridLineStyle "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcGridLineStyle` values, mirroring the product API’s names so code reads like its docs.
* acGridLineStyleDouble* = 2*[](#AcGridLineStyle.acGridLineStyleDouble "Link to this definition")
- acGridLineStyleSingle* = 1*[](#AcGridLineStyle.acGridLineStyleSingle "Link to this definition")
## AcGridLineType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcGridLineType "Direct link to AcGridLineType")
* *class *viktor.external.autocad.enums.AcGridLineType(*\*values*)[](#AcGridLineType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcGridLineType` values, mirroring the product API’s names so code reads like its docs.
* acHorzBottom* = 4*[](#AcGridLineType.acHorzBottom "Link to this definition")
- acHorzInside* = 2*[](#AcGridLineType.acHorzInside "Link to this definition")
* acHorzTop* = 1*[](#AcGridLineType.acHorzTop "Link to this definition")
- acInvalidGridLine* = 0*[](#AcGridLineType.acInvalidGridLine "Link to this definition")
* acVertInside* = 16*[](#AcGridLineType.acVertInside "Link to this definition")
- acVertLeft* = 8*[](#AcGridLineType.acVertLeft "Link to this definition")
* acVertRight* = 32*[](#AcGridLineType.acVertRight "Link to this definition")
## AcHatchObjectType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcHatchObjectType "Direct link to AcHatchObjectType")
* *class *viktor.external.autocad.enums.AcHatchObjectType(*\*values*)[](#AcHatchObjectType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcHatchObjectType` values, mirroring the product API’s names so code reads like its docs.
* acGradientObject* = 1*[](#AcHatchObjectType.acGradientObject "Link to this definition")
- acHatchObject* = 0*[](#AcHatchObjectType.acHatchObject "Link to this definition")
## AcHatchStyle[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcHatchStyle "Direct link to AcHatchStyle")
* *class *viktor.external.autocad.enums.AcHatchStyle(*\*values*)[](#AcHatchStyle "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcHatchStyle` values, mirroring the product API’s names so code reads like its docs.
* acHatchStyleIgnore* = 2*[](#AcHatchStyle.acHatchStyleIgnore "Link to this definition")
- acHatchStyleNormal* = 0*[](#AcHatchStyle.acHatchStyleNormal "Link to this definition")
* acHatchStyleOuter* = 1*[](#AcHatchStyle.acHatchStyleOuter "Link to this definition")
## AcHelixConstrainType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcHelixConstrainType "Direct link to AcHelixConstrainType")
* *class *viktor.external.autocad.enums.AcHelixConstrainType(*\*values*)[](#AcHelixConstrainType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcHelixConstrainType` values, mirroring the product API’s names so code reads like its docs.
* acHeight* = 2*[](#AcHelixConstrainType.acHeight "Link to this definition")
- acTurnHeight* = 0*[](#AcHelixConstrainType.acTurnHeight "Link to this definition")
* acTurns* = 1*[](#AcHelixConstrainType.acTurns "Link to this definition")
## AcHelixTwistType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcHelixTwistType "Direct link to AcHelixTwistType")
* *class *viktor.external.autocad.enums.AcHelixTwistType(*\*values*)[](#AcHelixTwistType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcHelixTwistType` values, mirroring the product API’s names so code reads like its docs.
* acCCW* = 0*[](#AcHelixTwistType.acCCW "Link to this definition")
- acCW* = 1*[](#AcHelixTwistType.acCW "Link to this definition")
## AcHorizontalAlignment[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcHorizontalAlignment "Direct link to AcHorizontalAlignment")
* *class *viktor.external.autocad.enums.AcHorizontalAlignment(*\*values*)[](#AcHorizontalAlignment "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcHorizontalAlignment` values, mirroring the product API’s names so code reads like its docs.
* acHorizontalAlignmentAligned* = 3*[](#AcHorizontalAlignment.acHorizontalAlignmentAligned "Link to this definition")
- acHorizontalAlignmentCenter* = 1*[](#AcHorizontalAlignment.acHorizontalAlignmentCenter "Link to this definition")
* acHorizontalAlignmentFit* = 5*[](#AcHorizontalAlignment.acHorizontalAlignmentFit "Link to this definition")
- acHorizontalAlignmentLeft* = 0*[](#AcHorizontalAlignment.acHorizontalAlignmentLeft "Link to this definition")
* acHorizontalAlignmentMiddle* = 4*[](#AcHorizontalAlignment.acHorizontalAlignmentMiddle "Link to this definition")
- acHorizontalAlignmentRight* = 2*[](#AcHorizontalAlignment.acHorizontalAlignmentRight "Link to this definition")
## AcISOPenWidth[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcISOPenWidth "Direct link to AcISOPenWidth")
* *class *viktor.external.autocad.enums.AcISOPenWidth(*\*values*)[](#AcISOPenWidth "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcISOPenWidth` values, mirroring the product API’s names so code reads like its docs.
* acPenWidth013* = 13*[](#AcISOPenWidth.acPenWidth013 "Link to this definition")
- acPenWidth018* = 18*[](#AcISOPenWidth.acPenWidth018 "Link to this definition")
* acPenWidth025* = 25*[](#AcISOPenWidth.acPenWidth025 "Link to this definition")
- acPenWidth035* = 35*[](#AcISOPenWidth.acPenWidth035 "Link to this definition")
* acPenWidth050* = 50*[](#AcISOPenWidth.acPenWidth050 "Link to this definition")
- acPenWidth070* = 70*[](#AcISOPenWidth.acPenWidth070 "Link to this definition")
* acPenWidth100* = 100*[](#AcISOPenWidth.acPenWidth100 "Link to this definition")
- acPenWidth140* = 140*[](#AcISOPenWidth.acPenWidth140 "Link to this definition")
* acPenWidth200* = 200*[](#AcISOPenWidth.acPenWidth200 "Link to this definition")
- acPenWidthUnk* = -1*[](#AcISOPenWidth.acPenWidthUnk "Link to this definition")
## AcInsertUnits[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcInsertUnits "Direct link to AcInsertUnits")
* *class *viktor.external.autocad.enums.AcInsertUnits(*\*values*)[](#AcInsertUnits "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcInsertUnits` values, mirroring the product API’s names so code reads like its docs.
* acInsertUnitsAngstroms* = 11*[](#AcInsertUnits.acInsertUnitsAngstroms "Link to this definition")
- acInsertUnitsAstronomicalUnits* = 18*[](#AcInsertUnits.acInsertUnitsAstronomicalUnits "Link to this definition")
* acInsertUnitsCentimeters* = 5*[](#AcInsertUnits.acInsertUnitsCentimeters "Link to this definition")
- acInsertUnitsDecameters* = 15*[](#AcInsertUnits.acInsertUnitsDecameters "Link to this definition")
* acInsertUnitsDecimeters* = 14*[](#AcInsertUnits.acInsertUnitsDecimeters "Link to this definition")
- acInsertUnitsFeet* = 2*[](#AcInsertUnits.acInsertUnitsFeet "Link to this definition")
* acInsertUnitsGigameters* = 17*[](#AcInsertUnits.acInsertUnitsGigameters "Link to this definition")
- acInsertUnitsHectometers* = 16*[](#AcInsertUnits.acInsertUnitsHectometers "Link to this definition")
* acInsertUnitsInches* = 1*[](#AcInsertUnits.acInsertUnitsInches "Link to this definition")
- acInsertUnitsKilometers* = 7*[](#AcInsertUnits.acInsertUnitsKilometers "Link to this definition")
* acInsertUnitsLightYears* = 19*[](#AcInsertUnits.acInsertUnitsLightYears "Link to this definition")
- acInsertUnitsMeters* = 6*[](#AcInsertUnits.acInsertUnitsMeters "Link to this definition")
* acInsertUnitsMicroinches* = 8*[](#AcInsertUnits.acInsertUnitsMicroinches "Link to this definition")
- acInsertUnitsMicrons* = 13*[](#AcInsertUnits.acInsertUnitsMicrons "Link to this definition")
* acInsertUnitsMiles* = 3*[](#AcInsertUnits.acInsertUnitsMiles "Link to this definition")
- acInsertUnitsMillimeters* = 4*[](#AcInsertUnits.acInsertUnitsMillimeters "Link to this definition")
* acInsertUnitsMils* = 9*[](#AcInsertUnits.acInsertUnitsMils "Link to this definition")
- acInsertUnitsNanometers* = 12*[](#AcInsertUnits.acInsertUnitsNanometers "Link to this definition")
* acInsertUnitsParsecs* = 20*[](#AcInsertUnits.acInsertUnitsParsecs "Link to this definition")
- acInsertUnitsUSSurveyFeet* = 21*[](#AcInsertUnits.acInsertUnitsUSSurveyFeet "Link to this definition")
* acInsertUnitsUSSurveyInch* = 22*[](#AcInsertUnits.acInsertUnitsUSSurveyInch "Link to this definition")
- acInsertUnitsUSSurveyMile* = 24*[](#AcInsertUnits.acInsertUnitsUSSurveyMile "Link to this definition")
* acInsertUnitsUSSurveyYard* = 23*[](#AcInsertUnits.acInsertUnitsUSSurveyYard "Link to this definition")
- acInsertUnitsUnitless* = 0*[](#AcInsertUnits.acInsertUnitsUnitless "Link to this definition")
* acInsertUnitsYards* = 10*[](#AcInsertUnits.acInsertUnitsYards "Link to this definition")
## AcInsertUnitsAction[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcInsertUnitsAction "Direct link to AcInsertUnitsAction")
* *class *viktor.external.autocad.enums.AcInsertUnitsAction(*\*values*)[](#AcInsertUnitsAction "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcInsertUnitsAction` values, mirroring the product API’s names so code reads like its docs.
* acInsertUnitsAutoAssign* = 1*[](#AcInsertUnitsAction.acInsertUnitsAutoAssign "Link to this definition")
- acInsertUnitsPrompt* = 0*[](#AcInsertUnitsAction.acInsertUnitsPrompt "Link to this definition")
## AcKeyboardAccelerator[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcKeyboardAccelerator "Direct link to AcKeyboardAccelerator")
* *class *viktor.external.autocad.enums.AcKeyboardAccelerator(*\*values*)[](#AcKeyboardAccelerator "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcKeyboardAccelerator` values, mirroring the product API’s names so code reads like its docs.
* acPreferenceClassic* = 0*[](#AcKeyboardAccelerator.acPreferenceClassic "Link to this definition")
- acPreferenceCustom* = 1*[](#AcKeyboardAccelerator.acPreferenceCustom "Link to this definition")
## AcKeyboardPriority[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcKeyboardPriority "Direct link to AcKeyboardPriority")
* *class *viktor.external.autocad.enums.AcKeyboardPriority(*\*values*)[](#AcKeyboardPriority "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcKeyboardPriority` values, mirroring the product API’s names so code reads like its docs.
* acKeyboardEntry* = 1*[](#AcKeyboardPriority.acKeyboardEntry "Link to this definition")
- acKeyboardEntryExceptScripts* = 2*[](#AcKeyboardPriority.acKeyboardEntryExceptScripts "Link to this definition")
* acKeyboardRunningObjSnap* = 0*[](#AcKeyboardPriority.acKeyboardRunningObjSnap "Link to this definition")
## AcLayerStateMask[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcLayerStateMask "Direct link to AcLayerStateMask")
* *class *viktor.external.autocad.enums.AcLayerStateMask(*\*values*)[](#AcLayerStateMask "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcLayerStateMask` values, mirroring the product API’s names so code reads like its docs.
* acLsAll* = 65535*[](#AcLayerStateMask.acLsAll "Link to this definition")
- acLsColor* = 32*[](#AcLayerStateMask.acLsColor "Link to this definition")
* acLsFrozen* = 2*[](#AcLayerStateMask.acLsFrozen "Link to this definition")
- acLsLineType* = 64*[](#AcLayerStateMask.acLsLineType "Link to this definition")
* acLsLineWeight* = 128*[](#AcLayerStateMask.acLsLineWeight "Link to this definition")
- acLsLocked* = 4*[](#AcLayerStateMask.acLsLocked "Link to this definition")
* acLsNewViewport* = 16*[](#AcLayerStateMask.acLsNewViewport "Link to this definition")
- acLsNone* = 0*[](#AcLayerStateMask.acLsNone "Link to this definition")
* acLsOn* = 1*[](#AcLayerStateMask.acLsOn "Link to this definition")
- acLsPlot* = 8*[](#AcLayerStateMask.acLsPlot "Link to this definition")
* acLsPlotStyle* = 256*[](#AcLayerStateMask.acLsPlotStyle "Link to this definition")
## AcLeaderType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcLeaderType "Direct link to AcLeaderType")
* *class *viktor.external.autocad.enums.AcLeaderType(*\*values*)[](#AcLeaderType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcLeaderType` values, mirroring the product API’s names so code reads like its docs.
* acLineNoArrow* = 0*[](#AcLeaderType.acLineNoArrow "Link to this definition")
- acLineWithArrow* = 2*[](#AcLeaderType.acLineWithArrow "Link to this definition")
* acSplineNoArrow* = 1*[](#AcLeaderType.acSplineNoArrow "Link to this definition")
- acSplineWithArrow* = 3*[](#AcLeaderType.acSplineWithArrow "Link to this definition")
## AcLineSpacingStyle[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcLineSpacingStyle "Direct link to AcLineSpacingStyle")
* *class *viktor.external.autocad.enums.AcLineSpacingStyle(*\*values*)[](#AcLineSpacingStyle "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcLineSpacingStyle` values, mirroring the product API’s names so code reads like its docs.
* acLineSpacingStyleAtLeast* = 1*[](#AcLineSpacingStyle.acLineSpacingStyleAtLeast "Link to this definition")
- acLineSpacingStyleExactly* = 2*[](#AcLineSpacingStyle.acLineSpacingStyleExactly "Link to this definition")
## AcLineWeight[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcLineWeight "Direct link to AcLineWeight")
* *class *viktor.external.autocad.enums.AcLineWeight(*\*values*)[](#AcLineWeight "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcLineWeight` values, mirroring the product API’s names so code reads like its docs.
* acLnWt000* = 0*[](#AcLineWeight.acLnWt000 "Link to this definition")
- acLnWt005* = 5*[](#AcLineWeight.acLnWt005 "Link to this definition")
* acLnWt009* = 9*[](#AcLineWeight.acLnWt009 "Link to this definition")
- acLnWt013* = 13*[](#AcLineWeight.acLnWt013 "Link to this definition")
* acLnWt015* = 15*[](#AcLineWeight.acLnWt015 "Link to this definition")
- acLnWt018* = 18*[](#AcLineWeight.acLnWt018 "Link to this definition")
* acLnWt020* = 20*[](#AcLineWeight.acLnWt020 "Link to this definition")
- acLnWt025* = 25*[](#AcLineWeight.acLnWt025 "Link to this definition")
* acLnWt030* = 30*[](#AcLineWeight.acLnWt030 "Link to this definition")
- acLnWt035* = 35*[](#AcLineWeight.acLnWt035 "Link to this definition")
* acLnWt040* = 40*[](#AcLineWeight.acLnWt040 "Link to this definition")
- acLnWt050* = 50*[](#AcLineWeight.acLnWt050 "Link to this definition")
* acLnWt053* = 53*[](#AcLineWeight.acLnWt053 "Link to this definition")
- acLnWt060* = 60*[](#AcLineWeight.acLnWt060 "Link to this definition")
* acLnWt070* = 70*[](#AcLineWeight.acLnWt070 "Link to this definition")
- acLnWt080* = 80*[](#AcLineWeight.acLnWt080 "Link to this definition")
* acLnWt090* = 90*[](#AcLineWeight.acLnWt090 "Link to this definition")
- acLnWt100* = 100*[](#AcLineWeight.acLnWt100 "Link to this definition")
* acLnWt106* = 106*[](#AcLineWeight.acLnWt106 "Link to this definition")
- acLnWt120* = 120*[](#AcLineWeight.acLnWt120 "Link to this definition")
* acLnWt140* = 140*[](#AcLineWeight.acLnWt140 "Link to this definition")
- acLnWt158* = 158*[](#AcLineWeight.acLnWt158 "Link to this definition")
* acLnWt200* = 200*[](#AcLineWeight.acLnWt200 "Link to this definition")
- acLnWt211* = 211*[](#AcLineWeight.acLnWt211 "Link to this definition")
* acLnWtByBlock* = -2*[](#AcLineWeight.acLnWtByBlock "Link to this definition")
- acLnWtByLayer* = -1*[](#AcLineWeight.acLnWtByLayer "Link to this definition")
* acLnWtByLwDefault* = -3*[](#AcLineWeight.acLnWtByLwDefault "Link to this definition")
## AcLoadPalette[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcLoadPalette "Direct link to AcLoadPalette")
* *class *viktor.external.autocad.enums.AcLoadPalette(*\*values*)[](#AcLoadPalette "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcLoadPalette` values, mirroring the product API’s names so code reads like its docs.
* acPaletteByDrawing* = 0*[](#AcLoadPalette.acPaletteByDrawing "Link to this definition")
- acPaletteBySession* = 1*[](#AcLoadPalette.acPaletteBySession "Link to this definition")
## AcLoftedSurfaceNormalType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcLoftedSurfaceNormalType "Direct link to AcLoftedSurfaceNormalType")
* *class *viktor.external.autocad.enums.AcLoftedSurfaceNormalType(*\*values*)[](#AcLoftedSurfaceNormalType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcLoftedSurfaceNormalType` values, mirroring the product API’s names so code reads like its docs.
* acAllNormal* = 5*[](#AcLoftedSurfaceNormalType.acAllNormal "Link to this definition")
- acEndsNormal* = 4*[](#AcLoftedSurfaceNormalType.acEndsNormal "Link to this definition")
* acFirstNormal* = 2*[](#AcLoftedSurfaceNormalType.acFirstNormal "Link to this definition")
- acLastNormal* = 3*[](#AcLoftedSurfaceNormalType.acLastNormal "Link to this definition")
* acRuled* = 0*[](#AcLoftedSurfaceNormalType.acRuled "Link to this definition")
- acSmooth* = 1*[](#AcLoftedSurfaceNormalType.acSmooth "Link to this definition")
* acUseDraftAngles* = 6*[](#AcLoftedSurfaceNormalType.acUseDraftAngles "Link to this definition")
## AcLoopType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcLoopType "Direct link to AcLoopType")
* *class *viktor.external.autocad.enums.AcLoopType(*\*values*)[](#AcLoopType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcLoopType` values, mirroring the product API’s names so code reads like its docs.
* acHatchLoopTypeDefault* = 0*[](#AcLoopType.acHatchLoopTypeDefault "Link to this definition")
- acHatchLoopTypeDerived* = 4*[](#AcLoopType.acHatchLoopTypeDerived "Link to this definition")
* acHatchLoopTypeExternal* = 1*[](#AcLoopType.acHatchLoopTypeExternal "Link to this definition")
- acHatchLoopTypePolyline* = 2*[](#AcLoopType.acHatchLoopTypePolyline "Link to this definition")
* acHatchLoopTypeTextbox* = 8*[](#AcLoopType.acHatchLoopTypeTextbox "Link to this definition")
## AcMLeaderContentType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcMLeaderContentType "Direct link to AcMLeaderContentType")
* *class *viktor.external.autocad.enums.AcMLeaderContentType(*\*values*)[](#AcMLeaderContentType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcMLeaderContentType` values, mirroring the product API’s names so code reads like its docs.
* acBlockContent* = 1*[](#AcMLeaderContentType.acBlockContent "Link to this definition")
- acMTextContent* = 2*[](#AcMLeaderContentType.acMTextContent "Link to this definition")
* acNoneContent* = 0*[](#AcMLeaderContentType.acNoneContent "Link to this definition")
## AcMLeaderType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcMLeaderType "Direct link to AcMLeaderType")
* *class *viktor.external.autocad.enums.AcMLeaderType(*\*values*)[](#AcMLeaderType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcMLeaderType` values, mirroring the product API’s names so code reads like its docs.
* acInVisibleLeader* = 0*[](#AcMLeaderType.acInVisibleLeader "Link to this definition")
- acSplineLeader* = 2*[](#AcMLeaderType.acSplineLeader "Link to this definition")
* acStraightLeader* = 1*[](#AcMLeaderType.acStraightLeader "Link to this definition")
## AcMLineJustification[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcMLineJustification "Direct link to AcMLineJustification")
* *class *viktor.external.autocad.enums.AcMLineJustification(*\*values*)[](#AcMLineJustification "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcMLineJustification` values, mirroring the product API’s names so code reads like its docs.
* acBottom* = 2*[](#AcMLineJustification.acBottom "Link to this definition")
- acTop* = 0*[](#AcMLineJustification.acTop "Link to this definition")
* acZero* = 1*[](#AcMLineJustification.acZero "Link to this definition")
## AcMeasurementUnits[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcMeasurementUnits "Direct link to AcMeasurementUnits")
* *class *viktor.external.autocad.enums.AcMeasurementUnits(*\*values*)[](#AcMeasurementUnits "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcMeasurementUnits` values, mirroring the product API’s names so code reads like its docs.
* acEnglish* = 0*[](#AcMeasurementUnits.acEnglish "Link to this definition")
- acMetric* = 1*[](#AcMeasurementUnits.acMetric "Link to this definition")
## AcMenuFileType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcMenuFileType "Direct link to AcMenuFileType")
* *class *viktor.external.autocad.enums.AcMenuFileType(*\*values*)[](#AcMenuFileType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcMenuFileType` values, mirroring the product API’s names so code reads like its docs.
* acMenuFileCompiled* = 0*[](#AcMenuFileType.acMenuFileCompiled "Link to this definition")
- acMenuFileSource* = 1*[](#AcMenuFileType.acMenuFileSource "Link to this definition")
## AcMenuGroupType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcMenuGroupType "Direct link to AcMenuGroupType")
* *class *viktor.external.autocad.enums.AcMenuGroupType(*\*values*)[](#AcMenuGroupType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcMenuGroupType` values, mirroring the product API’s names so code reads like its docs.
* acBaseMenuGroup* = 0*[](#AcMenuGroupType.acBaseMenuGroup "Link to this definition")
- acPartialMenuGroup* = 1*[](#AcMenuGroupType.acPartialMenuGroup "Link to this definition")
## AcMenuItemType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcMenuItemType "Direct link to AcMenuItemType")
* *class *viktor.external.autocad.enums.AcMenuItemType(*\*values*)[](#AcMenuItemType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcMenuItemType` values, mirroring the product API’s names so code reads like its docs.
* acMenuItem* = 0*[](#AcMenuItemType.acMenuItem "Link to this definition")
- acMenuSeparator* = 1*[](#AcMenuItemType.acMenuSeparator "Link to this definition")
* acMenuSubMenu* = 2*[](#AcMenuItemType.acMenuSubMenu "Link to this definition")
## AcMergeCellStyleOption[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcMergeCellStyleOption "Direct link to AcMergeCellStyleOption")
* *class *viktor.external.autocad.enums.AcMergeCellStyleOption(*\*values*)[](#AcMergeCellStyleOption "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcMergeCellStyleOption` values, mirroring the product API’s names so code reads like its docs.
* acMergeCellStyleConvertDuplicatesToOverrides* = 4*[](#AcMergeCellStyleOption.acMergeCellStyleConvertDuplicatesToOverrides "Link to this definition")
- acMergeCellStyleCopyDuplicates* = 1*[](#AcMergeCellStyleOption.acMergeCellStyleCopyDuplicates "Link to this definition")
* acMergeCellStyleIgnoreNewStyles* = 8*[](#AcMergeCellStyleOption.acMergeCellStyleIgnoreNewStyles "Link to this definition")
- acMergeCellStyleNone* = 0*[](#AcMergeCellStyleOption.acMergeCellStyleNone "Link to this definition")
* acMergeCellStyleOverwriteDuplicates* = 2*[](#AcMergeCellStyleOption.acMergeCellStyleOverwriteDuplicates "Link to this definition")
## AcMeshCreaseType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcMeshCreaseType "Direct link to AcMeshCreaseType")
* *class *viktor.external.autocad.enums.AcMeshCreaseType(*\*values*)[](#AcMeshCreaseType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcMeshCreaseType` values, mirroring the product API’s names so code reads like its docs.
* acAlwaysCrease* = 1*[](#AcMeshCreaseType.acAlwaysCrease "Link to this definition")
- acCreaseByLevel* = 2*[](#AcMeshCreaseType.acCreaseByLevel "Link to this definition")
* acNoneCrease* = 0*[](#AcMeshCreaseType.acNoneCrease "Link to this definition")
## AcOlePlotQuality[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcOlePlotQuality "Direct link to AcOlePlotQuality")
* *class *viktor.external.autocad.enums.AcOlePlotQuality(*\*values*)[](#AcOlePlotQuality "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcOlePlotQuality` values, mirroring the product API’s names so code reads like its docs.
* acOPQHighGraphics* = 2*[](#AcOlePlotQuality.acOPQHighGraphics "Link to this definition")
- acOPQLowGraphics* = 1*[](#AcOlePlotQuality.acOPQLowGraphics "Link to this definition")
* acOPQMonochrome* = 0*[](#AcOlePlotQuality.acOPQMonochrome "Link to this definition")
## AcOleQuality[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcOleQuality "Direct link to AcOleQuality")
* *class *viktor.external.autocad.enums.AcOleQuality(*\*values*)[](#AcOleQuality "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcOleQuality` values, mirroring the product API’s names so code reads like its docs.
* acOQGraphics* = 2*[](#AcOleQuality.acOQGraphics "Link to this definition")
- acOQHighPhoto* = 4*[](#AcOleQuality.acOQHighPhoto "Link to this definition")
* acOQLineArt* = 0*[](#AcOleQuality.acOQLineArt "Link to this definition")
- acOQPhoto* = 3*[](#AcOleQuality.acOQPhoto "Link to this definition")
* acOQText* = 1*[](#AcOleQuality.acOQText "Link to this definition")
## AcOleType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcOleType "Direct link to AcOleType")
* *class *viktor.external.autocad.enums.AcOleType(*\*values*)[](#AcOleType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcOleType` values, mirroring the product API’s names so code reads like its docs.
* acOTEmbedded* = 2*[](#AcOleType.acOTEmbedded "Link to this definition")
- acOTLink* = 1*[](#AcOleType.acOTLink "Link to this definition")
* acOTStatic* = 3*[](#AcOleType.acOTStatic "Link to this definition")
## AcOnOff[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcOnOff "Direct link to AcOnOff")
* *class *viktor.external.autocad.enums.AcOnOff(*\*values*)[](#AcOnOff "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcOnOff` values, mirroring the product API’s names so code reads like its docs.
* acOff* = 0*[](#AcOnOff.acOff "Link to this definition")
- acOn* = 1*[](#AcOnOff.acOn "Link to this definition")
## AcParseOption[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcParseOption "Direct link to AcParseOption")
* *class *viktor.external.autocad.enums.AcParseOption(*\*values*)[](#AcParseOption "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcParseOption` values, mirroring the product API’s names so code reads like its docs.
* acParseOptionNone* = 0*[](#AcParseOption.acParseOptionNone "Link to this definition")
- acPreserveMtextFormat* = 2*[](#AcParseOption.acPreserveMtextFormat "Link to this definition")
* acSetDefaultFormat* = 1*[](#AcParseOption.acSetDefaultFormat "Link to this definition")
## AcPatternType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPatternType "Direct link to AcPatternType")
* *class *viktor.external.autocad.enums.AcPatternType(*\*values*)[](#AcPatternType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPatternType` values, mirroring the product API’s names so code reads like its docs.
* acHatchPatternTypeCustomDefined* = 2*[](#AcPatternType.acHatchPatternTypeCustomDefined "Link to this definition")
- acHatchPatternTypePreDefined* = 1*[](#AcPatternType.acHatchPatternTypePreDefined "Link to this definition")
* acHatchPatternTypeUserDefined* = 0*[](#AcPatternType.acHatchPatternTypeUserDefined "Link to this definition")
## AcPlotOrientation[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPlotOrientation "Direct link to AcPlotOrientation")
* *class *viktor.external.autocad.enums.AcPlotOrientation(*\*values*)[](#AcPlotOrientation "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPlotOrientation` values, mirroring the product API’s names so code reads like its docs.
* acPlotOrientationLandscape* = 1*[](#AcPlotOrientation.acPlotOrientationLandscape "Link to this definition")
- acPlotOrientationPortrait* = 0*[](#AcPlotOrientation.acPlotOrientationPortrait "Link to this definition")
## AcPlotPaperUnits[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPlotPaperUnits "Direct link to AcPlotPaperUnits")
* *class *viktor.external.autocad.enums.AcPlotPaperUnits(*\*values*)[](#AcPlotPaperUnits "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPlotPaperUnits` values, mirroring the product API’s names so code reads like its docs.
* acInches* = 0*[](#AcPlotPaperUnits.acInches "Link to this definition")
- acMillimeters* = 1*[](#AcPlotPaperUnits.acMillimeters "Link to this definition")
* acPixels* = 2*[](#AcPlotPaperUnits.acPixels "Link to this definition")
## AcPlotPolicy[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPlotPolicy "Direct link to AcPlotPolicy")
* *class *viktor.external.autocad.enums.AcPlotPolicy(*\*values*)[](#AcPlotPolicy "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPlotPolicy` values, mirroring the product API’s names so code reads like its docs.
* acPolicyLegacy* = 1*[](#AcPlotPolicy.acPolicyLegacy "Link to this definition")
- acPolicyNamed* = 0*[](#AcPlotPolicy.acPolicyNamed "Link to this definition")
## AcPlotPolicyForLegacyDwgs[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPlotPolicyForLegacyDwgs "Direct link to AcPlotPolicyForLegacyDwgs")
* *class *viktor.external.autocad.enums.AcPlotPolicyForLegacyDwgs(*\*values*)[](#AcPlotPolicyForLegacyDwgs "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPlotPolicyForLegacyDwgs` values, mirroring the product API’s names so code reads like its docs.
* acPolicyLegacyDefault* = 0*[](#AcPlotPolicyForLegacyDwgs.acPolicyLegacyDefault "Link to this definition")
- acPolicyLegacyLegacy* = 2*[](#AcPlotPolicyForLegacyDwgs.acPolicyLegacyLegacy "Link to this definition")
* acPolicyLegacyQuery* = 1*[](#AcPlotPolicyForLegacyDwgs.acPolicyLegacyQuery "Link to this definition")
## AcPlotPolicyForNewDwgs[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPlotPolicyForNewDwgs "Direct link to AcPlotPolicyForNewDwgs")
* *class *viktor.external.autocad.enums.AcPlotPolicyForNewDwgs(*\*values*)[](#AcPlotPolicyForNewDwgs "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPlotPolicyForNewDwgs` values, mirroring the product API’s names so code reads like its docs.
* acPolicyNewDefault* = 0*[](#AcPlotPolicyForNewDwgs.acPolicyNewDefault "Link to this definition")
- acPolicyNewLegacy* = 1*[](#AcPlotPolicyForNewDwgs.acPolicyNewLegacy "Link to this definition")
## AcPlotRotation[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPlotRotation "Direct link to AcPlotRotation")
* *class *viktor.external.autocad.enums.AcPlotRotation(*\*values*)[](#AcPlotRotation "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPlotRotation` values, mirroring the product API’s names so code reads like its docs.
* ac0degrees* = 0*[](#AcPlotRotation.ac0degrees "Link to this definition")
- ac180degrees* = 2*[](#AcPlotRotation.ac180degrees "Link to this definition")
* ac270degrees* = 3*[](#AcPlotRotation.ac270degrees "Link to this definition")
- ac90degrees* = 1*[](#AcPlotRotation.ac90degrees "Link to this definition")
## AcPlotScale[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPlotScale "Direct link to AcPlotScale")
* *class *viktor.external.autocad.enums.AcPlotScale(*\*values*)[](#AcPlotScale "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPlotScale` values, mirroring the product API’s names so code reads like its docs.
* ac100\_1* = 32*[](#AcPlotScale.ac100_1 "Link to this definition")
- ac10\_1* = 31*[](#AcPlotScale.ac10_1 "Link to this definition")
* ac1\_1* = 16*[](#AcPlotScale.ac1_1 "Link to this definition")
- ac1\_10* = 21*[](#AcPlotScale.ac1_10 "Link to this definition")
* ac1\_100* = 27*[](#AcPlotScale.ac1_100 "Link to this definition")
- ac1\_128in\_1ft* = 1*[](#AcPlotScale.ac1_128in_1ft "Link to this definition")
* ac1\_16* = 22*[](#AcPlotScale.ac1_16 "Link to this definition")
- ac1\_16in\_1ft* = 4*[](#AcPlotScale.ac1_16in_1ft "Link to this definition")
* ac1\_2* = 17*[](#AcPlotScale.ac1_2 "Link to this definition")
- ac1\_20* = 23*[](#AcPlotScale.ac1_20 "Link to this definition")
* ac1\_2in\_1ft* = 10*[](#AcPlotScale.ac1_2in_1ft "Link to this definition")
- ac1\_30* = 24*[](#AcPlotScale.ac1_30 "Link to this definition")
* ac1\_32in\_1ft* = 3*[](#AcPlotScale.ac1_32in_1ft "Link to this definition")
- ac1\_4* = 18*[](#AcPlotScale.ac1_4 "Link to this definition")
* ac1\_40* = 25*[](#AcPlotScale.ac1_40 "Link to this definition")
- ac1\_4in\_1ft* = 8*[](#AcPlotScale.ac1_4in_1ft "Link to this definition")
* ac1\_5* = 19*[](#AcPlotScale.ac1_5 "Link to this definition")
- ac1\_50* = 26*[](#AcPlotScale.ac1_50 "Link to this definition")
* ac1\_64in\_1ft* = 2*[](#AcPlotScale.ac1_64in_1ft "Link to this definition")
- ac1\_8* = 20*[](#AcPlotScale.ac1_8 "Link to this definition")
* ac1\_8in\_1ft* = 6*[](#AcPlotScale.ac1_8in_1ft "Link to this definition")
- ac1ft\_1ft* = 15*[](#AcPlotScale.ac1ft_1ft "Link to this definition")
* ac1in\_1ft* = 12*[](#AcPlotScale.ac1in_1ft "Link to this definition")
- ac2\_1* = 28*[](#AcPlotScale.ac2_1 "Link to this definition")
* ac3\_16in\_1ft* = 7*[](#AcPlotScale.ac3_16in_1ft "Link to this definition")
- ac3\_32in\_1ft* = 5*[](#AcPlotScale.ac3_32in_1ft "Link to this definition")
* ac3\_4in\_1ft* = 11*[](#AcPlotScale.ac3_4in_1ft "Link to this definition")
- ac3\_8in\_1ft* = 9*[](#AcPlotScale.ac3_8in_1ft "Link to this definition")
* ac3in\_1ft* = 13*[](#AcPlotScale.ac3in_1ft "Link to this definition")
- ac4\_1* = 29*[](#AcPlotScale.ac4_1 "Link to this definition")
* ac6in\_1ft* = 14*[](#AcPlotScale.ac6in_1ft "Link to this definition")
- ac8\_1* = 30*[](#AcPlotScale.ac8_1 "Link to this definition")
* acScaleToFit* = 0*[](#AcPlotScale.acScaleToFit "Link to this definition")
## AcPlotType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPlotType "Direct link to AcPlotType")
* *class *viktor.external.autocad.enums.AcPlotType(*\*values*)[](#AcPlotType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPlotType` values, mirroring the product API’s names so code reads like its docs.
* acDisplay* = 0*[](#AcPlotType.acDisplay "Link to this definition")
- acExtents* = 1*[](#AcPlotType.acExtents "Link to this definition")
* acLayout* = 5*[](#AcPlotType.acLayout "Link to this definition")
- acLimits* = 2*[](#AcPlotType.acLimits "Link to this definition")
* acView* = 3*[](#AcPlotType.acView "Link to this definition")
- acWindow* = 4*[](#AcPlotType.acWindow "Link to this definition")
## AcPointCloudColorType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPointCloudColorType "Direct link to AcPointCloudColorType")
* *class *viktor.external.autocad.enums.AcPointCloudColorType(*\*values*)[](#AcPointCloudColorType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPointCloudColorType` values, mirroring the product API’s names so code reads like its docs.
* acByColor* = 1*[](#AcPointCloudColorType.acByColor "Link to this definition")
- acTrueColor* = 0*[](#AcPointCloudColorType.acTrueColor "Link to this definition")
## AcPointCloudExStylizationType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPointCloudExStylizationType "Direct link to AcPointCloudExStylizationType")
* *class *viktor.external.autocad.enums.AcPointCloudExStylizationType(*\*values*)[](#AcPointCloudExStylizationType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPointCloudExStylizationType` values, mirroring the product API’s names so code reads like its docs.
* acClassification* = 5*[](#AcPointCloudExStylizationType.acClassification "Link to this definition")
- acElevation* = 4*[](#AcPointCloudExStylizationType.acElevation "Link to this definition")
* acIntensities* = 3*[](#AcPointCloudExStylizationType.acIntensities "Link to this definition")
- acNormals* = 2*[](#AcPointCloudExStylizationType.acNormals "Link to this definition")
* acObject* = 1*[](#AcPointCloudExStylizationType.acObject "Link to this definition")
- acRGB* = 0*[](#AcPointCloudExStylizationType.acRGB "Link to this definition")
## AcPointCloudIntensityStyle[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPointCloudIntensityStyle "Direct link to AcPointCloudIntensityStyle")
* *class *viktor.external.autocad.enums.AcPointCloudIntensityStyle(*\*values*)[](#AcPointCloudIntensityStyle "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPointCloudIntensityStyle` values, mirroring the product API’s names so code reads like its docs.
* acIntensityBlue* = 4*[](#AcPointCloudIntensityStyle.acIntensityBlue "Link to this definition")
- acIntensityEditableFlag* = 5*[](#AcPointCloudIntensityStyle.acIntensityEditableFlag "Link to this definition")
* acIntensityGrayscale* = 0*[](#AcPointCloudIntensityStyle.acIntensityGrayscale "Link to this definition")
- acIntensityGreen* = 3*[](#AcPointCloudIntensityStyle.acIntensityGreen "Link to this definition")
* acIntensityRainbow* = 1*[](#AcPointCloudIntensityStyle.acIntensityRainbow "Link to this definition")
- acIntensityRed* = 2*[](#AcPointCloudIntensityStyle.acIntensityRed "Link to this definition")
## AcPointCloudStylizationType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPointCloudStylizationType "Direct link to AcPointCloudStylizationType")
* *class *viktor.external.autocad.enums.AcPointCloudStylizationType(*\*values*)[](#AcPointCloudStylizationType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPointCloudStylizationType` values, mirroring the product API’s names so code reads like its docs.
* acIntensity* = 3*[](#AcPointCloudStylizationType.acIntensity "Link to this definition")
- acNormal* = 2*[](#AcPointCloudStylizationType.acNormal "Link to this definition")
* acObjectColor* = 1*[](#AcPointCloudStylizationType.acObjectColor "Link to this definition")
- acScanColor* = 0*[](#AcPointCloudStylizationType.acScanColor "Link to this definition")
## AcPolylineType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPolylineType "Direct link to AcPolylineType")
* *class *viktor.external.autocad.enums.AcPolylineType(*\*values*)[](#AcPolylineType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPolylineType` values, mirroring the product API’s names so code reads like its docs.
* acCubicSplinePoly* = 3*[](#AcPolylineType.acCubicSplinePoly "Link to this definition")
- acFitCurvePoly* = 1*[](#AcPolylineType.acFitCurvePoly "Link to this definition")
* acQuadSplinePoly* = 2*[](#AcPolylineType.acQuadSplinePoly "Link to this definition")
- acSimplePoly* = 0*[](#AcPolylineType.acSimplePoly "Link to this definition")
## AcPolymeshType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPolymeshType "Direct link to AcPolymeshType")
* *class *viktor.external.autocad.enums.AcPolymeshType(*\*values*)[](#AcPolymeshType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPolymeshType` values, mirroring the product API’s names so code reads like its docs.
* acBezierSurfaceMesh* = 8*[](#AcPolymeshType.acBezierSurfaceMesh "Link to this definition")
- acCubicSurfaceMesh* = 6*[](#AcPolymeshType.acCubicSurfaceMesh "Link to this definition")
* acQuadSurfaceMesh* = 5*[](#AcPolymeshType.acQuadSurfaceMesh "Link to this definition")
- acSimpleMesh* = 0*[](#AcPolymeshType.acSimpleMesh "Link to this definition")
## AcPredefBlockType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPredefBlockType "Direct link to AcPredefBlockType")
* *class *viktor.external.autocad.enums.AcPredefBlockType(*\*values*)[](#AcPredefBlockType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPredefBlockType` values, mirroring the product API’s names so code reads like its docs.
* acBlockBox* = 3*[](#AcPredefBlockType.acBlockBox "Link to this definition")
- acBlockCircle* = 2*[](#AcPredefBlockType.acBlockCircle "Link to this definition")
* acBlockHexagon* = 4*[](#AcPredefBlockType.acBlockHexagon "Link to this definition")
- acBlockImperial* = 0*[](#AcPredefBlockType.acBlockImperial "Link to this definition")
* acBlockSlot* = 1*[](#AcPredefBlockType.acBlockSlot "Link to this definition")
- acBlockTriangle* = 5*[](#AcPredefBlockType.acBlockTriangle "Link to this definition")
* acBlockUserDefined* = 6*[](#AcPredefBlockType.acBlockUserDefined "Link to this definition")
## AcPreviewMode[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPreviewMode "Direct link to AcPreviewMode")
* *class *viktor.external.autocad.enums.AcPreviewMode(*\*values*)[](#AcPreviewMode "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPreviewMode` values, mirroring the product API’s names so code reads like its docs.
* acFullPreview* = 1*[](#AcPreviewMode.acFullPreview "Link to this definition")
- acPartialPreview* = 0*[](#AcPreviewMode.acPartialPreview "Link to this definition")
## AcPrinterSpoolAlert[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcPrinterSpoolAlert "Direct link to AcPrinterSpoolAlert")
* *class *viktor.external.autocad.enums.AcPrinterSpoolAlert(*\*values*)[](#AcPrinterSpoolAlert "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcPrinterSpoolAlert` values, mirroring the product API’s names so code reads like its docs.
* acPrinterAlertOnce* = 1*[](#AcPrinterSpoolAlert.acPrinterAlertOnce "Link to this definition")
- acPrinterAlwaysAlert* = 0*[](#AcPrinterSpoolAlert.acPrinterAlwaysAlert "Link to this definition")
* acPrinterNeverAlert* = 3*[](#AcPrinterSpoolAlert.acPrinterNeverAlert "Link to this definition")
- acPrinterNeverAlertLogOnce* = 2*[](#AcPrinterSpoolAlert.acPrinterNeverAlertLogOnce "Link to this definition")
## AcProxyImage[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcProxyImage "Direct link to AcProxyImage")
* *class *viktor.external.autocad.enums.AcProxyImage(*\*values*)[](#AcProxyImage "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcProxyImage` values, mirroring the product API’s names so code reads like its docs.
* acProxyBoundingBox* = 2*[](#AcProxyImage.acProxyBoundingBox "Link to this definition")
- acProxyNotShow* = 0*[](#AcProxyImage.acProxyNotShow "Link to this definition")
* acProxyShow* = 1*[](#AcProxyImage.acProxyShow "Link to this definition")
## AcRegenType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcRegenType "Direct link to AcRegenType")
* *class *viktor.external.autocad.enums.AcRegenType(*\*values*)[](#AcRegenType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcRegenType` values, mirroring the product API’s names so code reads like its docs.
* acActiveViewport* = 0*[](#AcRegenType.acActiveViewport "Link to this definition")
- acAllViewports* = 1*[](#AcRegenType.acAllViewports "Link to this definition")
## AcRotationAngle[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcRotationAngle "Direct link to AcRotationAngle")
* *class *viktor.external.autocad.enums.AcRotationAngle(*\*values*)[](#AcRotationAngle "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcRotationAngle` values, mirroring the product API’s names so code reads like its docs.
* acDegrees000* = 0*[](#AcRotationAngle.acDegrees000 "Link to this definition")
- acDegrees090* = 1*[](#AcRotationAngle.acDegrees090 "Link to this definition")
* acDegrees180* = 2*[](#AcRotationAngle.acDegrees180 "Link to this definition")
- acDegrees270* = 3*[](#AcRotationAngle.acDegrees270 "Link to this definition")
* acDegreesUnknown* = -1*[](#AcRotationAngle.acDegreesUnknown "Link to this definition")
## AcRowType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcRowType "Direct link to AcRowType")
* *class *viktor.external.autocad.enums.AcRowType(*\*values*)[](#AcRowType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcRowType` values, mirroring the product API’s names so code reads like its docs.
* acDataRow* = 1*[](#AcRowType.acDataRow "Link to this definition")
- acHeaderRow* = 4*[](#AcRowType.acHeaderRow "Link to this definition")
* acTitleRow* = 2*[](#AcRowType.acTitleRow "Link to this definition")
- acUnknownRow* = 0*[](#AcRowType.acUnknownRow "Link to this definition")
## AcSaveAsType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcSaveAsType "Direct link to AcSaveAsType")
* *class *viktor.external.autocad.enums.AcSaveAsType(*\*values*)[](#AcSaveAsType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcSaveAsType` values, mirroring the product API’s names so code reads like its docs.
* ac2000\_Template* = 14*[](#AcSaveAsType.ac2000_Template "Link to this definition")
- ac2000\_dwg* = 12*[](#AcSaveAsType.ac2000_dwg "Link to this definition")
* ac2000\_dxf* = 13*[](#AcSaveAsType.ac2000_dxf "Link to this definition")
- ac2004\_Template* = 26*[](#AcSaveAsType.ac2004_Template "Link to this definition")
* ac2004\_dwg* = 24*[](#AcSaveAsType.ac2004_dwg "Link to this definition")
- ac2004\_dxf* = 25*[](#AcSaveAsType.ac2004_dxf "Link to this definition")
* ac2007\_Template* = 38*[](#AcSaveAsType.ac2007_Template "Link to this definition")
- ac2007\_dwg* = 36*[](#AcSaveAsType.ac2007_dwg "Link to this definition")
* ac2007\_dxf* = 37*[](#AcSaveAsType.ac2007_dxf "Link to this definition")
- ac2010\_Template* = 50*[](#AcSaveAsType.ac2010_Template "Link to this definition")
* ac2010\_dwg* = 48*[](#AcSaveAsType.ac2010_dwg "Link to this definition")
- ac2010\_dxf* = 49*[](#AcSaveAsType.ac2010_dxf "Link to this definition")
* ac2013\_Template* = 62*[](#AcSaveAsType.ac2013_Template "Link to this definition")
- ac2013\_dwg* = 60*[](#AcSaveAsType.ac2013_dwg "Link to this definition")
* ac2013\_dxf* = 61*[](#AcSaveAsType.ac2013_dxf "Link to this definition")
- ac2018\_Template* = 66*[](#AcSaveAsType.ac2018_Template "Link to this definition")
* ac2018\_dwg* = 64*[](#AcSaveAsType.ac2018_dwg "Link to this definition")
- ac2018\_dxf* = 65*[](#AcSaveAsType.ac2018_dxf "Link to this definition")
* acNative* = 64*[](#AcSaveAsType.acNative "Link to this definition")
- acR12\_dxf* = 1*[](#AcSaveAsType.acR12_dxf "Link to this definition")
* acR13\_dwg* = 4*[](#AcSaveAsType.acR13_dwg "Link to this definition")
- acR13\_dxf* = 5*[](#AcSaveAsType.acR13_dxf "Link to this definition")
* acR14\_dwg* = 8*[](#AcSaveAsType.acR14_dwg "Link to this definition")
- acR14\_dxf* = 9*[](#AcSaveAsType.acR14_dxf "Link to this definition")
* acR15\_Template* = 14*[](#AcSaveAsType.acR15_Template "Link to this definition")
- acR15\_dwg* = 12*[](#AcSaveAsType.acR15_dwg "Link to this definition")
* acR15\_dxf* = 13*[](#AcSaveAsType.acR15_dxf "Link to this definition")
- acR18\_Template* = 26*[](#AcSaveAsType.acR18_Template "Link to this definition")
* acR18\_dwg* = 24*[](#AcSaveAsType.acR18_dwg "Link to this definition")
- acR18\_dxf* = 25*[](#AcSaveAsType.acR18_dxf "Link to this definition")
* acUnknown* = -1*[](#AcSaveAsType.acUnknown "Link to this definition")
## AcSectionGeneration[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcSectionGeneration "Direct link to AcSectionGeneration")
* *class *viktor.external.autocad.enums.AcSectionGeneration(*\*values*)[](#AcSectionGeneration "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcSectionGeneration` values, mirroring the product API’s names so code reads like its docs.
* acSectionGenerationDestinationFile* = 64*[](#AcSectionGeneration.acSectionGenerationDestinationFile "Link to this definition")
- acSectionGenerationDestinationNewBlock* = 16*[](#AcSectionGeneration.acSectionGenerationDestinationNewBlock "Link to this definition")
* acSectionGenerationDestinationReplaceBlock* = 32*[](#AcSectionGeneration.acSectionGenerationDestinationReplaceBlock "Link to this definition")
- acSectionGenerationSourceAllObjects* = 1*[](#AcSectionGeneration.acSectionGenerationSourceAllObjects "Link to this definition")
* acSectionGenerationSourceSelectedObjects* = 2*[](#AcSectionGeneration.acSectionGenerationSourceSelectedObjects "Link to this definition")
## AcSectionState[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcSectionState "Direct link to AcSectionState")
* *class *viktor.external.autocad.enums.AcSectionState(*\*values*)[](#AcSectionState "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcSectionState` values, mirroring the product API’s names so code reads like its docs.
* acSectionStateBoundary* = 2*[](#AcSectionState.acSectionStateBoundary "Link to this definition")
- acSectionStatePlane* = 1*[](#AcSectionState.acSectionStatePlane "Link to this definition")
* acSectionStateVolume* = 4*[](#AcSectionState.acSectionStateVolume "Link to this definition")
## AcSectionState2[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcSectionState2 "Direct link to AcSectionState2")
* *class *viktor.external.autocad.enums.AcSectionState2(*\*values*)[](#AcSectionState2 "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcSectionState2` values, mirroring the product API’s names so code reads like its docs.
* acSectionState2Boundary* = 4*[](#AcSectionState2.acSectionState2Boundary "Link to this definition")
- acSectionState2Plane* = 1*[](#AcSectionState2.acSectionState2Plane "Link to this definition")
* acSectionState2Slice* = 2*[](#AcSectionState2.acSectionState2Slice "Link to this definition")
- acSectionState2Volume* = 8*[](#AcSectionState2.acSectionState2Volume "Link to this definition")
## AcSectionSubItem[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcSectionSubItem "Direct link to AcSectionSubItem")
* *class *viktor.external.autocad.enums.AcSectionSubItem(*\*values*)[](#AcSectionSubItem "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcSectionSubItem` values, mirroring the product API’s names so code reads like its docs.
* acSectionSubItemBackLine* = 8*[](#AcSectionSubItem.acSectionSubItemBackLine "Link to this definition")
- acSectionSubItemBackLineBottom* = 32*[](#AcSectionSubItem.acSectionSubItemBackLineBottom "Link to this definition")
* acSectionSubItemBackLineTop* = 16*[](#AcSectionSubItem.acSectionSubItemBackLineTop "Link to this definition")
- acSectionSubItemSectionLine* = 1*[](#AcSectionSubItem.acSectionSubItemSectionLine "Link to this definition")
* acSectionSubItemSectionLineBottom* = 4*[](#AcSectionSubItem.acSectionSubItemSectionLineBottom "Link to this definition")
- acSectionSubItemSectionLineTop* = 2*[](#AcSectionSubItem.acSectionSubItemSectionLineTop "Link to this definition")
* acSectionSubItemVerticalLineBottom* = 128*[](#AcSectionSubItem.acSectionSubItemVerticalLineBottom "Link to this definition")
- acSectionSubItemVerticalLineTop* = 64*[](#AcSectionSubItem.acSectionSubItemVerticalLineTop "Link to this definition")
* acSectionSubItemkNone* = 0*[](#AcSectionSubItem.acSectionSubItemkNone "Link to this definition")
## AcSectionType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcSectionType "Direct link to AcSectionType")
* *class *viktor.external.autocad.enums.AcSectionType(*\*values*)[](#AcSectionType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcSectionType` values, mirroring the product API’s names so code reads like its docs.
* acSectionType2dSection* = 2*[](#AcSectionType.acSectionType2dSection "Link to this definition")
- acSectionType3dSection* = 4*[](#AcSectionType.acSectionType3dSection "Link to this definition")
* acSectionTypeLiveSection* = 1*[](#AcSectionType.acSectionTypeLiveSection "Link to this definition")
## AcSegmentAngleType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcSegmentAngleType "Direct link to AcSegmentAngleType")
* *class *viktor.external.autocad.enums.AcSegmentAngleType(*\*values*)[](#AcSegmentAngleType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcSegmentAngleType` values, mirroring the product API’s names so code reads like its docs.
* acDegrees15* = 1*[](#AcSegmentAngleType.acDegrees15 "Link to this definition")
- acDegrees30* = 2*[](#AcSegmentAngleType.acDegrees30 "Link to this definition")
* acDegrees45* = 3*[](#AcSegmentAngleType.acDegrees45 "Link to this definition")
- acDegrees60* = 4*[](#AcSegmentAngleType.acDegrees60 "Link to this definition")
* acDegrees90* = 6*[](#AcSegmentAngleType.acDegrees90 "Link to this definition")
- acDegreesAny* = 0*[](#AcSegmentAngleType.acDegreesAny "Link to this definition")
* acDegreesHorz* = 12*[](#AcSegmentAngleType.acDegreesHorz "Link to this definition")
## AcSelect[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcSelect "Direct link to AcSelect")
* *class *viktor.external.autocad.enums.AcSelect(*\*values*)[](#AcSelect "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcSelect` values, mirroring the product API’s names so code reads like its docs.
* acSelectionSetAll* = 5*[](#AcSelect.acSelectionSetAll "Link to this definition")
- acSelectionSetCrossing* = 1*[](#AcSelect.acSelectionSetCrossing "Link to this definition")
* acSelectionSetCrossingPolygon* = 7*[](#AcSelect.acSelectionSetCrossingPolygon "Link to this definition")
- acSelectionSetFence* = 2*[](#AcSelect.acSelectionSetFence "Link to this definition")
* acSelectionSetLast* = 4*[](#AcSelect.acSelectionSetLast "Link to this definition")
- acSelectionSetPrevious* = 3*[](#AcSelect.acSelectionSetPrevious "Link to this definition")
* acSelectionSetWindow* = 0*[](#AcSelect.acSelectionSetWindow "Link to this definition")
- acSelectionSetWindowPolygon* = 6*[](#AcSelect.acSelectionSetWindowPolygon "Link to this definition")
## AcSelectType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcSelectType "Direct link to AcSelectType")
* *class *viktor.external.autocad.enums.AcSelectType(*\*values*)[](#AcSelectType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcSelectType` values, mirroring the product API’s names so code reads like its docs.
* acTableSelectCrossing* = 2*[](#AcSelectType.acTableSelectCrossing "Link to this definition")
- acTableSelectWindow* = 1*[](#AcSelectType.acTableSelectWindow "Link to this definition")
## AcShadePlot[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcShadePlot "Direct link to AcShadePlot")
* *class *viktor.external.autocad.enums.AcShadePlot(*\*values*)[](#AcShadePlot "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcShadePlot` values, mirroring the product API’s names so code reads like its docs.
* acShadePlotAsDisplayed* = 0*[](#AcShadePlot.acShadePlotAsDisplayed "Link to this definition")
- acShadePlotHidden* = 2*[](#AcShadePlot.acShadePlotHidden "Link to this definition")
* acShadePlotRendered* = 3*[](#AcShadePlot.acShadePlotRendered "Link to this definition")
- acShadePlotWireframe* = 1*[](#AcShadePlot.acShadePlotWireframe "Link to this definition")
## AcShadowDisplayType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcShadowDisplayType "Direct link to AcShadowDisplayType")
* *class *viktor.external.autocad.enums.AcShadowDisplayType(*\*values*)[](#AcShadowDisplayType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcShadowDisplayType` values, mirroring the product API’s names so code reads like its docs.
* acCastsAndReceivesShadows* = 0*[](#AcShadowDisplayType.acCastsAndReceivesShadows "Link to this definition")
- acCastsShadows* = 1*[](#AcShadowDisplayType.acCastsShadows "Link to this definition")
* acIgnoreShadows* = 3*[](#AcShadowDisplayType.acIgnoreShadows "Link to this definition")
- acReceivesShadows* = 2*[](#AcShadowDisplayType.acReceivesShadows "Link to this definition")
## AcSplineFrameType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcSplineFrameType "Direct link to AcSplineFrameType")
* *class *viktor.external.autocad.enums.AcSplineFrameType(*\*values*)[](#AcSplineFrameType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcSplineFrameType` values, mirroring the product API’s names so code reads like its docs.
* acHide* = 1*[](#AcSplineFrameType.acHide "Link to this definition")
- acShow* = 0*[](#AcSplineFrameType.acShow "Link to this definition")
## AcSplineKnotParameterizationType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcSplineKnotParameterizationType "Direct link to AcSplineKnotParameterizationType")
* *class *viktor.external.autocad.enums.AcSplineKnotParameterizationType(*\*values*)[](#AcSplineKnotParameterizationType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcSplineKnotParameterizationType` values, mirroring the product API’s names so code reads like its docs.
* acChord* = 0*[](#AcSplineKnotParameterizationType.acChord "Link to this definition")
- acCustomParameterization* = 15*[](#AcSplineKnotParameterizationType.acCustomParameterization "Link to this definition")
* acSqrtChord* = 1*[](#AcSplineKnotParameterizationType.acSqrtChord "Link to this definition")
- acUniformParam* = 2*[](#AcSplineKnotParameterizationType.acUniformParam "Link to this definition")
## AcSplineMethodType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcSplineMethodType "Direct link to AcSplineMethodType")
* *class *viktor.external.autocad.enums.AcSplineMethodType(*\*values*)[](#AcSplineMethodType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcSplineMethodType` values, mirroring the product API’s names so code reads like its docs.
* acControlVertices* = 1*[](#AcSplineMethodType.acControlVertices "Link to this definition")
- acFit* = 0*[](#AcSplineMethodType.acFit "Link to this definition")
## AcTableDirection[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcTableDirection "Direct link to AcTableDirection")
* *class *viktor.external.autocad.enums.AcTableDirection(*\*values*)[](#AcTableDirection "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcTableDirection` values, mirroring the product API’s names so code reads like its docs.
* acTableBottomToTop* = 1*[](#AcTableDirection.acTableBottomToTop "Link to this definition")
- acTableTopToBottom* = 0*[](#AcTableDirection.acTableTopToBottom "Link to this definition")
## AcTableFlowDirection[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcTableFlowDirection "Direct link to AcTableFlowDirection")
* *class *viktor.external.autocad.enums.AcTableFlowDirection(*\*values*)[](#AcTableFlowDirection "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcTableFlowDirection` values, mirroring the product API’s names so code reads like its docs.
* acTableFlowDownOrUp* = 2*[](#AcTableFlowDirection.acTableFlowDownOrUp "Link to this definition")
- acTableFlowLeft* = 4*[](#AcTableFlowDirection.acTableFlowLeft "Link to this definition")
* acTableFlowRight* = 1*[](#AcTableFlowDirection.acTableFlowRight "Link to this definition")
## AcTableStyleOverrides[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcTableStyleOverrides "Direct link to AcTableStyleOverrides")
* *class *viktor.external.autocad.enums.AcTableStyleOverrides(*\*values*)[](#AcTableStyleOverrides "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcTableStyleOverrides` values, mirroring the product API’s names so code reads like its docs.
* acCellAlign* = 130*[](#AcTableStyleOverrides.acCellAlign "Link to this definition")
- acCellBackgroundColor* = 132*[](#AcTableStyleOverrides.acCellBackgroundColor "Link to this definition")
* acCellBackgroundFillNone* = 131*[](#AcTableStyleOverrides.acCellBackgroundFillNone "Link to this definition")
- acCellBottomGridColor* = 138*[](#AcTableStyleOverrides.acCellBottomGridColor "Link to this definition")
* acCellBottomGridLineWeight* = 142*[](#AcTableStyleOverrides.acCellBottomGridLineWeight "Link to this definition")
- acCellBottomVisibility* = 146*[](#AcTableStyleOverrides.acCellBottomVisibility "Link to this definition")
* acCellContentColor* = 133*[](#AcTableStyleOverrides.acCellContentColor "Link to this definition")
- acCellDataType* = 148*[](#AcTableStyleOverrides.acCellDataType "Link to this definition")
* acCellLeftGridColor* = 139*[](#AcTableStyleOverrides.acCellLeftGridColor "Link to this definition")
- acCellLeftGridLineWeight* = 143*[](#AcTableStyleOverrides.acCellLeftGridLineWeight "Link to this definition")
* acCellLeftVisibility* = 147*[](#AcTableStyleOverrides.acCellLeftVisibility "Link to this definition")
- acCellRightGridColor* = 137*[](#AcTableStyleOverrides.acCellRightGridColor "Link to this definition")
* acCellRightGridLineWeight* = 141*[](#AcTableStyleOverrides.acCellRightGridLineWeight "Link to this definition")
- acCellRightVisibility* = 145*[](#AcTableStyleOverrides.acCellRightVisibility "Link to this definition")
* acCellTextHeight* = 135*[](#AcTableStyleOverrides.acCellTextHeight "Link to this definition")
- acCellTextStyle* = 134*[](#AcTableStyleOverrides.acCellTextStyle "Link to this definition")
* acCellTopGridColor* = 136*[](#AcTableStyleOverrides.acCellTopGridColor "Link to this definition")
- acCellTopGridLineWeight* = 140*[](#AcTableStyleOverrides.acCellTopGridLineWeight "Link to this definition")
* acCellTopVisibility* = 144*[](#AcTableStyleOverrides.acCellTopVisibility "Link to this definition")
- acDataHorzBottomColor* = 54*[](#AcTableStyleOverrides.acDataHorzBottomColor "Link to this definition")
* acDataHorzBottomLineWeight* = 84*[](#AcTableStyleOverrides.acDataHorzBottomLineWeight "Link to this definition")
- acDataHorzBottomVisibility* = 114*[](#AcTableStyleOverrides.acDataHorzBottomVisibility "Link to this definition")
* acDataHorzInsideColor* = 53*[](#AcTableStyleOverrides.acDataHorzInsideColor "Link to this definition")
- acDataHorzInsideLineWeight* = 83*[](#AcTableStyleOverrides.acDataHorzInsideLineWeight "Link to this definition")
* acDataHorzInsideVisibility* = 113*[](#AcTableStyleOverrides.acDataHorzInsideVisibility "Link to this definition")
- acDataHorzTopColor* = 52*[](#AcTableStyleOverrides.acDataHorzTopColor "Link to this definition")
* acDataHorzTopLineWeight* = 82*[](#AcTableStyleOverrides.acDataHorzTopLineWeight "Link to this definition")
- acDataHorzTopVisibility* = 112*[](#AcTableStyleOverrides.acDataHorzTopVisibility "Link to this definition")
* acDataRowAlignment* = 17*[](#AcTableStyleOverrides.acDataRowAlignment "Link to this definition")
- acDataRowColor* = 8*[](#AcTableStyleOverrides.acDataRowColor "Link to this definition")
* acDataRowDataType* = 26*[](#AcTableStyleOverrides.acDataRowDataType "Link to this definition")
- acDataRowFillColor* = 14*[](#AcTableStyleOverrides.acDataRowFillColor "Link to this definition")
* acDataRowFillNone* = 11*[](#AcTableStyleOverrides.acDataRowFillNone "Link to this definition")
- acDataRowTextHeight* = 23*[](#AcTableStyleOverrides.acDataRowTextHeight "Link to this definition")
* acDataRowTextStyle* = 20*[](#AcTableStyleOverrides.acDataRowTextStyle "Link to this definition")
- acDataVertInsideColor* = 56*[](#AcTableStyleOverrides.acDataVertInsideColor "Link to this definition")
* acDataVertInsideLineWeight* = 86*[](#AcTableStyleOverrides.acDataVertInsideLineWeight "Link to this definition")
- acDataVertInsideVisibility* = 116*[](#AcTableStyleOverrides.acDataVertInsideVisibility "Link to this definition")
* acDataVertLeftColor* = 55*[](#AcTableStyleOverrides.acDataVertLeftColor "Link to this definition")
- acDataVertLeftLineWeight* = 85*[](#AcTableStyleOverrides.acDataVertLeftLineWeight "Link to this definition")
* acDataVertLeftVisibility* = 115*[](#AcTableStyleOverrides.acDataVertLeftVisibility "Link to this definition")
- acDataVertRightColor* = 57*[](#AcTableStyleOverrides.acDataVertRightColor "Link to this definition")
* acDataVertRightLineWeight* = 87*[](#AcTableStyleOverrides.acDataVertRightLineWeight "Link to this definition")
- acDataVertRightVisibility* = 117*[](#AcTableStyleOverrides.acDataVertRightVisibility "Link to this definition")
* acFlowDirection* = 3*[](#AcTableStyleOverrides.acFlowDirection "Link to this definition")
- acHeaderHorzBottomColor* = 48*[](#AcTableStyleOverrides.acHeaderHorzBottomColor "Link to this definition")
* acHeaderHorzBottomLineWeight* = 78*[](#AcTableStyleOverrides.acHeaderHorzBottomLineWeight "Link to this definition")
- acHeaderHorzBottomVisibility* = 108*[](#AcTableStyleOverrides.acHeaderHorzBottomVisibility "Link to this definition")
* acHeaderHorzInsideColor* = 47*[](#AcTableStyleOverrides.acHeaderHorzInsideColor "Link to this definition")
- acHeaderHorzInsideLineWeight* = 77*[](#AcTableStyleOverrides.acHeaderHorzInsideLineWeight "Link to this definition")
* acHeaderHorzInsideVisibility* = 107*[](#AcTableStyleOverrides.acHeaderHorzInsideVisibility "Link to this definition")
- acHeaderHorzTopColor* = 46*[](#AcTableStyleOverrides.acHeaderHorzTopColor "Link to this definition")
* acHeaderHorzTopLineWeight* = 76*[](#AcTableStyleOverrides.acHeaderHorzTopLineWeight "Link to this definition")
- acHeaderHorzTopVisibility* = 106*[](#AcTableStyleOverrides.acHeaderHorzTopVisibility "Link to this definition")
* acHeaderRowAlignment* = 16*[](#AcTableStyleOverrides.acHeaderRowAlignment "Link to this definition")
- acHeaderRowColor* = 7*[](#AcTableStyleOverrides.acHeaderRowColor "Link to this definition")
* acHeaderRowDataType* = 25*[](#AcTableStyleOverrides.acHeaderRowDataType "Link to this definition")
- acHeaderRowFillColor* = 13*[](#AcTableStyleOverrides.acHeaderRowFillColor "Link to this definition")
* acHeaderRowFillNone* = 10*[](#AcTableStyleOverrides.acHeaderRowFillNone "Link to this definition")
- acHeaderRowTextHeight* = 22*[](#AcTableStyleOverrides.acHeaderRowTextHeight "Link to this definition")
* acHeaderRowTextStyle* = 19*[](#AcTableStyleOverrides.acHeaderRowTextStyle "Link to this definition")
- acHeaderSuppressed* = 2*[](#AcTableStyleOverrides.acHeaderSuppressed "Link to this definition")
* acHeaderVertInsideColor* = 50*[](#AcTableStyleOverrides.acHeaderVertInsideColor "Link to this definition")
- acHeaderVertInsideLineWeight* = 80*[](#AcTableStyleOverrides.acHeaderVertInsideLineWeight "Link to this definition")
* acHeaderVertInsideVisibility* = 110*[](#AcTableStyleOverrides.acHeaderVertInsideVisibility "Link to this definition")
- acHeaderVertLeftColor* = 49*[](#AcTableStyleOverrides.acHeaderVertLeftColor "Link to this definition")
* acHeaderVertLeftLineWeight* = 79*[](#AcTableStyleOverrides.acHeaderVertLeftLineWeight "Link to this definition")
- acHeaderVertLeftVisibility* = 109*[](#AcTableStyleOverrides.acHeaderVertLeftVisibility "Link to this definition")
* acHeaderVertRightColor* = 51*[](#AcTableStyleOverrides.acHeaderVertRightColor "Link to this definition")
- acHeaderVertRightLineWeight* = 81*[](#AcTableStyleOverrides.acHeaderVertRightLineWeight "Link to this definition")
* acHeaderVertRightVisibility* = 111*[](#AcTableStyleOverrides.acHeaderVertRightVisibility "Link to this definition")
- acHorzCellMargin* = 4*[](#AcTableStyleOverrides.acHorzCellMargin "Link to this definition")
* acTitleHorzBottomColor* = 42*[](#AcTableStyleOverrides.acTitleHorzBottomColor "Link to this definition")
- acTitleHorzBottomLineWeight* = 72*[](#AcTableStyleOverrides.acTitleHorzBottomLineWeight "Link to this definition")
* acTitleHorzBottomVisibility* = 102*[](#AcTableStyleOverrides.acTitleHorzBottomVisibility "Link to this definition")
- acTitleHorzInsideColor* = 41*[](#AcTableStyleOverrides.acTitleHorzInsideColor "Link to this definition")
* acTitleHorzInsideLineWeight* = 71*[](#AcTableStyleOverrides.acTitleHorzInsideLineWeight "Link to this definition")
- acTitleHorzInsideVisibility* = 101*[](#AcTableStyleOverrides.acTitleHorzInsideVisibility "Link to this definition")
* acTitleHorzTopColor* = 40*[](#AcTableStyleOverrides.acTitleHorzTopColor "Link to this definition")
- acTitleHorzTopLineWeight* = 70*[](#AcTableStyleOverrides.acTitleHorzTopLineWeight "Link to this definition")
* acTitleHorzTopVisibility* = 100*[](#AcTableStyleOverrides.acTitleHorzTopVisibility "Link to this definition")
- acTitleRowAlignment* = 15*[](#AcTableStyleOverrides.acTitleRowAlignment "Link to this definition")
* acTitleRowColor* = 6*[](#AcTableStyleOverrides.acTitleRowColor "Link to this definition")
- acTitleRowDataType* = 24*[](#AcTableStyleOverrides.acTitleRowDataType "Link to this definition")
* acTitleRowFillColor* = 12*[](#AcTableStyleOverrides.acTitleRowFillColor "Link to this definition")
- acTitleRowFillNone* = 9*[](#AcTableStyleOverrides.acTitleRowFillNone "Link to this definition")
* acTitleRowTextHeight* = 21*[](#AcTableStyleOverrides.acTitleRowTextHeight "Link to this definition")
- acTitleRowTextStyle* = 18*[](#AcTableStyleOverrides.acTitleRowTextStyle "Link to this definition")
* acTitleSuppressed* = 1*[](#AcTableStyleOverrides.acTitleSuppressed "Link to this definition")
- acTitleVertInsideColor* = 44*[](#AcTableStyleOverrides.acTitleVertInsideColor "Link to this definition")
* acTitleVertInsideLineWeight* = 74*[](#AcTableStyleOverrides.acTitleVertInsideLineWeight "Link to this definition")
- acTitleVertInsideVisibility* = 104*[](#AcTableStyleOverrides.acTitleVertInsideVisibility "Link to this definition")
* acTitleVertLeftColor* = 43*[](#AcTableStyleOverrides.acTitleVertLeftColor "Link to this definition")
- acTitleVertLeftLineWeight* = 73*[](#AcTableStyleOverrides.acTitleVertLeftLineWeight "Link to this definition")
* acTitleVertLeftVisibility* = 103*[](#AcTableStyleOverrides.acTitleVertLeftVisibility "Link to this definition")
- acTitleVertRightColor* = 45*[](#AcTableStyleOverrides.acTitleVertRightColor "Link to this definition")
* acTitleVertRightLineWeight* = 75*[](#AcTableStyleOverrides.acTitleVertRightLineWeight "Link to this definition")
- acTitleVertRightVisibility* = 105*[](#AcTableStyleOverrides.acTitleVertRightVisibility "Link to this definition")
* acVertCellMargin* = 5*[](#AcTableStyleOverrides.acVertCellMargin "Link to this definition")
## AcTextAlignmentType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcTextAlignmentType "Direct link to AcTextAlignmentType")
* *class *viktor.external.autocad.enums.AcTextAlignmentType(*\*values*)[](#AcTextAlignmentType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcTextAlignmentType` values, mirroring the product API’s names so code reads like its docs.
* acCenterAlignment* = 1*[](#AcTextAlignmentType.acCenterAlignment "Link to this definition")
- acLeftAlignment* = 0*[](#AcTextAlignmentType.acLeftAlignment "Link to this definition")
* acRightAlignment* = 2*[](#AcTextAlignmentType.acRightAlignment "Link to this definition")
## AcTextAngleType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcTextAngleType "Direct link to AcTextAngleType")
* *class *viktor.external.autocad.enums.AcTextAngleType(*\*values*)[](#AcTextAngleType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcTextAngleType` values, mirroring the product API’s names so code reads like its docs.
* acAlwaysRightReadingAngle* = 2*[](#AcTextAngleType.acAlwaysRightReadingAngle "Link to this definition")
- acHorizontalAngle* = 1*[](#AcTextAngleType.acHorizontalAngle "Link to this definition")
* acInsertAngle* = 0*[](#AcTextAngleType.acInsertAngle "Link to this definition")
## AcTextAttachmentDirection[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcTextAttachmentDirection "Direct link to AcTextAttachmentDirection")
* *class *viktor.external.autocad.enums.AcTextAttachmentDirection(*\*values*)[](#AcTextAttachmentDirection "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcTextAttachmentDirection` values, mirroring the product API’s names so code reads like its docs.
* acAttachmentHorizontal* = 0*[](#AcTextAttachmentDirection.acAttachmentHorizontal "Link to this definition")
- acAttachmentVertical* = 1*[](#AcTextAttachmentDirection.acAttachmentVertical "Link to this definition")
## AcTextAttachmentType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcTextAttachmentType "Direct link to AcTextAttachmentType")
* *class *viktor.external.autocad.enums.AcTextAttachmentType(*\*values*)[](#AcTextAttachmentType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcTextAttachmentType` values, mirroring the product API’s names so code reads like its docs.
* acAttachmentAllLine* = 8*[](#AcTextAttachmentType.acAttachmentAllLine "Link to this definition")
- acAttachmentBottomLine* = 7*[](#AcTextAttachmentType.acAttachmentBottomLine "Link to this definition")
* acAttachmentBottomOfBottom* = 6*[](#AcTextAttachmentType.acAttachmentBottomOfBottom "Link to this definition")
- acAttachmentBottomOfTop* = 2*[](#AcTextAttachmentType.acAttachmentBottomOfTop "Link to this definition")
* acAttachmentBottomOfTopLine* = 3*[](#AcTextAttachmentType.acAttachmentBottomOfTopLine "Link to this definition")
- acAttachmentMiddle* = 4*[](#AcTextAttachmentType.acAttachmentMiddle "Link to this definition")
* acAttachmentMiddleOfBottom* = 5*[](#AcTextAttachmentType.acAttachmentMiddleOfBottom "Link to this definition")
- acAttachmentMiddleOfTop* = 1*[](#AcTextAttachmentType.acAttachmentMiddleOfTop "Link to this definition")
* acAttachmentTopOfTop* = 0*[](#AcTextAttachmentType.acAttachmentTopOfTop "Link to this definition")
## AcTextFontStyle[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcTextFontStyle "Direct link to AcTextFontStyle")
* *class *viktor.external.autocad.enums.AcTextFontStyle(*\*values*)[](#AcTextFontStyle "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcTextFontStyle` values, mirroring the product API’s names so code reads like its docs.
* acFontBold* = 2*[](#AcTextFontStyle.acFontBold "Link to this definition")
- acFontBoldItalic* = 3*[](#AcTextFontStyle.acFontBoldItalic "Link to this definition")
* acFontItalic* = 1*[](#AcTextFontStyle.acFontItalic "Link to this definition")
- acFontRegular* = 0*[](#AcTextFontStyle.acFontRegular "Link to this definition")
## AcTextGenerationFlag[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcTextGenerationFlag "Direct link to AcTextGenerationFlag")
* *class *viktor.external.autocad.enums.AcTextGenerationFlag(*\*values*)[](#AcTextGenerationFlag "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcTextGenerationFlag` values, mirroring the product API’s names so code reads like its docs.
* acTextFlagBackward* = 2*[](#AcTextGenerationFlag.acTextFlagBackward "Link to this definition")
- acTextFlagUpsideDown* = 4*[](#AcTextGenerationFlag.acTextFlagUpsideDown "Link to this definition")
## AcToolbarDockStatus[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcToolbarDockStatus "Direct link to AcToolbarDockStatus")
* *class *viktor.external.autocad.enums.AcToolbarDockStatus(*\*values*)[](#AcToolbarDockStatus "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcToolbarDockStatus` values, mirroring the product API’s names so code reads like its docs.
* acToolbarDockBottom* = 1*[](#AcToolbarDockStatus.acToolbarDockBottom "Link to this definition")
- acToolbarDockLeft* = 2*[](#AcToolbarDockStatus.acToolbarDockLeft "Link to this definition")
* acToolbarDockRight* = 3*[](#AcToolbarDockStatus.acToolbarDockRight "Link to this definition")
- acToolbarDockTop* = 0*[](#AcToolbarDockStatus.acToolbarDockTop "Link to this definition")
* acToolbarFloating* = 4*[](#AcToolbarDockStatus.acToolbarFloating "Link to this definition")
## AcToolbarItemType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcToolbarItemType "Direct link to AcToolbarItemType")
* *class *viktor.external.autocad.enums.AcToolbarItemType(*\*values*)[](#AcToolbarItemType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcToolbarItemType` values, mirroring the product API’s names so code reads like its docs.
* acToolbarButton* = 0*[](#AcToolbarItemType.acToolbarButton "Link to this definition")
- acToolbarControl* = 2*[](#AcToolbarItemType.acToolbarControl "Link to this definition")
* acToolbarFlyout* = 3*[](#AcToolbarItemType.acToolbarFlyout "Link to this definition")
- acToolbarSeparator* = 1*[](#AcToolbarItemType.acToolbarSeparator "Link to this definition")
## AcUnderlayLayerOverrideType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcUnderlayLayerOverrideType "Direct link to AcUnderlayLayerOverrideType")
* *class *viktor.external.autocad.enums.AcUnderlayLayerOverrideType(*\*values*)[](#AcUnderlayLayerOverrideType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcUnderlayLayerOverrideType` values, mirroring the product API’s names so code reads like its docs.
* acApplied* = 1*[](#AcUnderlayLayerOverrideType.acApplied "Link to this definition")
- acNoOverrides* = 0*[](#AcUnderlayLayerOverrideType.acNoOverrides "Link to this definition")
## AcUnits[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcUnits "Direct link to AcUnits")
* *class *viktor.external.autocad.enums.AcUnits(*\*values*)[](#AcUnits "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcUnits` values, mirroring the product API’s names so code reads like its docs.
* acArchitectural* = 4*[](#AcUnits.acArchitectural "Link to this definition")
- acDecimal* = 2*[](#AcUnits.acDecimal "Link to this definition")
* acDefaultUnits* = -1*[](#AcUnits.acDefaultUnits "Link to this definition")
- acEngineering* = 3*[](#AcUnits.acEngineering "Link to this definition")
* acFractional* = 5*[](#AcUnits.acFractional "Link to this definition")
- acScientific* = 1*[](#AcUnits.acScientific "Link to this definition")
## AcValueDataType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcValueDataType "Direct link to AcValueDataType")
* *class *viktor.external.autocad.enums.AcValueDataType(*\*values*)[](#AcValueDataType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcValueDataType` values, mirroring the product API’s names so code reads like its docs.
* acBuffer* = 128*[](#AcValueDataType.acBuffer "Link to this definition")
- acDate* = 8*[](#AcValueDataType.acDate "Link to this definition")
* acDouble* = 2*[](#AcValueDataType.acDouble "Link to this definition")
- acGeneral* = 512*[](#AcValueDataType.acGeneral "Link to this definition")
* acLong* = 1*[](#AcValueDataType.acLong "Link to this definition")
- acObjectId* = 64*[](#AcValueDataType.acObjectId "Link to this definition")
* acPoint2d* = 16*[](#AcValueDataType.acPoint2d "Link to this definition")
- acPoint3d* = 32*[](#AcValueDataType.acPoint3d "Link to this definition")
* acResbuf* = 256*[](#AcValueDataType.acResbuf "Link to this definition")
- acString* = 4*[](#AcValueDataType.acString "Link to this definition")
* acUnknownDataType* = 0*[](#AcValueDataType.acUnknownDataType "Link to this definition")
## AcValueUnitType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcValueUnitType "Direct link to AcValueUnitType")
* *class *viktor.external.autocad.enums.AcValueUnitType(*\*values*)[](#AcValueUnitType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcValueUnitType` values, mirroring the product API’s names so code reads like its docs.
* acUnitAngle* = 2*[](#AcValueUnitType.acUnitAngle "Link to this definition")
- acUnitArea* = 4*[](#AcValueUnitType.acUnitArea "Link to this definition")
* acUnitDistance* = 1*[](#AcValueUnitType.acUnitDistance "Link to this definition")
- acUnitVolume* = 8*[](#AcValueUnitType.acUnitVolume "Link to this definition")
* acUnitless* = 0*[](#AcValueUnitType.acUnitless "Link to this definition")
## AcVerticalAlignment[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcVerticalAlignment "Direct link to AcVerticalAlignment")
* *class *viktor.external.autocad.enums.AcVerticalAlignment(*\*values*)[](#AcVerticalAlignment "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcVerticalAlignment` values, mirroring the product API’s names so code reads like its docs.
* acVerticalAlignmentBaseline* = 0*[](#AcVerticalAlignment.acVerticalAlignmentBaseline "Link to this definition")
- acVerticalAlignmentBottom* = 1*[](#AcVerticalAlignment.acVerticalAlignmentBottom "Link to this definition")
* acVerticalAlignmentMiddle* = 2*[](#AcVerticalAlignment.acVerticalAlignmentMiddle "Link to this definition")
- acVerticalAlignmentTop* = 3*[](#AcVerticalAlignment.acVerticalAlignmentTop "Link to this definition")
## AcVerticalTextAttachmentType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcVerticalTextAttachmentType "Direct link to AcVerticalTextAttachmentType")
* *class *viktor.external.autocad.enums.AcVerticalTextAttachmentType(*\*values*)[](#AcVerticalTextAttachmentType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcVerticalTextAttachmentType` values, mirroring the product API’s names so code reads like its docs.
* acAttachmentCenter* = 0*[](#AcVerticalTextAttachmentType.acAttachmentCenter "Link to this definition")
- acAttachmentLinedCenter* = 1*[](#AcVerticalTextAttachmentType.acAttachmentLinedCenter "Link to this definition")
## AcViewportScale[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcViewportScale "Direct link to AcViewportScale")
* *class *viktor.external.autocad.enums.AcViewportScale(*\*values*)[](#AcViewportScale "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcViewportScale` values, mirroring the product API’s names so code reads like its docs.
* acVp100\_1* = 18*[](#AcViewportScale.acVp100_1 "Link to this definition")
- acVp10\_1* = 17*[](#AcViewportScale.acVp10_1 "Link to this definition")
* acVp1\_1* = 2*[](#AcViewportScale.acVp1_1 "Link to this definition")
- acVp1\_10* = 7*[](#AcViewportScale.acVp1_10 "Link to this definition")
* acVp1\_100* = 13*[](#AcViewportScale.acVp1_100 "Link to this definition")
- acVp1\_128in\_1ft* = 19*[](#AcViewportScale.acVp1_128in_1ft "Link to this definition")
* acVp1\_16* = 8*[](#AcViewportScale.acVp1_16 "Link to this definition")
- acVp1\_16in\_1ft* = 22*[](#AcViewportScale.acVp1_16in_1ft "Link to this definition")
* acVp1\_2* = 3*[](#AcViewportScale.acVp1_2 "Link to this definition")
- acVp1\_20* = 9*[](#AcViewportScale.acVp1_20 "Link to this definition")
* acVp1\_2in\_1ft* = 28*[](#AcViewportScale.acVp1_2in_1ft "Link to this definition")
- acVp1\_30* = 10*[](#AcViewportScale.acVp1_30 "Link to this definition")
* acVp1\_32in\_1ft* = 21*[](#AcViewportScale.acVp1_32in_1ft "Link to this definition")
- acVp1\_4* = 4*[](#AcViewportScale.acVp1_4 "Link to this definition")
* acVp1\_40* = 11*[](#AcViewportScale.acVp1_40 "Link to this definition")
- acVp1\_4in\_1ft* = 26*[](#AcViewportScale.acVp1_4in_1ft "Link to this definition")
* acVp1\_5* = 5*[](#AcViewportScale.acVp1_5 "Link to this definition")
- acVp1\_50* = 12*[](#AcViewportScale.acVp1_50 "Link to this definition")
* acVp1\_64in\_1ft* = 20*[](#AcViewportScale.acVp1_64in_1ft "Link to this definition")
- acVp1\_8* = 6*[](#AcViewportScale.acVp1_8 "Link to this definition")
* acVp1\_8in\_1ft* = 24*[](#AcViewportScale.acVp1_8in_1ft "Link to this definition")
- acVp1and1\_2in\_1ft* = 31*[](#AcViewportScale.acVp1and1_2in_1ft "Link to this definition")
* acVp1ft\_1ft* = 34*[](#AcViewportScale.acVp1ft_1ft "Link to this definition")
- acVp1in\_1ft* = 30*[](#AcViewportScale.acVp1in_1ft "Link to this definition")
* acVp2\_1* = 14*[](#AcViewportScale.acVp2_1 "Link to this definition")
- acVp3\_16in\_1ft* = 25*[](#AcViewportScale.acVp3_16in_1ft "Link to this definition")
* acVp3\_32in\_1ft* = 23*[](#AcViewportScale.acVp3_32in_1ft "Link to this definition")
- acVp3\_4in\_1ft* = 29*[](#AcViewportScale.acVp3_4in_1ft "Link to this definition")
* acVp3\_8in\_1ft* = 27*[](#AcViewportScale.acVp3_8in_1ft "Link to this definition")
- acVp3in\_1ft* = 32*[](#AcViewportScale.acVp3in_1ft "Link to this definition")
* acVp4\_1* = 15*[](#AcViewportScale.acVp4_1 "Link to this definition")
- acVp6in\_1ft* = 33*[](#AcViewportScale.acVp6in_1ft "Link to this definition")
* acVp8\_1* = 16*[](#AcViewportScale.acVp8_1 "Link to this definition")
- acVpCustomScale* = 1*[](#AcViewportScale.acVpCustomScale "Link to this definition")
* acVpScaleToFit* = 0*[](#AcViewportScale.acVpScaleToFit "Link to this definition")
## AcViewportSplitType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcViewportSplitType "Direct link to AcViewportSplitType")
* *class *viktor.external.autocad.enums.AcViewportSplitType(*\*values*)[](#AcViewportSplitType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcViewportSplitType` values, mirroring the product API’s names so code reads like its docs.
* acViewport2Horizontal* = 0*[](#AcViewportSplitType.acViewport2Horizontal "Link to this definition")
- acViewport2Vertical* = 1*[](#AcViewportSplitType.acViewport2Vertical "Link to this definition")
* acViewport3Above* = 6*[](#AcViewportSplitType.acViewport3Above "Link to this definition")
- acViewport3Below* = 7*[](#AcViewportSplitType.acViewport3Below "Link to this definition")
* acViewport3Horizontal* = 4*[](#AcViewportSplitType.acViewport3Horizontal "Link to this definition")
- acViewport3Left* = 2*[](#AcViewportSplitType.acViewport3Left "Link to this definition")
* acViewport3Right* = 3*[](#AcViewportSplitType.acViewport3Right "Link to this definition")
- acViewport3Vertical* = 5*[](#AcViewportSplitType.acViewport3Vertical "Link to this definition")
* acViewport4* = 8*[](#AcViewportSplitType.acViewport4 "Link to this definition")
## AcWindowState[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcWindowState "Direct link to AcWindowState")
* *class *viktor.external.autocad.enums.AcWindowState(*\*values*)[](#AcWindowState "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcWindowState` values, mirroring the product API’s names so code reads like its docs.
* acMax* = 3*[](#AcWindowState.acMax "Link to this definition")
- acMin* = 2*[](#AcWindowState.acMin "Link to this definition")
* acNorm* = 1*[](#AcWindowState.acNorm "Link to this definition")
## AcWireframeType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcWireframeType "Direct link to AcWireframeType")
* *class *viktor.external.autocad.enums.AcWireframeType(*\*values*)[](#AcWireframeType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcWireframeType` values, mirroring the product API’s names so code reads like its docs.
* acIsolines* = 0*[](#AcWireframeType.acIsolines "Link to this definition")
- acIsoparms* = 1*[](#AcWireframeType.acIsoparms "Link to this definition")
## AcXRefDemandLoad[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcXRefDemandLoad "Direct link to AcXRefDemandLoad")
* *class *viktor.external.autocad.enums.AcXRefDemandLoad(*\*values*)[](#AcXRefDemandLoad "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcXRefDemandLoad` values, mirroring the product API’s names so code reads like its docs.
* acDemandLoadDisabled* = 0*[](#AcXRefDemandLoad.acDemandLoadDisabled "Link to this definition")
- acDemandLoadEnabled* = 1*[](#AcXRefDemandLoad.acDemandLoadEnabled "Link to this definition")
* acDemandLoadEnabledWithCopy* = 2*[](#AcXRefDemandLoad.acDemandLoadEnabledWithCopy "Link to this definition")
## AcZoomScaleType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcZoomScaleType "Direct link to AcZoomScaleType")
* *class *viktor.external.autocad.enums.AcZoomScaleType(*\*values*)[](#AcZoomScaleType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcZoomScaleType` values, mirroring the product API’s names so code reads like its docs.
* acZoomScaledAbsolute* = 0*[](#AcZoomScaleType.acZoomScaledAbsolute "Link to this definition")
- acZoomScaledRelative* = 1*[](#AcZoomScaleType.acZoomScaledRelative "Link to this definition")
* acZoomScaledRelativePSpace* = 2*[](#AcZoomScaleType.acZoomScaledRelativePSpace "Link to this definition")
## AcadSecurityParamsConstants[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcadSecurityParamsConstants "Direct link to AcadSecurityParamsConstants")
* *class *viktor.external.autocad.enums.AcadSecurityParamsConstants(*\*values*)[](#AcadSecurityParamsConstants "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcadSecurityParamsConstants` values, mirroring the product API’s names so code reads like its docs.
* ACADSECURITYPARAMS\_ALGID\_RC4* = 26625*[](#AcadSecurityParamsConstants.ACADSECURITYPARAMS_ALGID_RC4 "Link to this definition")
## AcadSecurityParamsType[](https://docs.viktor.ai/sdk/api/external/autocad/.md#_AcadSecurityParamsType "Direct link to AcadSecurityParamsType")
* *class *viktor.external.autocad.enums.AcadSecurityParamsType(*\*values*)[](#AcadSecurityParamsType "Link to this definition")
Bases: `IntEnum`
New in 14.35.0
AutoCAD `AcadSecurityParamsType` values, mirroring the product API’s names so code reads like its docs.
* ACADSECURITYPARAMS\_ADD\_TIMESTAMP* = 32*[](#AcadSecurityParamsType.ACADSECURITYPARAMS_ADD_TIMESTAMP "Link to this definition")
- ACADSECURITYPARAMS\_ENCRYPT\_DATA* = 1*[](#AcadSecurityParamsType.ACADSECURITYPARAMS_ENCRYPT_DATA "Link to this definition")
* ACADSECURITYPARAMS\_ENCRYPT\_PROPS* = 2*[](#AcadSecurityParamsType.ACADSECURITYPARAMS_ENCRYPT_PROPS "Link to this definition")
- ACADSECURITYPARAMS\_SIGN\_DATA* = 16*[](#AcadSecurityParamsType.ACADSECURITYPARAMS_SIGN_DATA "Link to this definition")
---
# viktor.external.autodesk
## AutodeskFile[](https://docs.viktor.ai/sdk/api/external/autodesk/.md#_AutodeskFile "Direct link to AutodeskFile")
* *class *viktor.external.autodesk.AutodeskFile(*url*)[](#AutodeskFile "Link to this definition")
New in v14.25.0
Represents a file stored on Autodesk cloud storage ()
Example:
```
import viktor as vkt
# Set up OAuth2 integration to get access token
integration = vkt.external.OAuth2Integration("autodesk-integration")
token = integration.get_access_token()
# Get the AutodeskFile from a parametrization field
autodesk_file = params.autodesk_file # value of AutodeskFileField
# Get the AEC Data Model element group ID (requires API call)
element_group_id = autodesk_file.get_aec_data_model_element_group_id(token)
print(f"The element group id is: {element_group_id}")
# Access file properties and metadata:
project_id = autodesk_file.project_id # Can be extracted from URL
urn = autodesk_file.urn # Get the unique resource name
hub_id = autodesk_file.get_hub_id(token) # Requires API call
region = autodesk_file.get_region(token) # Requires API call
```
* get\_aec\_data\_model\_element\_group\_id(*access\_token*)[](#AutodeskFile.get_aec_data_model_element_group_id "Link to this definition")
New in v14.26.0
Get the AEC Data Model ElementGroup ID associated with this file.
* Return type:
`str`
- get\_hub\_id(*access\_token*)[](#AutodeskFile.get_hub_id "Link to this definition")
New in v14.26.0
Get the id of the hub this file belongs to.
* Return type:
`str`
* get\_latest\_version(*access\_token*)[](#AutodeskFile.get_latest_version "Link to this definition")
Get the latest version of the file on Autodesk cloud storage.
* Parameters:
**access\_token** (`str`) – Autodesk Platform Services token to access the file.
* Return type:
[`AutodeskFileVersion`](#AutodeskFileVersion "viktor.external.autodesk.AutodeskFileVersion")
- get\_region(*access\_token*)[](#AutodeskFile.get_region "Link to this definition")
New in v14.26.0
Get the region of the hub this file belongs to.
* Return type:
`str`
* *property *project\_id*: str*[](#AutodeskFile.project_id "Link to this definition")
New in v14.26.0
Get the id of the project this file belongs to.
- *property *url*: str*[](#AutodeskFile.url "Link to this definition")
URL of the file on Autodesk cloud storage.
* *property *urn*: str*[](#AutodeskFile.urn "Link to this definition")
New in v14.26.0
Get the unique resource name (also called “id”) of this file on Autodesk cloud storage.
## AutodeskFileVersion[](https://docs.viktor.ai/sdk/api/external/autodesk/.md#_AutodeskFileVersion "Direct link to AutodeskFileVersion")
* *class *viktor.external.autodesk.AutodeskFileVersion(*\_access\_token*, *\_data*)[](#AutodeskFileVersion "Link to this definition")
New in v14.25.0
Warning
Do not instantiate this class directly, it is created from [`AutodeskFile`](#AutodeskFile "viktor.external.autodesk.AutodeskFile").
* *property *attributes*: dict*[](#AutodeskFileVersion.attributes "Link to this definition")
Get the attributes of this version of the file on Autodesk cloud storage.
- get\_file()[](#AutodeskFileVersion.get_file "Link to this definition")
Download the content of this version of the file from Autodesk cloud storage.
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* *property *storage\_url*: str | None*[](#AutodeskFileVersion.storage_url "Link to this definition")
New in v14.26.0
Get the storage URL of this version of the file.
- *property *urn*: str*[](#AutodeskFileVersion.urn "Link to this definition")
Get the unique resource name (also called “id”) of this version of the file on Autodesk cloud storage.
---
# viktor.external.axisvm
## AxisVMAnalysis[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_AxisVMAnalysis "Direct link to AxisVMAnalysis")
* *class *viktor.external.axisvm.AxisVMAnalysis(*model*, *\**, *return\_results=True*, *return\_model=False*, *report\_template=None*)[](#AxisVMAnalysis "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
Perform an analysis using AxisVM on a third-party worker. To start an analysis call the method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"), with an appropriate timeout (in seconds).
To retrieve the results call the method [`get_results()`](#AxisVMAnalysis.get_results "viktor.external.axisvm.AxisVMAnalysis.get_results"), after [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"). The model file can be retrieved by calling [`get_model_file()`](#AxisVMAnalysis.get_model_file "viktor.external.axisvm.AxisVMAnalysis.get_model_file") and the result by calling [`get_result_file()`](#AxisVMAnalysis.get_result_file "viktor.external.axisvm.AxisVMAnalysis.get_result_file").
Usage:
```
axisvm_analysis = AxisVMAnalysis(model, return_results=True, return_model=True)
axisvm_analysis.execute(timeout=10)
results = axisvm_analysis.get_results()
model_file = axisvm_analysis.get_model_file()
result_file = axisvm_analysis.get_result_file()
```
Exceptions which can be raised during calculation:
> * [`ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
* **model** ([`Model`](#Model "viktor.external.axisvm.Model")) – AxisVM model ([`Model`](#Model "viktor.external.axisvm.Model"))
* **return\_results** (`bool`) – If True, an analysis will be run and the result file is returned.
* **return\_model** (`bool`) – If True, the model file is returned.
* **report\_template** (`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – (optional) report template that is added to AxisVM file
- get\_model\_file(*\**, *as\_file=False*)[](#AxisVMAnalysis.get_model_file "Link to this definition")
Retrieve the model file (only if return\_model = True). [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") must be called first.
* Parameters:
**as\_file** (`bool`) – Return as BytesIO (default) or File
New in v13.5.0
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
* get\_result\_file(*\**, *as\_file=False*)[](#AxisVMAnalysis.get_result_file "Link to this definition")
Retrieve the result file (only if return\_results = True). [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") must be called first.
* Parameters:
**as\_file** (`bool`) – Return as BytesIO (default) or File
New in v13.5.0
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
- get\_results()[](#AxisVMAnalysis.get_results "Link to this definition")
Retrieve the results (only if return\_results = True). `execute()` must be called first.
The format of the returned dictionary is:
```
{
'Forces': ,
'Displacements': ,
'Sections':
}
```
* Return type:
`dict`
## CircleArc[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_CircleArc "Direct link to CircleArc")
* *class *viktor.external.axisvm.CircleArc(*center*, *normal\_vector*, *alpha*)[](#CircleArc "Link to this definition")
Circular arc defined by its center, normal vector and angle. Used in various methods, in conjunction with a start and end point.
* Parameters:
* **center** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of the arc’s center point.
* **normal\_vector** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) component \[m] of the arc plane’s normal vector.
* **alpha** (`float`) – signed angle \[rad]. Positive angle is counterclockwise, from the start point.
## CrossSection[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_CrossSection "Direct link to CrossSection")
* *class *viktor.external.axisvm.CrossSection(*id\_*, *name*)[](#CrossSection "Link to this definition")
Bases: [`Object`](#Object "viktor.external.axisvm.Object")
Do not use this \_\_init\_\_ directly, but create the object from [`Model`](#Model "viktor.external.axisvm.Model")
* *class *Process(*\*values*)[](#CrossSection.Process "Link to this definition")
Bases: `Enum`
Manufacturing process.
* COLD\_FORMED*: [`Process`](#CrossSection.Process "viktor.external.axisvm.CrossSection.Process")** = 3*[](#CrossSection.Process.COLD_FORMED "Link to this definition")
- OTHER*: [`Process`](#CrossSection.Process "viktor.external.axisvm.CrossSection.Process")** = 0*[](#CrossSection.Process.OTHER "Link to this definition")
* ROLLED*: [`Process`](#CrossSection.Process "viktor.external.axisvm.CrossSection.Process")** = 1*[](#CrossSection.Process.ROLLED "Link to this definition")
- WELDED*: [`Process`](#CrossSection.Process "viktor.external.axisvm.CrossSection.Process")** = 2*[](#CrossSection.Process.WELDED "Link to this definition")
- *property *name*: str*[](#CrossSection.name "Link to this definition")
Name of the cross-section.
## CrossSectionInterface[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_CrossSectionInterface "Direct link to CrossSectionInterface")
* *class *viktor.external.axisvm.CrossSectionInterface[](#CrossSectionInterface "Link to this definition")
Bases: `_Interface`
Do not use this \_\_init\_\_ directly, but use [`Model.cross_sections`](#Model.cross_sections "viktor.external.axisvm.Model.cross_sections")
* create\_circular(*diameter*, *\**, *name=None*)[](#CrossSectionInterface.create_circular "Link to this definition")
Create a circular cross-section with given diameter.
* Parameters:
* **diameter** (`float`) – diameter \[m] of the cross-section.
* **name** (`str`) – name of the cross-section (must be unique) (default: auto).
* Return type:
[`CrossSection`](#CrossSection "viktor.external.axisvm.CrossSection")
- create\_rectangular(*width*, *height*, *\**, *process=Process.OTHER*, *name=None*)[](#CrossSectionInterface.create_rectangular "Link to this definition")
Create a rectangular cross-section with given width and height.
* Parameters:
* **width** (`float`) – width \[m] of the cross-section.
* **height** (`float`) – height \[m] of the cross-section.
* **process** ([`Process`](#CrossSection.Process "viktor.external.axisvm.CrossSection.Process")) – process (default: other).
* **name** (`str`) – name of the cross-section (must be unique) (default: auto).
* Return type:
[`CrossSection`](#CrossSection "viktor.external.axisvm.CrossSection")
## Domain[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_Domain "Direct link to Domain")
* *class *viktor.external.axisvm.Domain(*id\_*, *interface*)[](#Domain "Link to this definition")
Bases: [`Object`](#Object "viktor.external.axisvm.Object")
Do not use this \_\_init\_\_ directly, but create the object from [`Model`](#Model "viktor.external.axisvm.Model")
* *class *EccentricityType(*\*values*)[](#Domain.EccentricityType "Link to this definition")
Bases: `Enum`
Type of eccentricity.
* BOTTOM\_ALIGNED*: [`EccentricityType`](#Domain.EccentricityType "viktor.external.axisvm.Domain.EccentricityType")** = 5*[](#Domain.EccentricityType.BOTTOM_ALIGNED "Link to this definition")
- CONSTANT*: [`EccentricityType`](#Domain.EccentricityType "viktor.external.axisvm.Domain.EccentricityType")** = 1*[](#Domain.EccentricityType.CONSTANT "Link to this definition")
* ONE\_WAY*: [`EccentricityType`](#Domain.EccentricityType "viktor.external.axisvm.Domain.EccentricityType")** = 2*[](#Domain.EccentricityType.ONE_WAY "Link to this definition")
- TOP\_ALIGNED*: [`EccentricityType`](#Domain.EccentricityType "viktor.external.axisvm.Domain.EccentricityType")** = 4*[](#Domain.EccentricityType.TOP_ALIGNED "Link to this definition")
* TWO\_WAY*: [`EccentricityType`](#Domain.EccentricityType "viktor.external.axisvm.Domain.EccentricityType")** = 3*[](#Domain.EccentricityType.TWO_WAY "Link to this definition")
- *class *MeshGeometry(*\*values*)[](#Domain.MeshGeometry "Link to this definition")
Bases: `Enum`
Mesh geometry type.
* MIXED*: [`MeshGeometry`](#Domain.MeshGeometry "viktor.external.axisvm.Domain.MeshGeometry")** = 2*[](#Domain.MeshGeometry.MIXED "Link to this definition")
- QUAD*: [`MeshGeometry`](#Domain.MeshGeometry "viktor.external.axisvm.Domain.MeshGeometry")** = 1*[](#Domain.MeshGeometry.QUAD "Link to this definition")
* TRIANGLE*: [`MeshGeometry`](#Domain.MeshGeometry "viktor.external.axisvm.Domain.MeshGeometry")** = 0*[](#Domain.MeshGeometry.TRIANGLE "Link to this definition")
* *class *MeshType(*\*values*)[](#Domain.MeshType "Link to this definition")
Bases: `Enum`
Contour division method.
* ADAPTIVE*: [`MeshType`](#Domain.MeshType "viktor.external.axisvm.Domain.MeshType")** = 0*[](#Domain.MeshType.ADAPTIVE "Link to this definition")
- UNIFORM*: [`MeshType`](#Domain.MeshType "viktor.external.axisvm.Domain.MeshType")** = 1*[](#Domain.MeshType.UNIFORM "Link to this definition")
- *class *SurfaceType(*\*values*)[](#Domain.SurfaceType "Link to this definition")
Bases: `Enum`
Finite element type.
* HOLE*: [`SurfaceType`](#Domain.SurfaceType "viktor.external.axisvm.Domain.SurfaceType")** = 0*[](#Domain.SurfaceType.HOLE "Link to this definition")
- MEMBRANE\_STRAIN*: [`SurfaceType`](#Domain.SurfaceType "viktor.external.axisvm.Domain.SurfaceType")** = 2*[](#Domain.SurfaceType.MEMBRANE_STRAIN "Link to this definition")
* MEMBRANE\_STRESS*: [`SurfaceType`](#Domain.SurfaceType "viktor.external.axisvm.Domain.SurfaceType")** = 1*[](#Domain.SurfaceType.MEMBRANE_STRESS "Link to this definition")
- PLATE*: [`SurfaceType`](#Domain.SurfaceType "viktor.external.axisvm.Domain.SurfaceType")** = 3*[](#Domain.SurfaceType.PLATE "Link to this definition")
* SHELL*: [`SurfaceType`](#Domain.SurfaceType "viktor.external.axisvm.Domain.SurfaceType")** = 4*[](#Domain.SurfaceType.SHELL "Link to this definition")
* generate\_mesh(*mesh\_geometry*, *mesh\_size*, *\**, *mesh\_type=MeshType.UNIFORM*, *fit\_to\_point\_loads=None*, *fit\_to\_line\_loads=None*, *fit\_to\_surface\_loads=None*, *quad\_mesh\_quality=2*)[](#Domain.generate_mesh "Link to this definition")
Generate a mesh on the domain.
* Parameters:
* **mesh\_geometry** ([`MeshGeometry`](#Domain.MeshGeometry "viktor.external.axisvm.Domain.MeshGeometry")) – mesh geometry type.
* **mesh\_size** (`float`) – average mesh size \[m].
* **mesh\_type** ([`MeshType`](#Domain.MeshType "viktor.external.axisvm.Domain.MeshType")) – contour division method (default: uniform).
* **fit\_to\_point\_loads** (`float`) – fit mesh to point loads (default: false).
* **fit\_to\_line\_loads** (`float`) – fit mesh to line loads (default: false).
* **fit\_to\_surface\_loads** (`float`) – fit mesh to surface loads (default: false)
* **quad\_mesh\_quality** (`int`) – smoothing quality (1-6) (default: 2)
* Return type:
`None`
- set\_eccentricity(*eccentricity\_type*, *\**, *ecc\_1=None*, *p1=None*, *ecc\_2=None*, *p2=None*, *ecc\_3=None*, *p3=None*)[](#Domain.set_eccentricity "Link to this definition")
Set eccentricity for the domain.
* Parameters:
* **eccentricity\_type** ([`EccentricityType`](#Domain.EccentricityType "viktor.external.axisvm.Domain.EccentricityType")) – type of eccentricity.
* **ecc\_1** (`float`) – eccentricity \[m] at reference point 1.
* **p1** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of reference point 1.
* **ecc\_2** (`float`) – eccentricity \[m] at reference point 2.
* **p2** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of reference point 2.
* **ecc\_3** (`float`) – eccentricity \[m] at reference point 3.
* **p3** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of reference point 3.
* Return type:
`None`
## DomainInterface[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_DomainInterface "Direct link to DomainInterface")
* *class *viktor.external.axisvm.DomainInterface[](#DomainInterface "Link to this definition")
Bases: `_Interface`
Do not use this \_\_init\_\_ directly, but use [`Model.domains`](#Model.domains "viktor.external.axisvm.Model.domains")
* create(*lines*, *\**, *surface\_type*, *thickness*, *material*)[](#DomainInterface.create "Link to this definition")
Create a domain from given lines.
* Parameters:
* **lines** (`List`\[[`Line`](#Line "viktor.external.axisvm.Line")]) – lines to create a domain from (lines must form a closed loop!).
* **surface\_type** ([`SurfaceType`](#Domain.SurfaceType "viktor.external.axisvm.Domain.SurfaceType")) – finite element surface type.
* **thickness** (`float`) – thickness \[m] of the surface.
* **material** ([`Material`](#Material "viktor.external.axisvm.Material")) – material of the surface.
* Return type:
[`Domain`](#Domain "viktor.external.axisvm.Domain")
- generate\_mesh\_on\_domains(*domains*, *mesh\_geometry*, *mesh\_size*, *\**, *mesh\_type=MeshType.UNIFORM*, *fit\_to\_point\_loads=None*, *fit\_to\_line\_loads=None*, *fit\_to\_surface\_loads=None*, *quad\_mesh\_quality=2*)[](#DomainInterface.generate_mesh_on_domains "Link to this definition")
Generate a mesh on one or more domains.
* Parameters:
* **domains** (`List`\[[`Domain`](#Domain "viktor.external.axisvm.Domain")]) – domain(s) to generate the mesh on.
* **mesh\_geometry** ([`MeshGeometry`](#Domain.MeshGeometry "viktor.external.axisvm.Domain.MeshGeometry")) – mesh geometry type.
* **mesh\_size** (`float`) – average mesh size \[m].
* **mesh\_type** ([`MeshType`](#Domain.MeshType "viktor.external.axisvm.Domain.MeshType")) – contour division method (default: uniform).
* **fit\_to\_point\_loads** (`float`) – fit mesh to point loads (default: false).
* **fit\_to\_line\_loads** (`float`) – fit mesh to line loads (default: false).
* **fit\_to\_surface\_loads** (`float`) – fit mesh to surface loads (default: false)
* **quad\_mesh\_quality** (`int`) – smoothing quality (1-6) (default: 2)
* Return type:
`None`
* set\_eccentricity(*domain*, *eccentricity\_type*, *\**, *ecc\_1=None*, *p1=None*, *ecc\_2=None*, *p2=None*, *ecc\_3=None*, *p3=None*)[](#DomainInterface.set_eccentricity "Link to this definition")
Set eccentricity for a domain.
* Parameters:
* **domain** ([`Domain`](#Domain "viktor.external.axisvm.Domain")) – domain to set eccentricity.
* **eccentricity\_type** ([`EccentricityType`](#Domain.EccentricityType "viktor.external.axisvm.Domain.EccentricityType")) – type of eccentricity.
* **ecc\_1** (`float`) – eccentricity \[m] at reference point 1.
* **p1** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of reference point 1.
* **ecc\_2** (`float`) – eccentricity \[m] at reference point 2.
* **p2** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of reference point 2.
* **ecc\_3** (`float`) – eccentricity \[m] at reference point 3.
* **p3** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of reference point 3.
* Return type:
`None`
## Line[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_Line "Direct link to Line")
* *class *viktor.external.axisvm.Line(*id\_*, *interface*, *node1*, *node2*)[](#Line "Link to this definition")
Bases: [`Object`](#Object "viktor.external.axisvm.Object")
Do not use this \_\_init\_\_ directly, but create the object from [`Model`](#Model "viktor.external.axisvm.Model")
* define\_as\_beam(*material*, *css\_start*, *css\_end=None*, *\**, *local\_z\_reference=None*)[](#Line.define_as_beam "Link to this definition")
Define the line as beam with given material and cross-section.
* Parameters:
* **material** ([`Material`](#Material "viktor.external.axisvm.Material")) – material of the beam.
* **css\_start** ([`CrossSection`](#CrossSection "viktor.external.axisvm.CrossSection")) – cross-section at the start node of the beam.
* **css\_end** ([`CrossSection`](#CrossSection "viktor.external.axisvm.CrossSection")) – cross-section at the start node of the beam (default: same as css\_start).
* **local\_z\_reference** ([`Reference`](#Reference "viktor.external.axisvm.Reference")) – local z-reference (must be of type vector) (default: auto).
* Return type:
[`Member`](#Member "viktor.external.axisvm.Member")
- *property *end\_node*: [Node](#Node "viktor.external.axisvm.Node")*[](#Line.end_node "Link to this definition")
End node of the line.
* split\_by\_number(*n*)[](#Line.split_by_number "Link to this definition")
Split the line in ‘n’ equal parts.
* Parameters:
**n** (`int`) – number of parts after the split.
* Return type:
`None`
- *property *start\_node*: [Node](#Node "viktor.external.axisvm.Node")*[](#Line.start_node "Link to this definition")
Start node of the line.
## LineInterface[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_LineInterface "Direct link to LineInterface")
* *class *viktor.external.axisvm.LineInterface[](#LineInterface "Link to this definition")
Bases: `_Interface`
Do not use this \_\_init\_\_ directly, but use [`Model.lines`](#Model.lines "viktor.external.axisvm.Model.lines")
* create(*start\_node*, *end\_node*, *circle\_arc=None*)[](#LineInterface.create "Link to this definition")
Create a line between start and end node.
* Parameters:
* **start\_node** ([`Node`](#Node "viktor.external.axisvm.Node")) – start node.
* **end\_node** ([`Node`](#Node "viktor.external.axisvm.Node")) – end node.
* **circle\_arc** ([`CircleArc`](#CircleArc "viktor.external.axisvm.CircleArc")) – circular arc between the nodes (default: straight line).
* Return type:
[`Line`](#Line "viktor.external.axisvm.Line")
- define\_as\_beam(*line*, *material*, *css\_start*, *css\_end=None*, *\**, *local\_z\_reference=None*)[](#LineInterface.define_as_beam "Link to this definition")
Define a line as beam with given material and cross-section.
* Parameters:
* **line** ([`Line`](#Line "viktor.external.axisvm.Line")) – line to define as beam.
* **material** ([`Material`](#Material "viktor.external.axisvm.Material")) – material of the beam.
* **css\_start** ([`CrossSection`](#CrossSection "viktor.external.axisvm.CrossSection")) – cross-section at the start node of the beam.
* **css\_end** ([`CrossSection`](#CrossSection "viktor.external.axisvm.CrossSection")) – cross-section at the start node of the beam (default: same as css\_start).
* **local\_z\_reference** ([`Reference`](#Reference "viktor.external.axisvm.Reference")) – local z-reference (must be of type vector) (default: auto).
* Return type:
[`Member`](#Member "viktor.external.axisvm.Member")
* split\_by\_number(*line*, *n*)[](#LineInterface.split_by_number "Link to this definition")
Split a line in ‘n’ equal parts.
* Parameters:
* **line** ([`Line`](#Line "viktor.external.axisvm.Line")) – line to split.
* **n** (`int`) – number of parts after the split.
* Return type:
`None`
## LineSupport[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_LineSupport "Direct link to LineSupport")
* *class *viktor.external.axisvm.LineSupport(*id\_*)[](#LineSupport "Link to this definition")
Bases: [`Object`](#Object "viktor.external.axisvm.Object")
Do not use this \_\_init\_\_ directly, but create the object from [`Model`](#Model "viktor.external.axisvm.Model")
* *class *NonLinearity(*\*values*)[](#LineSupport.NonLinearity "Link to this definition")
Bases: `Enum`
Type of non-linear behavior.
* COMPRESSION\_ONLY*: [`NonLinearity`](#LineSupport.NonLinearity "viktor.external.axisvm.LineSupport.NonLinearity")** = 2*[](#LineSupport.NonLinearity.COMPRESSION_ONLY "Link to this definition")
- LINEAR*: [`NonLinearity`](#LineSupport.NonLinearity "viktor.external.axisvm.LineSupport.NonLinearity")** = 0*[](#LineSupport.NonLinearity.LINEAR "Link to this definition")
* TENSION\_ONLY*: [`NonLinearity`](#LineSupport.NonLinearity "viktor.external.axisvm.LineSupport.NonLinearity")** = 1*[](#LineSupport.NonLinearity.TENSION_ONLY "Link to this definition")
## LineSupportInterface[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_LineSupportInterface "Direct link to LineSupportInterface")
* *class *viktor.external.axisvm.LineSupportInterface[](#LineSupportInterface "Link to this definition")
Bases: `_Interface`
Do not use this \_\_init\_\_ directly, but use [`Model.line_supports`](#Model.line_supports "viktor.external.axisvm.Model.line_supports")
* create\_on\_member(*member*, *k\_x*, *k\_y*, *k\_z*, *\**, *non\_linearity\_x=NonLinearity.LINEAR*, *non\_linearity\_y=NonLinearity.LINEAR*, *non\_linearity\_z=NonLinearity.LINEAR*, *resistance\_fx=0.0*, *resistance\_fy=0.0*, *resistance\_fz=0.0*)[](#LineSupportInterface.create_on_member "Link to this definition")
Create a line support on a member (beam), in the member’s coordinate system.
* Parameters:
* **member** ([`Member`](#Member "viktor.external.axisvm.Member")) – member (beam) to create the line support on.
* **k\_x** (`float`) – stiffness \[kN/m/m] in the local x-direction.
* **k\_y** (`float`) – stiffness \[kN/m/m] in the local y-direction.
* **k\_z** (`float`) – stiffness \[kN/m/m] in the local z-direction.
* **non\_linearity\_x** ([`NonLinearity`](#LineSupport.NonLinearity "viktor.external.axisvm.LineSupport.NonLinearity")) – non-linear behaviour in the local x-direction (default: linear).
* **non\_linearity\_y** ([`NonLinearity`](#LineSupport.NonLinearity "viktor.external.axisvm.LineSupport.NonLinearity")) – non-linear behaviour in the local y-direction (default: linear).
* **non\_linearity\_z** ([`NonLinearity`](#LineSupport.NonLinearity "viktor.external.axisvm.LineSupport.NonLinearity")) – non-linear behaviour in the local z-direction (default: linear).
* **resistance\_fx** (`float`) – resistance \[kN/m] in the local x-direction (default: 0.0).
* **resistance\_fy** (`float`) – resistance \[kN/m] in the local y-direction (default: 0.0).
* **resistance\_fz** (`float`) – resistance \[kN/m] in the local z-direction (default: 0.0).
* Return type:
[`LineSupport`](#LineSupport "viktor.external.axisvm.LineSupport")
## Load[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_Load "Direct link to Load")
* *class *viktor.external.axisvm.Load(*id\_*)[](#Load "Link to this definition")
Bases: [`Object`](#Object "viktor.external.axisvm.Object")
Do not use this \_\_init\_\_ directly, but create the object from [`Model`](#Model "viktor.external.axisvm.Model")
* *class *Axis(*\*values*)[](#Load.Axis "Link to this definition")
Bases: `Enum`
* X*: [`Axis`](#Load.Axis "viktor.external.axisvm.Load.Axis")** = 0*[](#Load.Axis.X "Link to this definition")
- XX*: [`Axis`](#Load.Axis "viktor.external.axisvm.Load.Axis")** = 3*[](#Load.Axis.XX "Link to this definition")
* Y*: [`Axis`](#Load.Axis "viktor.external.axisvm.Load.Axis")** = 1*[](#Load.Axis.Y "Link to this definition")
- YY*: [`Axis`](#Load.Axis "viktor.external.axisvm.Load.Axis")** = 4*[](#Load.Axis.YY "Link to this definition")
* Z*: [`Axis`](#Load.Axis "viktor.external.axisvm.Load.Axis")** = 2*[](#Load.Axis.Z "Link to this definition")
- ZZ*: [`Axis`](#Load.Axis "viktor.external.axisvm.Load.Axis")** = 5*[](#Load.Axis.ZZ "Link to this definition")
- *class *DistributionType(*\*values*)[](#Load.DistributionType "Link to this definition")
Bases: `Enum`
* GLOBAL*: [`DistributionType`](#Load.DistributionType "viktor.external.axisvm.Load.DistributionType")** = 0*[](#Load.DistributionType.GLOBAL "Link to this definition")
- LOCAL*: [`DistributionType`](#Load.DistributionType "viktor.external.axisvm.Load.DistributionType")** = 1*[](#Load.DistributionType.LOCAL "Link to this definition")
* PROJECTED*: [`DistributionType`](#Load.DistributionType "viktor.external.axisvm.Load.DistributionType")** = 2*[](#Load.DistributionType.PROJECTED "Link to this definition")
* *class *SurfaceDistributionType(*\*values*)[](#Load.SurfaceDistributionType "Link to this definition")
Bases: `Enum`
* PROJECTED*: [`SurfaceDistributionType`](#Load.SurfaceDistributionType "viktor.external.axisvm.Load.SurfaceDistributionType")** = 1*[](#Load.SurfaceDistributionType.PROJECTED "Link to this definition")
- SURFACE*: [`SurfaceDistributionType`](#Load.SurfaceDistributionType "viktor.external.axisvm.Load.SurfaceDistributionType")** = 0*[](#Load.SurfaceDistributionType.SURFACE "Link to this definition")
- *class *System(*\*values*)[](#Load.System "Link to this definition")
Bases: `Enum`
* GLOBAL*: [`System`](#Load.System "viktor.external.axisvm.Load.System")** = 0*[](#Load.System.GLOBAL "Link to this definition")
- LOCAL*: [`System`](#Load.System "viktor.external.axisvm.Load.System")** = 1*[](#Load.System.LOCAL "Link to this definition")
* REFERENCE*: [`System`](#Load.System "viktor.external.axisvm.Load.System")** = 2*[](#Load.System.REFERENCE "Link to this definition")
## LoadCase[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_LoadCase "Direct link to LoadCase")
* *class *viktor.external.axisvm.LoadCase(*id\_*, *name*)[](#LoadCase "Link to this definition")
Bases: [`Object`](#Object "viktor.external.axisvm.Object")
Do not use this \_\_init\_\_ directly, but create the object from [`Model`](#Model "viktor.external.axisvm.Model")
* *property *name*: str*[](#LoadCase.name "Link to this definition")
Name of the load case.
## LoadCaseInterface[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_LoadCaseInterface "Direct link to LoadCaseInterface")
* *class *viktor.external.axisvm.LoadCaseInterface[](#LoadCaseInterface "Link to this definition")
Bases: `_Interface`
Do not use this \_\_init\_\_ directly, but use [`Model.load_cases`](#Model.load_cases "viktor.external.axisvm.Model.load_cases")
* create(*name=None*)[](#LoadCaseInterface.create "Link to this definition")
Create a load case.
* Parameters:
**name** (`str`) – name of the load case (default: auto).
* Return type:
[`LoadCase`](#LoadCase "viktor.external.axisvm.LoadCase")
## LoadCombination[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_LoadCombination "Direct link to LoadCombination")
* *class *viktor.external.axisvm.LoadCombination(*id\_*, *name*)[](#LoadCombination "Link to this definition")
Bases: [`Object`](#Object "viktor.external.axisvm.Object")
Do not use this \_\_init\_\_ directly, but create the object from [`Model`](#Model "viktor.external.axisvm.Model")
* *class *Type(*\*values*)[](#LoadCombination.Type "Link to this definition")
Bases: `Enum`
* OTHER*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 0*[](#LoadCombination.Type.OTHER "Link to this definition")
- SLS\_1*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 1*[](#LoadCombination.Type.SLS_1 "Link to this definition")
* SLS\_2*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 2*[](#LoadCombination.Type.SLS_2 "Link to this definition")
- SLS\_3*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 3*[](#LoadCombination.Type.SLS_3 "Link to this definition")
* SLS\_CHAR*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 1*[](#LoadCombination.Type.SLS_CHAR "Link to this definition")
- SLS\_FREQ*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 2*[](#LoadCombination.Type.SLS_FREQ "Link to this definition")
* SLS\_QUASI*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 3*[](#LoadCombination.Type.SLS_QUASI "Link to this definition")
- ULS*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 4*[](#LoadCombination.Type.ULS "Link to this definition")
* ULS\_1*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 4*[](#LoadCombination.Type.ULS_1 "Link to this definition")
- ULS\_2*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 5*[](#LoadCombination.Type.ULS_2 "Link to this definition")
* ULS\_3*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 6*[](#LoadCombination.Type.ULS_3 "Link to this definition")
- ULS\_A*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 9*[](#LoadCombination.Type.ULS_A "Link to this definition")
* ULS\_A1*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 12*[](#LoadCombination.Type.ULS_A1 "Link to this definition")
- ULS\_A2*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 13*[](#LoadCombination.Type.ULS_A2 "Link to this definition")
* ULS\_A3*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 14*[](#LoadCombination.Type.ULS_A3 "Link to this definition")
- ULS\_A4*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 15*[](#LoadCombination.Type.ULS_A4 "Link to this definition")
* ULS\_A5*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 16*[](#LoadCombination.Type.ULS_A5 "Link to this definition")
- ULS\_A6*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 17*[](#LoadCombination.Type.ULS_A6 "Link to this definition")
* ULS\_A7*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 18*[](#LoadCombination.Type.ULS_A7 "Link to this definition")
- ULS\_A8*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 19*[](#LoadCombination.Type.ULS_A8 "Link to this definition")
* ULS\_AB*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 8*[](#LoadCombination.Type.ULS_AB "Link to this definition")
- ULS\_ALL*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 7*[](#LoadCombination.Type.ULS_ALL "Link to this definition")
* ULS\_ALL\_AB*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 11*[](#LoadCombination.Type.ULS_ALL_AB "Link to this definition")
- ULS\_B*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 10*[](#LoadCombination.Type.ULS_B "Link to this definition")
* ULS\_EXCEPTIONAL*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 6*[](#LoadCombination.Type.ULS_EXCEPTIONAL "Link to this definition")
- ULS\_SEISMIC*: [`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")** = 5*[](#LoadCombination.Type.ULS_SEISMIC "Link to this definition")
- *property *name*: str*[](#LoadCombination.name "Link to this definition")
Name of the load case.
## LoadCombinationInterface[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_LoadCombinationInterface "Direct link to LoadCombinationInterface")
* *class *viktor.external.axisvm.LoadCombinationInterface[](#LoadCombinationInterface "Link to this definition")
Bases: `_Interface`
Do not use this \_\_init\_\_ directly, but use [`Model.load_combinations`](#Model.load_combinations "viktor.external.axisvm.Model.load_combinations")
* create(*combination\_type*, *load\_case\_factors*, *\**, *name=None*)[](#LoadCombinationInterface.create "Link to this definition")
Create a load combination from given load cases and factors.
* Parameters:
* **combination\_type** ([`Type`](#LoadCombination.Type "viktor.external.axisvm.LoadCombination.Type")) – load combination type.
* **load\_case\_factors** (`Dict`\[[`LoadCase`](#LoadCase "viktor.external.axisvm.LoadCase"), `float`]) – factorized load cases {load\_case: factor}.
* **name** (`str`) – name of the load combination (default: auto).
* Return type:
[`LoadCombination`](#LoadCombination "viktor.external.axisvm.LoadCombination")
## LoadInterface[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_LoadInterface "Direct link to LoadInterface")
* *class *viktor.external.axisvm.LoadInterface[](#LoadInterface "Link to this definition")
Bases: `_Interface`
Do not use this \_\_init\_\_ directly, but use [`Model.loads`](#Model.loads "viktor.external.axisvm.Model.loads")
* create\_beam\_self\_weight(*load\_case*, *member*)[](#LoadInterface.create_beam_self_weight "Link to this definition")
Create a self-weight load on a member (beam).
* Parameters:
* **load\_case** ([`LoadCase`](#LoadCase "viktor.external.axisvm.LoadCase")) – load case to add the load to.
* **member** ([`Member`](#Member "viktor.external.axisvm.Member")) – member to create the load on.
* Return type:
[`Load`](#Load "viktor.external.axisvm.Load")
- create\_domain\_constant(*load\_case*, *domain*, *load*, *\**, *distribution\_type=SurfaceDistributionType.SURFACE*, *system=System.GLOBAL*)[](#LoadInterface.create_domain_constant "Link to this definition")
Create a constant distributed load on a domain.
* Parameters:
* **load\_case** ([`LoadCase`](#LoadCase "viktor.external.axisvm.LoadCase")) – load case to add the load to.
* **domain** ([`Domain`](#Domain "viktor.external.axisvm.Domain")) – domain to create the load on.
* **load** (`Tuple`\[`float`, `float`, `float`]) – magnitude of the load (x, y, z) \[kN].
* **distribution\_type** ([`SurfaceDistributionType`](#Load.SurfaceDistributionType "viktor.external.axisvm.Load.SurfaceDistributionType")) – distribution type (default: SURFACE).
* **system** ([`System`](#Load.System "viktor.external.axisvm.Load.System")) – coordinate system (default: GLOBAL).
* Return type:
[`Load`](#Load "viktor.external.axisvm.Load")
* create\_domain\_linear(*load\_case*, *domain*, *load*, *\**, *component*, *point\_1*, *point\_2*, *point\_3*, *distribution\_type=DistributionType.GLOBAL*, *load\_on\_hole=False*)[](#LoadInterface.create_domain_linear "Link to this definition")
Create a linear distributed load on a domain.
* Parameters:
* **load\_case** ([`LoadCase`](#LoadCase "viktor.external.axisvm.LoadCase")) – load case to add the load to.
* **domain** ([`Domain`](#Domain "viktor.external.axisvm.Domain")) – domain to create the load on.
* **load** (`Tuple`\[`float`, `float`, `float`]) – magnitude of the load at (point\_1, point\_2, point\_3) \[kN].
* **component** ([`Axis`](#Load.Axis "viktor.external.axisvm.Load.Axis")) – direction of the load (X, Y, Z only).
* **point\_1** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of reference point 1.
* **point\_2** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of reference point 2.
* **point\_3** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of reference point 3.
* **distribution\_type** ([`DistributionType`](#Load.DistributionType "viktor.external.axisvm.Load.DistributionType")) – distribution type (default: GLOBAL).
* **load\_on\_hole** (`bool`) – apply load on hole (default: False -> loads disappear on holes).
* Return type:
[`Load`](#Load "viktor.external.axisvm.Load")
- create\_domain\_self\_weight(*load\_case*, *domain*)[](#LoadInterface.create_domain_self_weight "Link to this definition")
Create a self-weight load on a domain.
* Parameters:
* **load\_case** ([`LoadCase`](#LoadCase "viktor.external.axisvm.LoadCase")) – load case to add the load to.
* **domain** ([`Domain`](#Domain "viktor.external.axisvm.Domain")) – domain to create the load on.
* Return type:
[`Load`](#Load "viktor.external.axisvm.Load")
## Material[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_Material "Direct link to Material")
* *class *viktor.external.axisvm.Material(*id\_*, *name*)[](#Material "Link to this definition")
Bases: [`Object`](#Object "viktor.external.axisvm.Object")
Do not use this \_\_init\_\_ directly, but create the object from [`Model`](#Model "viktor.external.axisvm.Model")
* *class *DesignCode(*\*values*)[](#Material.DesignCode "Link to this definition")
Bases: `Enum`
National design code.
* CA\_BRIDGE*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 24*[](#Material.DesignCode.CA_BRIDGE "Link to this definition")
- CA\_NBCC*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 22*[](#Material.DesignCode.CA_NBCC "Link to this definition")
* CA\_ONTARIO*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 23*[](#Material.DesignCode.CA_ONTARIO "Link to this definition")
- DUTCH\_NEN*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 5*[](#Material.DesignCode.DUTCH_NEN "Link to this definition")
* EURO\_CODE*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 2*[](#Material.DesignCode.EURO_CODE "Link to this definition")
- EURO\_CODE\_AUSTRIAN*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 10*[](#Material.DesignCode.EURO_CODE_AUSTRIAN "Link to this definition")
* EURO\_CODE\_B*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 17*[](#Material.DesignCode.EURO_CODE_B "Link to this definition")
- EURO\_CODE\_CZ*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 16*[](#Material.DesignCode.EURO_CODE_CZ "Link to this definition")
* EURO\_CODE\_DK*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 19*[](#Material.DesignCode.EURO_CODE_DK "Link to this definition")
- EURO\_CODE\_FIN*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 13*[](#Material.DesignCode.EURO_CODE_FIN "Link to this definition")
* EURO\_CODE\_GER*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 8*[](#Material.DesignCode.EURO_CODE_GER "Link to this definition")
- EURO\_CODE\_HU*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 15*[](#Material.DesignCode.EURO_CODE_HU "Link to this definition")
* EURO\_CODE\_NL*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 12*[](#Material.DesignCode.EURO_CODE_NL "Link to this definition")
- EURO\_CODE\_PL*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 18*[](#Material.DesignCode.EURO_CODE_PL "Link to this definition")
* EURO\_CODE\_RO*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 14*[](#Material.DesignCode.EURO_CODE_RO "Link to this definition")
- EURO\_CODE\_S*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 20*[](#Material.DesignCode.EURO_CODE_S "Link to this definition")
* EURO\_CODE\_SK*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 25*[](#Material.DesignCode.EURO_CODE_SK "Link to this definition")
- EURO\_CODE\_UK*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 11*[](#Material.DesignCode.EURO_CODE_UK "Link to this definition")
* GERMAN\_DIN1045\_1*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 6*[](#Material.DesignCode.GERMAN_DIN1045_1 "Link to this definition")
- HUNGARIAN\_MSZ*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 1*[](#Material.DesignCode.HUNGARIAN_MSZ "Link to this definition")
* ITALIAN*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 9*[](#Material.DesignCode.ITALIAN "Link to this definition")
- OTHER*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 0*[](#Material.DesignCode.OTHER "Link to this definition")
* ROMANIAN\_STAS*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 4*[](#Material.DesignCode.ROMANIAN_STAS "Link to this definition")
- SWISS\_SIA26X*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 7*[](#Material.DesignCode.SWISS_SIA26X "Link to this definition")
* US*: [`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")** = 21*[](#Material.DesignCode.US "Link to this definition")
- *property *name*: str*[](#Material.name "Link to this definition")
Name of the material.
## MaterialInterface[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_MaterialInterface "Direct link to MaterialInterface")
* *class *viktor.external.axisvm.MaterialInterface[](#MaterialInterface "Link to this definition")
Bases: `_Interface`
Do not use this \_\_init\_\_ directly, but use [`Model.materials`](#Model.materials "viktor.external.axisvm.Model.materials")
* add\_from\_catalog(*name*, *national\_design\_code*)[](#MaterialInterface.add_from_catalog "Link to this definition")
Adds a material from the catalog.
* Parameters:
* **name** (`str`) – name of the material to be added (must exist in the corresponding national design code).
* **national\_design\_code** ([`DesignCode`](#Material.DesignCode "viktor.external.axisvm.Material.DesignCode")) – national design code in which the material with given name resides.
* Return type:
[`Material`](#Material "viktor.external.axisvm.Material")
- create\_concrete\_eurocode(*\**, *e\_x*, *e\_y=None*, *e\_z=None*, *nu\_x*, *nu\_y=None*, *nu\_z=None*, *alpha\_x=0.0*, *alpha\_y=None*, *alpha\_z=None*, *rho*, *f\_ck*, *gamma\_c*, *alpha\_cc*, *phi\_t=0.0*, *material\_code=None*, *name=None*)[](#MaterialInterface.create_concrete_eurocode "Link to this definition")
Create a concrete material according to the Eurocode.
* Parameters:
* **e\_x** (`float`) – Young’s modulus of elasticity \[kN/m2] in local x-direction.
* **e\_y** (`float`) – Young’s modulus of elasticity \[kN/m2] in local y-direction (default = e\_x).
* **e\_z** (`float`) – Young’s modulus of elasticity \[kN/m2] in local z-direction (default = e\_x).
* **nu\_x** (`float`) – Poisson’s ratio \[-] in local x-direction (0 <= nu <= 0.5).
* **nu\_y** (`float`) – Poisson’s ratio \[-] in local y-direction (0 <= nu <= 0.5) (default = nu\_x).
* **nu\_z** (`float`) – Poisson’s ratio \[-] in local z-direction (0 <= nu <= 0.5) (default = nu\_x).
* **alpha\_x** (`float`) – thermal expansion coefficient \[1/C] in local x-direction (default = 0.0).
* **alpha\_y** (`float`) – thermal expansion coefficient \[1/C] in local y-direction (default = alpha\_x).
* **alpha\_z** (`float`) – thermal expansion coefficient \[1/C] in local z-direction (default = alpha\_x).
* **rho** (`float`) – density \[kg/m3].
* **f\_ck** (`float`) – characteristic compressive cylinder strength \[kN/m2] at 28 days.
* **gamma\_c** (`float`) – safety factor \[-].
* **alpha\_cc** (`float`) – concrete strength-reduction factor for sustained loading \[-].
* **phi\_t** (`float`) – creeping factor \[-] (default = 0.0).
* **material\_code** (`str`) – material code name, as shown in the interface (default: auto).
* **name** (`str`) – material name, as shown in the interface (default: auto).
* Return type:
[`Material`](#Material "viktor.external.axisvm.Material")
## Member[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_Member "Direct link to Member")
* *class *viktor.external.axisvm.Member(*line*, *type\_*)[](#Member "Link to this definition")
Bases: [`Object`](#Object "viktor.external.axisvm.Object")
Do not use this \_\_init\_\_ directly, but create the object from [`Model`](#Model "viktor.external.axisvm.Model")
## Model[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_Model "Direct link to Model")
* *class *viktor.external.axisvm.Model[](#Model "Link to this definition")
Can be used to construct an AxisVM model, which can be used as input of [`AxisVMAnalysis`](#AxisVMAnalysis "viktor.external.axisvm.AxisVMAnalysis").
Objects are created/modified through the methods on their respective interface (see the properties below for all available interfaces). The following basic actions can be performed on all interfaces (example: node interface):
* cast to list, indexing and slicing:
> ```
> nodes = list(model.nodes) # List[Node]
> node2 = model.nodes[1] # Node
> nodes_2_3 = model.nodes[1:3] # List[Node]
> ```
* iteration:
> ```
> for node in model.nodes:
> print(node.id)
> ```
* length:
> ```
> number_of_nodes = len(model.nodes)
> ```
* containment check:
> ```
> node_in_model = node in model.nodes # bool
> ```
Example usage:
```
model = Model()
material = model.materials.add_from_catalog('C12/15', AxisVMMaterial.DesignCode.EURO_CODE)
cross_section = model.cross_sections.create_rectangular(0.01, 0.01)
n1 = model.nodes.create(0, 0, 0)
n2 = model.nodes.create(1, 0, 0)
beam = model.lines.create(n1, n2).define_as_beam(material, cross_section)
model.node_supports.create_relative_to_member(n1, stiffness_x=1e10, stiffness_y=1e10, stiffness_z=1e10,
stiffness_xx=1e10, stiffness_yy=1e10, stiffness_zz=1e10)
load_case = model.load_cases.create()
model.loads.create_beam_self_weight(load_case, beam)
model.results.nodal_displacements([n2])
```
* *property *cross\_sections*: [CrossSectionInterface](#CrossSectionInterface "viktor.external.axisvm.CrossSectionInterface")*[](#Model.cross_sections "Link to this definition")
Interface for creating cross-sections.
- *property *domains*: [DomainInterface](#DomainInterface "viktor.external.axisvm.DomainInterface")*[](#Model.domains "Link to this definition")
Interface for creating domains.
* *property *line\_supports*: [LineSupportInterface](#LineSupportInterface "viktor.external.axisvm.LineSupportInterface")*[](#Model.line_supports "Link to this definition")
Interface for creating line supports.
- *property *lines*: [LineInterface](#LineInterface "viktor.external.axisvm.LineInterface")*[](#Model.lines "Link to this definition")
Interface for creating lines, beams, etc.
* *property *load\_cases*: [LoadCaseInterface](#LoadCaseInterface "viktor.external.axisvm.LoadCaseInterface")*[](#Model.load_cases "Link to this definition")
Interface for creating load cases.
- *property *load\_combinations*: [LoadCombinationInterface](#LoadCombinationInterface "viktor.external.axisvm.LoadCombinationInterface")*[](#Model.load_combinations "Link to this definition")
Interface for creating load combinations.
* *property *loads*: [LoadInterface](#LoadInterface "viktor.external.axisvm.LoadInterface")*[](#Model.loads "Link to this definition")
Interface for creating loads.
- *property *materials*: [MaterialInterface](#MaterialInterface "viktor.external.axisvm.MaterialInterface")*[](#Model.materials "Link to this definition")
Interface for creating materials.
* *property *node\_supports*: [NodeSupportInterface](#NodeSupportInterface "viktor.external.axisvm.NodeSupportInterface")*[](#Model.node_supports "Link to this definition")
Interface for creating node supports.
- *property *nodes*: [NodeInterface](#NodeInterface "viktor.external.axisvm.NodeInterface")*[](#Model.nodes "Link to this definition")
Interface for creating nodes.
* *property *references*: [ReferenceInterface](#ReferenceInterface "viktor.external.axisvm.ReferenceInterface")*[](#Model.references "Link to this definition")
Interface for creating reference points, vectors, axes, planes and angles.
- *property *results*: [ResultInterface](#ResultInterface "viktor.external.axisvm.ResultInterface")*[](#Model.results "Link to this definition")
Interface for requesting results from the worker (only requested results will be returned).
* *property *sections*: [SectionInterface](#SectionInterface "viktor.external.axisvm.SectionInterface")*[](#Model.sections "Link to this definition")
Interface for creating sections, on which results can be obtained.
## Node[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_Node "Direct link to Node")
* *class *viktor.external.axisvm.Node(*id\_*, *x*, *y*, *z*)[](#Node "Link to this definition")
Bases: [`Object`](#Object "viktor.external.axisvm.Object")
Do not use this \_\_init\_\_ directly, but create the object from [`Model`](#Model "viktor.external.axisvm.Model")
* *property *x*: float*[](#Node.x "Link to this definition")
X-coordinate.
- *property *y*: float*[](#Node.y "Link to this definition")
Y-coordinate.
* *property *z*: float*[](#Node.z "Link to this definition")
Z-coordinate.
## NodeInterface[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_NodeInterface "Direct link to NodeInterface")
* *class *viktor.external.axisvm.NodeInterface[](#NodeInterface "Link to this definition")
Bases: `_Interface`
Do not use this \_\_init\_\_ directly, but use [`Model.nodes`](#Model.nodes "viktor.external.axisvm.Model.nodes")
* create(*x*, *y*, *z*)[](#NodeInterface.create "Link to this definition")
Create a node at the given position and with given degree-of-freedom.
* Parameters:
* **x** (`float`) – x-position \[m].
* **y** (`float`) – y-position \[m].
* **z** (`float`) – z-position \[m].
* Return type:
[`Node`](#Node "viktor.external.axisvm.Node")
## NodeSupport[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_NodeSupport "Direct link to NodeSupport")
* *class *viktor.external.axisvm.NodeSupport(*id\_*)[](#NodeSupport "Link to this definition")
Bases: [`Object`](#Object "viktor.external.axisvm.Object")
Do not use this \_\_init\_\_ directly, but create the object from [`Model`](#Model "viktor.external.axisvm.Model")
## NodeSupportInterface[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_NodeSupportInterface "Direct link to NodeSupportInterface")
* *class *viktor.external.axisvm.NodeSupportInterface(*lines*)[](#NodeSupportInterface "Link to this definition")
Bases: `_Interface`
Do not use this \_\_init\_\_ directly, but use [`Model.node_supports`](#Model.node_supports "viktor.external.axisvm.Model.node_supports")
* create\_relative\_to\_member(*node*, *\**, *stiffness\_x=0.0*, *stiffness\_y=0.0*, *stiffness\_z=0.0*, *stiffness\_xx=0.0*, *stiffness\_yy=0.0*, *stiffness\_zz=0.0*, *resistance\_x=0.0*, *resistance\_y=0.0*, *resistance\_z=0.0*, *resistance\_xx=0.0*, *resistance\_yy=0.0*, *resistance\_zz=0.0*, *non\_linearity\_x=NonLinearity.LINEAR*, *non\_linearity\_y=NonLinearity.LINEAR*, *non\_linearity\_z=NonLinearity.LINEAR*, *non\_linearity\_xx=NonLinearity.LINEAR*, *non\_linearity\_yy=NonLinearity.LINEAR*, *non\_linearity\_zz=NonLinearity.LINEAR*)[](#NodeSupportInterface.create_relative_to_member "Link to this definition")
Create a nodal support, relative to the member’s local coordinate system.
* Parameters:
* **node** ([`Node`](#Node "viktor.external.axisvm.Node")) – node to create the support on. Must be an end-point of a member of type beam or rib.
* **stiffness\_x** (`float`) – translational stiffness \[kN/m] in local x-direction (default = 0.0).
* **stiffness\_y** (`float`) – translational stiffness \[kN/m] in local y-direction (default = 0.0).
* **stiffness\_z** (`float`) – translational stiffness \[kN/m] in local z-direction (default = 0.0).
* **stiffness\_xx** (`float`) – rotational stiffness \[kNm/rad] around the local x-axis (default = 0.0).
* **stiffness\_yy** (`float`) – rotational stiffness \[kNm/rad] around the local y-axis (default = 0.0).
* **stiffness\_zz** (`float`) – rotational stiffness \[kNm/rad] around the local z-axis (default = 0.0).
* **resistance\_x** (`float`) – translational resistance \[kN/m] in local x-direction (default = 0.0).
* **resistance\_y** (`float`) – translational resistance \[kN/m] in local y-direction (default = 0.0).
* **resistance\_z** (`float`) – translational resistance \[kN/m] in local z-direction (default = 0.0).
* **resistance\_xx** (`float`) – rotational resistance \[kNm/m] around the local x-axis (default = 0.0).
* **resistance\_yy** (`float`) – rotational resistance \[kNm/m] around the local y-axis (default = 0.0).
* **resistance\_zz** (`float`) – rotational resistance \[kNm/m] around the local z-axis (default = 0.0).
* **non\_linearity\_x** ([`NonLinearity`](#LineSupport.NonLinearity "viktor.external.axisvm.LineSupport.NonLinearity")) – translational non-linear behaviour in local x-direction (default: linear).
* **non\_linearity\_y** ([`NonLinearity`](#LineSupport.NonLinearity "viktor.external.axisvm.LineSupport.NonLinearity")) – translational non-linear behaviour in local y-direction (default: linear).
* **non\_linearity\_z** ([`NonLinearity`](#LineSupport.NonLinearity "viktor.external.axisvm.LineSupport.NonLinearity")) – translational non-linear behaviour in local z-direction (default: linear).
* **non\_linearity\_xx** ([`NonLinearity`](#LineSupport.NonLinearity "viktor.external.axisvm.LineSupport.NonLinearity")) – rotational non-linear behaviour around the local x-axis (default: linear).
* **non\_linearity\_yy** ([`NonLinearity`](#LineSupport.NonLinearity "viktor.external.axisvm.LineSupport.NonLinearity")) – rotational non-linear behaviour around the local y-axis (default: linear).
* **non\_linearity\_zz** ([`NonLinearity`](#LineSupport.NonLinearity "viktor.external.axisvm.LineSupport.NonLinearity")) – rotational non-linear behaviour around the local z-axis (default: linear).
* Return type:
[`NodeSupport`](#NodeSupport "viktor.external.axisvm.NodeSupport")
## Object[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_Object "Direct link to Object")
* *class *viktor.external.axisvm.Object(*id\_*)[](#Object "Link to this definition")
Bases: `ABC`
Abstract base class of all AxisVM objects. Do not use this \_\_init\_\_ directly.
* *property *id*: int*[](#Object.id "Link to this definition")
Object id.
## Reference[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_Reference "Direct link to Reference")
* *class *viktor.external.axisvm.Reference(*id\_*)[](#Reference "Link to this definition")
Bases: [`Object`](#Object "viktor.external.axisvm.Object"), `ABC`
Do not use this \_\_init\_\_ directly, but create the object from [`Model`](#Model "viktor.external.axisvm.Model")
## ReferenceInterface[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_ReferenceInterface "Direct link to ReferenceInterface")
* *class *viktor.external.axisvm.ReferenceInterface[](#ReferenceInterface "Link to this definition")
Bases: `_Interface`
Do not use this \_\_init\_\_ directly, but use [`Model.references`](#Model.references "viktor.external.axisvm.Model.references")
* create\_angle(*angle*)[](#ReferenceInterface.create_angle "Link to this definition")
Create a reference angle.
* Parameters:
**angle** (`float`) – angle \[rad].
* Return type:
[`Reference`](#Reference "viktor.external.axisvm.Reference")
- create\_axis(*point\_1*, *point\_2*)[](#ReferenceInterface.create_axis "Link to this definition")
Create a reference axis.
* Parameters:
* **point\_1** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of the start point.
* **point\_2** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of the end point.
* Return type:
[`Reference`](#Reference "viktor.external.axisvm.Reference")
* create\_plane(*point\_1*, *point\_2*, *point\_3*)[](#ReferenceInterface.create_plane "Link to this definition")
Create a reference plane.
* Parameters:
* **point\_1** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of point 1.
* **point\_2** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of point 2.
* **point\_3** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of point 3.
* Return type:
[`Reference`](#Reference "viktor.external.axisvm.Reference")
- create\_point(*x*, *y*, *z*)[](#ReferenceInterface.create_point "Link to this definition")
Create a reference point.
* Parameters:
* **x** (`float`) – x-position \[m].
* **y** (`float`) – y-position \[m].
* **z** (`float`) – z-position \[m].
* Return type:
[`Reference`](#Reference "viktor.external.axisvm.Reference")
* create\_vector(*point\_1*, *point\_2*)[](#ReferenceInterface.create_vector "Link to this definition")
Create a reference vector.
* Parameters:
* **point\_1** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of the start point.
* **point\_2** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of the end point.
* Return type:
[`Reference`](#Reference "viktor.external.axisvm.Reference")
## ResultInterface[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_ResultInterface "Direct link to ResultInterface")
* *class *viktor.external.axisvm.ResultInterface(*nodes*, *node\_supports*, *lines*, *sections*)[](#ResultInterface "Link to this definition")
* line\_forces(*members=None*, *\**, *by\_load\_case=True*)[](#ResultInterface.line_forces "Link to this definition")
Request line forces for all load cases or combinations.
* Parameters:
* **members** (`List`\[[`Member`](#Member "viktor.external.axisvm.Member")]) – members to request the results for, or None for all members (default: all members).
* **by\_load\_case** (`bool`) – True to get the result on all load cases; False to get results on all load combinations.
* Return type:
`None`
- nodal\_displacements(*nodes=None*, *\**, *by\_load\_case=True*)[](#ResultInterface.nodal_displacements "Link to this definition")
Request nodal displacements for all load cases or combinations.
* Parameters:
* **nodes** (`List`\[[`Node`](#Node "viktor.external.axisvm.Node")]) – nodes to request the results for, or None for all nodes (default: all nodes).
* **by\_load\_case** (`bool`) – True to get result on all load cases; False to get results on all load combinations.
* Return type:
`None`
* nodal\_support\_forces(*node\_supports=None*, *\**, *by\_load\_case=True*)[](#ResultInterface.nodal_support_forces "Link to this definition")
Request nodal support forces for all load cases or combinations.
* Parameters:
* **node\_supports** (`List`\[[`NodeSupport`](#NodeSupport "viktor.external.axisvm.NodeSupport")]) – node supports to request the results for, or None for all node supports (default: all node supports).
* **by\_load\_case** (`bool`) – True to get result on all load cases; False to get results on all load combinations.
* Return type:
`None`
- section\_surface\_forces(*sections*, *cases*, *chain\_index=1*)[](#ResultInterface.section_surface_forces "Link to this definition")
Request section chain’s surface forces for given load combinations.
* Parameters:
* **sections** (`List`\[[`Section`](#Section "viktor.external.axisvm.Section")]) – sections to request the results for, or None for all sections (default: all sections).
* **cases** (`List`\[[`LoadCombination`](#LoadCombination "viktor.external.axisvm.LoadCombination")]) – list of load combinations to request the results for.
* **chain\_index** (`int`) – index of the segment chain to request the results for (default: 1).
* Return type:
`None`
* section\_surface\_stresses(*sections*, *cases*, *chain\_index=1*)[](#ResultInterface.section_surface_stresses "Link to this definition")
Request section chain’s surface stresses for given load combinations.
* Parameters:
* **sections** (`List`\[[`Section`](#Section "viktor.external.axisvm.Section")]) – sections to request the results for, or None for all sections (default: all sections).
* **cases** (`List`\[[`LoadCombination`](#LoadCombination "viktor.external.axisvm.LoadCombination")]) – list of load combinations to request the results for.
* **chain\_index** (`int`) – index of the segment chain to request the results for (default: 1).
* Return type:
`None`
## Section[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_Section "Direct link to Section")
* *class *viktor.external.axisvm.Section(*id\_*, *interface*, *name*)[](#Section "Link to this definition")
Bases: [`Object`](#Object "viktor.external.axisvm.Object")
Do not use this \_\_init\_\_ directly, but create the object from [`Model`](#Model "viktor.external.axisvm.Model")
* *property *name*: str*[](#Section.name "Link to this definition")
Name of the section.
## SectionInterface[](https://docs.viktor.ai/sdk/api/external/axisvm/.md#_SectionInterface "Direct link to SectionInterface")
* *class *viktor.external.axisvm.SectionInterface[](#SectionInterface "Link to this definition")
Bases: `_Interface`
Do not use this \_\_init\_\_ directly, but use [`Model.sections`](#Model.sections "viktor.external.axisvm.Model.sections")
* create(*start\_point*, *end\_point*, *normal\_vector*, *\**, *name=None*)[](#SectionInterface.create "Link to this definition")
Create a section (segment) from coordinates, to obtain results from.
* Parameters:
* **start\_point** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of the section’s start point.
* **end\_point** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) position \[m] of the section’s end point.
* **normal\_vector** (`Tuple`\[`float`, `float`, `float`]) – (x, y, z) components \[m] of the section plane’s normal vector.
* **name** (`str`) – name of the section (default: auto).
* Return type:
[`Section`](#Section "viktor.external.axisvm.Section")
---
# viktor.external.dfoundations
## BearingPilesCalculationOptions[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_BearingPilesCalculationOptions "Direct link to BearingPilesCalculationOptions")
* *class *viktor.external.dfoundations.BearingPilesCalculationOptions(*calculation\_type*, *rigid*, *max\_allowed\_settlement\_str\_geo=150*, *max\_allowed\_settlement\_sls=150*, *max\_allowed\_relative\_rotation\_str\_geo=100*, *max\_allowed\_relative\_rotation\_sls=300*, *\**, *xi3=None*, *xi4=None*, *gamma\_b=None*, *gamma\_s=None*, *gamma\_fnk=None*, *area=None*, *e\_ea\_gem=None*, *write\_intermediate\_results=False*, *use\_pile\_group=True*, *overrule\_excavation=False*, *suppress\_qciii\_reduction=False*, *use\_almere\_rules=False*, *use\_extra\_almere\_rules=False*, *trajectory\_begin\_end\_interval=None*, *net\_bearing\_capacity=None*, *cpt\_test\_level=None*)[](#BearingPilesCalculationOptions "Link to this definition")
Bases: `_CalculationOptions`
* Parameters:
* **calculation\_type** ([`CalculationType`](#CalculationType "viktor.external.dfoundations.CalculationType"))
* **rigid** (`bool`) – True for rigid, False for non-rigid
* **max\_allowed\_settlement\_str\_geo** (`int`) – \[mm]
* **max\_allowed\_relative\_rotation\_str\_geo** (`int`) – 1 : \[-]
* **max\_allowed\_settlement\_sls** (`int`) – \[mm]
* **max\_allowed\_relative\_rotation\_sls** (`int`) – 1 : \[-]
* **xi3** (`float`) – ξ\_3 \[-]
* **xi4** (`float`) – ξ\_4 \[-]
* **gamma\_b** (`float`) – γ\_b \[-]
* **gamma\_s** (`float`) – γ\_s \[-]
* **gamma\_fnk** (`float`) – γ\_f;nk \[-]
* **area** (`float`) – \[m²]
* **e\_ea\_gem** (`float`) – E\_ea;gem \[kN/m2]
* **write\_intermediate\_results** (`bool`)
* **use\_pile\_group** (`bool`)
* **overrule\_excavation** (`bool`)
* **suppress\_qciii\_reduction** (`bool`)
* **use\_almere\_rules** (`bool`)
* **use\_extra\_almere\_rules** (`bool`)
* **trajectory\_begin\_end\_interval** (`Tuple`\[`float`, `float`, `float`]) – tuple(\[m], \[m], \[m])
* **net\_bearing\_capacity** (`int`) – \[kN]
* **cpt\_test\_level** (`float`) – \[m]
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if ‘calculation\_type’ is DESIGN\_CALCULATION or INDICATION\_BEARING\_CAPACITY or PILE\_TIP\_LEVEL\_AND\_NET\_BEARING\_CAPACITY and trajectory\_begin\_end\_interval’ is not set.
* if the number of iterations > 151, based on the provided ‘trajectory\_begin\_end\_interval’.
* if ‘calculation\_type’ is PILE\_TIP\_LEVEL\_AND\_NET\_BEARING\_CAPACITY and ‘net\_bearing\_capacity’ is not set.
* if ‘calculation\_type’ is DESIGN\_CALCULATION or COMPLETE\_CALCULATION and ‘cpt\_test\_level’ is not set.
## BearingPilesModel[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_BearingPilesModel "Direct link to BearingPilesModel")
* *class *viktor.external.dfoundations.BearingPilesModel(*construction\_sequence*, *calculation\_options*, *excavation\_level*, *reduction\_cone\_resistance=None*, *\**, *create\_default\_materials=True*)[](#BearingPilesModel "Link to this definition")
Bases: `_Model`
Create a Bearing Piles (EC7-NL) model.
* Parameters:
* **construction\_sequence** ([`ConstructionSequence`](#ConstructionSequence "viktor.external.dfoundations.ConstructionSequence"))
* **calculation\_options** ([`BearingPilesCalculationOptions`](#BearingPilesCalculationOptions "viktor.external.dfoundations.BearingPilesCalculationOptions"))
* **excavation\_level** (`float`) – \[m]
* **reduction\_cone\_resistance** (`float`) – Distance edge pile to excavation boundary \[m] to implement ‘Begemann’. ‘None’ to implement ‘Safe (NEN)’.
* **create\_default\_materials** (`bool`) – whether to start with the default D-Foundations materials.
The default materials are:
> * BClay, clean, moderate
>
> * BClay, clean, modstiff
>
> * BClay, clean, stiff
>
> * BClay, clean, weak
>
> * BClay, sl san, moderate
>
> * BClay, sl san, modstiff
>
> * BClay, sl san, stiff
>
> * BClay, sl san, weak
>
> * BGravel, clean, moderate
>
> * BGravel, clean, stiff
>
> * BGravel, ve sil, moderate
>
> * BGravel, ve sil, stiff
>
> * BLoam, clean, moderate
>
> * BLoam, clean, modstiff
>
> * BLoam, clean, stiff
>
> * BLoam, clean, weak
>
> * BLoam, sl san, moderate
>
> * BLoam, sl san, modstiff
>
> * BLoam, sl san, stiff
>
> * BLoam, sl san, weak
>
> * BPeat, sl san, moderate
>
> * BPeat, sl san, stiff
>
> * BPeat, sl san, weak
>
> * BSand, clean, loose
>
> * BSand, clean, moderate
>
> * BSand, clean, stiff
>
> * BSand, ve sil, loose
>
> * BSand, ve sil, moderate
>
> * BSand, ve sil, stiff
>
> * Clay, clean, moderate
>
> * Clay, clean, stiff
>
> * Clay, clean, weak
>
> * Clay, organ, moderate
>
> * Clay, organ, weak
>
> * Clay, sl san, moderate
>
> * Clay, sl san, stiff
>
> * Clay, sl san, weak
>
> * Clay, ve san, stiff
>
> * Gravel, sl sil, loose
>
> * Gravel, sl sil, moderate
>
> * Gravel, sl sil, stiff
>
> * Gravel, ve sil, loose
>
> * Gravel, ve sil, moderate
>
> * Gravel, ve sil, stiff
>
> * Loam, sl san, moderate
>
> * Loam, sl san, stiff
>
> * Loam, sl san, weak
>
> * Loam, ve san, stiff
>
> * Peat, mod pl, moderate
>
> * Peat, not pl, weak
>
> * Sand, clean, loose
>
> * Sand, clean, moderate
>
> * Sand, clean, stiff
>
> * Sand, sl sil, moderate
>
> * Sand, ve sil, loose
* materials[](#BearingPilesModel.materials "Link to this definition")
Lists all materials currently in de model.
- profiles[](#BearingPilesModel.profiles "Link to this definition")
Lists all profiles currently in de model.
* pile\_types[](#BearingPilesModel.pile_types "Link to this definition")
Lists all pile types currently in de model.
- piles[](#BearingPilesModel.piles "Link to this definition")
Lists all piles currently in de model.
* generate\_input\_file(*metadata=None*, *\**, *as\_file=False*)[](#BearingPilesModel.generate_input_file "Link to this definition")
Generate a D-Foundations input file.
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
* **metadata** ([`Metadata`](#Metadata "viktor.external.dfoundations.Metadata")) – Metadata which will be written to the input file. If no metadata is provided, default data will be used.
* **as\_file** (`bool`) – return as BytesIO (default) or File
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `BytesIO`
- create\_material(*name*, *soil\_type*, *gamma\_unsat*, *gamma\_sat*, *friction\_angle*, *diameter\_d50=0.2*, *color=None*)[](#BearingPilesModel.create_material "Link to this definition")
Create a material with the given name and properties.
* Parameters:
* **name** (`str`) – name of the material to create (max. 25 characters)
* **soil\_type** ([`SoilType`](#SoilType "viktor.external.dfoundations.SoilType")) – \[-]
* **gamma\_unsat** (`float`) – gamma-unsaturated, dry \[kN/m³]
* **gamma\_sat** (`float`) – gamma-saturated, wet \[kN/m³]
* **friction\_angle** (`float`) – phi \[degree]
* **diameter\_d50** (`float`) – median \[mm]
* **color** ([`Color`](https://docs.viktor.ai/sdk/api/core/.md#Color "viktor.core.Color")) – color for visualization in deltares software (None for default color ‘white’)
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if material with given name already exists in the model
* if name is longer than 25 characters
* Return type:
`None`
* create\_pile(*name*, *x*, *y*, *pile\_head\_level*, *surcharge*, *limit\_state\_str\_geo*, *serviceability\_limit\_state*)[](#BearingPilesModel.create_pile "Link to this definition")
Create a pile with given properties.
* Parameters:
* **name** (`str`) – name of the pile. Must be unique. Max. 10 characters.
* **x** (`float`) – \[m]
* **y** (`float`) – \[m]
* **pile\_head\_level** (`float`) – \[m R.L.]
* **surcharge** (`float`) – \[kN/m2]
* **limit\_state\_str\_geo** (`float`) – Limit state STR/GEO \[kN]
* **serviceability\_limit\_state** (`float`) – \[kN]
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if pile with given name already exists.
* if name exceeds the max. number of characters (10).
* Return type:
`None`
- create\_pile\_type(*name*, *shape*, *pile\_type*, *slip\_layer*, *type\_sand\_gravel=None*, *type\_clay\_loam\_peat=None*, *type\_p=None*, *load\_settlement\_curve=None*, *material=None*, *factor\_sand\_gravel=None*, *factor\_clay\_loam\_peat=None*, *factor\_pile\_class=None*, *e\_modulus=None*, *slip\_layer\_adhesion=None*, *\**, *use\_pre\_2016=False*, *as\_prefab=False*, *qciii\_reduction=None*, *overrule\_tip\_section\_factor=None*, *overrule\_tip\_shape\_factor=None*)[](#BearingPilesModel.create_pile_type "Link to this definition")
Create a pile type with the given properties.
* Parameters:
* **name** (`str`) – name of the pile type. Must be unique. Max. 10 characters.
* **shape** (`_PileShape`) – pile type shape class instance. See below for possible shapes.
* **pile\_type** ([`PileType`](#PileType "viktor.external.dfoundations.PileType")) – predefined/user-defined pile type. Only certain types are valid in combination with the provided ‘shape’. For more information on valid combinations, please refer to the D-Foundations software.
* **slip\_layer** ([`PileSlipLayer`](#PileSlipLayer "viktor.external.dfoundations.PileSlipLayer"))
* **type\_sand\_gravel** ([`PileType`](#PileType "viktor.external.dfoundations.PileType")) – pile type for α\_s sand/gravel
* **type\_clay\_loam\_peat** ([`PileTypeClayLoamPeat`](#PileTypeClayLoamPeat "viktor.external.dfoundations.PileTypeClayLoamPeat")) – pile type for α\_s clay/loam/peat
* **type\_p** ([`PileType`](#PileType "viktor.external.dfoundations.PileType")) – pile type for α\_p
* **load\_settlement\_curve** ([`PileLoadSettlementCurve`](#PileLoadSettlementCurve "viktor.external.dfoundations.PileLoadSettlementCurve"))
* **material** ([`PileMaterial`](#PileMaterial "viktor.external.dfoundations.PileMaterial"))
* **factor\_sand\_gravel** (`float`) – α\_s \[-]. Only required if ‘type\_sand\_gravel’ is of type user-defined.
* **factor\_clay\_loam\_peat** (`float`) – α\_s \[-]. Only required if ‘type\_clay\_loam\_peat’ is of type user-defined.
* **factor\_pile\_class** (`float`) – α\_p \[-]. Only required if ‘type\_p’ is of type user-defined.
* **e\_modulus** (`float`) – Young’s modulus \[kN/m2]. Only required if ‘material’ is of type user-defined.
* **slip\_layer\_adhesion** (`float`) – Representative cohesion \[kN/m2]. Only required if ‘slip\_layer’ is of type user-defined.
* **use\_pre\_2016** (`bool`)
* **as\_prefab** (`bool`)
* **qciii\_reduction** (`float`) – \[%]
* **overrule\_tip\_section\_factor** (`float`) – Pile top cross section factor (s) \[-]
* **overrule\_tip\_shape\_factor** (`float`) – Pile tip shape factor (β) \[-]
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if ‘pile\_type’ is of type user-defined and ‘type\_sand\_gravel’ is not set.
* if ‘pile\_type’ is of type user-defined and ‘type\_clay\_loam\_peat’ is not set.
* if ‘pile\_type’ is of type user-defined and ‘material’ is not set.
* if ‘pile\_type’ is of type user-defined and ‘type\_p’ is not set.
* if ‘pile\_type’ is of type user-defined and ‘load\_settlement\_curve’ is not set.
* if ‘type\_sand\_gravel’ is of type user-defined and ‘factor\_sand\_gravel’ is not set.
* if ‘type\_clay\_loam\_peat’ is of type user-defined and ‘factor\_clay\_loam\_peat’ is not set.
* if ‘material’ is of type user-defined and ‘e\_modulus’ is not set.
* if ‘type\_p’ is of type user-defined and ‘factor\_pile\_class’ is not set.
* if ‘slip\_layer’ is of type user-defined and ‘slip\_layer\_adhesion’ is not set.
* if an invalid ‘shape’ is provided.
* if a ‘pile\_type’ is provided that is invalid in combination with the given ‘shape’.
* if one of the types PileType.USER\_DEFINED\_VIBRATING or PileType.USER\_DEFINED\_LOW\_VIBRATING is selected for ‘type\_sand\_gravel’ or ‘type\_p’ (no valid options).
* if a pile type with the give name already exists.
* if ‘factor\_sand\_gravel’, ‘factor\_clay\_loam\_peat’ or ‘factor\_pile\_class’ is outside valid range 0-9.
* if ‘overrule\_tip\_section\_factor’ or ‘overrule\_tip\_shape\_factor’ is outside valid range 0-10.
* Return type:
`None`
Possible shapes are:
> * RectPile
>
> * RectEnlPile
>
> * SectionPile
>
> * RoundPile
>
> * TaperPile
>
> * HollowPile
>
> * HollowOpenPile
>
> * RoundEnlPile
>
> * LostTipPile
>
> * DrivenBasePile
>
> * HShapedPile
* create\_profile(*name*, *layers*, *x*, *y*, *measurements*, *phreatic\_level*, *pile\_tip\_level*, *overconsolidation\_ratio*, *top\_positive\_skin\_friction*, *bottom\_negative\_skin\_friction*, *expected\_ground\_level\_settlement*, *\**, *cpt\_rule=CPTRule.NEN*, *min\_layer\_thickness=0.1*)[](#BearingPilesModel.create_profile "Link to this definition")
Create a profile manually.
* Parameters:
* **name** (`str`) – name of the profile (must be unique).
* **layers** (`List`\[[`ProfileLayer`](#ProfileLayer "viktor.external.dfoundations.ProfileLayer")]) – list of layers.
* **x** (`float`) – \[m]
* **y** (`float`) – \[m]
* **measurements** (`List`\[`Tuple`\[`float`, `float`]]) – list of measurement data (level \[m], qc-value \[MPa]).
* **phreatic\_level** (`float`) – \[m]
* **pile\_tip\_level** (`float`) – \[m]
* **overconsolidation\_ratio** (`float`) – overconsolidation ratio of bearing zone \[-]
* **top\_positive\_skin\_friction** (`float`) – top of positive skin friction \[m]
* **bottom\_negative\_skin\_friction** (`float`) – bottom of negative skin friction \[m]
* **expected\_ground\_level\_settlement** (`float`) – \[m]
* **cpt\_rule** ([`CPTRule`](#CPTRule "viktor.external.dfoundations.CPTRule"))
* **min\_layer\_thickness** (`float`) – \[m]
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if max. number of profiles (350) was reached.
* if profile with the given name already exists.
* if a material exists within one of the layers of which the name does not exist in the model.
* if measurements exceeds max. number of rows (5000).
* if layers exceeds max. number for a single profile (100).
* Return type:
`None`
- import\_profile(*cpt*, *layers*, *x*, *y*, *phreatic\_level*, *pile\_tip\_level*, *overconsolidation\_ratio*, *top\_positive\_skin\_friction*, *bottom\_negative\_skin\_friction*, *expected\_ground\_level\_settlement*, *name=None*, *manual\_ground\_level=None*, *\**, *cpt\_rule=CPTRule.NEN*, *min\_layer\_thickness=0.1*)[](#BearingPilesModel.import_profile "Link to this definition")
Create a profile by importing a CPT-file.
* Parameters:
* **cpt** ([`GEFData`](https://docs.viktor.ai/sdk/api/geo/.md#GEFData "viktor.geo.GEFData")) – CPT file to import.
* **layers** (`List`\[[`ProfileLayer`](#ProfileLayer "viktor.external.dfoundations.ProfileLayer")]) – list of layers.
* **x** (`float`) – \[m]
* **y** (`float`) – \[m]
* **phreatic\_level** (`float`) – \[m]
* **pile\_tip\_level** (`float`) – \[m]
* **overconsolidation\_ratio** (`float`) – overconsolidation ratio of bearing zone \[-]
* **top\_positive\_skin\_friction** (`float`) – top of positive skin friction \[m]
* **bottom\_negative\_skin\_friction** (`float`) – bottom of negative skin friction \[m]
* **expected\_ground\_level\_settlement** (`float`) – \[m]
* **name** (`str`) – name of the profile (must be unique). None for default (name of the cpt).
* **manual\_ground\_level** (`float`) – set to override the ground level \[m] from the cpt.
* **cpt\_rule** ([`CPTRule`](#CPTRule "viktor.external.dfoundations.CPTRule"))
* **min\_layer\_thickness** (`float`) – \[m]
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if max. number of profiles (350) was reached.
* if profile with the given name already exists.
* if a material exists within one of the layers of which the name does not exist in the model.
* if measurements exceeds max. number of rows (5000).
* if layers exceeds max. number for a single profile (100).
* if ground level could not be read from cpt file.
* Return type:
`None`
## CPTRule[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_CPTRule "Direct link to CPTRule")
* *class *viktor.external.dfoundations.CPTRule(*\*values*)[](#CPTRule "Link to this definition")
Bases: `Enum`
* CUR*: [`CPTRule`](#CPTRule "viktor.external.dfoundations.CPTRule")** = 1*[](#CPTRule.CUR "Link to this definition")
- NEN*: [`CPTRule`](#CPTRule "viktor.external.dfoundations.CPTRule")** = 0*[](#CPTRule.NEN "Link to this definition")
* NEN\_STRESS*: [`CPTRule`](#CPTRule "viktor.external.dfoundations.CPTRule")** = 0*[](#CPTRule.NEN_STRESS "Link to this definition")
- QC\_ONLY*: [`CPTRule`](#CPTRule "viktor.external.dfoundations.CPTRule")** = 3*[](#CPTRule.QC_ONLY "Link to this definition")
* TYPE\_3*: [`CPTRule`](#CPTRule "viktor.external.dfoundations.CPTRule")** = 2*[](#CPTRule.TYPE_3 "Link to this definition")
## CalculationType[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_CalculationType "Direct link to CalculationType")
* *class *viktor.external.dfoundations.CalculationType(*\*values*)[](#CalculationType "Link to this definition")
Bases: `Enum`
* BEARING\_CAPACITY\_AT\_FIXED\_PILE\_TIP\_LEVEL*: [`CalculationType`](#CalculationType "viktor.external.dfoundations.CalculationType")** = 3*[](#CalculationType.BEARING_CAPACITY_AT_FIXED_PILE_TIP_LEVEL "Link to this definition")
- COMPLETE\_CALCULATION*: [`CalculationType`](#CalculationType "viktor.external.dfoundations.CalculationType")** = 1*[](#CalculationType.COMPLETE_CALCULATION "Link to this definition")
* DESIGN\_CALCULATION*: [`CalculationType`](#CalculationType "viktor.external.dfoundations.CalculationType")** = 0*[](#CalculationType.DESIGN_CALCULATION "Link to this definition")
- INDICATION\_BEARING\_CAPACITY*: [`CalculationType`](#CalculationType "viktor.external.dfoundations.CalculationType")** = 2*[](#CalculationType.INDICATION_BEARING_CAPACITY "Link to this definition")
* PILE\_TIP\_LEVEL\_AND\_NET\_BEARING\_CAPACITY*: [`CalculationType`](#CalculationType "viktor.external.dfoundations.CalculationType")** = 4*[](#CalculationType.PILE_TIP_LEVEL_AND_NET_BEARING_CAPACITY "Link to this definition")
## ConstructionSequence[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_ConstructionSequence "Direct link to ConstructionSequence")
* *class *viktor.external.dfoundations.ConstructionSequence(*\*values*)[](#ConstructionSequence "Link to this definition")
Bases: `Enum`
* CPT\_EXCAVATION\_INSTALL*: [`ConstructionSequence`](#ConstructionSequence "viktor.external.dfoundations.ConstructionSequence")** = 1*[](#ConstructionSequence.CPT_EXCAVATION_INSTALL "Link to this definition")
- CPT\_INSTALL\_EXCAVATION*: [`ConstructionSequence`](#ConstructionSequence "viktor.external.dfoundations.ConstructionSequence")** = 6*[](#ConstructionSequence.CPT_INSTALL_EXCAVATION "Link to this definition")
* EXCAVATION\_CPT\_BOTH\_BEFORE\_AND\_AFTER\_INSTALL*: [`ConstructionSequence`](#ConstructionSequence "viktor.external.dfoundations.ConstructionSequence")** = 7*[](#ConstructionSequence.EXCAVATION_CPT_BOTH_BEFORE_AND_AFTER_INSTALL "Link to this definition")
- EXCAVATION\_CPT\_INSTALL*: [`ConstructionSequence`](#ConstructionSequence "viktor.external.dfoundations.ConstructionSequence")** = 3*[](#ConstructionSequence.EXCAVATION_CPT_INSTALL "Link to this definition")
* EXCAVATION\_INSTALL\_CPT*: [`ConstructionSequence`](#ConstructionSequence "viktor.external.dfoundations.ConstructionSequence")** = 4*[](#ConstructionSequence.EXCAVATION_INSTALL_CPT "Link to this definition")
- INSTALL\_CPT\_EXCAVATION*: [`ConstructionSequence`](#ConstructionSequence "viktor.external.dfoundations.ConstructionSequence")** = 2*[](#ConstructionSequence.INSTALL_CPT_EXCAVATION "Link to this definition")
* INSTALL\_EXCAVATION\_CPT*: [`ConstructionSequence`](#ConstructionSequence "viktor.external.dfoundations.ConstructionSequence")** = 5*[](#ConstructionSequence.INSTALL_EXCAVATION_CPT "Link to this definition")
## DFoundationsAnalysis[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_DFoundationsAnalysis "Direct link to DFoundationsAnalysis")
* *class *viktor.external.dfoundations.DFoundationsAnalysis(*input\_file*)[](#DFoundationsAnalysis "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
DFoundationsAnalysis can be used to perform an analysis using D-Foundations on a third-party worker. To start an analysis call the method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"), with an appropriate timeout (in seconds). To retrieve the results call the method [`get_output_file()`](#DFoundationsAnalysis.get_output_file "viktor.external.dfoundations.DFoundationsAnalysis.get_output_file"), after [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute").
Note: the input for the BytesIO object should be of type bytes. You can convert a string to bytes by calling the method `encode()`. Default encoding is ‘utf-8’.
Usage:
```
input_file = BytesIO("dfoundations input file body".encode('utf-8'))
dfoundations_analysis = DFoundationsAnalysis(input_file=input_file)
dfoundations_analysis.execute(timeout=10)
output_file = dfoundations_analysis.get_output_file()
```
Exceptions which can be raised during calculation: - [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
**input\_file** (`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – .foi input file.
- get\_output\_file(*extension='.fod'*, *\**, *as\_file=False*)[](#DFoundationsAnalysis.get_output_file "Link to this definition")
* Method can be used to retrieve the results generated by running an external analysis. Call method
[`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") first and [`get_output_file()`](#DFoundationsAnalysis.get_output_file "viktor.external.dfoundations.DFoundationsAnalysis.get_output_file") afterwards.
- Parameters:
* **extension** (`str`) – extension of the file you want to return; one of: ‘.fos’, ‘.fod’, ‘.error.log’, ‘.err’
* **as\_file** (`bool`) – return as BytesIO (default) or File
- Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
- Returns:
* File, if as\_file = True
* BytesIO, if as\_file = False (default)
## DrivenBasePile[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_DrivenBasePile "Direct link to DrivenBasePile")
* *class *viktor.external.dfoundations.DrivenBasePile(*base\_diameter*, *pile\_diameter*, *base\_height*)[](#DrivenBasePile "Link to this definition")
Bases: [`RoundEnlPile`](#RoundEnlPile "viktor.external.dfoundations.RoundEnlPile")
Round pile with in situ formed base.
Round pile with enlarged base.
* Parameters:
* **base\_diameter** (`float`) – \[m]
* **pile\_diameter** (`float`) – \[m]. Must be smaller than ‘base\_diameter’.
* **base\_height** (`float`) – \[m]
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") – if ‘pile\_diameter’ is not smaller than ‘base\_diameter’.
## HShapedPile[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_HShapedPile "Direct link to HShapedPile")
* *class *viktor.external.dfoundations.HShapedPile(*height*, *width*, *thickness\_web*, *thickness\_flange*)[](#HShapedPile "Link to this definition")
Bases: `_PileShape`
H-shaped profile.
* Parameters:
* **height** (`float`) – \[m]
* **width** (`float`) – \[m]
* **thickness\_web** (`float`) – \[mm]. Must be smaller than ‘width’.
* **thickness\_flange** (`float`) – \[mm]. Must be smaller than half of ‘height’.
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if ‘thickness\_web’ is not smaller than ‘width’.
* if ‘thickness\_flange’ is not smaller than half of ‘height’.
## HollowOpenPile[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_HollowOpenPile "Direct link to HollowOpenPile")
* *class *viktor.external.dfoundations.HollowOpenPile(*external\_diameter*, *wall\_thickness*)[](#HollowOpenPile "Link to this definition")
Bases: `_PileShape`
Round open-ended hollow pile.
* Parameters:
* **external\_diameter** (`float`) – \[m]
* **wall\_thickness** (`float`) – \[mm]. Must be smaller than half of ‘external\_diameter’.
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") – if ‘wall\_thickness’ is not smaller than half of ‘external\_diameter’.
- *property *internal\_diameter*: float*[](#HollowOpenPile.internal_diameter "Link to this definition")
## HollowPile[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_HollowPile "Direct link to HollowPile")
* *class *viktor.external.dfoundations.HollowPile(*external\_diameter*, *wall\_thickness*)[](#HollowPile "Link to this definition")
Bases: `_PileShape`
Round hollow pile with closed base.
* Parameters:
* **external\_diameter** (`float`) – \[m]
* **wall\_thickness** (`float`) – \[mm]. Must be smaller than half of ‘external\_diameter’.
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") – if ‘wall\_thickness’ is not smaller than half of ‘external\_diameter’.
- *property *internal\_diameter*: float*[](#HollowPile.internal_diameter "Link to this definition")
## LostTipPile[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_LostTipPile "Direct link to LostTipPile")
* *class *viktor.external.dfoundations.LostTipPile(*base\_diameter*, *pile\_diameter*)[](#LostTipPile "Link to this definition")
Bases: `_PileShape`
Round pile with lost tip.
* Parameters:
* **base\_diameter** (`float`) – \[m]
* **pile\_diameter** (`float`) – \[m]. Must be smaller than ‘base\_diameter’.
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") – if ‘pile\_diameter’ is not smaller than ‘base\_diameter’.
## MaxConeResistType[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_MaxConeResistType "Direct link to MaxConeResistType")
* *class *viktor.external.dfoundations.MaxConeResistType(*\*values*)[](#MaxConeResistType "Link to this definition")
Bases: `Enum`
* MANUAL*: [`MaxConeResistType`](#MaxConeResistType "viktor.external.dfoundations.MaxConeResistType")** = 1*[](#MaxConeResistType.MANUAL "Link to this definition")
- STANDARD*: [`MaxConeResistType`](#MaxConeResistType "viktor.external.dfoundations.MaxConeResistType")** = 0*[](#MaxConeResistType.STANDARD "Link to this definition")
## Metadata[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_Metadata "Direct link to Metadata")
* *class *viktor.external.dfoundations.Metadata(*file\_name='-'*, *company='-'*, *title\_1='-'*, *title\_2='-'*, *geotechnical\_consultant=''*, *design\_engineer=''*, *principal=''*, *project\_id=''*, *location=''*, *current\_date=False*, *current\_time=False*)[](#Metadata "Link to this definition")
Data container for metadata to be added to the D-Foundations input file.
* Parameters:
* **file\_name** (`str`) – file name, as shown in the input file header
* **company** (`str`) – company name, as shown in the input file header
* **title\_1** (`str`)
* **title\_2** (`str`)
* **geotechnical\_consultant** (`str`)
* **design\_engineer** (`str`)
* **principal** (`str`)
* **project\_id** (`str`)
* **location** (`str`)
* **current\_date** (`bool`) – date, as shown in the input file header
* **current\_time** (`bool`) – time, as shown in the input file header
## OutputFileParser[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_OutputFileParser "Direct link to OutputFileParser")
* *class *viktor.external.dfoundations.OutputFileParser(*fod\_file*)[](#OutputFileParser "Link to this definition")
Helper class to extract results from a D-Foundations output file (.fod).
Currently the following versions are (partly) supported:
* * v17:
* Tension Piles model
* Bearing Piles model - Preliminary Design (calculation options only)
* * v19:
* Tension Piles model
* Bearing Piles model - Verification
Example usage:
```
parser = OutputFileParser(fod_file)
calculation_parameters = parser.calculation_parameters
results = parser.results(False)
```
* Parameters:
**fod\_file** (`StringIO`) – D-Foundations output file (.fod)
- *abstract property *calculation\_parameters*: Dict\[str, float | bool]*[](#OutputFileParser.calculation_parameters "Link to this definition")
Calculation parameters.
* *property *raw\_results*: str*[](#OutputFileParser.raw_results "Link to this definition")
- *abstractmethod *results(*as\_pandas=True*)[](#OutputFileParser.results "Link to this definition")
All result data.
* Parameters:
**as\_pandas** (`bool`) – True to return the results as a dictionary of pandas DataFrame objects. False for dicts.
* Return type:
`Dict`\[`str`, `DataFrame` | `Dict`\[`str`, `Any`]]
## PileLoadSettlementCurve[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_PileLoadSettlementCurve "Direct link to PileLoadSettlementCurve")
* *class *viktor.external.dfoundations.PileLoadSettlementCurve(*\*values*)[](#PileLoadSettlementCurve "Link to this definition")
Bases: `Enum`
* ONE*: [`PileLoadSettlementCurve`](#PileLoadSettlementCurve "viktor.external.dfoundations.PileLoadSettlementCurve")** = 0*[](#PileLoadSettlementCurve.ONE "Link to this definition")
- THREE*: [`PileLoadSettlementCurve`](#PileLoadSettlementCurve "viktor.external.dfoundations.PileLoadSettlementCurve")** = 2*[](#PileLoadSettlementCurve.THREE "Link to this definition")
* TWO*: [`PileLoadSettlementCurve`](#PileLoadSettlementCurve "viktor.external.dfoundations.PileLoadSettlementCurve")** = 1*[](#PileLoadSettlementCurve.TWO "Link to this definition")
## PileMaterial[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_PileMaterial "Direct link to PileMaterial")
* *class *viktor.external.dfoundations.PileMaterial(*\*values*)[](#PileMaterial "Link to this definition")
Bases: `Enum`
* CONCRETE*: [`PileMaterial`](#PileMaterial "viktor.external.dfoundations.PileMaterial")** = 0*[](#PileMaterial.CONCRETE "Link to this definition")
- STEEL*: [`PileMaterial`](#PileMaterial "viktor.external.dfoundations.PileMaterial")** = 1*[](#PileMaterial.STEEL "Link to this definition")
* TIMBER*: [`PileMaterial`](#PileMaterial "viktor.external.dfoundations.PileMaterial")** = 2*[](#PileMaterial.TIMBER "Link to this definition")
- USER\_DEFINED*: [`PileMaterial`](#PileMaterial "viktor.external.dfoundations.PileMaterial")** = 3*[](#PileMaterial.USER_DEFINED "Link to this definition")
* WOOD*: [`PileMaterial`](#PileMaterial "viktor.external.dfoundations.PileMaterial")** = 2*[](#PileMaterial.WOOD "Link to this definition")
## PileSlipLayer[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_PileSlipLayer "Direct link to PileSlipLayer")
* *class *viktor.external.dfoundations.PileSlipLayer(*\*values*)[](#PileSlipLayer "Link to this definition")
Bases: `Enum`
* BENTONITE*: [`PileSlipLayer`](#PileSlipLayer "viktor.external.dfoundations.PileSlipLayer")** = 2*[](#PileSlipLayer.BENTONITE "Link to this definition")
- BITUMEN*: [`PileSlipLayer`](#PileSlipLayer "viktor.external.dfoundations.PileSlipLayer")** = 3*[](#PileSlipLayer.BITUMEN "Link to this definition")
* NONE*: [`PileSlipLayer`](#PileSlipLayer "viktor.external.dfoundations.PileSlipLayer")** = 0*[](#PileSlipLayer.NONE "Link to this definition")
- SYNTHETIC*: [`PileSlipLayer`](#PileSlipLayer "viktor.external.dfoundations.PileSlipLayer")** = 1*[](#PileSlipLayer.SYNTHETIC "Link to this definition")
* USER\_DEFINED*: [`PileSlipLayer`](#PileSlipLayer "viktor.external.dfoundations.PileSlipLayer")** = 4*[](#PileSlipLayer.USER_DEFINED "Link to this definition")
## PileType[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_PileType "Direct link to PileType")
* *class *viktor.external.dfoundations.PileType(*\*values*)[](#PileType "Link to this definition")
Bases: `Enum`
* BORED\_DRILLING*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 12*[](#PileType.BORED_DRILLING "Link to this definition")
- BORED\_SHELLING*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 13*[](#PileType.BORED_SHELLING "Link to this definition")
* CLOSED\_STEEL*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 1*[](#PileType.CLOSED_STEEL "Link to this definition")
- CONTINUOUS\_FLIGHT\_AUGER*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 11*[](#PileType.CONTINUOUS_FLIGHT_AUGER "Link to this definition")
* DRIVEN\_TUBE\_BACK\_DRIVING*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 2*[](#PileType.DRIVEN_TUBE_BACK_DRIVING "Link to this definition")
- DRIVEN\_TUBE\_BACK\_VIBRATION*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 3*[](#PileType.DRIVEN_TUBE_BACK_VIBRATION "Link to this definition")
* GROUTED\_STEEL\_PIPE*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 24*[](#PileType.GROUTED_STEEL_PIPE "Link to this definition")
- GROUTED\_STEEL\_PROFILE*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 23*[](#PileType.GROUTED_STEEL_PROFILE "Link to this definition")
* MICRO\_ANCHOR\_BORED*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 20*[](#PileType.MICRO_ANCHOR_BORED "Link to this definition")
- MICRO\_ANCHOR\_SCREWED*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 21*[](#PileType.MICRO_ANCHOR_SCREWED "Link to this definition")
* MICRO\_DOUBLE\_EXTORTED*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 16*[](#PileType.MICRO_DOUBLE_EXTORTED "Link to this definition")
- MICRO\_DOUBLE\_NOT\_EXTORTED*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 17*[](#PileType.MICRO_DOUBLE_NOT_EXTORTED "Link to this definition")
* MICRO\_SINGLE\_EXTORTED*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 18*[](#PileType.MICRO_SINGLE_EXTORTED "Link to this definition")
- MICRO\_SINGLE\_NOT\_EXTORTED*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 19*[](#PileType.MICRO_SINGLE_NOT_EXTORTED "Link to this definition")
* MICRO\_VIBRATED*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 22*[](#PileType.MICRO_VIBRATED "Link to this definition")
- MV*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 15*[](#PileType.MV "Link to this definition")
* OPEN\_STEEL*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 14*[](#PileType.OPEN_STEEL "Link to this definition")
- PREFAB\_CONCRETE*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 0*[](#PileType.PREFAB_CONCRETE "Link to this definition")
* PREFAB\_WITHOUT\_GROUT*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 9*[](#PileType.PREFAB_WITHOUT_GROUT "Link to this definition")
- PREFAB\_WITH\_GROUT*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 8*[](#PileType.PREFAB_WITH_GROUT "Link to this definition")
* SCREW\_LOST\_TIP*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 6*[](#PileType.SCREW_LOST_TIP "Link to this definition")
- SCREW\_WITH\_GROUT*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 7*[](#PileType.SCREW_WITH_GROUT "Link to this definition")
* STEEL*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 10*[](#PileType.STEEL "Link to this definition")
- STRAIGHT\_TIMBER*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 5*[](#PileType.STRAIGHT_TIMBER "Link to this definition")
* TAPERED\_TIMBER*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 4*[](#PileType.TAPERED_TIMBER "Link to this definition")
- USER\_DEFINED*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 27*[](#PileType.USER_DEFINED "Link to this definition")
* USER\_DEFINED\_LOW\_VIBRATING*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 26*[](#PileType.USER_DEFINED_LOW_VIBRATING "Link to this definition")
- USER\_DEFINED\_VIBRATING*: [`PileType`](#PileType "viktor.external.dfoundations.PileType")** = 25*[](#PileType.USER_DEFINED_VIBRATING "Link to this definition")
## PileTypeClayLoamPeat[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_PileTypeClayLoamPeat "Direct link to PileTypeClayLoamPeat")
* *class *viktor.external.dfoundations.PileTypeClayLoamPeat(*\*values*)[](#PileTypeClayLoamPeat "Link to this definition")
Bases: `Enum`
* ACCORDING\_TO\_STANDARD*: [`PileTypeClayLoamPeat`](#PileTypeClayLoamPeat "viktor.external.dfoundations.PileTypeClayLoamPeat")** = 0*[](#PileTypeClayLoamPeat.ACCORDING_TO_STANDARD "Link to this definition")
- USER\_DEFINED*: [`PileTypeClayLoamPeat`](#PileTypeClayLoamPeat "viktor.external.dfoundations.PileTypeClayLoamPeat")** = 1*[](#PileTypeClayLoamPeat.USER_DEFINED "Link to this definition")
## ProfileLayer[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_ProfileLayer "Direct link to ProfileLayer")
* *class *viktor.external.dfoundations.ProfileLayer(*top\_level*, *material*, *ad\_pore\_pressure\_at\_top=0.0*, *ad\_pore\_pressure\_at\_bottom=0.0*, *ocr=1.0*)[](#ProfileLayer "Link to this definition")
Data container for a single layer within a profile.
* Parameters:
* **top\_level** (`float`) – \[m]
* **material** (`str`) – name of the material.
* **ad\_pore\_pressure\_at\_top** (`float`) – \[kN/m2]. Tensions Piles (EC7-NL) model only. Ignored for other model types.
* **ad\_pore\_pressure\_at\_bottom** (`float`) – \[kN/m2]. Tensions Piles (EC7-NL) model only. Ignored for other model types.
* **ocr** (`float`) – \[-]. Tensions Piles (EC7-NL) model only. Ignored for other model types.
- *property *material*: str*[](#ProfileLayer.material "Link to this definition")
## RectEnlPile[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_RectEnlPile "Direct link to RectEnlPile")
* *class *viktor.external.dfoundations.RectEnlPile(*base\_width*, *base\_length*, *base\_height*, *shaft\_width*, *shaft\_length*)[](#RectEnlPile "Link to this definition")
Bases: `_PileShape`
Round pile with enlarged base.
* Parameters:
* **base\_width** (`float`) – \[m]
* **base\_length** (`float`) – \[m]
* **base\_height** (`float`) – \[m]
* **shaft\_width** (`float`) – \[m]. Must be smaller than ‘base\_width’.
* **shaft\_length** (`float`) – \[m]. Must be smaller than ‘base\_length’.
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if ‘shaft\_width’ is not smaller than ‘base\_width’.
* if ‘shaft\_length’ is not smaller than ‘base\_length’.
## RectPile[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_RectPile "Direct link to RectPile")
* *class *viktor.external.dfoundations.RectPile(*width*, *length*)[](#RectPile "Link to this definition")
Bases: `_PileShape`
Rectangular pile.
* Parameters:
* **width** (`float`) – \[m]
* **length** (`float`) – \[m]
## RoundEnlPile[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_RoundEnlPile "Direct link to RoundEnlPile")
* *class *viktor.external.dfoundations.RoundEnlPile(*base\_diameter*, *pile\_diameter*, *base\_height*)[](#RoundEnlPile "Link to this definition")
Bases: [`LostTipPile`](#LostTipPile "viktor.external.dfoundations.LostTipPile")
Round pile with enlarged base.
* Parameters:
* **base\_diameter** (`float`) – \[m]
* **pile\_diameter** (`float`) – \[m]. Must be smaller than ‘base\_diameter’.
* **base\_height** (`float`) – \[m]
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") – if ‘pile\_diameter’ is not smaller than ‘base\_diameter’.
## RoundPile[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_RoundPile "Direct link to RoundPile")
* *class *viktor.external.dfoundations.RoundPile(*diameter*)[](#RoundPile "Link to this definition")
Bases: `_PileShape`
Round pile.
* Parameters:
**diameter** (`float`) – \[m]
## SectionPile[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_SectionPile "Direct link to SectionPile")
* *class *viktor.external.dfoundations.SectionPile(*width*, *length*)[](#SectionPile "Link to this definition")
Bases: [`RectPile`](#RectPile "viktor.external.dfoundations.RectPile")
Section pile.
Rectangular pile.
* Parameters:
* **width** (`float`) – \[m]
* **length** (`float`) – \[m]
## SoilType[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_SoilType "Direct link to SoilType")
* *class *viktor.external.dfoundations.SoilType(*\*values*)[](#SoilType "Link to this definition")
Bases: `Enum`
* CLAY*: [`SoilType`](#SoilType "viktor.external.dfoundations.SoilType")** = 3*[](#SoilType.CLAY "Link to this definition")
- GRAVEL*: [`SoilType`](#SoilType "viktor.external.dfoundations.SoilType")** = 0*[](#SoilType.GRAVEL "Link to this definition")
* LOAM*: [`SoilType`](#SoilType "viktor.external.dfoundations.SoilType")** = 2*[](#SoilType.LOAM "Link to this definition")
- PEAT*: [`SoilType`](#SoilType "viktor.external.dfoundations.SoilType")** = 4*[](#SoilType.PEAT "Link to this definition")
* SAND*: [`SoilType`](#SoilType "viktor.external.dfoundations.SoilType")** = 1*[](#SoilType.SAND "Link to this definition")
## TaperPile[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_TaperPile "Direct link to TaperPile")
* *class *viktor.external.dfoundations.TaperPile(*diameter\_tip*, *increase*)[](#TaperPile "Link to this definition")
Bases: `_PileShape`
Round tapered pile.
* Parameters:
* **diameter\_tip** (`float`) – \[m]
* **increase** (`float`) – \[m/m’]
## TensionPilesCalculationOptions[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_TensionPilesCalculationOptions "Direct link to TensionPilesCalculationOptions")
* *class *viktor.external.dfoundations.TensionPilesCalculationOptions(*calculation\_type*, *rigid*, *unit\_weight\_water=9.81*, *surcharge=0.0*, *\**, *xi3=None*, *xi4=None*, *gamma\_m\_var\_qc=None*, *gamma\_st=None*, *gamma\_gamma=None*, *use\_compaction=False*, *overrule\_excavation=False*, *overrule\_excess\_pore\_pressure=True*, *trajectory\_begin\_end\_interval=None*, *net\_bearing\_capacity=None*)[](#TensionPilesCalculationOptions "Link to this definition")
Bases: `_CalculationOptions`
Data container for the calculation options for a Tension Piles (EC7-NL) model.
* Parameters:
* **calculation\_type** ([`CalculationType`](#CalculationType "viktor.external.dfoundations.CalculationType")) –
valid types:
* CalculationType.INDICATION\_BEARING\_CAPACITY
* CalculationType.BEARING\_CAPACITY\_AT\_FIXED\_PILE\_TIP\_LEVEL
* CalculationType.PILE\_TIP\_LEVEL\_AND\_NET\_BEARING\_CAPACITY
* **rigid** (`bool`) – True for rigid, False for non-rigid
* **unit\_weight\_water** (`float`) – \[kN/m3]
* **surcharge** (`float`) – \[kN/m2]
* **xi3** (`float`) – ξ\_3 \[-]
* **xi4** (`float`) – ξ\_4 \[-]
* **gamma\_m\_var\_qc** (`float`) – γ\_m;var;qc \[-]
* **gamma\_st** (`float`) – γ\_st \[-]
* **gamma\_gamma** (`float`) – γ\_γ \[-]
* **overrule\_excavation** (`bool`)
* **use\_compaction** (`bool`)
* **overrule\_excess\_pore\_pressure** (`bool`)
* **trajectory\_begin\_end\_interval** (`Tuple`\[`float`, `float`, `float`]) – tuple(\[m], \[m], \[m])
* **net\_bearing\_capacity** (`int`) – \[kN]
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if ‘calculation\_type’ is not one of the valid types.
* if ‘calculation\_type’ is INDICATION\_BEARING\_CAPACITY or PILE\_TIP\_LEVEL\_AND\_NET\_BEARING\_CAPACITY and ‘trajectory\_begin\_end\_interval’ is not set.
* if the number of iterations > 151, based on the provided ‘trajectory\_begin\_end\_interval’.
* if ‘calculation\_type’ is PILE\_TIP\_LEVEL\_AND\_NET\_BEARING\_CAPACITY and ‘net\_bearing\_capacity’ is not set.
## TensionPilesModel[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_TensionPilesModel "Direct link to TensionPilesModel")
* *class *viktor.external.dfoundations.TensionPilesModel(*construction\_sequence*, *calculation\_options*, *excavation\_level*, *reduction\_cone\_resistance=None*, *\**, *create\_default\_materials=True*)[](#TensionPilesModel "Link to this definition")
Bases: `_Model`
Create a Tension Piles (EC7-NL) model.
* Parameters:
* **construction\_sequence** ([`ConstructionSequence`](#ConstructionSequence "viktor.external.dfoundations.ConstructionSequence"))
* **calculation\_options** ([`TensionPilesCalculationOptions`](#TensionPilesCalculationOptions "viktor.external.dfoundations.TensionPilesCalculationOptions"))
* **excavation\_level** (`float`) – \[m]
* **reduction\_cone\_resistance** (`float`) – Distance edge pile to excavation boundary \[m] to implement ‘Begemann’. ‘None’ to implement ‘Safe (NEN)’.
* **create\_default\_materials** (`bool`) – whether to start with the default D-Foundations materials.
The default materials are:
> * BClay, clean, moderate
>
> * BClay, clean, modstiff
>
> * BClay, clean, stiff
>
> * BClay, clean, weak
>
> * BClay, sl san, moderate
>
> * BClay, sl san, modstiff
>
> * BClay, sl san, stiff
>
> * BClay, sl san, weak
>
> * BGravel, clean, moderate
>
> * BGravel, clean, stiff
>
> * BGravel, ve sil, moderate
>
> * BGravel, ve sil, stiff
>
> * BLoam, clean, moderate
>
> * BLoam, clean, modstiff
>
> * BLoam, clean, stiff
>
> * BLoam, clean, weak
>
> * BLoam, sl san, moderate
>
> * BLoam, sl san, modstiff
>
> * BLoam, sl san, stiff
>
> * BLoam, sl san, weak
>
> * BPeat, sl san, moderate
>
> * BPeat, sl san, stiff
>
> * BPeat, sl san, weak
>
> * BSand, clean, loose
>
> * BSand, clean, moderate
>
> * BSand, clean, stiff
>
> * BSand, ve sil, loose
>
> * BSand, ve sil, moderate
>
> * BSand, ve sil, stiff
>
> * Clay, clean, moderate
>
> * Clay, clean, stiff
>
> * Clay, clean, weak
>
> * Clay, organ, moderate
>
> * Clay, organ, weak
>
> * Clay, sl san, moderate
>
> * Clay, sl san, stiff
>
> * Clay, sl san, weak
>
> * Clay, ve san, stiff
>
> * Gravel, sl sil, loose
>
> * Gravel, sl sil, moderate
>
> * Gravel, sl sil, stiff
>
> * Gravel, ve sil, loose
>
> * Gravel, ve sil, moderate
>
> * Gravel, ve sil, stiff
>
> * Loam, sl san, moderate
>
> * Loam, sl san, stiff
>
> * Loam, sl san, weak
>
> * Loam, ve san, stiff
>
> * Peat, mod pl, moderate
>
> * Peat, not pl, weak
>
> * Sand, clean, loose
>
> * Sand, clean, moderate
>
> * Sand, clean, stiff
>
> * Sand, sl sil, moderate
>
> * Sand, ve sil, loose
* materials[](#TensionPilesModel.materials "Link to this definition")
Lists all materials currently in de model.
- profiles[](#TensionPilesModel.profiles "Link to this definition")
Lists all profiles currently in de model.
* pile\_types[](#TensionPilesModel.pile_types "Link to this definition")
Lists all pile types currently in de model.
- piles[](#TensionPilesModel.piles "Link to this definition")
Lists all piles currently in de model.
* generate\_input\_file(*metadata=None*, *\**, *as\_file=False*)[](#TensionPilesModel.generate_input_file "Link to this definition")
Generate a D-Foundations input file.
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
* **metadata** ([`Metadata`](#Metadata "viktor.external.dfoundations.Metadata")) – Metadata which will be written to the input file. If no metadata is provided, default data will be used.
* **as\_file** (`bool`) – return as BytesIO (default) or File
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `BytesIO`
- create\_material(*name*, *soil\_type*, *gamma\_unsat*, *gamma\_sat*, *friction\_angle*, *diameter\_d50=0.2*, *max\_cone\_resist\_type=MaxConeResistType.STANDARD*, *max\_cone\_resist=0.0*, *apply\_tension=True*, *min\_void\_ratio=0.4*, *max\_void\_ratio=0.8*, *color=None*)[](#TensionPilesModel.create_material "Link to this definition")
Create a material with the given name and properties.
* Parameters:
* **name** (`str`) – name of the material to create (max. 25 characters)
* **color** ([`Color`](https://docs.viktor.ai/sdk/api/core/.md#Color "viktor.core.Color")) – color for visualization in deltares software (None for default color ‘white’)
* **soil\_type** ([`SoilType`](#SoilType "viktor.external.dfoundations.SoilType")) – \[-]
* **gamma\_unsat** (`float`) – gamma-unsaturated, dry \[kN/m³]
* **gamma\_sat** (`float`) – gamma-saturated, wet \[kN/m³]
* **friction\_angle** (`float`) – phi \[degree]
* **diameter\_d50** (`float`) – median \[mm]
* **max\_cone\_resist\_type** ([`MaxConeResistType`](#MaxConeResistType "viktor.external.dfoundations.MaxConeResistType")) – \[-]
* **max\_cone\_resist** (`float`) – \[MPa]
* **apply\_tension** (`bool`) – True (default) / False
* **min\_void\_ratio** (`float`) – \[-]
* **max\_void\_ratio** (`float`) – \[-]
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if material with given name already exists in the model
* if name is longer than 25 characters
* Return type:
`None`
* create\_pile(*name*, *x*, *y*, *pile\_head\_level*, *load\_max\_min=None*)[](#TensionPilesModel.create_pile "Link to this definition")
Create a pile with given properties.
* Parameters:
* **name** (`str`) – name of the pile. Must be unique. Max. 10 characters.
* **x** (`float`) – \[m]
* **y** (`float`) – \[m]
* **pile\_head\_level** (`float`) – \[m R.L.]
* **load\_max\_min** (`Tuple`\[`float`, `float`]) – (max. load \[kN], min. load \[kN]). None for ‘No’ use of alternating loads.
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if pile with given name already exists.
* if name exceeds the max. number of characters (10).
* Return type:
`None`
- create\_pile\_type(*name*, *shape*, *type\_sand\_gravel*, *type\_clay\_loam\_peat*, *material*, *factor\_sand\_gravel=None*, *factor\_clay\_loam\_peat=None*, *unit\_weight\_material=None*)[](#TensionPilesModel.create_pile_type "Link to this definition")
Create a pile type with the given properties.
* Parameters:
* **name** (`str`) – name of the pile type. Must be unique. Max. 10 characters.
* **shape** (`_PileShape`) – pile type shape class instance. See below for possible shapes.
* **type\_sand\_gravel** ([`PileType`](#PileType "viktor.external.dfoundations.PileType")) – pile type for α\_t sand/gravel. predefined/user-defined pile type. Only certain types are valid in combination with the provided ‘shape’. For more information on valid combinations, please refer to the D-Foundations software.
* **type\_clay\_loam\_peat** ([`PileTypeClayLoamPeat`](#PileTypeClayLoamPeat "viktor.external.dfoundations.PileTypeClayLoamPeat")) – pile type for α\_t clay/loam/peat.
* **material** ([`PileMaterial`](#PileMaterial "viktor.external.dfoundations.PileMaterial"))
* **factor\_sand\_gravel** (`float`) – α\_t \[-]. Only required if ‘type\_sand\_gravel’ is of type user-defined.
* **factor\_clay\_loam\_peat** (`float`) – α\_t \[-]. Only required if ‘type\_sand\_gravel’ is of type user-defined.
* **unit\_weight\_material** (`float`) – unit weight pile material \[kN/m3]. Only required if ‘material’ is of type ser-defined.
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if ‘type\_sand\_gravel’ is of type user-defined and ‘factor\_sand\_gravel’ is not set.
* if ‘type\_clay\_loam\_peat’ is of type user-defined and ‘factor\_clay\_loam\_peat’ is not set.
* if ‘material’ is of type user-defined and ‘unit\_weight\_material’ is not set.
* if an invalid ‘shape’ is provided.
* if a ‘type\_sand\_gravel’ is provided that is invalid in combination with the given ‘shape’.
* if a pile type with the give name already exists.
* if ‘factor\_sand\_gravel’ or ‘factor\_clay\_loam\_peat’ is outside valid range 0-9.
* Return type:
`None`
Possible shapes are:
> * RectPile
>
> * RectEnlPile
>
> * UserPile
>
> * RoundPile
>
> * TaperPile
>
> * HollowPile
>
> * HollowOpenPile
>
> * RoundEnlPile
>
> * LostTipPile
>
> * DrivenBasePile
>
> * HShapedPile
* create\_profile(*name*, *layers*, *x*, *y*, *measurements*, *phreatic\_level*, *pile\_tip\_level*, *top\_tension\_zone*, *\**, *cpt\_rule=CPTRule.NEN*, *min\_layer\_thickness=0.1*)[](#TensionPilesModel.create_profile "Link to this definition")
Create a profile manually.
* Parameters:
* **name** (`str`) – name of the profile (must be unique).
* **layers** (`List`\[[`ProfileLayer`](#ProfileLayer "viktor.external.dfoundations.ProfileLayer")]) – list of layers.
* **x** (`float`) – \[m]
* **y** (`float`) – \[m]
* **measurements** (`List`\[`Tuple`\[`float`, `float`]]) – list of measurement data (level \[m], qc-value \[MPa]).
* **phreatic\_level** (`float`) – \[m]
* **pile\_tip\_level** (`float`) – \[m]
* **top\_tension\_zone** (`float`) – Top of tension zone \[m]
* **cpt\_rule** ([`CPTRule`](#CPTRule "viktor.external.dfoundations.CPTRule"))
* **min\_layer\_thickness** (`float`) – \[m]
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if max. number of profiles (350) was reached.
* if profile with the given name already exists.
* if a material exists within one of the layers of which the name does not exist in the model.
* if measurements exceeds max. number of rows (5000).
* if layers exceeds max. number for a single profile (100).
* Return type:
`None`
- import\_profile(*cpt*, *layers*, *x*, *y*, *phreatic\_level*, *pile\_tip\_level*, *top\_tension\_zone*, *name=None*, *manual\_ground\_level=None*, *\**, *cpt\_rule=CPTRule.NEN*, *min\_layer\_thickness=0.1*)[](#TensionPilesModel.import_profile "Link to this definition")
Create a profile by importing a CPT-file.
* Parameters:
* **cpt** ([`GEFData`](https://docs.viktor.ai/sdk/api/geo/.md#GEFData "viktor.geo.GEFData")) – CPT file to import.
* **layers** (`List`\[[`ProfileLayer`](#ProfileLayer "viktor.external.dfoundations.ProfileLayer")]) – list of layers.
* **x** (`float`) – \[m]
* **y** (`float`) – \[m]
* **phreatic\_level** (`float`) – \[m]
* **pile\_tip\_level** (`float`) – \[m]
* **top\_tension\_zone** (`float`) – Top of tension zone \[m]
* **name** (`str`) – name of the profile (must be unique). None for default (name of the cpt).
* **manual\_ground\_level** (`float`) – set to override the ground level \[m] from the cpt.
* **cpt\_rule** ([`CPTRule`](#CPTRule "viktor.external.dfoundations.CPTRule"))
* **min\_layer\_thickness** (`float`) – \[m]
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if max. number of profiles (350) was reached.
* if profile with the given name already exists.
* if a material exists within one of the layers of which the name does not exist in the model.
* if measurements exceeds max. number of rows (5000).
* if layers exceeds max. number for a single profile (100).
* if ground level could not be read from cpt file.
* Return type:
`None`
## UserPile[](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#_UserPile "Direct link to UserPile")
* *class *viktor.external.dfoundations.UserPile(*circumference*, *cross\_section*)[](#UserPile "Link to this definition")
Bases: `_PileShape`
User defined pile.
* Parameters:
* **circumference** (`float`) – \[m]
* **cross\_section** (`float`) – \[m2]
---
# viktor.external.dgeostability
## DGeoStabilityAnalysis[](https://docs.viktor.ai/sdk/api/external/dgeostability/.md#_DGeoStabilityAnalysis "Direct link to DGeoStabilityAnalysis")
* *class *viktor.external.dgeostability.DGeoStabilityAnalysis(*input\_file*)[](#DGeoStabilityAnalysis "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
DGeoStabilityAnalysis can be used to perform an analysis using DGeoStability on a third-party worker. To start an analysis call the method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"), with an appropriate timeout (in seconds). To retrieve the results call the method [`get_output_file()`](#DGeoStabilityAnalysis.get_output_file "viktor.external.dgeostability.DGeoStabilityAnalysis.get_output_file"), after [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute").
Usage:
```
dgeostability_analysis = DGeoStabilityAnalysis(input_file=input_file)
dgeostability_analysis.execute(timeout=10)
output_file = dgeostability_analysis.get_output_file()
```
Exceptions which can be raised during calculation: - [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
**input\_file** (`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – .sti input file.
- get\_output\_file(*extension='.sto'*, *\**, *as\_file=False*)[](#DGeoStabilityAnalysis.get_output_file "Link to this definition")
Method can be used to retrieve the results generated by running an external analysis. Call method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") first and [`get_output_file()`](#DGeoStabilityAnalysis.get_output_file "viktor.external.dgeostability.DGeoStabilityAnalysis.get_output_file") afterwards.
* Parameters:
* **extension** (`str`) – extension of the file you want to return; ‘.sto’, ‘.error.log’, ‘.err’
* **as\_file** (`bool`) – Return as BytesIO (default) or File
New in v13.5.0
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
---
# viktor.external.dsettlement
## CalculationModel[](https://docs.viktor.ai/sdk/api/external/dsettlement/.md#_CalculationModel "Direct link to CalculationModel")
* *class *viktor.external.dsettlement.CalculationModel(*\*values*)[](#CalculationModel "Link to this definition")
Bases: `Enum`
* ISOTACHE*: [`CalculationModel`](#CalculationModel "viktor.external.dsettlement.CalculationModel")** = 2*[](#CalculationModel.ISOTACHE "Link to this definition")
- NEN\_BJERRUM*: [`CalculationModel`](#CalculationModel "viktor.external.dsettlement.CalculationModel")** = 1*[](#CalculationModel.NEN_BJERRUM "Link to this definition")
* NEN\_KOPPEJAN*: [`CalculationModel`](#CalculationModel "viktor.external.dsettlement.CalculationModel")** = 0*[](#CalculationModel.NEN_KOPPEJAN "Link to this definition")
## ConsolidationModel[](https://docs.viktor.ai/sdk/api/external/dsettlement/.md#_ConsolidationModel "Direct link to ConsolidationModel")
* *class *viktor.external.dsettlement.ConsolidationModel(*\*values*)[](#ConsolidationModel "Link to this definition")
Bases: `Enum`
* DARCY*: [`ConsolidationModel`](#ConsolidationModel "viktor.external.dsettlement.ConsolidationModel")** = 0*[](#ConsolidationModel.DARCY "Link to this definition")
- TERZAGHI*: [`ConsolidationModel`](#ConsolidationModel "viktor.external.dsettlement.ConsolidationModel")** = 1*[](#ConsolidationModel.TERZAGHI "Link to this definition")
## DSettlementAnalysis[](https://docs.viktor.ai/sdk/api/external/dsettlement/.md#_DSettlementAnalysis "Direct link to DSettlementAnalysis")
* *class *viktor.external.dsettlement.DSettlementAnalysis(*input\_file*)[](#DSettlementAnalysis "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
DSettlementAnalysis can be used to perform an analysis using DSettlement on a third-party worker. To start an analysis call the method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"), with an appropriate timeout (in seconds). To retrieve the results call the method [`get_output_file()`](#DSettlementAnalysis.get_output_file "viktor.external.dsettlement.DSettlementAnalysis.get_output_file"), after [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute").
Usage:
```
input_file = File.from_data("dsettlement input file body")
dsettlement_analysis = DSettlementAnalysis(input_file=input_file)
dsettlement_analysis.execute(timeout=10)
output_file = dsettlement_analysis.get_output_file() # obtain output file in BytesIO
sld_file = dsettlement_analysis.get_sld_file() # obtain sld file in StringIO (to post-process)
```
Exceptions which can be raised during calculation: - [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
**input\_file** (`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – .sli input file.
- get\_output\_file(*extension='.sld'*, *\**, *as\_file=False*)[](#DSettlementAnalysis.get_output_file "Link to this definition")
Method can be used to retrieve the results generated by running an external analysis. Call method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") first and [`get_output_file()`](#DSettlementAnalysis.get_output_file "viktor.external.dsettlement.DSettlementAnalysis.get_output_file") afterwards.
* Parameters:
* **extension** (`str`) – extension of the file you want to return; one of: ‘.sld’, ‘.slo’, ‘.error.log’, ‘.err’
* **as\_file** (`bool`) – return as BytesIO (default) or File
New in v13.5.0
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
* get\_sld\_file(*\**, *as\_file=False*)[](#DSettlementAnalysis.get_sld_file "Link to this definition")
Method to retrieve the sld (result) file.
* Parameters:
**as\_file** (`bool`) – return as StringIO (default) or File
New in v13.5.0
* Raises:
**ValueError** – if file can not be obtained.
* Return type:
`StringIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
## DrainGrid[](https://docs.viktor.ai/sdk/api/external/dsettlement/.md#_DrainGrid "Direct link to DrainGrid")
* *class *viktor.external.dsettlement.DrainGrid(*\*values*)[](#DrainGrid "Link to this definition")
Bases: `Enum`
* RECTANGULAR*: [`DrainGrid`](#DrainGrid "viktor.external.dsettlement.DrainGrid")** = 1*[](#DrainGrid.RECTANGULAR "Link to this definition")
- TRIANGULAR*: [`DrainGrid`](#DrainGrid "viktor.external.dsettlement.DrainGrid")** = 0*[](#DrainGrid.TRIANGULAR "Link to this definition")
* UNDETERMINED*: [`DrainGrid`](#DrainGrid "viktor.external.dsettlement.DrainGrid")** = 2*[](#DrainGrid.UNDETERMINED "Link to this definition")
## DrainType[](https://docs.viktor.ai/sdk/api/external/dsettlement/.md#_DrainType "Direct link to DrainType")
* *class *viktor.external.dsettlement.DrainType(*\*values*)[](#DrainType "Link to this definition")
Bases: `Enum`
* COLUMN*: [`DrainType`](#DrainType "viktor.external.dsettlement.DrainType")** = 1*[](#DrainType.COLUMN "Link to this definition")
- SAND\_WALL*: [`DrainType`](#DrainType "viktor.external.dsettlement.DrainType")** = 2*[](#DrainType.SAND_WALL "Link to this definition")
* STRIP*: [`DrainType`](#DrainType "viktor.external.dsettlement.DrainType")** = 0*[](#DrainType.STRIP "Link to this definition")
## DrainageSimpleMode[](https://docs.viktor.ai/sdk/api/external/dsettlement/.md#_DrainageSimpleMode "Direct link to DrainageSimpleMode")
* *class *viktor.external.dsettlement.DrainageSimpleMode(*begin\_time*, *end\_time*, *underpressure*, *dewatering\_head\_or\_pressure*)[](#DrainageSimpleMode "Link to this definition")
Simple drainage schema; to be used in VerticalDrain.
* Parameters:
* **begin\_time** (`float`) – \[days]
* **end\_time** (`float`) – \[days]
* **underpressure** (`float`) – \[kPa]
* **dewatering\_head\_or\_pressure** (`float`) – water head \[m] or tube pressure (if VerticalDrain.drain\_type = SAND\_WALL) \[kPa]
## Metadata[](https://docs.viktor.ai/sdk/api/external/dsettlement/.md#_Metadata "Direct link to Metadata")
* *class *viktor.external.dsettlement.Metadata(*file\_name='-'*, *company='-'*, *created\_by='-'*, *title\_1='-'*, *title\_2='-'*, *title\_3='-'*, *write\_date=False*, *write\_time=False*)[](#Metadata "Link to this definition")
Data-class for defining metadata.
* Parameters:
* **file\_name** (`str`)
* **company** (`str`)
* **created\_by** (`str`)
* **title\_1** (`str`) – max. 50 characters
* **title\_2** (`str`) – max. 50 characters
* **title\_3** (`str`) – max. 50 characters
* **write\_date** (`bool`) – True to write the current date to the sli file; False for dummy (‘01/01/1900’)
* **write\_time** (`bool`) – True to write the current date to the sli file; False for dummy (‘00:00:00’)
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") – if title\_1, title\_2 or title\_3 has more than 50 characters
## Model1D[](https://docs.viktor.ai/sdk/api/external/dsettlement/.md#_Model1D "Direct link to Model1D")
* *class *viktor.external.dsettlement.Model1D(*calculation\_model*, *consolidation\_model*, *create\_default\_materials=True*, *\**, *natural\_strain=False*, *water\_unit\_weight=9.81*, *verticals\_discretization=100*, *verticals\_z\_coordinate=0.0*, *maintain\_profile=False*, *profile\_unit\_weight\_above\_phreatic\_level=10.0*, *profile\_unit\_weight\_below\_phreatic\_level=10.0*, *end\_of\_settlement\_calculation=10000*, *vertical\_drain=None*)[](#Model1D "Link to this definition")
Bases: `_Model`
Model for a 1D D-Settlement analysis.
Example usage:
```
# instantiate 1D model
model = Model1D(CalculationModel.NEN_KOPPEJAN, ConsolidationModel.TERZAGHI)
# update the geometry
model.create_material("my_mat", 21.0, 19.0, color=Color(0, 0, 0))
model.update_geometry(-1.0, [(1.0, "Loam"), (0.0, "my_mat")], phreatic_level=-3.0)
# add load(s)
model.create_uniform_load("my_load", 0, 0.001, 0.0, 0.0)
# generate the input file
input_file = model.generate_input_file()
```
* Parameters:
* **calculation\_model** ([`CalculationModel`](#CalculationModel "viktor.external.dsettlement.CalculationModel"))
* **consolidation\_model** ([`ConsolidationModel`](#ConsolidationModel "viktor.external.dsettlement.ConsolidationModel"))
* **create\_default\_materials** (`bool`) – start with default materials or none
* **natural\_strain** (`bool`) – if False -> linear strain
* **water\_unit\_weight** (`float`) – in \[kN/m³]
* **vertical\_drain** ([`VerticalDrain`](#VerticalDrain "viktor.external.dsettlement.VerticalDrain")) – parameters for vertical drains, or None (default) to disable option
- materials[](#Model1D.materials "Link to this definition")
* create\_material(*name*, *gam\_dry*, *gam\_wet*, *color=None*, *\**, *initial\_void\_ratio=0.0*, *cohesion=0.0*, *phi=0.0*, *precon\_isotache\_type=0*, *precon\_koppejan\_type=0*, *use\_equivalent\_age=0*, *equivalent\_age=0.0*, *pc=0.0*, *ocr=1.0*, *pop=0.0*, *limit\_stress=1.0*, *drained=0*, *ap\_as\_approximation\_by\_cp\_cs=0*, *cv=10.0*, *permeability\_ver=0.05*, *permeability\_hor\_factor=1.0*, *storage\_type=0*, *permeability\_strain\_modulus=1000000000000000.0*, *use\_prob\_defaults=1*, *std\_gam\_dry=0.0*, *std\_gam\_wet=0.0*, *std\_cv=0.0*, *std\_pc=0.0*, *std\_pri\_comp\_index=0.0*, *std\_sec\_comp\_index=0.0*, *std\_sec\_comp\_rate=0.0*, *std\_ocr=0.0*, *std\_permeability\_ver=0.0*, *std\_pop=0.0*, *std\_permeability\_hor\_factor=0.0*, *std\_initial\_void\_ratio=0.0*, *std\_permeability\_strain\_modulus=0.0*, *std\_limit\_stress=0.0*, *std\_cp=0.0*, *std\_cp1=0.0*, *std\_cs=0.0*, *std\_cs1=0.0*, *std\_ap=0.0*, *std\_asec=0.0*, *std\_car=0.0*, *std\_ca=0.0*, *std\_r\_ratio=0.0*, *std\_c\_ratio=0.0*, *std\_s\_ratio=0.0*, *std\_cr\_index=0.0*, *std\_cc\_index=0.0*, *std\_csw\_index=0.0*, *dist\_gam\_dry=2*, *dist\_gam\_wet=2*, *dist\_cv=2*, *dist\_pc=2*, *dist\_pri\_comp\_index=2*, *dist\_sec\_comp\_index=2*, *dist\_sec\_comp\_rate=2*, *dist\_ocr=2*, *dist\_permeability\_ver=2*, *dist\_pop=2*, *dist\_permeability\_hor\_factor=2*, *dist\_initial\_void\_ratio=2*, *dist\_permeability\_strain\_modulus=2*, *dist\_limit\_stress=2*, *dist\_cp=2*, *dist\_cp1=2*, *dist\_cs=2*, *dist\_cs1=2*, *dist\_ap=2*, *dist\_asec=2*, *dist\_car=2*, *dist\_ca=2*, *dist\_r\_ratio=2*, *dist\_c\_ratio=2*, *dist\_s\_ratio=2*, *dist\_cr\_index=2*, *dist\_cc\_index=2*, *dist\_csw\_index=2*, *cor\_cp\_cp1=0.0*, *cor\_cs\_cp1=0.0*, *cor\_cs1\_cp1=0.0*, *cor\_ap\_cp1=0.0*, *cor\_asec\_cp1=0.0*, *cor\_cr\_index\_cc\_index=0.0*, *cor\_r\_ratio\_c\_ratio=0.0*, *cor\_ca\_cc\_index\_or\_c\_ratio=0.0*, *cor\_pri\_comp\_index\_sec\_comp\_index=0.0*, *cor\_sec\_comp\_rate\_sec\_comp\_index=0.0*, *cp=1.0*, *cp1=1.0*, *cs=1.0*, *cs1=1.0*, *ap=1.0*, *asec=1.0*, *car=0.0*, *ca=1.0*, *comp\_ratio=1*, *r\_ratio=1.0*, *c\_ratio=1.0*, *s\_ratio=0.0*, *cr\_index=1.0*, *cc\_index=1.0*, *csw\_index=0.0*, *pri\_comp\_index=0.01*, *sec\_comp\_index=0.1*, *sec\_comp\_rate=0.005*, *horizontal\_behaviour\_type=2*, *elasticity=1000.0*, *default\_elasticity=1*)[](#Model1D.create_material "Link to this definition")
Create a material with the given name and properties.
* Parameters:
* **name** (`str`) – name of the material to create (max. 25 characters)
* **color** ([`Color`](https://docs.viktor.ai/sdk/api/core/.md#Color "viktor.core.Color")) – color for visualization in deltares software (None for random color)
* **gam\_dry** (`float`) – unit weight above phreatic level in \[kN/m³]
* **gam\_wet** (`float`) – unit weight below phreatic level in \[kN/m³]
* **...****.** – etc.
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if material with given name already exists in the model
* if name is longer than 25 characters
* Return type:
`None`
- create\_uniform\_load(*name*, *time*, *unit\_weight*, *height*, *y\_application*)[](#Model1D.create_uniform_load "Link to this definition")
Create a uniform load with the given name and properties.
* Parameters:
* **name** (`str`) – name of the uniform load to create
* **time** (`int`) – in \[days], -1 for initial load
* **unit\_weight** (`float`) – in \[kN/m³]
* **height** (`float`) – in \[m]
* **y\_application** (`float`) – in \[m]
* Return type:
`None`
* set\_calculation\_times(*\*time*)[](#Model1D.set_calculation_times "Link to this definition")
(Re)set calculation time(s)
* Parameters:
**time** (`int`) – one or more calculation times at which results will be obtained # todo: days
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if time < 0 or > end time
* if duplicates exist
* Return type:
`None`
- generate\_input\_file(*metadata=None*, *\**, *dissipation\_calculation=None*, *as\_file=False*)[](#Model1D.generate_input_file "Link to this definition")
Generate a D-Settlement input file.
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
* **metadata** ([`Metadata`](#Metadata "viktor.external.dsettlement.Metadata")) – Metadata which will be written to the input file. If no metadata is provided, default data will be used.
* **dissipation\_calculation** (`_Vertical`) – select vertical to add dissipation calculation; ‘None’ to disable.
* **as\_file** (`bool`) – return as BytesIO (default) or File
New in v13.5.0
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* *property *bottom\_level*: float*[](#Model1D.bottom_level "Link to this definition")
- *property *layers*: List\[Tuple\[float, str]]*[](#Model1D.layers "Link to this definition")
* *property *phreatic\_level*: float | None*[](#Model1D.phreatic_level "Link to this definition")
- *property *top\_level*: float*[](#Model1D.top_level "Link to this definition")
* update\_geometry(*bottom\_level*, *layers*, *phreatic\_level=None*)[](#Model1D.update_geometry "Link to this definition")
Overwrite the current (default if not updated before) geometry with the given data.
* Parameters:
* **bottom\_level** (`float`) – bottom level of the bottom-most layer \[m]
* **layers** (`List`\[`Tuple`\[`float`, `str`]]) – list of layers defined by top level \[m] and material name (must be created beforehand with [`create_material()`](#Model1D.create_material "viktor.external.dsettlement.Model1D.create_material") or one of the default materials). Should be defined from top to bottom.
* **phreatic\_level** (`float`) – in \[m]
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if layers are not defined from top to bottom
* if lowest layer top level is below given bottom level
* if material with given name does not exist
* Return type:
`None`
Example usage:
```
model.update_geometry(-1, [(1.0, "Loam"), (0.0, "Sand")], phreatic_level=-3)
```
## Model2D[](https://docs.viktor.ai/sdk/api/external/dsettlement/.md#_Model2D "Direct link to Model2D")
* *class *viktor.external.dsettlement.Model2D(*calculation\_model*, *consolidation\_model*, *boundary\_bottom*, *create\_default\_materials=True*, *\**, *natural\_strain=False*, *limits=(0.0, 100.0)*, *water\_unit\_weight=9.81*, *verticals\_discretization=100*, *verticals\_z\_coordinate=0.0*, *maintain\_profile=False*, *profile\_time=0*, *profile\_unit\_weight\_above\_phreatic\_level=10.0*, *profile\_unit\_weight\_below\_phreatic\_level=10.0*, *end\_of\_settlement\_calculation=10000*, *stress\_distribution\_loads=False*, *vertical\_drain=None*)[](#Model2D "Link to this definition")
Bases: `_Model`
Model for a 2D D-Settlement analysis.
Example usage:
```
# Initialize parameters for vertical drainage, to be used in the init of Model2D.
vertical_drain = VerticalDrain(DrainType.SAND_WALL, 5.0, 90.0, 0.0, 2.0, 4.0,
start_of_drainage=2.0, phreatic_level_in_drain=4.0)
# Create the model (NEN - Koppejan / Terzaghi) with a starting bottom boundary, vertical drainage and
# miscellaneous default parameters.
model = Model2D(CalculationModel.NEN_KOPPEJAN, ConsolidationModel.TERZAGHI,
boundary_bottom=[(0.0, 0.0), (100.0, 0.0)], vertical_drain=vertical_drain)
# Create points for defining boundaries and pl-lines.
points_boundary1 = [model.create_point(x, y) for (x, y) in [(0.0, 5.0), (50.0, 5.0), (100.0, 2.5)]]
points_boundary2 = [model.create_point(x, y) for (x, y) in [(0.0, 5.0), (50.0, 5.0), (100.0, 7.5)]]
points_boundary3 = [model.create_point(x, y) for (x, y) in [(0.0, 10.0), (25, 10.0), (75, 10.0), (100.0, 10.0)]]
points_plline1 = [model.create_point(x, y) for (x, y) in [(0.0, 4.0), (100.0, 4.0)]]
points_plline2 = [model.create_point(x, y) for (x, y) in [(0.0, 6.0), (100.0, 6.0)]]
# Create the pl-lines.
plline1 = model.create_pl_line(points_plline1, is_phreatic=True)
plline2 = model.create_pl_line(points_plline2)
# Create the layers.
model.create_layer(points_boundary1, 'Sand', pl_line_top=99, pl_line_bottom=plline2)
model.create_layer(points_boundary2, 'Soft Clay', pl_line_top=99, pl_line_bottom=99)
model.create_layer(points_boundary3, 'Loam', pl_line_top=plline1, pl_line_bottom=99)
# Create verticals.
model.create_vertical(45.0)
model.create_vertical(50.0)
model.create_vertical(55.0)
# Create loads.
model.create_non_uniform_load('load1', [(25, 10.0), (50.0, 12.0), (75, 10.0)])
# Create calculation/residual times.
model.set_calculation_times(1, 4, 2, 5)
# Generate the input file for the model as if it was generated by D-Settlement.
input_file = model.generate_input_file()
```
* Parameters:
* **calculation\_model** ([`CalculationModel`](#CalculationModel "viktor.external.dsettlement.CalculationModel")) – Specifies which calculation model is used.
* **consolidation\_model** ([`ConsolidationModel`](#ConsolidationModel "viktor.external.dsettlement.ConsolidationModel")) – Specifies which consolidation model is used.
* **boundary\_bottom** (`List`\[`Tuple`\[`float`, `float`]]) – The bottom boundary of the geometry.
* **create\_default\_materials** (`bool`) – start with default materials or none
* **natural\_strain** (`bool`) – Indicates if natural strain is used. If False, linear strain is used.
* **water\_unit\_weight** (`float`) – in \[kN/m³]
* **stress\_distribution\_loads** (`bool`) – True for ‘Simulate’, False for ‘None’ (default).
* **vertical\_drain** ([`VerticalDrain`](#VerticalDrain "viktor.external.dsettlement.VerticalDrain")) – parameters for vertical drains, or None (default) to disable option
- materials[](#Model2D.materials "Link to this definition")
* create\_material(*name*, *gam\_dry*, *gam\_wet*, *color=None*, *\**, *initial\_void\_ratio=0.0*, *cohesion=0.0*, *phi=0.0*, *precon\_isotache\_type=0*, *precon\_koppejan\_type=0*, *use\_equivalent\_age=0*, *equivalent\_age=0.0*, *pc=0.0*, *ocr=1.0*, *pop=0.0*, *limit\_stress=1.0*, *drained=0*, *ap\_as\_approximation\_by\_cp\_cs=0*, *cv=10.0*, *permeability\_ver=0.05*, *permeability\_hor\_factor=1.0*, *storage\_type=0*, *permeability\_strain\_modulus=1000000000000000.0*, *use\_prob\_defaults=1*, *std\_gam\_dry=0.0*, *std\_gam\_wet=0.0*, *std\_cv=0.0*, *std\_pc=0.0*, *std\_pri\_comp\_index=0.0*, *std\_sec\_comp\_index=0.0*, *std\_sec\_comp\_rate=0.0*, *std\_ocr=0.0*, *std\_permeability\_ver=0.0*, *std\_pop=0.0*, *std\_permeability\_hor\_factor=0.0*, *std\_initial\_void\_ratio=0.0*, *std\_permeability\_strain\_modulus=0.0*, *std\_limit\_stress=0.0*, *std\_cp=0.0*, *std\_cp1=0.0*, *std\_cs=0.0*, *std\_cs1=0.0*, *std\_ap=0.0*, *std\_asec=0.0*, *std\_car=0.0*, *std\_ca=0.0*, *std\_r\_ratio=0.0*, *std\_c\_ratio=0.0*, *std\_s\_ratio=0.0*, *std\_cr\_index=0.0*, *std\_cc\_index=0.0*, *std\_csw\_index=0.0*, *dist\_gam\_dry=2*, *dist\_gam\_wet=2*, *dist\_cv=2*, *dist\_pc=2*, *dist\_pri\_comp\_index=2*, *dist\_sec\_comp\_index=2*, *dist\_sec\_comp\_rate=2*, *dist\_ocr=2*, *dist\_permeability\_ver=2*, *dist\_pop=2*, *dist\_permeability\_hor\_factor=2*, *dist\_initial\_void\_ratio=2*, *dist\_permeability\_strain\_modulus=2*, *dist\_limit\_stress=2*, *dist\_cp=2*, *dist\_cp1=2*, *dist\_cs=2*, *dist\_cs1=2*, *dist\_ap=2*, *dist\_asec=2*, *dist\_car=2*, *dist\_ca=2*, *dist\_r\_ratio=2*, *dist\_c\_ratio=2*, *dist\_s\_ratio=2*, *dist\_cr\_index=2*, *dist\_cc\_index=2*, *dist\_csw\_index=2*, *cor\_cp\_cp1=0.0*, *cor\_cs\_cp1=0.0*, *cor\_cs1\_cp1=0.0*, *cor\_ap\_cp1=0.0*, *cor\_asec\_cp1=0.0*, *cor\_cr\_index\_cc\_index=0.0*, *cor\_r\_ratio\_c\_ratio=0.0*, *cor\_ca\_cc\_index\_or\_c\_ratio=0.0*, *cor\_pri\_comp\_index\_sec\_comp\_index=0.0*, *cor\_sec\_comp\_rate\_sec\_comp\_index=0.0*, *cp=1.0*, *cp1=1.0*, *cs=1.0*, *cs1=1.0*, *ap=1.0*, *asec=1.0*, *car=0.0*, *ca=1.0*, *comp\_ratio=1*, *r\_ratio=1.0*, *c\_ratio=1.0*, *s\_ratio=0.0*, *cr\_index=1.0*, *cc\_index=1.0*, *csw\_index=0.0*, *pri\_comp\_index=0.01*, *sec\_comp\_index=0.1*, *sec\_comp\_rate=0.005*, *horizontal\_behaviour\_type=2*, *elasticity=1000.0*, *default\_elasticity=1*)[](#Model2D.create_material "Link to this definition")
Create a material with the given name and properties.
* Parameters:
* **name** (`str`) – name of the material to create (max. 25 characters)
* **color** ([`Color`](https://docs.viktor.ai/sdk/api/core/.md#Color "viktor.core.Color")) – color for visualization in deltares software (None for random color)
* **gam\_dry** (`float`) – unit weight above phreatic level in \[kN/m³]
* **gam\_wet** (`float`) – unit weight below phreatic level in \[kN/m³]
* **...****.** – etc.
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if material with given name already exists in the model
* if name is longer than 25 characters
* Return type:
`None`
- create\_uniform\_load(*name*, *time*, *unit\_weight*, *height*, *y\_application*)[](#Model2D.create_uniform_load "Link to this definition")
Create a uniform load with the given name and properties.
* Parameters:
* **name** (`str`) – name of the uniform load to create
* **time** (`int`) – in \[days], -1 for initial load
* **unit\_weight** (`float`) – in \[kN/m³]
* **height** (`float`) – in \[m]
* **y\_application** (`float`) – in \[m]
* Return type:
`None`
* set\_calculation\_times(*\*time*)[](#Model2D.set_calculation_times "Link to this definition")
(Re)set calculation time(s)
* Parameters:
**time** (`int`) – one or more calculation times at which results will be obtained # todo: days
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if time < 0 or > end time
* if duplicates exist
* Return type:
`None`
- generate\_input\_file(*metadata=None*, *\**, *dissipation\_calculation=None*, *as\_file=False*)[](#Model2D.generate_input_file "Link to this definition")
Generate a D-Settlement input file.
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
* **metadata** ([`Metadata`](#Metadata "viktor.external.dsettlement.Metadata")) – Metadata which will be written to the input file. If no metadata is provided, default data will be used.
* **dissipation\_calculation** (`_Vertical`) – select vertical to add dissipation calculation; ‘None’ to disable.
* **as\_file** (`bool`) – return as BytesIO (default) or File
New in v13.5.0
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* create\_layer(*boundary\_top*, *material*, *pl\_line\_top*, *pl\_line\_bottom*)[](#Model2D.create_layer "Link to this definition")
Define layers from bottom to top.
* Parameters:
* **boundary\_top** (`List`\[`_Point`]) – boundary at top of layer
* **material** (`str`) – name of the material to be used (must be created beforehand)
* **pl\_line\_top** (`_PlLine` | `int`) – pl-line at top, or 0 for no pressure, or 99 for interpolation
* **pl\_line\_bottom** (`_PlLine` | `int`) – pl-line at bottom, or 0 for no pressure, or 99 for interpolation
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if material with given name does not exist
* if boundary\_bottom is provided for layer other than first
* if pl\_line\_top or pl\_line\_bottom are not valid
* if ‘points’ contains duplicates
* if start and end ‘points’ are not on the left and right boundary limit respectively
* if ‘points’ are not in ascending X-direction
* if ‘is\_phreatic’ is True but was already set before
* Return type:
`_Layer`
- create\_non\_uniform\_load(*name*, *points*, *time=0*, *end\_time=0*, *gamma\_dry=10.0*, *gamma\_wet=10.0*, *temporary=False*)[](#Model2D.create_non_uniform_load "Link to this definition")
Create a non-uniform load.
DSettlement assumes that a non-uniform load is caused by soil self weight. Initial loads only affects the initial stresses and do not cause creep or consolidation.
* Parameters:
* **name** (`str`) – Name of the load.
* **points** (`List`\[`Tuple`\[`float`, `float`]]) – Points, as x-y coordinates, of the load. The first and last points must be located on a layer or another non-uniform load.
* **time** (`int`) – The moment the load is laid down \[days]. If time is set to -1 days, the load is considered an initial load.
* **end\_time** (`int`) – The moment the load is removed (only in the case of temporary loads) \[days].
* **temporary** (`bool`) – Bool which indicates if the load is a temporary load.
* **gamma\_dry** (`float`) – Total unit weight above phreatic level \[kN/m3].
* **gamma\_wet** (`float`) – Total unit weight below phreatic level \[kN/m3].
* Return type:
`_NonUniformLoad`
* create\_pl\_line(*points*, *is\_phreatic=False*)[](#Model2D.create_pl_line "Link to this definition")
Create a piezometric level line (pl-line) from the given points.
* Parameters:
* **points** (`List`\[`_Point`]) – list of points that define the pl-line
* **is\_phreatic** (`bool`) – whether to set the current pl-line as the phreatic line (overwrites previous!)
* Return type:
`_PlLine`
* Returns:
pl-line
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") –
* if ‘points’ contains duplicates
* if start and end ‘points’ are not on the left and right boundary limit respectively
* if ‘points’ are not in ascending X-direction
* if ‘is\_phreatic’ is True but was already set before
- create\_point(*x*, *y*)[](#Model2D.create_point "Link to this definition")
Create a point with given x and y coordinates.
* Parameters:
* **x** (`float`) – in \[m]
* **y** (`float`) – in \[m]
* Return type:
`_Point`
* Returns:
\_Point which can be used to create boundaries for layers or pl-lines.
* create\_vertical(*x*)[](#Model2D.create_vertical "Link to this definition")
Create vertical based on x-coordinate.
* Parameters:
**x** (`float`) – \[m]
* Raises:
[**ModelError**](https://docs.viktor.ai/sdk/api/errors/.md#ModelError "viktor.errors.ModelError") – if x < left boundary limit or > right boundary limit
* Return type:
`_Vertical`
## OutputFileParser[](https://docs.viktor.ai/sdk/api/external/dsettlement/.md#_OutputFileParser "Direct link to OutputFileParser")
* *class *viktor.external.dsettlement.OutputFileParser(*sld\_file*)[](#OutputFileParser "Link to this definition")
Helper class to extract results from a D-Settlement output file (.sld).
Example usage:
```
parser = OutputFileParser(sld_file)
vertical_results = parser.vertical_results
residual_times = parser.residual_times
```
* *property *raw\_results*: str*[](#OutputFileParser.raw_results "Link to this definition")
Raw result data. For convenience, specific data can also be extracted using available methods.
- *property *residual\_times*: Dict\[int, Dict\[str, List\[float]]]*[](#OutputFileParser.residual_times "Link to this definition")
Returns the residual times.
Structure of dictionary:
```
{
vertical number: int: {
Time: List[float]
Settlement: List[float]
...
}
}
```
* *property *vertical\_results*: Dict\[int, Dict\[str, Any]]*[](#OutputFileParser.vertical_results "Link to this definition")
Returns results for all verticals.
Structure of dictionary:
```
{
vertical number: int: {
coordinates: {
x: float
z: float
},
time_settlement_per_load: {
time_step_count: int
load_step_count: int
time: List[float] [days]
load_1: List[float] [kPa]
load_2: List[float] [kPa]
... (depending on model)
},
depths: List[float]
leakages: List[float] -> empty for some models
drained_layers: List[float] -> empty for some models
stresses: { -> empty for some models
initial_total_stress: List[float]
... (depending on model)
},
vertical_data: {
time: float: {
settlement: List[float]
... (depending on model)
}
},
}
}
```
## VerticalDrain[](https://docs.viktor.ai/sdk/api/external/dsettlement/.md#_VerticalDrain "Direct link to VerticalDrain")
* *class *viktor.external.dsettlement.VerticalDrain(*drain\_type*, *range\_from*, *range\_to*, *bottom\_position*, *center\_to\_center*, *width\_diameter*, *thickness=None*, *position\_drain=None*, *grid=None*, *start\_of\_drainage=None*, *phreatic\_level\_in\_drain=None*, *schedule=None*)[](#VerticalDrain "Link to this definition")
Data-class for setting vertical drain options.
* Parameters:
* **drain\_type** ([`DrainType`](#DrainType "viktor.external.dsettlement.DrainType")) – drain type.
* **range\_from** (`float`) – range \[m] from which drainage takes place.
* **range\_to** (`float`) – range \[m] to which drainage takes place.
* **bottom\_position** (`float`) – position of bottom (depth) of drains \[m].
* **center\_to\_center** (`float`) – center-to-center distance of drains \[m].
* **width\_diameter** (`float`) – width (or diameter for drain\_type = COLUMN) of drains \[m].
* **thickness** (`float`) – thickness of strip \[m]. Must be set for drain\_type = STRIP.
* **position\_drain** (`float`) – drain position \[m]. Must be set for drain\_type = SAND\_WALL (only if schedule is defined).
* **grid** ([`DrainGrid`](#DrainGrid "viktor.external.dsettlement.DrainGrid")) – drain grid type. Must be set for drain\_type = STRIP | COLUMN.
* **start\_of\_drainage** (`float`) – start time of drainage \[days]. Must be set for simple and no schedule.
* **phreatic\_level\_in\_drain** (`float`) – phreatic level in drain \[m]. Must be set for simple and no schedule.
* **schedule** ([`DrainageSimpleMode`](#DrainageSimpleMode "viktor.external.dsettlement.DrainageSimpleMode") | `List`\[`Tuple`\[`float`, `float`, `float`]]) – DrainageSimpleMode for simple schedule; list of (time \[days], underpressure \[kPa], water head \[m] (if drain\_type = STRIP | COLUMN) / tube pressure \[kPa] (if drain\_type = SAND\_WALL)) for detailed schedule (default: no schedule).
- *property *position\_drain*: float | None*[](#VerticalDrain.position_drain "Link to this definition")
---
# viktor.external.dsheetpiling
## DSheetPilingAnalysis[](https://docs.viktor.ai/sdk/api/external/dsheetpiling/.md#_DSheetPilingAnalysis "Direct link to DSheetPilingAnalysis")
* *class *viktor.external.dsheetpiling.DSheetPilingAnalysis(*input\_file*)[](#DSheetPilingAnalysis "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
DSheetPilingAnalysis can be used to perform an analysis using D-Sheet Piling on a third-party worker. To start an analysis call the method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"), with an appropriate timeout (in seconds). To retrieve the results call the method [`get_output_file()`](#DSheetPilingAnalysis.get_output_file "viktor.external.dsheetpiling.DSheetPilingAnalysis.get_output_file"), after [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute").
Usage:
```
dsheetpiling_analysis = DSheetPilingAnalysis(input_file=input_file)
dsheetpiling_analysis.execute(timeout=10)
output_file = dsheetpiling_analysis.get_output_file()
```
Exceptions which can be raised during calculation: - [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
**input\_file** (`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – .shi input file.
- get\_output\_file(*extension='.shd'*, *\**, *as\_file=False*)[](#DSheetPilingAnalysis.get_output_file "Link to this definition")
Method can be used to retrieve the results generated by running an external analysis. Call method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") first and [`get_output_file()`](#DSheetPilingAnalysis.get_output_file "viktor.external.dsheetpiling.DSheetPilingAnalysis.get_output_file") afterwards.
* Parameters:
* **extension** (`str`) – extension of the file you want to return; one of: ‘.shd’, ‘.shs’, ‘.shl’, ‘.sho’, ‘.error.log’, ‘.err’
* **as\_file** (`bool`) – Return as BytesIO (default) or File
New in v13.5.0
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
---
# viktor.external.dstability
## DStabilityAnalysis[](https://docs.viktor.ai/sdk/api/external/dstability/.md#_DStabilityAnalysis "Direct link to DStabilityAnalysis")
* *class *viktor.external.dstability.DStabilityAnalysis(*input\_file*)[](#DStabilityAnalysis "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
DStabilityAnalysis can be used to perform an analysis using D-Stability on a third-party worker. To start an analysis call the method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"), with an appropriate timeout (in seconds). To retrieve the results call the method [`get_output_file()`](#DStabilityAnalysis.get_output_file "viktor.external.dstability.DStabilityAnalysis.get_output_file"), after [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute").
Example usage:
```
file = File() # create a writable File object
path = Path(file.source) # request its path
dstability_model.serialize(path) # let GEOLIB write to the file
analysis = DStabilityAnalysis(input_file=file) # pass the file with content to DStabilityAnalysis
analysis.execute(timeout=10)
output_file = analysis.get_output_file()
```
Exceptions which can be raised during calculation: - [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
**input\_file** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – File object with the body of the .stix input file.
- get\_output\_file(*extension='.stix'*)[](#DStabilityAnalysis.get_output_file "Link to this definition")
Method can be used to retrieve the results generated by running an external analysis. Call method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") first and [`get_output_file()`](#DStabilityAnalysis.get_output_file "viktor.external.dstability.DStabilityAnalysis.get_output_file") afterwards.
* Parameters:
**extension** (`str`) – extension of the file you want to return; ‘.stix’
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
---
# viktor.external.dynamo
## DynamoAnalysis[](https://docs.viktor.ai/sdk/api/external/dynamo/.md#_DynamoAnalysis "Direct link to DynamoAnalysis")
* *class *viktor.external.dynamo.DynamoAnalysis(*files=None*, *executable\_key='dynamo'*, *output\_filenames=None*)[](#DynamoAnalysis "Link to this definition")
Bases: [`GenericAnalysis`](https://docs.viktor.ai/sdk/api/external/generic/.md#GenericAnalysis "viktor.external.generic.GenericAnalysis")
New in 14.17.0
DynamoAnalysis can be used to evaluate a matlab script on third-party infrastructure. The script is expected to be blocking, i.e. if the executable is invoked from command prompt, it should wait until the script is finished. For security purposes the executable that should be called has to be defined in the configuration file of the worker.
Usage:
```
files = [
('input1.txt', file1),
('input2.txt', file2)
]
analysis = DynamoAnalysis(files=files, output_filenames=["output.txt"])
analysis.execute(timeout=60)
output_file = analysis.get_output_file("output.txt")
```
Exceptions which can be raised during calculation:
> * [`viktor.errors.LicenseError`](https://docs.viktor.ai/sdk/api/errors/.md#LicenseError "viktor.errors.LicenseError"): no license available
>
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
* **files** (`List`\[`Tuple`\[`str`, `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]] | `None`) – Files that are transferred to the working directory on the server. Each file is a tuple containing the content and the filename which is used to save on the infrastructure.
* **executable\_key** (`str`) – The key of the executable that needs to be evaluated. This key should be present in the configuration file of the worker, defaults to run\_matlab.
* **output\_filenames** (`List`\[`str`]) – A list of filenames (including extension) that are to be transferred back to the SDK. This filename is relative to the working directory.
At least one of the attributes above should be included in the call.
* Raises:
**ValueError** – when no attribute is included in call.
## DynamoFile[](https://docs.viktor.ai/sdk/api/external/dynamo/.md#_DynamoFile "Direct link to DynamoFile")
* *class *viktor.external.dynamo.DynamoFile(*file*)[](#DynamoFile "Link to this definition")
Dynamo file instantiated from an existing input .dyn file. This class allows for easy transformation of input nodes by means of the [`update()`](#DynamoFile.update "viktor.external.dynamo.DynamoFile.update") method.
* Parameters:
**file** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Dynamo input file (.dyn).
- generate()[](#DynamoFile.generate "Link to this definition")
Generate the (updated) Dynamo input file.
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* get\_node\_id(*name*)[](#DynamoFile.get_node_id "Link to this definition")
Retrieve the unique node id by name.
* Parameters:
**name** (`str`) – Name of the node.
* Return type:
`str`
- update(*name*, *value*)[](#DynamoFile.update "Link to this definition")
Update the value of an input node with specified name.
* Parameters:
* **name** (`str`) – Name of the input node.
* **value** (`Any`) – New input value.
* Return type:
`None`
## convert\_geometry\_to\_glb[](https://docs.viktor.ai/sdk/api/external/dynamo/.md#_convert_geometry_to_glb "Direct link to convert_geometry_to_glb")
* viktor.external.dynamo.convert\_geometry\_to\_glb(*file*, *filter=None*)[](#convert_geometry_to_glb "Link to this definition")
Convert a Dynamo geometry file (.json) to a GLB file, which can directly be used in a [`GeometryResult`](https://docs.viktor.ai/sdk/api/views/.md#GeometryResult "viktor.views.GeometryResult").
Filter specific geometric objects by id, obtained by calling [`get_node_id()`](#DynamoFile.get_node_id "viktor.external.dynamo.DynamoFile.get_node_id"):
```
input_file = DynamoFile(file)
sphere_id = input_file.get_node_id("Sphere") # geometry node called "Sphere"
...
geometry_file = dynamo_analysis.get_output_file(filename='geometry.json', as_file=True) # viktor.external.dynamo.DynamoAnalysis
glb_file = convert_geometry_to_glb(geometry_file, filter=[sphere_id])
```
* Parameters:
* **file** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Dynamo geometry file (.json).
* **filter** (`List`\[`str`]) – Filter geometric objects by id (default: include all).
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
## get\_dynamo\_result[](https://docs.viktor.ai/sdk/api/external/dynamo/.md#_get_dynamo_result "Direct link to get_dynamo_result")
* viktor.external.dynamo.get\_dynamo\_result(*file*, *id\_*)[](#get_dynamo_result "Link to this definition")
Extract results from a Dynamo output file (.xml) by means of a node ‘id’, which can be obtained by calling [`get_node_id()`](#DynamoFile.get_node_id "viktor.external.dynamo.DynamoFile.get_node_id").
Example using BytesIO:
```
input_file = DynamoFile(file)
output_id = input_file.get_node_id("Area") # output node called "Area"
...
output_file = dynamo_analysis.get_output_file(filename='output.xml') # viktor.external.dynamo.DynamoAnalysis
result = get_dynamo_result(output_file, id_=output_id)
```
Example using [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File"):
```
input_file = DynamoFile(file)
output_id = input_file.get_node_id("Area") # output node called "Area"
...
output_file = dynamo_analysis.get_output_file(filename='output.xml', as_file=True) # viktor.external.dynamo.DynamoAnalysis
with output_file.open_binary() as f:
result = get_dynamo_result(f, id_=output_id)
```
* Parameters:
* **file** (`BinaryIO`) – Dynamo output file (.xml).
* **id** – Unique identifier of the output result node.
* Return type:
`str`
---
# viktor.external.etabs
## ETABSAnalysis[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_ETABSAnalysis "Direct link to ETABSAnalysis")
* *class *viktor.external.etabs.etabs.ETABSAnalysis(*script=None*, *script\_key=''*, *files=None*, *output\_filenames=None*)[](#ETABSAnalysis "Link to this definition")
Bases: [`PythonAnalysis`](https://docs.viktor.ai/sdk/api/external/python/.md#PythonAnalysis "viktor.external.python.PythonAnalysis")
New in 14.17.0
ETABSAnalysis can be used to evaluate an ETABS-python script on third-party infrastructure. The script is expected to be blocking, i.e. if the script is invoked from command prompt, it should wait until the executable is finished. The default behaviour, is that the python script is defined within the app and send to the worker to be executed on third-party infrastructure. If desired (due to security considerations) the worker can be configured to only run local scripts. These scripts must be defined the in worker configuration file and can be selected through the script\_key.
Usage:
```
script = vkt.File.from_path(Path(__file__).parent / "run_etabs.py")
files = [
('input1.txt', file1),
]
analysis = ETABSAnalysis(script=script, files=files, output_filenames=["output.txt"])
analysis.execute(timeout=60)
output_file = analysis.get_output_file("output.txt")
```
Exceptions which can be raised during calculation:
> * [`viktor.errors.LicenseError`](https://docs.viktor.ai/sdk/api/errors/.md#LicenseError "viktor.errors.LicenseError"): no license available
>
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
* **script** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Script file that is transferred to the working directory on the server.
* **script\_key** (`str`) – The key of the script that needs to be run. Only use this when the worker is configured to run local scripts. This key should be present in the configuration file of the worker.
* **files** (`List`\[`Tuple`\[`str`, `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]]) – Additional files that are transferred to the working directory on the server. Each file is a tuple containing the content and the filename which is used to save on the infrastructure.
* **output\_filenames** (`List`\[`str`]) – A list of filenames (including extension) that are to be transferred back to the app. This filename is relative to the working directory.
Either one of ‘script’ or ‘script\_key’ should be defined.
* Raises:
**ValueError** – when neither ‘script’ or ‘script\_key’ is included OR when both are included.
## ETABSConnection[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_ETABSConnection "Direct link to ETABSConnection")
* *class *viktor.external.etabs.etabs.ETABSConnection(*session*)[](#ETABSConnection "Link to this definition")
Bases: `_CSIConnection`
New in 14.31.0
The `sap` object returned by [`connect()`](#connect "viktor.external.etabs.etabs.connect") or [`attach()`](#attach "viktor.external.etabs.etabs.attach"), used to control ETABS through the ETABS OAPI. Use the default OAPI calls with comtypes syntax. Each call returns the OAPI result: the status code, or `[*out_params, status]` when the call has output parameters.
The SDK sends calls to the worker in chunks. A result is read when your code first uses its value: in `==`, `if`, `float()`, `int()`, `str()`, `print()` or a loop. A failed call raises [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError") at that read, with the call and your line. Two things do not read a result: passing it to a later call, and unpacking it into names. So the example below sends all three calls in one chunk. `result is None` is always `False` on an unread result; use `== None`. Pass `defer=False` to [`connect()`](#connect "viktor.external.etabs.etabs.connect") / [`attach()`](#attach "viktor.external.etabs.etabs.attach") to send each call on its own.
```
name, ret = sap.FrameObj.AddByCoord(0, 0, 0, 6, 0, 0, "", "Default", "Beam", "Global")
sap.FrameObj.SetSection(name, "W12X26")
```
See [`batch()`](#ETABSConnection.batch "viktor.external.etabs.etabs.ETABSConnection.batch") when one loop makes more than a few hundred calls.
Warning
Do not instantiate this class directly; obtain it from [`connect()`](#connect "viktor.external.etabs.etabs.connect") or [`attach()`](#attach "viktor.external.etabs.etabs.attach").
* batch()[](#ETABSConnection.batch "Link to this definition")
New in v14.37.0
Send all calls of the block to the worker as one job when the block ends. Without the block the SDK sends calls in chunks of a few hundred, each one round trip. The gain grows with the size of the block; below a few hundred calls it changes nothing. You cannot read a result inside the block: a read raises `RuntimeError`. So do `isinstance()`, `print()`, `str()` and `repr()` on a result. Read the results after the block. The block runs as one job under the session `timeout` (300 s by default). For a very large block, increase `timeout` in [`connect()`](#connect "viktor.external.etabs.etabs.connect") / [`attach()`](#attach "viktor.external.etabs.etabs.attach").
```
with sap.batch():
for x, y in points: # 5000 points
name, ret = sap.FrameObj.AddByCoord(x, y, 0, x, y, 3, "", "W12X26")
sap.FrameObj.SetGroupAssign(name, "Columns")
# 10000 calls went to the worker in one job
```
Needs a deferred connection (`defer=True`). Blocks cannot be nested. Calls made before the block are sent when the block starts.
* Return type:
`ContextManager`\[`None`, `bool` | `None`]
- *property *application*: Any*[](#ETABSConnection.application "Link to this definition")
Call OAPI members on the top-level application object rather than the SapModel.
Example:
```
sap.application.Hide()
version = sap.application.GetOAPIVersionNumber()
```
## attach[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_attach "Direct link to attach")
* viktor.external.etabs.etabs.attach(*timeout=300*, *defer=True*)[](#attach "Link to this definition")
New in 14.33.0
Attach to the ETABS instance already running on the worker machine and control it through the ETABS OAPI, like [`connect()`](#connect "viktor.external.etabs.etabs.connect"), but without starting a fresh instance. Typical use: a personal worker on the engineer’s own machine, so the app acts on the model they have open on screen.
Warning
This is a BETA feature.
Requires a worker of kind `etabsconnect`. Declare it in your [viktor.config.toml](https://docs.viktor.ai/docs/create-apps/references/viktor-config-toml/):
```
worker_integrations = [
"etabsconnect",
]
```
Usage:
```
import viktor as vkt
with vkt.etabs.attach(timeout=60) as sap:
[pt_i, pt_j, ret] = sap.FrameObj.GetPoints("B1", "", "") # reads the model open in ETABS
ret = sap.View.RefreshView() # changes show in the user's window
```
Closing the session detaches without exiting the instance. The app can change the attached model but not save it in place: `File.Save` requires a relative filename and writes into the session directory.
Note
The OAPI members you call on `sap` (e.g. `sap.FrameObj.AddByCoord`) mirror the ETABS OAPI and are surfaced through IDE autocomplete rather than listed here. Look them up in the ETABS OAPI reference: the `CSI API ETABS v1.chm` help file in your ETABS installation directory (e.g. `C:/Program Files/Computers and Structures/ETABS /`), or on CSI’s [developer site](https://www.csiamerica.com/developer).
* Parameters:
* **timeout** (`int`) – timeout in seconds for one chunk of calls; also bounds the attach itself, so keep it at or above the platform’s 30 second bind window.
* **defer** (`bool`) – queue calls and send them to the worker in chunks; a result is fetched when your code first reads it (default: True). False sends every call at once and returns plain values.
New in v14.37.0
* Return type:
[`ETABSConnection`](#ETABSConnection "viktor.external.etabs.etabs.ETABSConnection")
Exceptions which can be raised during execution:
> * [`viktor.errors.WorkerSessionAttachError`](https://docs.viktor.ai/sdk/api/errors/.md#WorkerSessionAttachError "viktor.errors.WorkerSessionAttachError"): the attach failed, e.g. no ETABS is running on the worker machine, or the running instance is a different product. `reason` names the cause; that set is open.
>
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error during a call. Error message provides more information.
>
> * [`viktor.errors.WorkerSessionError`](https://docs.viktor.ai/sdk/api/errors/.md#WorkerSessionError "viktor.errors.WorkerSessionError"): the session was lost after attaching (e.g. the user closed the ETABS instance). The session cannot be resumed; start a new one to continue.
>
> * TimeoutError: a chunk of calls took longer than `timeout`
## connect[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_connect "Direct link to connect")
* viktor.external.etabs.etabs.connect(*timeout=300*, *defer=True*)[](#connect "Link to this definition")
New in 14.31.0
Connect to ETABS running on a connected VIKTOR worker and control it through the ETABS OAPI directly from your app, as shown below. Always starts a fresh, empty instance; to act on the instance already running on the worker machine instead, use [`attach()`](#attach "viktor.external.etabs.etabs.attach").
Warning
This is a BETA feature.
Requires a worker of kind `etabsconnect`. Declare it in your [viktor.config.toml](https://docs.viktor.ai/docs/create-apps/references/viktor-config-toml/):
```
worker_integrations = [
"etabsconnect",
]
```
Usage:
```
import viktor as vkt
with vkt.etabs.connect(timeout=60) as sap:
ret = sap.InitializeNewModel(vkt.etabs.eUnits.kN_m_C) # a call returns the status code
[beam_name, ret] = sap.FrameObj.AddByCoord(0, 0, 0, 6, 0, 0, "", "Default", "Beam", "Global")
[pt_i, pt_j, ret] = sap.FrameObj.GetPoints(beam_name, "", "") # ...or out-params, then status
sap.File.Save("model.edb") # use a relative filename, not an absolute path
```
Note
The OAPI members you call on `sap` (e.g. `sap.FrameObj.AddByCoord`) mirror the ETABS OAPI and are surfaced through IDE autocomplete rather than listed here. Look them up in the ETABS OAPI reference: the `CSI API ETABS v1.chm` help file in your ETABS installation directory (e.g. `C:/Program Files/Computers and Structures/ETABS /`), or on CSI’s [developer site](https://www.csiamerica.com/developer).
* Parameters:
* **timeout** (`int`) – timeout in seconds for one chunk of calls.
* **defer** (`bool`) – queue calls and send them to the worker in chunks; a result is fetched when your code first reads it (default: True). False sends every call at once and returns plain values.
New in v14.37.0
* Return type:
[`ETABSConnection`](#ETABSConnection "viktor.external.etabs.etabs.ETABSConnection")
Exceptions which can be raised during execution:
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information. A host whose ETABS license is not activated also fails this way: ETABS blocks on an interactive sign-in dialog that the worker cannot answer, so starting it up times out.
>
> * [`viktor.errors.WorkerSessionError`](https://docs.viktor.ai/sdk/api/errors/.md#WorkerSessionError "viktor.errors.WorkerSessionError"): the session was lost (e.g. its ETABS instance was torn down). The session cannot be resumed; start a new one to continue.
>
> * TimeoutError: a chunk of calls took longer than `timeout`
ETABS enum values, generated from ETABS 23.3.1 (Ultimate).
## e2DFrameType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_e2DFrameType "Direct link to e2DFrameType")
* *class *viktor.external.etabs.enums.e2DFrameType(*\*values*)[](#e2DFrameType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `e2DFrameType` values, mirroring the product API’s names so code reads like its docs.
* ConcentricBraced* = 1*[](#e2DFrameType.ConcentricBraced "Link to this definition")
- EccentricBraced* = 2*[](#e2DFrameType.EccentricBraced "Link to this definition")
* PortalFrame* = 0*[](#e2DFrameType.PortalFrame "Link to this definition")
## e3DFrameType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_e3DFrameType "Direct link to e3DFrameType")
* *class *viktor.external.etabs.enums.e3DFrameType(*\*values*)[](#e3DFrameType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `e3DFrameType` values, mirroring the product API’s names so code reads like its docs.
* BeamSlab* = 2*[](#e3DFrameType.BeamSlab "Link to this definition")
- FlatPlate* = 3*[](#e3DFrameType.FlatPlate "Link to this definition")
* OpenFrame* = 0*[](#e3DFrameType.OpenFrame "Link to this definition")
- PerimeterFrame* = 1*[](#e3DFrameType.PerimeterFrame "Link to this definition")
## eAreaDesignOrientation[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eAreaDesignOrientation "Direct link to eAreaDesignOrientation")
* *class *viktor.external.etabs.enums.eAreaDesignOrientation(*\*values*)[](#eAreaDesignOrientation "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eAreaDesignOrientation` values, mirroring the product API’s names so code reads like its docs.
* Floor* = 2*[](#eAreaDesignOrientation.Floor "Link to this definition")
- Null* = 4*[](#eAreaDesignOrientation.Null "Link to this definition")
* Other* = 5*[](#eAreaDesignOrientation.Other "Link to this definition")
- Ramp\_DO\_NOT\_USE* = 3*[](#eAreaDesignOrientation.Ramp_DO_NOT_USE "Link to this definition")
* Wall* = 1*[](#eAreaDesignOrientation.Wall "Link to this definition")
## eBridgeCodeAASHTO[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeCodeAASHTO "Direct link to eBridgeCodeAASHTO")
* *class *viktor.external.etabs.enums.eBridgeCodeAASHTO(*\*values*)[](#eBridgeCodeAASHTO "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeCodeAASHTO` values, mirroring the product API’s names so code reads like its docs.
* AASHTO\_LRFD\_2007* = 1*[](#eBridgeCodeAASHTO.AASHTO_LRFD_2007 "Link to this definition")
- AASHTO\_LRFD\_2012* = 2*[](#eBridgeCodeAASHTO.AASHTO_LRFD_2012 "Link to this definition")
* AASHTO\_LRFD\_2014* = 3*[](#eBridgeCodeAASHTO.AASHTO_LRFD_2014 "Link to this definition")
- AASHTO\_LRFD\_2017* = 4*[](#eBridgeCodeAASHTO.AASHTO_LRFD_2017 "Link to this definition")
* AASHTO\_LRFD\_2020* = 5*[](#eBridgeCodeAASHTO.AASHTO_LRFD_2020 "Link to this definition")
- AASHTO\_STD\_2002* = 0*[](#eBridgeCodeAASHTO.AASHTO_STD_2002 "Link to this definition")
## eBridgeCodeInterims[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeCodeInterims "Direct link to eBridgeCodeInterims")
* *class *viktor.external.etabs.enums.eBridgeCodeInterims(*\*values*)[](#eBridgeCodeInterims "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeCodeInterims` values, mirroring the product API’s names so code reads like its docs.
* Interim\_2011* = 1*[](#eBridgeCodeInterims.Interim_2011 "Link to this definition")
- Interim\_2012* = 2*[](#eBridgeCodeInterims.Interim_2012 "Link to this definition")
* Interim\_2013* = 3*[](#eBridgeCodeInterims.Interim_2013 "Link to this definition")
- Interim\_2014* = 4*[](#eBridgeCodeInterims.Interim_2014 "Link to this definition")
* Interim\_2015* = 5*[](#eBridgeCodeInterims.Interim_2015 "Link to this definition")
- NoInterims* = 0*[](#eBridgeCodeInterims.NoInterims "Link to this definition")
## eBridgeObjectBentPart[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeObjectBentPart "Direct link to eBridgeObjectBentPart")
* *class *viktor.external.etabs.enums.eBridgeObjectBentPart(*\*values*)[](#eBridgeObjectBentPart "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeObjectBentPart` values, mirroring the product API’s names so code reads like its docs.
* Bearing* = 3*[](#eBridgeObjectBentPart.Bearing "Link to this definition")
- CapBeam* = 1*[](#eBridgeObjectBentPart.CapBeam "Link to this definition")
* Column* = 2*[](#eBridgeObjectBentPart.Column "Link to this definition")
- Wall* = 4*[](#eBridgeObjectBentPart.Wall "Link to this definition")
## eBridgeObjectFoundationPart[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeObjectFoundationPart "Direct link to eBridgeObjectFoundationPart")
* *class *viktor.external.etabs.enums.eBridgeObjectFoundationPart(*\*values*)[](#eBridgeObjectFoundationPart "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeObjectFoundationPart` values, mirroring the product API’s names so code reads like its docs.
* Footing* = 1*[](#eBridgeObjectFoundationPart.Footing "Link to this definition")
- FoundationSpring* = 4*[](#eBridgeObjectFoundationPart.FoundationSpring "Link to this definition")
* Pile* = 3*[](#eBridgeObjectFoundationPart.Pile "Link to this definition")
- PileCap* = 2*[](#eBridgeObjectFoundationPart.PileCap "Link to this definition")
## eBridgeObjectType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeObjectType "Direct link to eBridgeObjectType")
* *class *viktor.external.etabs.enums.eBridgeObjectType(*\*values*)[](#eBridgeObjectType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeObjectType` values, mirroring the product API’s names so code reads like its docs.
* General* = 0*[](#eBridgeObjectType.General "Link to this definition")
- Segmental* = 1*[](#eBridgeObjectType.Segmental "Link to this definition")
## eBridgeObjectUserPointType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeObjectUserPointType "Direct link to eBridgeObjectUserPointType")
* *class *viktor.external.etabs.enums.eBridgeObjectUserPointType(*\*values*)[](#eBridgeObjectUserPointType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeObjectUserPointType` values, mirroring the product API’s names so code reads like its docs.
* General* = 0*[](#eBridgeObjectUserPointType.General "Link to this definition")
- SegmentalTendon* = 1*[](#eBridgeObjectUserPointType.SegmentalTendon "Link to this definition")
## eBridgeResponseDesignRating[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeResponseDesignRating "Direct link to eBridgeResponseDesignRating")
* *class *viktor.external.etabs.enums.eBridgeResponseDesignRating(*\*values*)[](#eBridgeResponseDesignRating "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeResponseDesignRating` values, mirroring the product API’s names so code reads like its docs.
* Design\_Crack\_Bot\_Crack\_Width* = 55*[](#eBridgeResponseDesignRating.Design_Crack_Bot_Crack_Width "Link to this definition")
- Design\_Crack\_Top\_Bot\_Crack\_Widths* = 56*[](#eBridgeResponseDesignRating.Design_Crack_Top_Bot_Crack_Widths "Link to this definition")
* Design\_Crack\_Top\_Crack\_Width* = 54*[](#eBridgeResponseDesignRating.Design_Crack_Top_Crack_Width "Link to this definition")
- Design\_Fatigue\_Bot\_Flange\_Lateral\_Bending\_Stress\_Range* = 75*[](#eBridgeResponseDesignRating.Design_Fatigue_Bot_Flange_Lateral_Bending_Stress_Range "Link to this definition")
* Design\_Fatigue\_Bot\_Flange\_Tensile\_Stress\_Range\_Without\_FLB* = 74*[](#eBridgeResponseDesignRating.Design_Fatigue_Bot_Flange_Tensile_Stress_Range_Without_FLB "Link to this definition")
- Design\_Fatigue\_DC\_Ratio\_Web\_Shear* = 76*[](#eBridgeResponseDesignRating.Design_Fatigue_DC_Ratio_Web_Shear "Link to this definition")
* Design\_Fatigue\_Top\_Flange\_Tensile\_Stress\_Range\_Without\_FLB* = 73*[](#eBridgeResponseDesignRating.Design_Fatigue_Top_Flange_Tensile_Stress_Range_Without_FLB "Link to this definition")
- Design\_Flexure\_Moment\_About\_Horizontal\_Axis\_M3* = 64*[](#eBridgeResponseDesignRating.Design_Flexure_Moment_About_Horizontal_Axis_M3 "Link to this definition")
* Design\_Principal\_Stress\_Beam\_Web\_Bot* = 61*[](#eBridgeResponseDesignRating.Design_Principal_Stress_Beam_Web_Bot "Link to this definition")
- Design\_Principal\_Stress\_Beam\_Web\_Top* = 60*[](#eBridgeResponseDesignRating.Design_Principal_Stress_Beam_Web_Top "Link to this definition")
* Design\_Principal\_Stress\_Envelope* = 57*[](#eBridgeResponseDesignRating.Design_Principal_Stress_Envelope "Link to this definition")
- Design\_Principal\_Stress\_Neutral\_Axis* = 62*[](#eBridgeResponseDesignRating.Design_Principal_Stress_Neutral_Axis "Link to this definition")
* Design\_Principal\_Stress\_Web\_Bot* = 59*[](#eBridgeResponseDesignRating.Design_Principal_Stress_Web_Bot "Link to this definition")
- Design\_Principal\_Stress\_Web\_Top* = 58*[](#eBridgeResponseDesignRating.Design_Principal_Stress_Web_Top "Link to this definition")
* Design\_Shear\_Controlling\_DC\_Ratio* = 43*[](#eBridgeResponseDesignRating.Design_Shear_Controlling_DC_Ratio "Link to this definition")
- Design\_Shear\_Controlling\_Shear\_DC\_Ratio* = 34*[](#eBridgeResponseDesignRating.Design_Shear_Controlling_Shear_DC_Ratio "Link to this definition")
* Design\_Shear\_Controlling\_Torsion\_DC\_Ratio* = 35*[](#eBridgeResponseDesignRating.Design_Shear_Controlling_Torsion_DC_Ratio "Link to this definition")
- Design\_Shear\_Demand\_Concrete\_Shear\_Capacity\_Ratio* = 33*[](#eBridgeResponseDesignRating.Design_Shear_Demand_Concrete_Shear_Capacity_Ratio "Link to this definition")
* Design\_Shear\_Longit\_Rebar\_Area* = 45*[](#eBridgeResponseDesignRating.Design_Shear_Longit_Rebar_Area "Link to this definition")
- Design\_Shear\_Longit\_Rebar\_Area\_Beam* = 50*[](#eBridgeResponseDesignRating.Design_Shear_Longit_Rebar_Area_Beam "Link to this definition")
* Design\_Shear\_Longit\_Rebar\_Area\_Bot\_Flange* = 48*[](#eBridgeResponseDesignRating.Design_Shear_Longit_Rebar_Area_Bot_Flange "Link to this definition")
- Design\_Shear\_Longit\_Rebar\_Area\_Bot\_Slab* = 46*[](#eBridgeResponseDesignRating.Design_Shear_Longit_Rebar_Area_Bot_Slab "Link to this definition")
* Design\_Shear\_Longit\_Rebar\_Area\_Slab* = 49*[](#eBridgeResponseDesignRating.Design_Shear_Longit_Rebar_Area_Slab "Link to this definition")
- Design\_Shear\_Longit\_Rebar\_Area\_Top\_Slab* = 47*[](#eBridgeResponseDesignRating.Design_Shear_Longit_Rebar_Area_Top_Slab "Link to this definition")
* Design\_Shear\_Longit\_Torsional\_Rebar\_Area\_PerL* = 51*[](#eBridgeResponseDesignRating.Design_Shear_Longit_Torsional_Rebar_Area_PerL "Link to this definition")
- Design\_Shear\_Rebar\_Area\_PerL* = 44*[](#eBridgeResponseDesignRating.Design_Shear_Rebar_Area_PerL "Link to this definition")
* Design\_Shear\_Required\_Extra\_Longit\_Rebar\_Area* = 37*[](#eBridgeResponseDesignRating.Design_Shear_Required_Extra_Longit_Rebar_Area "Link to this definition")
- Design\_Shear\_Required\_Extra\_Longit\_Rebar\_Area\_Beam* = 42*[](#eBridgeResponseDesignRating.Design_Shear_Required_Extra_Longit_Rebar_Area_Beam "Link to this definition")
* Design\_Shear\_Required\_Extra\_Longit\_Rebar\_Area\_Bot\_Slab* = 39*[](#eBridgeResponseDesignRating.Design_Shear_Required_Extra_Longit_Rebar_Area_Bot_Slab "Link to this definition")
- Design\_Shear\_Required\_Extra\_Longit\_Rebar\_Area\_For\_Torsion* = 38*[](#eBridgeResponseDesignRating.Design_Shear_Required_Extra_Longit_Rebar_Area_For_Torsion "Link to this definition")
* Design\_Shear\_Required\_Extra\_Longit\_Rebar\_Area\_Slab* = 41*[](#eBridgeResponseDesignRating.Design_Shear_Required_Extra_Longit_Rebar_Area_Slab "Link to this definition")
- Design\_Shear\_Required\_Extra\_Longit\_Rebar\_Area\_Top\_Slab* = 40*[](#eBridgeResponseDesignRating.Design_Shear_Required_Extra_Longit_Rebar_Area_Top_Slab "Link to this definition")
* Design\_Shear\_Required\_Extra\_Shear\_Rebar\_Area\_PerL* = 36*[](#eBridgeResponseDesignRating.Design_Shear_Required_Extra_Shear_Rebar_Area_PerL "Link to this definition")
- Design\_Shear\_Torsion\_Plus\_Shear\_Rebar\_Area\_PerL* = 53*[](#eBridgeResponseDesignRating.Design_Shear_Torsion_Plus_Shear_Rebar_Area_PerL "Link to this definition")
* Design\_Shear\_Torsion\_Rebar\_Area\_PerL* = 52*[](#eBridgeResponseDesignRating.Design_Shear_Torsion_Rebar_Area_PerL "Link to this definition")
- Design\_Strength\_DC\_Ratio\_FlexureShearInteract\_Neg* = 71*[](#eBridgeResponseDesignRating.Design_Strength_DC_Ratio_FlexureShearInteract_Neg "Link to this definition")
* Design\_Strength\_DC\_Ratio\_FlexureShearInteract\_Pos* = 70*[](#eBridgeResponseDesignRating.Design_Strength_DC_Ratio_FlexureShearInteract_Pos "Link to this definition")
- Design\_Strength\_DC\_Ratio\_Negative\_Moment* = 66*[](#eBridgeResponseDesignRating.Design_Strength_DC_Ratio_Negative_Moment "Link to this definition")
* Design\_Strength\_DC\_Ratio\_Net\_Section\_Fracture\_Neg* = 69*[](#eBridgeResponseDesignRating.Design_Strength_DC_Ratio_Net_Section_Fracture_Neg "Link to this definition")
- Design\_Strength\_DC\_Ratio\_Net\_Section\_Fracture\_Pos* = 68*[](#eBridgeResponseDesignRating.Design_Strength_DC_Ratio_Net_Section_Fracture_Pos "Link to this definition")
* Design\_Strength\_DC\_Ratio\_Positive\_Moment* = 65*[](#eBridgeResponseDesignRating.Design_Strength_DC_Ratio_Positive_Moment "Link to this definition")
- Design\_Strength\_DC\_Ratio\_Shear* = 67*[](#eBridgeResponseDesignRating.Design_Strength_DC_Ratio_Shear "Link to this definition")
* Design\_Strength\_Total\_Nominal\_Shear\_Force\_6\_10\_10\_4\_2* = 72*[](#eBridgeResponseDesignRating.Design_Strength_Total_Nominal_Shear_Force_6_10_10_4_2 "Link to this definition")
- Design\_Tendon\_Stress\_Controlling\_DC\_Ratio* = 63*[](#eBridgeResponseDesignRating.Design_Tendon_Stress_Controlling_DC_Ratio "Link to this definition")
* Rating\_ASM\_Rating* = 94*[](#eBridgeResponseDesignRating.Rating_ASM_Rating "Link to this definition")
- Rating\_Flexure* = 81*[](#eBridgeResponseDesignRating.Rating_Flexure "Link to this definition")
* Rating\_Flexure\_Factored\_Moment\_Resistance* = 82*[](#eBridgeResponseDesignRating.Rating_Flexure_Factored_Moment_Resistance "Link to this definition")
- Rating\_Flexure\_Factored\_Moment\_Resistance\_UMr* = 83*[](#eBridgeResponseDesignRating.Rating_Flexure_Factored_Moment_Resistance_UMr "Link to this definition")
* Rating\_Flexure\_Live\_load\_Capacity\_Factor\_F* = 84*[](#eBridgeResponseDesignRating.Rating_Flexure_Live_load_Capacity_Factor_F "Link to this definition")
- Rating\_LFM\_Service\_Rating* = 96*[](#eBridgeResponseDesignRating.Rating_LFM_Service_Rating "Link to this definition")
* Rating\_LFM\_Strength\_Rating* = 95*[](#eBridgeResponseDesignRating.Rating_LFM_Strength_Rating "Link to this definition")
- Rating\_MinRebar\_Flexure\_Rating* = 92*[](#eBridgeResponseDesignRating.Rating_MinRebar_Flexure_Rating "Link to this definition")
* Rating\_MinRebar\_Min\_Of\_Abs\_1\_2Mcr\_And\_Abs\_1\_33Mu\_For\_Neg* = 91*[](#eBridgeResponseDesignRating.Rating_MinRebar_Min_Of_Abs_1_2Mcr_And_Abs_1_33Mu_For_Neg "Link to this definition")
- Rating\_MinRebar\_Min\_Of\_Abs\_1\_2Mcr\_And\_Abs\_1\_33Mu\_For\_Pos* = 90*[](#eBridgeResponseDesignRating.Rating_MinRebar_Min_Of_Abs_1_2Mcr_And_Abs_1_33Mu_For_Pos "Link to this definition")
* Rating\_Service* = 93*[](#eBridgeResponseDesignRating.Rating_Service "Link to this definition")
- Rating\_Service\_Flexure\_Rating* = 89*[](#eBridgeResponseDesignRating.Rating_Service_Flexure_Rating "Link to this definition")
* Rating\_Shear* = 77*[](#eBridgeResponseDesignRating.Rating_Shear "Link to this definition")
- Rating\_Shear\_Factored\_Shear\_Resistance* = 78*[](#eBridgeResponseDesignRating.Rating_Shear_Factored_Shear_Resistance "Link to this definition")
* Rating\_Shear\_Factored\_Shear\_Resistance\_UVr* = 79*[](#eBridgeResponseDesignRating.Rating_Shear_Factored_Shear_Resistance_UVr "Link to this definition")
- Rating\_Shear\_Live\_load\_Capacity\_Factor\_F* = 80*[](#eBridgeResponseDesignRating.Rating_Shear_Live_load_Capacity_Factor_F "Link to this definition")
* Rating\_Strength\_Flexure\_Rating* = 86*[](#eBridgeResponseDesignRating.Rating_Strength_Flexure_Rating "Link to this definition")
- Rating\_Strength\_Live\_load\_Capacity\_Factor\_F\_Moment\_M3* = 87*[](#eBridgeResponseDesignRating.Rating_Strength_Live_load_Capacity_Factor_F_Moment_M3 "Link to this definition")
* Rating\_Strength\_Live\_load\_Capacity\_Factor\_F\_Shear\_V2* = 88*[](#eBridgeResponseDesignRating.Rating_Strength_Live_load_Capacity_Factor_F_Shear_V2 "Link to this definition")
- Rating\_Strength\_Shear\_Rating* = 85*[](#eBridgeResponseDesignRating.Rating_Strength_Shear_Rating "Link to this definition")
* S11\_Longitudinal\_Beam\_Bot\_Center* = 39*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Bot_Center "Link to this definition")
- S11\_Longitudinal\_Beam\_Bot\_Envelope* = 32*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Bot_Envelope "Link to this definition")
* S11\_Longitudinal\_Beam\_Bot\_Left* = 29*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Bot_Left "Link to this definition")
- S11\_Longitudinal\_Beam\_Bot\_Right* = 31*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Bot_Right "Link to this definition")
* S11\_Longitudinal\_Beam\_Top\_Center* = 10*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Top_Center "Link to this definition")
- S11\_Longitudinal\_Beam\_Top\_Envelope* = 12*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Top_Envelope "Link to this definition")
* S11\_Longitudinal\_Beam\_Top\_Left* = 9*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Top_Left "Link to this definition")
- S11\_Longitudinal\_Beam\_Top\_Right* = 11*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Top_Right "Link to this definition")
* S11\_Longitudinal\_Bot\_Center* = 15*[](#eBridgeResponseDesignRating.S11_Longitudinal_Bot_Center "Link to this definition")
- S11\_Longitudinal\_Bot\_Envelope* = 18*[](#eBridgeResponseDesignRating.S11_Longitudinal_Bot_Envelope "Link to this definition")
* S11\_Longitudinal\_Bot\_Left* = 13*[](#eBridgeResponseDesignRating.S11_Longitudinal_Bot_Left "Link to this definition")
- S11\_Longitudinal\_Bot\_Left\_Corner* = 14*[](#eBridgeResponseDesignRating.S11_Longitudinal_Bot_Left_Corner "Link to this definition")
* S11\_Longitudinal\_Bot\_Right* = 16*[](#eBridgeResponseDesignRating.S11_Longitudinal_Bot_Right "Link to this definition")
- S11\_Longitudinal\_Bot\_Right\_Corner* = 17*[](#eBridgeResponseDesignRating.S11_Longitudinal_Bot_Right_Corner "Link to this definition")
* S11\_Longitudinal\_Girder\_Bot\_Envelope* = 21*[](#eBridgeResponseDesignRating.S11_Longitudinal_Girder_Bot_Envelope "Link to this definition")
- S11\_Longitudinal\_Girder\_Bot\_Left* = 19*[](#eBridgeResponseDesignRating.S11_Longitudinal_Girder_Bot_Left "Link to this definition")
* S11\_Longitudinal\_Girder\_Bot\_Right* = 20*[](#eBridgeResponseDesignRating.S11_Longitudinal_Girder_Bot_Right "Link to this definition")
- S11\_Longitudinal\_Slab\_Bot\_Beam\_Center* = 24*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Bot_Beam_Center "Link to this definition")
* S11\_Longitudinal\_Slab\_Bot\_Beam\_Left* = 23*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Bot_Beam_Left "Link to this definition")
- S11\_Longitudinal\_Slab\_Bot\_Beam\_Right* = 25*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Bot_Beam_Right "Link to this definition")
* S11\_Longitudinal\_Slab\_Bot\_Center* = 26*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Bot_Center "Link to this definition")
- S11\_Longitudinal\_Slab\_Bot\_Envelope* = 28*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Bot_Envelope "Link to this definition")
* S11\_Longitudinal\_Slab\_Bot\_Left* = 22*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Bot_Left "Link to this definition")
- S11\_Longitudinal\_Slab\_Bot\_Right* = 27*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Bot_Right "Link to this definition")
* S11\_Longitudinal\_Slab\_Top\_Beam\_Center* = 6*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Top_Beam_Center "Link to this definition")
- S11\_Longitudinal\_Slab\_Top\_Center* = 5*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Top_Center "Link to this definition")
* S11\_Longitudinal\_Slab\_Top\_Envelope* = 8*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Top_Envelope "Link to this definition")
- S11\_Longitudinal\_Slab\_Top\_Left* = 4*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Top_Left "Link to this definition")
* S11\_Longitudinal\_Slab\_Top\_Right* = 7*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Top_Right "Link to this definition")
- S11\_Longitudinal\_Top\_Center* = 1*[](#eBridgeResponseDesignRating.S11_Longitudinal_Top_Center "Link to this definition")
* S11\_Longitudinal\_Top\_Envelope* = 3*[](#eBridgeResponseDesignRating.S11_Longitudinal_Top_Envelope "Link to this definition")
- S11\_Longitudinal\_Top\_Left* = 0*[](#eBridgeResponseDesignRating.S11_Longitudinal_Top_Left "Link to this definition")
* S11\_Longitudinal\_Top\_Right* = 2*[](#eBridgeResponseDesignRating.S11_Longitudinal_Top_Right "Link to this definition")
## eBridgeResponseDisplDOF[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeResponseDisplDOF "Direct link to eBridgeResponseDisplDOF")
* *class *viktor.external.etabs.enums.eBridgeResponseDisplDOF(*\*values*)[](#eBridgeResponseDisplDOF "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeResponseDisplDOF` values, mirroring the product API’s names so code reads like its docs.
* Avg\_Longitudinal\_Rotation* = 4*[](#eBridgeResponseDisplDOF.Avg_Longitudinal_Rotation "Link to this definition")
- Longitudinal\_Displacement* = 2*[](#eBridgeResponseDisplDOF.Longitudinal_Displacement "Link to this definition")
* Longitudinal\_Rotation* = 3*[](#eBridgeResponseDisplDOF.Longitudinal_Rotation "Link to this definition")
- Transverse\_Displacement* = 1*[](#eBridgeResponseDisplDOF.Transverse_Displacement "Link to this definition")
* Vertical\_Displacement* = 0*[](#eBridgeResponseDisplDOF.Vertical_Displacement "Link to this definition")
## eBridgeResponseDisplLoc[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeResponseDisplLoc "Direct link to eBridgeResponseDisplLoc")
* *class *viktor.external.etabs.enums.eBridgeResponseDisplLoc(*\*values*)[](#eBridgeResponseDisplLoc "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeResponseDisplLoc` values, mirroring the product API’s names so code reads like its docs.
* Left\_Web* = 5*[](#eBridgeResponseDisplLoc.Left_Web "Link to this definition")
- Left\_Web\_Bottom* = 4*[](#eBridgeResponseDisplLoc.Left_Web_Bottom "Link to this definition")
* Left\_Web\_Top* = 3*[](#eBridgeResponseDisplLoc.Left_Web_Top "Link to this definition")
- Right\_Web* = 8*[](#eBridgeResponseDisplLoc.Right_Web "Link to this definition")
* Right\_Web\_Bottom* = 7*[](#eBridgeResponseDisplLoc.Right_Web_Bottom "Link to this definition")
- Right\_Web\_Top* = 6*[](#eBridgeResponseDisplLoc.Right_Web_Top "Link to this definition")
* Slab\_Center* = 9*[](#eBridgeResponseDisplLoc.Slab_Center "Link to this definition")
- Web* = 2*[](#eBridgeResponseDisplLoc.Web "Link to this definition")
* Web\_Bottom* = 1*[](#eBridgeResponseDisplLoc.Web_Bottom "Link to this definition")
- Web\_Top* = 0*[](#eBridgeResponseDisplLoc.Web_Top "Link to this definition")
## eBridgeResponseForce[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeResponseForce "Direct link to eBridgeResponseForce")
* *class *viktor.external.etabs.enums.eBridgeResponseForce(*\*values*)[](#eBridgeResponseForce "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeResponseForce` values, mirroring the product API’s names so code reads like its docs.
* Axial\_Force\_P* = 1*[](#eBridgeResponseForce.Axial_Force_P "Link to this definition")
- Moment\_About\_Horizontal\_Axis\_M3* = 6*[](#eBridgeResponseForce.Moment_About_Horizontal_Axis_M3 "Link to this definition")
* Moment\_About\_Vertical\_Axis\_M2* = 5*[](#eBridgeResponseForce.Moment_About_Vertical_Axis_M2 "Link to this definition")
- Shear\_Horizontal\_V3* = 3*[](#eBridgeResponseForce.Shear_Horizontal_V3 "Link to this definition")
* Shear\_Vertical\_V2* = 2*[](#eBridgeResponseForce.Shear_Vertical_V2 "Link to this definition")
- Torsion\_T* = 4*[](#eBridgeResponseForce.Torsion_T "Link to this definition")
## eBridgeResponsePart[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeResponsePart "Direct link to eBridgeResponsePart")
* *class *viktor.external.etabs.enums.eBridgeResponsePart(*\*values*)[](#eBridgeResponsePart "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeResponsePart` values, mirroring the product API’s names so code reads like its docs.
* All\_Beams* = 7*[](#eBridgeResponsePart.All_Beams "Link to this definition")
- All\_Girders* = 6*[](#eBridgeResponsePart.All_Girders "Link to this definition")
* All\_Slabs* = 9*[](#eBridgeResponsePart.All_Slabs "Link to this definition")
- All\_Webs* = 8*[](#eBridgeResponsePart.All_Webs "Link to this definition")
* Beam* = 3*[](#eBridgeResponsePart.Beam "Link to this definition")
- Entire\_Bridge\_Section* = 1*[](#eBridgeResponsePart.Entire_Bridge_Section "Link to this definition")
* Entire\_Section\_Plus\_All\_Girders* = 10*[](#eBridgeResponsePart.Entire_Section_Plus_All_Girders "Link to this definition")
- Girder* = 2*[](#eBridgeResponsePart.Girder "Link to this definition")
* Slab* = 5*[](#eBridgeResponsePart.Slab "Link to this definition")
- Web* = 4*[](#eBridgeResponsePart.Web "Link to this definition")
## eBridgeResponseStress[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeResponseStress "Direct link to eBridgeResponseStress")
* *class *viktor.external.etabs.enums.eBridgeResponseStress(*\*values*)[](#eBridgeResponseStress "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeResponseStress` values, mirroring the product API’s names so code reads like its docs.
* S11\_Lateral\_Bending\_Bot* = 25*[](#eBridgeResponseStress.S11_Lateral_Bending_Bot "Link to this definition")
- S11\_Lateral\_Bending\_Top* = 22*[](#eBridgeResponseStress.S11_Lateral_Bending_Top "Link to this definition")
* S11\_Lateral\_Bending\_Top\_ULeft* = 23*[](#eBridgeResponseStress.S11_Lateral_Bending_Top_ULeft "Link to this definition")
- S11\_Lateral\_Bending\_Top\_URight* = 24*[](#eBridgeResponseStress.S11_Lateral_Bending_Top_URight "Link to this definition")
* S11\_Longitudinal\_Bot\_Beam\_Left* = 16*[](#eBridgeResponseStress.S11_Longitudinal_Bot_Beam_Left "Link to this definition")
- S11\_Longitudinal\_Bot\_Beam\_Right* = 17*[](#eBridgeResponseStress.S11_Longitudinal_Bot_Beam_Right "Link to this definition")
* S11\_Longitudinal\_Bot\_Center* = 14*[](#eBridgeResponseStress.S11_Longitudinal_Bot_Center "Link to this definition")
- S11\_Longitudinal\_Bot\_Envelope* = 18*[](#eBridgeResponseStress.S11_Longitudinal_Bot_Envelope "Link to this definition")
* S11\_Longitudinal\_Bot\_Left* = 13*[](#eBridgeResponseStress.S11_Longitudinal_Bot_Left "Link to this definition")
- S11\_Longitudinal\_Bot\_Right* = 15*[](#eBridgeResponseStress.S11_Longitudinal_Bot_Right "Link to this definition")
* S11\_Longitudinal\_Top\_Beam\_Center* = 3*[](#eBridgeResponseStress.S11_Longitudinal_Top_Beam_Center "Link to this definition")
- S11\_Longitudinal\_Top\_Bot\_Center* = 20*[](#eBridgeResponseStress.S11_Longitudinal_Top_Bot_Center "Link to this definition")
* S11\_Longitudinal\_Top\_Bot\_Left* = 19*[](#eBridgeResponseStress.S11_Longitudinal_Top_Bot_Left "Link to this definition")
- S11\_Longitudinal\_Top\_Bot\_Right* = 21*[](#eBridgeResponseStress.S11_Longitudinal_Top_Bot_Right "Link to this definition")
* S11\_Longitudinal\_Top\_Center* = 1*[](#eBridgeResponseStress.S11_Longitudinal_Top_Center "Link to this definition")
- S11\_Longitudinal\_Top\_Envelope* = 4*[](#eBridgeResponseStress.S11_Longitudinal_Top_Envelope "Link to this definition")
* S11\_Longitudinal\_Top\_Left* = 0*[](#eBridgeResponseStress.S11_Longitudinal_Top_Left "Link to this definition")
- S11\_Longitudinal\_Top\_Right* = 2*[](#eBridgeResponseStress.S11_Longitudinal_Top_Right "Link to this definition")
* S11\_Longitudinal\_Top\_ULeft\_Center* = 6*[](#eBridgeResponseStress.S11_Longitudinal_Top_ULeft_Center "Link to this definition")
- S11\_Longitudinal\_Top\_ULeft\_Envelope* = 8*[](#eBridgeResponseStress.S11_Longitudinal_Top_ULeft_Envelope "Link to this definition")
* S11\_Longitudinal\_Top\_ULeft\_Left* = 5*[](#eBridgeResponseStress.S11_Longitudinal_Top_ULeft_Left "Link to this definition")
- S11\_Longitudinal\_Top\_ULeft\_Right* = 7*[](#eBridgeResponseStress.S11_Longitudinal_Top_ULeft_Right "Link to this definition")
* S11\_Longitudinal\_Top\_URight\_Center* = 10*[](#eBridgeResponseStress.S11_Longitudinal_Top_URight_Center "Link to this definition")
- S11\_Longitudinal\_Top\_URight\_Envelope* = 12*[](#eBridgeResponseStress.S11_Longitudinal_Top_URight_Envelope "Link to this definition")
* S11\_Longitudinal\_Top\_URight\_Left* = 9*[](#eBridgeResponseStress.S11_Longitudinal_Top_URight_Left "Link to this definition")
- S11\_Longitudinal\_Top\_URight\_Right* = 11*[](#eBridgeResponseStress.S11_Longitudinal_Top_URight_Right "Link to this definition")
## eBridgeSegmentConstructionMethod[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeSegmentConstructionMethod "Direct link to eBridgeSegmentConstructionMethod")
* *class *viktor.external.etabs.enums.eBridgeSegmentConstructionMethod(*\*values*)[](#eBridgeSegmentConstructionMethod "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeSegmentConstructionMethod` values, mirroring the product API’s names so code reads like its docs.
* CastInPlace* = 1*[](#eBridgeSegmentConstructionMethod.CastInPlace "Link to this definition")
- Precast* = 0*[](#eBridgeSegmentConstructionMethod.Precast "Link to this definition")
## eBridgeSegmentType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeSegmentType "Direct link to eBridgeSegmentType")
* *class *viktor.external.etabs.enums.eBridgeSegmentType(*\*values*)[](#eBridgeSegmentType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeSegmentType` values, mirroring the product API’s names so code reads like its docs.
* Closure* = 3*[](#eBridgeSegmentType.Closure "Link to this definition")
- PierTable* = 1*[](#eBridgeSegmentType.PierTable "Link to this definition")
* Rigid* = 0*[](#eBridgeSegmentType.Rigid "Link to this definition")
- Segment* = 2*[](#eBridgeSegmentType.Segment "Link to this definition")
## eBridgeTendonCategory[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eBridgeTendonCategory "Direct link to eBridgeTendonCategory")
* *class *viktor.external.etabs.enums.eBridgeTendonCategory(*\*values*)[](#eBridgeTendonCategory "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eBridgeTendonCategory` values, mirroring the product API’s names so code reads like its docs.
* BottomSpan* = 2*[](#eBridgeTendonCategory.BottomSpan "Link to this definition")
- Cantilever* = 1*[](#eBridgeTendonCategory.Cantilever "Link to this definition")
* Continuity* = 4*[](#eBridgeTendonCategory.Continuity "Link to this definition")
- General* = 0*[](#eBridgeTendonCategory.General "Link to this definition")
* TopSpan* = 3*[](#eBridgeTendonCategory.TopSpan "Link to this definition")
## eCNameType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eCNameType "Direct link to eCNameType")
* *class *viktor.external.etabs.enums.eCNameType(*\*values*)[](#eCNameType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eCNameType` values, mirroring the product API’s names so code reads like its docs.
* LoadCase* = 0*[](#eCNameType.LoadCase "Link to this definition")
- LoadCombo* = 1*[](#eCNameType.LoadCombo "Link to this definition")
## eConstraintAxis[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eConstraintAxis "Direct link to eConstraintAxis")
* *class *viktor.external.etabs.enums.eConstraintAxis(*\*values*)[](#eConstraintAxis "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eConstraintAxis` values, mirroring the product API’s names so code reads like its docs.
* AutoAxis* = 4*[](#eConstraintAxis.AutoAxis "Link to this definition")
- X* = 1*[](#eConstraintAxis.X "Link to this definition")
* Y* = 2*[](#eConstraintAxis.Y "Link to this definition")
- Z* = 3*[](#eConstraintAxis.Z "Link to this definition")
## eConstraintType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eConstraintType "Direct link to eConstraintType")
* *class *viktor.external.etabs.enums.eConstraintType(*\*values*)[](#eConstraintType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eConstraintType` values, mirroring the product API’s names so code reads like its docs.
* Beam* = 5*[](#eConstraintType.Beam "Link to this definition")
- Body* = 1*[](#eConstraintType.Body "Link to this definition")
* Diaphragm* = 2*[](#eConstraintType.Diaphragm "Link to this definition")
- Equal* = 6*[](#eConstraintType.Equal "Link to this definition")
* Line* = 13*[](#eConstraintType.Line "Link to this definition")
- Local* = 7*[](#eConstraintType.Local "Link to this definition")
* Plate* = 3*[](#eConstraintType.Plate "Link to this definition")
- Rod* = 4*[](#eConstraintType.Rod "Link to this definition")
* Weld* = 8*[](#eConstraintType.Weld "Link to this definition")
## eDeckType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eDeckType "Direct link to eDeckType")
* *class *viktor.external.etabs.enums.eDeckType(*\*values*)[](#eDeckType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eDeckType` values, mirroring the product API’s names so code reads like its docs.
* Filled* = 1*[](#eDeckType.Filled "Link to this definition")
- SolidSlab* = 3*[](#eDeckType.SolidSlab "Link to this definition")
* Unfilled* = 2*[](#eDeckType.Unfilled "Link to this definition")
## eDesignActionType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eDesignActionType "Direct link to eDesignActionType")
* *class *viktor.external.etabs.enums.eDesignActionType(*\*values*)[](#eDesignActionType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eDesignActionType` values, mirroring the product API’s names so code reads like its docs.
* LongTermComposite* = 3*[](#eDesignActionType.LongTermComposite "Link to this definition")
- NonComposite* = 1*[](#eDesignActionType.NonComposite "Link to this definition")
* Other* = 5*[](#eDesignActionType.Other "Link to this definition")
- ShortTermComposite* = 2*[](#eDesignActionType.ShortTermComposite "Link to this definition")
* Staged* = 4*[](#eDesignActionType.Staged "Link to this definition")
## eDiaphragmOption[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eDiaphragmOption "Direct link to eDiaphragmOption")
* *class *viktor.external.etabs.enums.eDiaphragmOption(*\*values*)[](#eDiaphragmOption "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eDiaphragmOption` values, mirroring the product API’s names so code reads like its docs.
* DefinedDiaphragm* = 3*[](#eDiaphragmOption.DefinedDiaphragm "Link to this definition")
- Disconnect* = 1*[](#eDiaphragmOption.Disconnect "Link to this definition")
* FromShellObject* = 2*[](#eDiaphragmOption.FromShellObject "Link to this definition")
## eFileTypeIO[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eFileTypeIO "Direct link to eFileTypeIO")
* *class *viktor.external.etabs.enums.eFileTypeIO(*\*values*)[](#eFileTypeIO "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eFileTypeIO` values, mirroring the product API’s names so code reads like its docs.
* DBTablesAccess* = 3*[](#eFileTypeIO.DBTablesAccess "Link to this definition")
- DBTablesExcel* = 2*[](#eFileTypeIO.DBTablesExcel "Link to this definition")
* DBTablesText* = 4*[](#eFileTypeIO.DBTablesText "Link to this definition")
- DBTablesXML* = 5*[](#eFileTypeIO.DBTablesXML "Link to this definition")
* TextFile* = 1*[](#eFileTypeIO.TextFile "Link to this definition")
## eForce[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eForce "Direct link to eForce")
* *class *viktor.external.etabs.enums.eForce(*\*values*)[](#eForce "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eForce` values, mirroring the product API’s names so code reads like its docs.
* N* = 3*[](#eForce.N "Link to this definition")
- NotApplicable* = 0*[](#eForce.NotApplicable "Link to this definition")
* kN* = 4*[](#eForce.kN "Link to this definition")
- kgf* = 5*[](#eForce.kgf "Link to this definition")
* kip* = 2*[](#eForce.kip "Link to this definition")
- lb* = 1*[](#eForce.lb "Link to this definition")
* tonf* = 6*[](#eForce.tonf "Link to this definition")
## eFrameDesignOrientation[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eFrameDesignOrientation "Direct link to eFrameDesignOrientation")
* *class *viktor.external.etabs.enums.eFrameDesignOrientation(*\*values*)[](#eFrameDesignOrientation "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eFrameDesignOrientation` values, mirroring the product API’s names so code reads like its docs.
* Beam* = 2*[](#eFrameDesignOrientation.Beam "Link to this definition")
- Brace* = 3*[](#eFrameDesignOrientation.Brace "Link to this definition")
* Column* = 1*[](#eFrameDesignOrientation.Column "Link to this definition")
- Null* = 4*[](#eFrameDesignOrientation.Null "Link to this definition")
* Other* = 5*[](#eFrameDesignOrientation.Other "Link to this definition")
## eFramePropType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eFramePropType "Direct link to eFramePropType")
* *class *viktor.external.etabs.enums.eFramePropType(*\*values*)[](#eFramePropType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eFramePropType` values, mirroring the product API’s names so code reads like its docs.
* Angle* = 4*[](#eFramePropType.Angle "Link to this definition")
- Auto* = 12*[](#eFramePropType.Auto "Link to this definition")
* Box* = 6*[](#eFramePropType.Box "Link to this definition")
- Bridge* = 16*[](#eFramePropType.Bridge "Link to this definition")
* BucklingRestrainedBrace* = 33*[](#eFramePropType.BucklingRestrainedBrace "Link to this definition")
- BuiltupICoverplate* = 23*[](#eFramePropType.BuiltupICoverplate "Link to this definition")
* BuiltupIHybrid* = 26*[](#eFramePropType.BuiltupIHybrid "Link to this definition")
- BuiltupUHybrid* = 27*[](#eFramePropType.BuiltupUHybrid "Link to this definition")
* Channel* = 2*[](#eFramePropType.Channel "Link to this definition")
- Circle* = 9*[](#eFramePropType.Circle "Link to this definition")
* Cold\_2C* = 18*[](#eFramePropType.Cold_2C "Link to this definition")
- Cold\_2L* = 21*[](#eFramePropType.Cold_2L "Link to this definition")
* Cold\_Box* = 42*[](#eFramePropType.Cold_Box "Link to this definition")
- Cold\_C* = 17*[](#eFramePropType.Cold_C "Link to this definition")
* Cold\_Hat* = 22*[](#eFramePropType.Cold_Hat "Link to this definition")
- Cold\_I* = 43*[](#eFramePropType.Cold_I "Link to this definition")
* Cold\_L* = 20*[](#eFramePropType.Cold_L "Link to this definition")
- Cold\_Pipe* = 44*[](#eFramePropType.Cold_Pipe "Link to this definition")
* Cold\_T* = 45*[](#eFramePropType.Cold_T "Link to this definition")
- Cold\_Z* = 19*[](#eFramePropType.Cold_Z "Link to this definition")
* ConcreteBox* = 36*[](#eFramePropType.ConcreteBox "Link to this definition")
- ConcreteCross* = 38*[](#eFramePropType.ConcreteCross "Link to this definition")
* ConcretePipe* = 37*[](#eFramePropType.ConcretePipe "Link to this definition")
- ConcreteTee* = 35*[](#eFramePropType.ConcreteTee "Link to this definition")
* Concrete\_L* = 28*[](#eFramePropType.Concrete_L "Link to this definition")
- CoreBrace\_BRB* = 34*[](#eFramePropType.CoreBrace_BRB "Link to this definition")
* DbChannel* = 11*[](#eFramePropType.DbChannel "Link to this definition")
- DblAngle* = 5*[](#eFramePropType.DblAngle "Link to this definition")
* EncasedCircle* = 32*[](#eFramePropType.EncasedCircle "Link to this definition")
- EncasedRectangle* = 31*[](#eFramePropType.EncasedRectangle "Link to this definition")
* FilledPipe* = 30*[](#eFramePropType.FilledPipe "Link to this definition")
- FilledTube* = 29*[](#eFramePropType.FilledTube "Link to this definition")
* General* = 10*[](#eFramePropType.General "Link to this definition")
- I* = 1*[](#eFramePropType.I "Link to this definition")
* Joist* = 15*[](#eFramePropType.Joist "Link to this definition")
- PCCGirderBox* = 47*[](#eFramePropType.PCCGirderBox "Link to this definition")
* PCCGirderI* = 24*[](#eFramePropType.PCCGirderI "Link to this definition")
- PCCGirderSuperT* = 41*[](#eFramePropType.PCCGirderSuperT "Link to this definition")
* PCCGirderU* = 25*[](#eFramePropType.PCCGirderU "Link to this definition")
- Pipe* = 7*[](#eFramePropType.Pipe "Link to this definition")
* Rectangular* = 8*[](#eFramePropType.Rectangular "Link to this definition")
- SD* = 13*[](#eFramePropType.SD "Link to this definition")
* SteelPlate* = 39*[](#eFramePropType.SteelPlate "Link to this definition")
- SteelRod* = 40*[](#eFramePropType.SteelRod "Link to this definition")
* T* = 3*[](#eFramePropType.T "Link to this definition")
- Trapezoidal* = 46*[](#eFramePropType.Trapezoidal "Link to this definition")
* Variable* = 14*[](#eFramePropType.Variable "Link to this definition")
## eHingeDistributionType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eHingeDistributionType "Direct link to eHingeDistributionType")
* *class *viktor.external.etabs.enums.eHingeDistributionType(*\*values*)[](#eHingeDistributionType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eHingeDistributionType` values, mirroring the product API’s names so code reads like its docs.
* ContinuousSupport* = 4*[](#eHingeDistributionType.ContinuousSupport "Link to this definition")
- DistributedPlasticity* = 2*[](#eHingeDistributionType.DistributedPlasticity "Link to this definition")
* EqualSpacing* = 3*[](#eHingeDistributionType.EqualSpacing "Link to this definition")
- NonlinearBeamColumn* = 1*[](#eHingeDistributionType.NonlinearBeamColumn "Link to this definition")
* UserDefined* = 5*[](#eHingeDistributionType.UserDefined "Link to this definition")
## eHingeLengthOverwriteType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eHingeLengthOverwriteType "Direct link to eHingeLengthOverwriteType")
* *class *viktor.external.etabs.enums.eHingeLengthOverwriteType(*\*values*)[](#eHingeLengthOverwriteType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eHingeLengthOverwriteType` values, mirroring the product API’s names so code reads like its docs.
* Absolute* = 2*[](#eHingeLengthOverwriteType.Absolute "Link to this definition")
- None\_* = 1*[](#eHingeLengthOverwriteType.None_ "Link to this definition")
* Relative* = 3*[](#eHingeLengthOverwriteType.Relative "Link to this definition")
## eHingeLocationType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eHingeLocationType "Direct link to eHingeLocationType")
* *class *viktor.external.etabs.enums.eHingeLocationType(*\*values*)[](#eHingeLocationType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eHingeLocationType` values, mirroring the product API’s names so code reads like its docs.
* OffsetFromIEnd* = 2*[](#eHingeLocationType.OffsetFromIEnd "Link to this definition")
- OffsetFromJEnd* = 3*[](#eHingeLocationType.OffsetFromJEnd "Link to this definition")
* RelativeDistance* = 1*[](#eHingeLocationType.RelativeDistance "Link to this definition")
## eItemType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eItemType "Direct link to eItemType")
* *class *viktor.external.etabs.enums.eItemType(*\*values*)[](#eItemType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eItemType` values, mirroring the product API’s names so code reads like its docs.
* Group* = 1*[](#eItemType.Group "Link to this definition")
- Objects* = 0*[](#eItemType.Objects "Link to this definition")
* SelectedObjects* = 2*[](#eItemType.SelectedObjects "Link to this definition")
## eItemTypeElm[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eItemTypeElm "Direct link to eItemTypeElm")
* *class *viktor.external.etabs.enums.eItemTypeElm(*\*values*)[](#eItemTypeElm "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eItemTypeElm` values, mirroring the product API’s names so code reads like its docs.
* Element* = 1*[](#eItemTypeElm.Element "Link to this definition")
- GroupElm* = 2*[](#eItemTypeElm.GroupElm "Link to this definition")
* ObjectElm* = 0*[](#eItemTypeElm.ObjectElm "Link to this definition")
- SelectionElm* = 3*[](#eItemTypeElm.SelectionElm "Link to this definition")
## eLength[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eLength "Direct link to eLength")
* *class *viktor.external.etabs.enums.eLength(*\*values*)[](#eLength "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eLength` values, mirroring the product API’s names so code reads like its docs.
* NotApplicable* = 0*[](#eLength.NotApplicable "Link to this definition")
- cm* = 5*[](#eLength.cm "Link to this definition")
* ft* = 2*[](#eLength.ft "Link to this definition")
- inch* = 1*[](#eLength.inch "Link to this definition")
* m* = 6*[](#eLength.m "Link to this definition")
- micron* = 3*[](#eLength.micron "Link to this definition")
* mm* = 4*[](#eLength.mm "Link to this definition")
## eLinkPropType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eLinkPropType "Direct link to eLinkPropType")
* *class *viktor.external.etabs.enums.eLinkPropType(*\*values*)[](#eLinkPropType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eLinkPropType` values, mirroring the product API’s names so code reads like its docs.
* Damper* = 2*[](#eLinkPropType.Damper "Link to this definition")
- Gap* = 3*[](#eLinkPropType.Gap "Link to this definition")
* Hook* = 4*[](#eLinkPropType.Hook "Link to this definition")
- Isolator1* = 6*[](#eLinkPropType.Isolator1 "Link to this definition")
* Isolator2* = 7*[](#eLinkPropType.Isolator2 "Link to this definition")
- Isolator3* = 10*[](#eLinkPropType.Isolator3 "Link to this definition")
* Linear* = 1*[](#eLinkPropType.Linear "Link to this definition")
- MultilinearElastic* = 8*[](#eLinkPropType.MultilinearElastic "Link to this definition")
* MultilinearPlastic* = 9*[](#eLinkPropType.MultilinearPlastic "Link to this definition")
- PlasticWen* = 5*[](#eLinkPropType.PlasticWen "Link to this definition")
## eLoadCaseType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eLoadCaseType "Direct link to eLoadCaseType")
* *class *viktor.external.etabs.enums.eLoadCaseType(*\*values*)[](#eLoadCaseType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eLoadCaseType` values, mirroring the product API’s names so code reads like its docs.
* Buckling* = 10*[](#eLoadCaseType.Buckling "Link to this definition")
- HyperStatic* = 14*[](#eLoadCaseType.HyperStatic "Link to this definition")
* LinearDynamic* = 7*[](#eLoadCaseType.LinearDynamic "Link to this definition")
- LinearHistory* = 5*[](#eLoadCaseType.LinearHistory "Link to this definition")
* LinearStatic* = 1*[](#eLoadCaseType.LinearStatic "Link to this definition")
- LinearStaticMultiStep* = 13*[](#eLoadCaseType.LinearStaticMultiStep "Link to this definition")
* Modal* = 3*[](#eLoadCaseType.Modal "Link to this definition")
- MovingLoad* = 9*[](#eLoadCaseType.MovingLoad "Link to this definition")
* NonlinearDynamic* = 8*[](#eLoadCaseType.NonlinearDynamic "Link to this definition")
- NonlinearHistory* = 6*[](#eLoadCaseType.NonlinearHistory "Link to this definition")
* NonlinearStatic* = 2*[](#eLoadCaseType.NonlinearStatic "Link to this definition")
- PowerSpectralDensity* = 12*[](#eLoadCaseType.PowerSpectralDensity "Link to this definition")
* ResponseSpectrum* = 4*[](#eLoadCaseType.ResponseSpectrum "Link to this definition")
- SteadyState* = 11*[](#eLoadCaseType.SteadyState "Link to this definition")
## eLoadPatternType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eLoadPatternType "Direct link to eLoadPatternType")
* *class *viktor.external.etabs.enums.eLoadPatternType(*\*values*)[](#eLoadPatternType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eLoadPatternType` values, mirroring the product API’s names so code reads like its docs.
* ActiveEarthPressure* = 45*[](#eLoadPatternType.ActiveEarthPressure "Link to this definition")
- Bouyancy* = 36*[](#eLoadPatternType.Bouyancy "Link to this definition")
* Braking* = 15*[](#eLoadPatternType.Braking "Link to this definition")
- Centrifugal* = 16*[](#eLoadPatternType.Centrifugal "Link to this definition")
* Construction* = 39*[](#eLoadPatternType.Construction "Link to this definition")
- Creep* = 29*[](#eLoadPatternType.Creep "Link to this definition")
* Dead* = 1*[](#eLoadPatternType.Dead "Link to this definition")
- DeadManufacture* = 42*[](#eLoadPatternType.DeadManufacture "Link to this definition")
* DeadWater* = 41*[](#eLoadPatternType.DeadWater "Link to this definition")
- DeadWearing* = 40*[](#eLoadPatternType.DeadWearing "Link to this definition")
* DownDrag* = 23*[](#eLoadPatternType.DownDrag "Link to this definition")
- EarthHydrostatic* = 43*[](#eLoadPatternType.EarthHydrostatic "Link to this definition")
* EarthSurcharge* = 22*[](#eLoadPatternType.EarthSurcharge "Link to this definition")
- EuroLm1Char* = 48*[](#eLoadPatternType.EuroLm1Char "Link to this definition")
* EuroLm1Freq* = 49*[](#eLoadPatternType.EuroLm1Freq "Link to this definition")
- EuroLm2* = 50*[](#eLoadPatternType.EuroLm2 "Link to this definition")
* EuroLm3* = 51*[](#eLoadPatternType.EuroLm3 "Link to this definition")
- EuroLm4* = 52*[](#eLoadPatternType.EuroLm4 "Link to this definition")
* Friction* = 17*[](#eLoadPatternType.Friction "Link to this definition")
- HorizontalEarthPressure* = 20*[](#eLoadPatternType.HorizontalEarthPressure "Link to this definition")
* Hyperstatic* = 35*[](#eLoadPatternType.Hyperstatic "Link to this definition")
- Ice* = 18*[](#eLoadPatternType.Ice "Link to this definition")
* Impact* = 38*[](#eLoadPatternType.Impact "Link to this definition")
- Live* = 3*[](#eLoadPatternType.Live "Link to this definition")
* LiveLoadSurcharge* = 31*[](#eLoadPatternType.LiveLoadSurcharge "Link to this definition")
- LockedInForces* = 32*[](#eLoadPatternType.LockedInForces "Link to this definition")
* Move* = 9*[](#eLoadPatternType.Move "Link to this definition")
- MoveDeflection* = 57*[](#eLoadPatternType.MoveDeflection "Link to this definition")
* MoveFatigue* = 55*[](#eLoadPatternType.MoveFatigue "Link to this definition")
- MoveFatiguePermit* = 56*[](#eLoadPatternType.MoveFatiguePermit "Link to this definition")
* MoveTrain* = 58*[](#eLoadPatternType.MoveTrain "Link to this definition")
- Notional* = 12*[](#eLoadPatternType.Notional "Link to this definition")
* Other* = 8*[](#eLoadPatternType.Other "Link to this definition")
- PassiveEarthPressure* = 44*[](#eLoadPatternType.PassiveEarthPressure "Link to this definition")
* PatternAuto* = 60*[](#eLoadPatternType.PatternAuto "Link to this definition")
- PatternLive* = 13*[](#eLoadPatternType.PatternLive "Link to this definition")
* PedestrianLL* = 33*[](#eLoadPatternType.PedestrianLL "Link to this definition")
- PedestrianLLReduced* = 46*[](#eLoadPatternType.PedestrianLLReduced "Link to this definition")
* Permit* = 54*[](#eLoadPatternType.Permit "Link to this definition")
- Prestress* = 34*[](#eLoadPatternType.Prestress "Link to this definition")
* PrestressTransfer* = 59*[](#eLoadPatternType.PrestressTransfer "Link to this definition")
- Quake* = 5*[](#eLoadPatternType.Quake "Link to this definition")
* QuakeDrift* = 61*[](#eLoadPatternType.QuakeDrift "Link to this definition")
- QuakeVerticalOnly* = 62*[](#eLoadPatternType.QuakeVerticalOnly "Link to this definition")
* ReduceLive* = 4*[](#eLoadPatternType.ReduceLive "Link to this definition")
- Rooflive* = 11*[](#eLoadPatternType.Rooflive "Link to this definition")
* SeaState* = 53*[](#eLoadPatternType.SeaState "Link to this definition")
- Settlement* = 27*[](#eLoadPatternType.Settlement "Link to this definition")
* Shrinkage* = 28*[](#eLoadPatternType.Shrinkage "Link to this definition")
- Snow* = 7*[](#eLoadPatternType.Snow "Link to this definition")
* SnowHighAltitude* = 47*[](#eLoadPatternType.SnowHighAltitude "Link to this definition")
- StreamFlow* = 37*[](#eLoadPatternType.StreamFlow "Link to this definition")
* SuperDead* = 2*[](#eLoadPatternType.SuperDead "Link to this definition")
- Temperature* = 10*[](#eLoadPatternType.Temperature "Link to this definition")
* TemperatureGradient* = 26*[](#eLoadPatternType.TemperatureGradient "Link to this definition")
- VehicleCollision* = 24*[](#eLoadPatternType.VehicleCollision "Link to this definition")
* VerticalEarthPressure* = 21*[](#eLoadPatternType.VerticalEarthPressure "Link to this definition")
- VesselCollision* = 25*[](#eLoadPatternType.VesselCollision "Link to this definition")
* WaterloadPressure* = 30*[](#eLoadPatternType.WaterloadPressure "Link to this definition")
- Wave* = 14*[](#eLoadPatternType.Wave "Link to this definition")
* Wind* = 6*[](#eLoadPatternType.Wind "Link to this definition")
- WindOnLiveLoad* = 19*[](#eLoadPatternType.WindOnLiveLoad "Link to this definition")
## eMatCoupledType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eMatCoupledType "Direct link to eMatCoupledType")
* *class *viktor.external.etabs.enums.eMatCoupledType(*\*values*)[](#eMatCoupledType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eMatCoupledType` values, mirroring the product API’s names so code reads like its docs.
* FariaConcreteDamagePlasticity* = 4*[](#eMatCoupledType.FariaConcreteDamagePlasticity "Link to this definition")
- ModifiedDarwinPecknoldConcrete* = 3*[](#eMatCoupledType.ModifiedDarwinPecknoldConcrete "Link to this definition")
* None\_* = 1*[](#eMatCoupledType.None_ "Link to this definition")
- VonMisesPlasticity* = 2*[](#eMatCoupledType.VonMisesPlasticity "Link to this definition")
## eMatType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eMatType "Direct link to eMatType")
* *class *viktor.external.etabs.enums.eMatType(*\*values*)[](#eMatType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eMatType` values, mirroring the product API’s names so code reads like its docs.
* Aluminum* = 4*[](#eMatType.Aluminum "Link to this definition")
- ColdFormed* = 5*[](#eMatType.ColdFormed "Link to this definition")
* Concrete* = 2*[](#eMatType.Concrete "Link to this definition")
- Masonry* = 8*[](#eMatType.Masonry "Link to this definition")
* NoDesign* = 3*[](#eMatType.NoDesign "Link to this definition")
- Rebar* = 6*[](#eMatType.Rebar "Link to this definition")
* Steel* = 1*[](#eMatType.Steel "Link to this definition")
- Tendon* = 7*[](#eMatType.Tendon "Link to this definition")
## eMatTypeAluminum[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eMatTypeAluminum "Direct link to eMatTypeAluminum")
* *class *viktor.external.etabs.enums.eMatTypeAluminum(*\*values*)[](#eMatTypeAluminum "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eMatTypeAluminum` values, mirroring the product API’s names so code reads like its docs.
* SubType\_5052\_H34* = 3*[](#eMatTypeAluminum.SubType_5052_H34 "Link to this definition")
- SubType\_6061\_T6* = 1*[](#eMatTypeAluminum.SubType_6061_T6 "Link to this definition")
* SubType\_6063\_T6* = 2*[](#eMatTypeAluminum.SubType_6063_T6 "Link to this definition")
## eMatTypeColdFormed[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eMatTypeColdFormed "Direct link to eMatTypeColdFormed")
* *class *viktor.external.etabs.enums.eMatTypeColdFormed(*\*values*)[](#eMatTypeColdFormed "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eMatTypeColdFormed` values, mirroring the product API’s names so code reads like its docs.
* ASTM\_A653SQGr33* = 1*[](#eMatTypeColdFormed.ASTM_A653SQGr33 "Link to this definition")
- ASTM\_A653SQGr50* = 2*[](#eMatTypeColdFormed.ASTM_A653SQGr50 "Link to this definition")
## eMatTypeConcrete[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eMatTypeConcrete "Direct link to eMatTypeConcrete")
* *class *viktor.external.etabs.enums.eMatTypeConcrete(*\*values*)[](#eMatTypeConcrete "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eMatTypeConcrete` values, mirroring the product API’s names so code reads like its docs.
* Chinese\_C20\_NormalWeight* = 9*[](#eMatTypeConcrete.Chinese_C20_NormalWeight "Link to this definition")
- Chinese\_C30\_NormalWeight* = 10*[](#eMatTypeConcrete.Chinese_C30_NormalWeight "Link to this definition")
* Chinese\_C40\_NormalWeight* = 11*[](#eMatTypeConcrete.Chinese_C40_NormalWeight "Link to this definition")
- EN\_C12\_NormalWeight* = 22*[](#eMatTypeConcrete.EN_C12_NormalWeight "Link to this definition")
* EN\_C16\_NormalWeight* = 23*[](#eMatTypeConcrete.EN_C16_NormalWeight "Link to this definition")
- EN\_C20\_NormalWeight* = 24*[](#eMatTypeConcrete.EN_C20_NormalWeight "Link to this definition")
* EN\_C25\_NormalWeight* = 25*[](#eMatTypeConcrete.EN_C25_NormalWeight "Link to this definition")
- EN\_C30\_NormalWeight* = 26*[](#eMatTypeConcrete.EN_C30_NormalWeight "Link to this definition")
* EN\_C35\_NormalWeight* = 27*[](#eMatTypeConcrete.EN_C35_NormalWeight "Link to this definition")
- EN\_C40\_NormalWeight* = 28*[](#eMatTypeConcrete.EN_C40_NormalWeight "Link to this definition")
* EN\_C45\_NormalWeight* = 29*[](#eMatTypeConcrete.EN_C45_NormalWeight "Link to this definition")
- EN\_C50\_NormalWeight* = 30*[](#eMatTypeConcrete.EN_C50_NormalWeight "Link to this definition")
* EN\_C55\_NormalWeight* = 31*[](#eMatTypeConcrete.EN_C55_NormalWeight "Link to this definition")
- EN\_C60\_NormalWeight* = 32*[](#eMatTypeConcrete.EN_C60_NormalWeight "Link to this definition")
* EN\_C70\_NormalWeight* = 33*[](#eMatTypeConcrete.EN_C70_NormalWeight "Link to this definition")
- EN\_C80\_NormalWeight* = 34*[](#eMatTypeConcrete.EN_C80_NormalWeight "Link to this definition")
* EN\_C90\_NormalWeight* = 35*[](#eMatTypeConcrete.EN_C90_NormalWeight "Link to this definition")
- FC3000\_LightWeight* = 5*[](#eMatTypeConcrete.FC3000_LightWeight "Link to this definition")
* FC3000\_NormalWeight* = 1*[](#eMatTypeConcrete.FC3000_NormalWeight "Link to this definition")
- FC4000\_LightWeight* = 6*[](#eMatTypeConcrete.FC4000_LightWeight "Link to this definition")
* FC4000\_NormalWeight* = 2*[](#eMatTypeConcrete.FC4000_NormalWeight "Link to this definition")
- FC5000\_LightWeight* = 7*[](#eMatTypeConcrete.FC5000_LightWeight "Link to this definition")
* FC5000\_NormalWeight* = 3*[](#eMatTypeConcrete.FC5000_NormalWeight "Link to this definition")
- FC6000\_LightWeight* = 8*[](#eMatTypeConcrete.FC6000_LightWeight "Link to this definition")
* FC6000\_NormalWeight* = 4*[](#eMatTypeConcrete.FC6000_NormalWeight "Link to this definition")
- Indian\_M15\_NormalWeight* = 12*[](#eMatTypeConcrete.Indian_M15_NormalWeight "Link to this definition")
* Indian\_M20\_NormalWeight* = 13*[](#eMatTypeConcrete.Indian_M20_NormalWeight "Link to this definition")
- Indian\_M25\_NormalWeight* = 14*[](#eMatTypeConcrete.Indian_M25_NormalWeight "Link to this definition")
* Indian\_M30\_NormalWeight* = 15*[](#eMatTypeConcrete.Indian_M30_NormalWeight "Link to this definition")
- Indian\_M35\_NormalWeight* = 16*[](#eMatTypeConcrete.Indian_M35_NormalWeight "Link to this definition")
* Indian\_M40\_NormalWeight* = 17*[](#eMatTypeConcrete.Indian_M40_NormalWeight "Link to this definition")
- Indian\_M45\_NormalWeight* = 18*[](#eMatTypeConcrete.Indian_M45_NormalWeight "Link to this definition")
* Indian\_M50\_NormalWeight* = 19*[](#eMatTypeConcrete.Indian_M50_NormalWeight "Link to this definition")
- Indian\_M55\_NormalWeight* = 20*[](#eMatTypeConcrete.Indian_M55_NormalWeight "Link to this definition")
* Indian\_M60\_NormalWeight* = 21*[](#eMatTypeConcrete.Indian_M60_NormalWeight "Link to this definition")
## eMatTypeRebar[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eMatTypeRebar "Direct link to eMatTypeRebar")
* *class *viktor.external.etabs.enums.eMatTypeRebar(*\*values*)[](#eMatTypeRebar "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eMatTypeRebar` values, mirroring the product API’s names so code reads like its docs.
* ASTM\_A615Gr40* = 1*[](#eMatTypeRebar.ASTM_A615Gr40 "Link to this definition")
- ASTM\_A615Gr60* = 2*[](#eMatTypeRebar.ASTM_A615Gr60 "Link to this definition")
* ASTM\_A615Gr75* = 3*[](#eMatTypeRebar.ASTM_A615Gr75 "Link to this definition")
- ASTM\_A706* = 4*[](#eMatTypeRebar.ASTM_A706 "Link to this definition")
* Chinese\_HPB235* = 5*[](#eMatTypeRebar.Chinese_HPB235 "Link to this definition")
- Chinese\_HRB335* = 6*[](#eMatTypeRebar.Chinese_HRB335 "Link to this definition")
* Chinese\_HRB400* = 7*[](#eMatTypeRebar.Chinese_HRB400 "Link to this definition")
- Indian\_HYSD415* = 9*[](#eMatTypeRebar.Indian_HYSD415 "Link to this definition")
* Indian\_HYSD500* = 10*[](#eMatTypeRebar.Indian_HYSD500 "Link to this definition")
- Indian\_HYSD550* = 11*[](#eMatTypeRebar.Indian_HYSD550 "Link to this definition")
* Indian\_Mild250* = 8*[](#eMatTypeRebar.Indian_Mild250 "Link to this definition")
## eMatTypeSteel[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eMatTypeSteel "Direct link to eMatTypeSteel")
* *class *viktor.external.etabs.enums.eMatTypeSteel(*\*values*)[](#eMatTypeSteel "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eMatTypeSteel` values, mirroring the product API’s names so code reads like its docs.
* ASTM\_A36* = 1*[](#eMatTypeSteel.ASTM_A36 "Link to this definition")
- ASTM\_A500GrB\_Fy42* = 3*[](#eMatTypeSteel.ASTM_A500GrB_Fy42 "Link to this definition")
* ASTM\_A500GrB\_Fy46* = 4*[](#eMatTypeSteel.ASTM_A500GrB_Fy46 "Link to this definition")
- ASTM\_A53GrB* = 2*[](#eMatTypeSteel.ASTM_A53GrB "Link to this definition")
* ASTM\_A572Gr50* = 5*[](#eMatTypeSteel.ASTM_A572Gr50 "Link to this definition")
- ASTM\_A913Gr50* = 6*[](#eMatTypeSteel.ASTM_A913Gr50 "Link to this definition")
* ASTM\_A992\_Fy50* = 7*[](#eMatTypeSteel.ASTM_A992_Fy50 "Link to this definition")
- Chinese\_Q235* = 8*[](#eMatTypeSteel.Chinese_Q235 "Link to this definition")
* Chinese\_Q345* = 9*[](#eMatTypeSteel.Chinese_Q345 "Link to this definition")
- Chinese\_Q355* = 16*[](#eMatTypeSteel.Chinese_Q355 "Link to this definition")
* EN100252\_S235* = 12*[](#eMatTypeSteel.EN100252_S235 "Link to this definition")
- EN100252\_S275* = 13*[](#eMatTypeSteel.EN100252_S275 "Link to this definition")
* EN100252\_S355* = 14*[](#eMatTypeSteel.EN100252_S355 "Link to this definition")
- EN100252\_S450* = 15*[](#eMatTypeSteel.EN100252_S450 "Link to this definition")
* Indian\_Fe250* = 10*[](#eMatTypeSteel.Indian_Fe250 "Link to this definition")
- Indian\_Fe345* = 11*[](#eMatTypeSteel.Indian_Fe345 "Link to this definition")
## eMatTypeTendon[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eMatTypeTendon "Direct link to eMatTypeTendon")
* *class *viktor.external.etabs.enums.eMatTypeTendon(*\*values*)[](#eMatTypeTendon "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eMatTypeTendon` values, mirroring the product API’s names so code reads like its docs.
* ASTM\_A416Gr250* = 1*[](#eMatTypeTendon.ASTM_A416Gr250 "Link to this definition")
- ASTM\_A416Gr270* = 2*[](#eMatTypeTendon.ASTM_A416Gr270 "Link to this definition")
## eNamedSetType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eNamedSetType "Direct link to eNamedSetType")
* *class *viktor.external.etabs.enums.eNamedSetType(*\*values*)[](#eNamedSetType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eNamedSetType` values, mirroring the product API’s names so code reads like its docs.
* All* = 0*[](#eNamedSetType.All "Link to this definition")
- BridgeCalculationReport* = 17*[](#eNamedSetType.BridgeCalculationReport "Link to this definition")
* BridgeCalculationReportSub* = 18*[](#eNamedSetType.BridgeCalculationReportSub "Link to this definition")
- BridgeSeismicReport* = 15*[](#eNamedSetType.BridgeSeismicReport "Link to this definition")
* BridgeSuperstructureResponse* = 16*[](#eNamedSetType.BridgeSuperstructureResponse "Link to this definition")
- JointTHResponseSpectra* = 8*[](#eNamedSetType.JointTHResponseSpectra "Link to this definition")
* NamedDisplay* = 9*[](#eNamedSetType.NamedDisplay "Link to this definition")
- PlotFunctionTraces* = 10*[](#eNamedSetType.PlotFunctionTraces "Link to this definition")
* PushoverCurve* = 11*[](#eNamedSetType.PushoverCurve "Link to this definition")
- RunAnalysis* = 2*[](#eNamedSetType.RunAnalysis "Link to this definition")
* RunBridgeDesignSeismic* = 5*[](#eNamedSetType.RunBridgeDesignSeismic "Link to this definition")
- RunBridgeDesignSubstructure* = 4*[](#eNamedSetType.RunBridgeDesignSubstructure "Link to this definition")
* RunBridgeDesignSuperstructure* = 3*[](#eNamedSetType.RunBridgeDesignSuperstructure "Link to this definition")
- RunBridgeRatingSuperstructure* = 6*[](#eNamedSetType.RunBridgeRatingSuperstructure "Link to this definition")
* RunMemberRating* = 7*[](#eNamedSetType.RunMemberRating "Link to this definition")
- TableGroupSuperset* = 14*[](#eNamedSetType.TableGroupSuperset "Link to this definition")
* TableSet* = 13*[](#eNamedSetType.TableSet "Link to this definition")
- UpdateBridgeObject* = 1*[](#eNamedSetType.UpdateBridgeObject "Link to this definition")
* VirtualWork* = 12*[](#eNamedSetType.VirtualWork "Link to this definition")
## eObjType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eObjType "Direct link to eObjType")
* *class *viktor.external.etabs.enums.eObjType(*\*values*)[](#eObjType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eObjType` values, mirroring the product API’s names so code reads like its docs.
* Area* = 3*[](#eObjType.Area "Link to this definition")
- Frame* = 2*[](#eObjType.Frame "Link to this definition")
* Point* = 1*[](#eObjType.Point "Link to this definition")
- Solid* = 6*[](#eObjType.Solid "Link to this definition")
## eReturnCode[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eReturnCode "Direct link to eReturnCode")
* *class *viktor.external.etabs.enums.eReturnCode(*\*values*)[](#eReturnCode "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eReturnCode` values, mirroring the product API’s names so code reads like its docs.
* Deprecated* = -98*[](#eReturnCode.Deprecated "Link to this definition")
- NoError* = 0*[](#eReturnCode.NoError "Link to this definition")
* NotApplicable* = -100*[](#eReturnCode.NotApplicable "Link to this definition")
- NotImplemented* = -99*[](#eReturnCode.NotImplemented "Link to this definition")
* TableDoesNotExist* = -96*[](#eReturnCode.TableDoesNotExist "Link to this definition")
- TableIsObsolete* = -97*[](#eReturnCode.TableIsObsolete "Link to this definition")
* UnspecifiedError* = 1*[](#eReturnCode.UnspecifiedError "Link to this definition")
## eShellType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eShellType "Direct link to eShellType")
* *class *viktor.external.etabs.enums.eShellType(*\*values*)[](#eShellType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eShellType` values, mirroring the product API’s names so code reads like its docs.
* Layered* = 6*[](#eShellType.Layered "Link to this definition")
- Membrane* = 3*[](#eShellType.Membrane "Link to this definition")
* PlateThick\_DO\_NOT\_USE* = 5*[](#eShellType.PlateThick_DO_NOT_USE "Link to this definition")
- PlateThin\_DO\_NOT\_USE* = 4*[](#eShellType.PlateThin_DO_NOT_USE "Link to this definition")
* ShellThick* = 2*[](#eShellType.ShellThick "Link to this definition")
- ShellThin* = 1*[](#eShellType.ShellThin "Link to this definition")
## eSlabType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eSlabType "Direct link to eSlabType")
* *class *viktor.external.etabs.enums.eSlabType(*\*values*)[](#eSlabType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eSlabType` values, mirroring the product API’s names so code reads like its docs.
* Drop* = 1*[](#eSlabType.Drop "Link to this definition")
- Footing* = 6*[](#eSlabType.Footing "Link to this definition")
* Mat* = 5*[](#eSlabType.Mat "Link to this definition")
- Ribbed* = 3*[](#eSlabType.Ribbed "Link to this definition")
* Slab* = 0*[](#eSlabType.Slab "Link to this definition")
- Stiff\_DO\_NOT\_USE* = 2*[](#eSlabType.Stiff_DO_NOT_USE "Link to this definition")
* Waffle* = 4*[](#eSlabType.Waffle "Link to this definition")
## eSolidPropFormulationType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eSolidPropFormulationType "Direct link to eSolidPropFormulationType")
* *class *viktor.external.etabs.enums.eSolidPropFormulationType(*\*values*)[](#eSolidPropFormulationType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eSolidPropFormulationType` values, mirroring the product API’s names so code reads like its docs.
* LegacyQuadratic* = 1*[](#eSolidPropFormulationType.LegacyQuadratic "Link to this definition")
- LegacyStandard* = 0*[](#eSolidPropFormulationType.LegacyStandard "Link to this definition")
* Quadratic* = 3*[](#eSolidPropFormulationType.Quadratic "Link to this definition")
- Standard* = 2*[](#eSolidPropFormulationType.Standard "Link to this definition")
## eSuperObjectClass[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eSuperObjectClass "Direct link to eSuperObjectClass")
* *class *viktor.external.etabs.enums.eSuperObjectClass(*\*values*)[](#eSuperObjectClass "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eSuperObjectClass` values, mirroring the product API’s names so code reads like its docs.
* BridgeFoundation* = 3*[](#eSuperObjectClass.BridgeFoundation "Link to this definition")
- Foundation* = 2*[](#eSuperObjectClass.Foundation "Link to this definition")
* None\_* = 0*[](#eSuperObjectClass.None_ "Link to this definition")
- SuperObject* = 1*[](#eSuperObjectClass.SuperObject "Link to this definition")
## eTemperature[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eTemperature "Direct link to eTemperature")
* *class *viktor.external.etabs.enums.eTemperature(*\*values*)[](#eTemperature "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eTemperature` values, mirroring the product API’s names so code reads like its docs.
* C* = 2*[](#eTemperature.C "Link to this definition")
- F* = 1*[](#eTemperature.F "Link to this definition")
* NotApplicable* = 0*[](#eTemperature.NotApplicable "Link to this definition")
## eTemplateType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eTemplateType "Direct link to eTemplateType")
* *class *viktor.external.etabs.enums.eTemplateType(*\*values*)[](#eTemplateType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eTemplateType` values, mirroring the product API’s names so code reads like its docs.
* Advanced* = 17*[](#eTemplateType.Advanced "Link to this definition")
- Barrel* = 12*[](#eTemplateType.Barrel "Link to this definition")
* Beam* = 2*[](#eTemplateType.Beam "Link to this definition")
- BracedFrame* = 7*[](#eTemplateType.BracedFrame "Link to this definition")
* Bridge* = 11*[](#eTemplateType.Bridge "Link to this definition")
- BridgeWizard* = 23*[](#eTemplateType.BridgeWizard "Link to this definition")
* CableBridges* = 29*[](#eTemplateType.CableBridges "Link to this definition")
- Clear* = 1*[](#eTemplateType.Clear "Link to this definition")
* Cylinder* = 13*[](#eTemplateType.Cylinder "Link to this definition")
- Dome* = 14*[](#eTemplateType.Dome "Link to this definition")
* EccentricFrame* = 8*[](#eTemplateType.EccentricFrame "Link to this definition")
- Floor* = 16*[](#eTemplateType.Floor "Link to this definition")
* Frame2D* = 21*[](#eTemplateType.Frame2D "Link to this definition")
- Frame3D* = 22*[](#eTemplateType.Frame3D "Link to this definition")
* Grid* = 0*[](#eTemplateType.Grid "Link to this definition")
- PerimeterFrame* = 9*[](#eTemplateType.PerimeterFrame "Link to this definition")
* PipesAndPlates* = 24*[](#eTemplateType.PipesAndPlates "Link to this definition")
- PortalFrame* = 6*[](#eTemplateType.PortalFrame "Link to this definition")
* ShearWall* = 15*[](#eTemplateType.ShearWall "Link to this definition")
- Shells* = 25*[](#eTemplateType.Shells "Link to this definition")
* SlopedTruss* = 3*[](#eTemplateType.SlopedTruss "Link to this definition")
- SolidModels* = 26*[](#eTemplateType.SolidModels "Link to this definition")
* SpaceFrame* = 10*[](#eTemplateType.SpaceFrame "Link to this definition")
- SpaceTruss* = 5*[](#eTemplateType.SpaceTruss "Link to this definition")
* Staircases* = 28*[](#eTemplateType.Staircases "Link to this definition")
- StorageStructures* = 27*[](#eTemplateType.StorageStructures "Link to this definition")
* Truss2D* = 19*[](#eTemplateType.Truss2D "Link to this definition")
- Truss3D* = 20*[](#eTemplateType.Truss3D "Link to this definition")
* UndergoundConcrete* = 18*[](#eTemplateType.UndergoundConcrete "Link to this definition")
- VerticalTruss* = 4*[](#eTemplateType.VerticalTruss "Link to this definition")
## eUnits[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eUnits "Direct link to eUnits")
* *class *viktor.external.etabs.enums.eUnits(*\*values*)[](#eUnits "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eUnits` values, mirroring the product API’s names so code reads like its docs.
* N\_cm\_C* = 15*[](#eUnits.N_cm_C "Link to this definition")
- N\_m\_C* = 10*[](#eUnits.N_m_C "Link to this definition")
* N\_mm\_C* = 9*[](#eUnits.N_mm_C "Link to this definition")
- Ton\_cm\_C* = 16*[](#eUnits.Ton_cm_C "Link to this definition")
* Ton\_m\_C* = 12*[](#eUnits.Ton_m_C "Link to this definition")
- Ton\_mm\_C* = 11*[](#eUnits.Ton_mm_C "Link to this definition")
* kN\_cm\_C* = 13*[](#eUnits.kN_cm_C "Link to this definition")
- kN\_m\_C* = 6*[](#eUnits.kN_m_C "Link to this definition")
* kN\_mm\_C* = 5*[](#eUnits.kN_mm_C "Link to this definition")
- kgf\_cm\_C* = 14*[](#eUnits.kgf_cm_C "Link to this definition")
* kgf\_m\_C* = 8*[](#eUnits.kgf_m_C "Link to this definition")
- kgf\_mm\_C* = 7*[](#eUnits.kgf_mm_C "Link to this definition")
* kip\_ft\_F* = 4*[](#eUnits.kip_ft_F "Link to this definition")
- kip\_in\_F* = 3*[](#eUnits.kip_in_F "Link to this definition")
* lb\_ft\_F* = 2*[](#eUnits.lb_ft_F "Link to this definition")
- lb\_in\_F* = 1*[](#eUnits.lb_in_F "Link to this definition")
## eWallPierRebarLayerType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eWallPierRebarLayerType "Direct link to eWallPierRebarLayerType")
* *class *viktor.external.etabs.enums.eWallPierRebarLayerType(*\*values*)[](#eWallPierRebarLayerType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eWallPierRebarLayerType` values, mirroring the product API’s names so code reads like its docs.
* Confinement\_EndZoneI* = 5*[](#eWallPierRebarLayerType.Confinement_EndZoneI "Link to this definition")
- Confinement\_EndZoneJ* = 6*[](#eWallPierRebarLayerType.Confinement_EndZoneJ "Link to this definition")
* Diagonal\_Each* = 7*[](#eWallPierRebarLayerType.Diagonal_Each "Link to this definition")
- Horizontal\_Distributed\_MiddleZone\_Eachface* = 2*[](#eWallPierRebarLayerType.Horizontal_Distributed_MiddleZone_Eachface "Link to this definition")
* Vertical\_Distributed\_EndZoneI\_Total* = 3*[](#eWallPierRebarLayerType.Vertical_Distributed_EndZoneI_Total "Link to this definition")
- Vertical\_Distributed\_EndZoneJ\_Total* = 4*[](#eWallPierRebarLayerType.Vertical_Distributed_EndZoneJ_Total "Link to this definition")
* Vertical\_Distributed\_MiddleZone\_Eachface* = 1*[](#eWallPierRebarLayerType.Vertical_Distributed_MiddleZone_Eachface "Link to this definition")
## eWallPropType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eWallPropType "Direct link to eWallPropType")
* *class *viktor.external.etabs.enums.eWallPropType(*\*values*)[](#eWallPropType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eWallPropType` values, mirroring the product API’s names so code reads like its docs.
* AutoSelectList* = 2*[](#eWallPropType.AutoSelectList "Link to this definition")
- Specified* = 1*[](#eWallPropType.Specified "Link to this definition")
## eWallSpandrelRebarLayerType[](https://docs.viktor.ai/sdk/api/external/etabs/.md#_eWallSpandrelRebarLayerType "Direct link to eWallSpandrelRebarLayerType")
* *class *viktor.external.etabs.enums.eWallSpandrelRebarLayerType(*\*values*)[](#eWallSpandrelRebarLayerType "Link to this definition")
Bases: `IntEnum`
New in 14.31.0
ETABS `eWallSpandrelRebarLayerType` values, mirroring the product API’s names so code reads like its docs.
* Diagonal\_Each* = 5*[](#eWallSpandrelRebarLayerType.Diagonal_Each "Link to this definition")
- Horizontal\_Bottom\_Total* = 2*[](#eWallSpandrelRebarLayerType.Horizontal_Bottom_Total "Link to this definition")
* Horizontal\_Distributed\_Eachface* = 3*[](#eWallSpandrelRebarLayerType.Horizontal_Distributed_Eachface "Link to this definition")
- Horizontal\_Top\_Total* = 1*[](#eWallSpandrelRebarLayerType.Horizontal_Top_Total "Link to this definition")
* Vertical\_Ties\_Distributed* = 4*[](#eWallSpandrelRebarLayerType.Vertical_Ties_Distributed "Link to this definition")
---
# viktor.external.excel
## Excel[](https://docs.viktor.ai/sdk/api/external/excel/.md#_Excel "Direct link to Excel")
* *class *viktor.external.excel.Excel(*template*, *named\_input\_cells=None*, *direct\_input\_cells=None*, *macros=None*, *named\_output\_cells=None*, *direct\_output\_cells=None*, *extension='.xlsm'*, *typed\_results=False*)[](#Excel "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
Excel can be used to perform an analysis of an Excel sheet using a third-party worker. This Excel sheet may contain macros (i.e. .xlsm extension).
To start an analysis call the method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"), with an appropriate timeout (in seconds). To retrieve the results call the method [`get_named_cell_result()`](#Excel.get_named_cell_result "viktor.external.excel.Excel.get_named_cell_result") or [`get_direct_cell_result()`](#Excel.get_direct_cell_result "viktor.external.excel.Excel.get_direct_cell_result"), after [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute").
Example:
```
named_input_cells = [NamedInputCell('x', x)]
direct_output_cells = [DirectOutputCell('Sheet1', 'B', 3)]
excel_analysis = Excel(template, named_input_cells=named_input_cells,
direct_output_cells=direct_output_cells, extension='.xlsx')
excel_analysis.execute(timeout=10)
result = excel.get_direct_cell_result('Sheet1', 'B', 3)
```
* Parameters:
* **template** (`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Excel template to be filled, executed and returned.
* **named\_input\_cells** (`List`\[[`NamedInputCell`](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#NamedInputCell "viktor.external.spreadsheet.NamedInputCell")]) – A list of named cells containing input values.
* **direct\_input\_cells** (`List`\[[`DirectInputCell`](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#DirectInputCell "viktor.external.spreadsheet.DirectInputCell")]) – A list of direct cells containing input values.
* **macros** (`List`\[[`Macro`](#Macro "viktor.external.excel.Macro")]) – A list of macros to be executed. The order of the list is preserved. This means the first macro in the list will be executed first, the second macro wil be executed second, etc.
* **named\_output\_cells** (`List`\[[`NamedOutputCell`](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#NamedOutputCell "viktor.external.spreadsheet.NamedOutputCell")]) – A list of named cells of which the result after evaluation is desired.
* **direct\_output\_cells** (`List`\[[`DirectOutputCell`](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#DirectOutputCell "viktor.external.spreadsheet.DirectOutputCell")]) – A list of direct cells of which the result after evaluation is desired.
* **extension** (`str`) – Extension of the file you want to evaluate: ‘.xlsm’ | ‘.xlsx’.
* **typed\_results** (`bool`) – Cell results are of the same type as spreadsheet, if False, all values are str
Exceptions which can be raised during calculation: - [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* *property *error\_message*: str | None*[](#Excel.error_message "Link to this definition")
The error string containing information from the Excel worker when available, None otherwise.
- execute(*timeout=30*)[](#Excel.execute "Link to this definition")
Run method to start an external Excel analysis using a VIKTOR worker.
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
**timeout** (`int`) – Timeout period in seconds.
* Raises:
* TimeoutError when timeout has been exceeded
* ConnectionError if no worker installed or connected
* [`viktor.errors.LicenseError`](https://docs.viktor.ai/sdk/api/errors/.md#LicenseError "viktor.errors.LicenseError") if no license is available
* [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError") if the external program cannot execute with the provided inputs
* Return type:
`None`
* *property *filled\_template*: BytesIO*[](#Excel.filled_template "Link to this definition")
A BytesIO object which contains the filled template if available, otherwise raises a SpreadsheetError.
- get\_direct\_cell\_result(*sheet\_name*, *column*, *row*)[](#Excel.get_direct_cell_result "Link to this definition")
Function which may be called after excel.execute(). It can be used to fetch the result of a direct cell.
* Parameters:
* **sheet\_name** (`str`) – Name of the worksheet of the desired cell.
* **column** (`str`) – Name of the column of the desired cell.
* **row** (`int`) – Name of the row of the desired cell.
* Returns:
The result contained in the cell corresponding to (sheet\_name, column, row).
* Return type:
Check `worker_version` to know which type of result is expected:
* worker\_version < 1 returns the result with type str.
* worker version >= 1 returns the result with type depending on cell type:
> * cell type integer / long returns integer
>
> * cell type single / double / currency / decimal returns float
>
> * cell type string returns string
>
> * cell type boolean returns boolean
>
> * cell type date returns RFC 3339 format string (e.g. “1998-02-23T00:00:00Z”)
* get\_filled\_template()[](#Excel.get_filled_template "Link to this definition")
New in v13.5.0
Retrieve the filled-in template if available, otherwise raises a SpreadsheetError.
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
- get\_named\_cell\_result(*name*)[](#Excel.get_named_cell_result "Link to this definition")
Function which may be called after excel.execute(). It can be used to fetch the result of a named cell.
* Parameters:
**name** (`str`) – Name of the named cell of which the result is desired.
* Returns:
The result contained in the named cell corresponding to name.
* Return type:
Check `worker_version` to know which type of result is expected:
* worker\_version < 1 returns the result with type str.
* worker version >= 1 returns the result with type depending on cell type:
> * cell type integer / long returns integer
>
> * cell type single / double / currency / decimal returns float
>
> * cell type string returns string
>
> * cell type boolean returns boolean
>
> * cell type date returns RFC 3339 format string (e.g. “1998-02-23T00:00:00Z”)
* result\_available()[](#Excel.result_available "Link to this definition")
* Return type:
`bool`
* Returns:
True if excel has returned a result. Warning! This does not necessarily have to be a successful result.
- *property *success*: bool | None*[](#Excel.success "Link to this definition")
True if excel has returned a successful result, False if excel has returned an unsuccessful result, None otherwise.
## Macro[](https://docs.viktor.ai/sdk/api/external/excel/.md#_Macro "Direct link to Macro")
* *class *viktor.external.excel.Macro(*command*)[](#Macro "Link to this definition")
Class for defining an Excel macro.
* Parameters:
**command** (`str`) – the name of the Excel Macro command.
- serialize()[](#Macro.serialize "Link to this definition")
* Return type:
`dict`
---
# viktor.external.external\_program
## ExternalProgram[](https://docs.viktor.ai/sdk/api/external/external-program/.md#_ExternalProgram "Direct link to ExternalProgram")
* *class *viktor.external.external\_program.ExternalProgram(*queue\_name*, *version*)[](#ExternalProgram "Link to this definition")
Bases: `ABC`
Warning
Do not use this class directly in an application!
Base-class of an external analysis.
* Parameters:
* **queue\_name** (`str`) – Name of the external integration.
* **version** (`int`) – Version of the API between SDK <-> worker.
- execute(*timeout=25*)[](#ExternalProgram.execute "Link to this definition")
Run method to start an external analysis using a VIKTOR worker.
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
**timeout** (`int`) – Timeout period in seconds.
* Raises:
* TimeoutError when timeout has been exceeded
* ConnectionError if no worker installed or connected
* LicenseError if no license is available
* ExecutionError if the external program cannot execute with the provided inputs
* Return type:
`None`
## OAuth2Integration[](https://docs.viktor.ai/sdk/api/external/external-program/.md#_OAuth2Integration "Direct link to OAuth2Integration")
* *class *viktor.external.external\_program.OAuth2Integration(*name*)[](#OAuth2Integration "Link to this definition")
New in 14.23.0
Third-party OAuth 2.0 integration.
Usage:
```
integration = vkt.external.OAuth2Integration('my-oauth2-integration')
access_token = integration.get_access_token()
# use access_token to do request on host URL associated with integration 'my-oauth2-integration'
```
* get\_access\_token()[](#OAuth2Integration.get_access_token "Link to this definition")
Obtain the personal access token
* Raises:
* PermissionDeniedError: needs login from user
* ResourceNotFoundError: integration not found
* PreconditionFailedError: integration not assigned to this app
* Return type:
`str`
---
# viktor.external.generic
## GenericAnalysis[](https://docs.viktor.ai/sdk/api/external/generic/.md#_GenericAnalysis "Direct link to GenericAnalysis")
* *class *viktor.external.generic.GenericAnalysis(*files=None*, *executable\_key=None*, *output\_filenames=None*)[](#GenericAnalysis "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
GenericAnalysis can be used to evaluate an executable on third-party infrastructure. The executable is expected to be blocking, i.e. if the executable is invoked from command prompt, it should wait until the executable is finished. For security purposes the executable that should be called has to be defined in the configuration file of the worker.
Usage:
```
files = [
('input1.txt', file1),
('input2.txt', file2)
]
generic_analysis = GenericAnalysis(files=files, executable_key="someexecutable", output_filenames=["output.txt"])
generic_analysis.execute(timeout=60)
output_file = generic_analysis.get_output_file("output.txt")
```
Exceptions which can be raised during calculation:
> * [`viktor.errors.LicenseError`](https://docs.viktor.ai/sdk/api/errors/.md#LicenseError "viktor.errors.LicenseError"): no license available
>
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
* **files** (`List`\[`Tuple`\[`str`, `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]] | `None`) – Files that are transferred to the working directory on the server. Each file is a tuple containing the content and the filename which is used to save on the infrastructure.
* **executable\_key** (`str`) – The key of the executable that needs to be evaluated. This key should be present in the configuration file of the worker.
* **output\_filenames** (`List`\[`str`]) – A list of filenames (including extension) that are to be transferred back to the app. This filename is relative to the working directory.
* Raises:
**ValueError** – when no attribute is included in call.
- get\_output\_file(*filename*, *\**, *as\_file=False*)[](#GenericAnalysis.get_output_file "Link to this definition")
Method can be used to retrieve the results generated by running an external analysis. Call method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") first and [`get_output_file()`](#GenericAnalysis.get_output_file "viktor.external.generic.GenericAnalysis.get_output_file") afterwards.
* Parameters:
* **filename** (`str`) – The name of the file (including extension) that you want to get.
* **as\_file** (`bool`) – Return as BytesIO (default) or File
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
---
# viktor.external.grasshopper
## GrasshopperAnalysis[](https://docs.viktor.ai/sdk/api/external/grasshopper/.md#_GrasshopperAnalysis "Direct link to GrasshopperAnalysis")
* *class *viktor.external.grasshopper.GrasshopperAnalysis(*\**, *script*, *input\_parameters=None*)[](#GrasshopperAnalysis "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
New in v14.8.0
Perform an analysis using Grasshopper on a remote server by means of a worker. To start an analysis call the method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"), with an appropriate timeout (in seconds).
To retrieve the output, call [`get_output()`](#GrasshopperAnalysis.get_output "viktor.external.grasshopper.GrasshopperAnalysis.get_output").
Usage:
```
my_input_parameters = {
'my_int': 1,
'my_bool': True,
'my_string': "test",
'my_list': [1, 2, 3],
'my_dict': {'{0;0;0}': [1], '{0;1;1}': [1, 2, 3]}
}
grasshopper_analysis = GrasshopperAnalysis(script=my_grasshopper_script, input_parameters=my_input_parameters)
grasshopper_analysis.execute(timeout=10)
output = grasshopper_analysis.get_output()
```
Exceptions which can be raised during calculation:
> * [`ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
* **script** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Grasshopper script (.gh)
* **input\_parameters** (`Dict`\[`str`, `Any`]) – Input parameters to be passed to the grasshopper script in the form of a float dict. Key names will be matched with the Hops parameter names in Grasshopper and substituted accordingly
- get\_output()[](#GrasshopperAnalysis.get_output "Link to this definition")
Retrieve the output generated by running the Grasshopper analysis. Call method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") first and [`get_output()`](#GrasshopperAnalysis.get_output "viktor.external.grasshopper.GrasshopperAnalysis.get_output") afterward.
The output is in the form:
```
{
"absolutetolerance": float,
"angletolerance": float,
"modelunits": str,
"algo": str,
"pointer": str,
"cachesolve": bool,
"recursionlevel": int,
"values": list[dict]
"warnings": list[str],
"errors": list[str]
}
```
* Return type:
`dict`
---
# viktor.external.grlweap
## GRLWeapAnalysis[](https://docs.viktor.ai/sdk/api/external/grlweap/.md#_GRLWeapAnalysis "Direct link to GRLWeapAnalysis")
* *class *viktor.external.grlweap.GRLWeapAnalysis(*input\_file*)[](#GRLWeapAnalysis "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
GRLWeapAnalysis can be used to perform an analysis using GRLWeap on a third-party worker. To start an analysis call the method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"), with an appropriate timeout (in seconds). To retrieve the results call the method [`get_output_file()`](#GRLWeapAnalysis.get_output_file "viktor.external.grlweap.GRLWeapAnalysis.get_output_file"), after [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute").
Usage:
```
grlweap_analysis = GRLWeapAnalysis(input_file=gwt_file)
grlweap_analysis.execute(timeout=10)
result = grlweap_analysis.get_output_file()
```
Exceptions which can be raised during calculation: - [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
**input\_file** (`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – .gwt input file.
- get\_output\_file(*\**, *as\_file=False*)[](#GRLWeapAnalysis.get_output_file "Link to this definition")
Method can be used to retrieve the results generated by running an external analysis. Call method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") first and [`get_output_file()`](#GRLWeapAnalysis.get_output_file "viktor.external.grlweap.GRLWeapAnalysis.get_output_file") afterwards.
* Parameters:
**as\_file** (`bool`) – Return as BytesIO (default) or File
New in v13.5.0
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
---
# viktor.external.idea
## Beam[](https://docs.viktor.ai/sdk/api/external/idea/.md#_Beam "Direct link to Beam")
* *class *viktor.external.idea\_rcs.idea\_rcs.Beam(*rcs*, *check\_section*)[](#Beam "Link to this definition")
Bases: [`Member`](#Member "viktor.external.idea_rcs.idea_rcs.Member")
Do not use this \_\_init\_\_ directly, but create the object by [`Model.create_beam()`](#Model.create_beam "viktor.external.idea_rcs.idea_rcs.Model.create_beam").
## CompressionMember[](https://docs.viktor.ai/sdk/api/external/idea/.md#_CompressionMember "Direct link to CompressionMember")
* *class *viktor.external.idea\_rcs.idea\_rcs.CompressionMember(*rcs*, *check\_section*)[](#CompressionMember "Link to this definition")
Bases: [`Member`](#Member "viktor.external.idea_rcs.idea_rcs.Member")
Do not use this \_\_init\_\_ directly, but create the object by [`Model.create_compression_member()`](#Model.create_compression_member "viktor.external.idea_rcs.idea_rcs.Model.create_compression_member").
## GeneralShape[](https://docs.viktor.ai/sdk/api/external/idea/.md#_GeneralShape "Direct link to GeneralShape")
* *class *viktor.external.idea\_rcs.idea\_rcs.GeneralShape(*outline*, *\**, *openings=None*)[](#GeneralShape "Link to this definition")
Bases: [`SectionPrototype1D`](#SectionPrototype1D "viktor.external.idea_rcs.idea_rcs.SectionPrototype1D")
General cross-section, defined by a set of coordinates.
* Parameters:
* **outline** (`Sequence`\[`Tuple`\[`float`, `float`]]) – Vertices which define the outline of the section (y, z). A minimum of 3 vertices is required, the outline is automatically closed.
* **openings** (`Sequence`\[`Sequence`\[`Tuple`\[`float`, `float`]]]) – One or multiple openings, defined by vertices (y, z). A minimum of 3 vertices per opening is required, the opening is automatically closed.
## IdeaRcsAnalysis[](https://docs.viktor.ai/sdk/api/external/idea/.md#_IdeaRcsAnalysis "Direct link to IdeaRcsAnalysis")
* *class *viktor.external.idea\_rcs.idea\_rcs.IdeaRcsAnalysis(*input\_file*, *\**, *return\_result\_xml=None*, *return\_rcs\_file=None*)[](#IdeaRcsAnalysis "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
Can be used to perform an analysis using IDEA StatiCa RCS on a third-party worker. To start an analysis call the method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"), with an appropriate timeout (in seconds). To retrieve the results call the method [`get_output_file()`](#IdeaRcsAnalysis.get_output_file "viktor.external.idea_rcs.idea_rcs.IdeaRcsAnalysis.get_output_file"), after [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute").
Usage:
```
idea_rcs_file = File.from_data("idea rcs input file content")
idea_rcs_analysis = IdeaRcsAnalysis(input_file=idea_rcs_file)
idea_rcs_analysis.execute(timeout=10)
result = idea_rcs_analysis.get_output_file()
```
Exceptions which can be raised during calculation:
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
* **input\_file** (`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – IDEA (Open)Model input XML file.
* **return\_result\_xml** (`bool`) – Result .xml file will be available if set to True (default: True).
* **return\_rcs\_file** (`bool`) – Input .ideaRcs file will be available if set to True (default: False).
- get\_idea\_rcs\_file(*\**, *as\_file=False*)[](#IdeaRcsAnalysis.get_idea_rcs_file "Link to this definition")
Method can be used to retrieve the .ideaRcs file which is converted from the (Open)Model input XML. The file is only available when return\_rcs\_file=True. [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") must be called first.
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
* Returns:
* File, if as\_file = True
* BytesIO, if as\_file = False (default)
* get\_output\_file(*\**, *as\_file=False*)[](#IdeaRcsAnalysis.get_output_file "Link to this definition")
Method can be used to retrieve the results generated by running an external analysis. The file is only available when return\_result\_xml=True. [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") must be called first.
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
* Returns:
* File (encoding=’utf-16’), if as\_file = True
* BytesIO (encoding=’utf-16’), if as\_file = False (default)
## Member[](https://docs.viktor.ai/sdk/api/external/idea/.md#_Member "Direct link to Member")
* *class *viktor.external.idea\_rcs.idea\_rcs.Member(*rcs*, *check\_section*)[](#Member "Link to this definition")
Base class of all member types.
* *property *bars*: List\[[ReinforcedBar](https://docs.viktor.ai/sdk/api/external/idea/.md#ReinforcedBar "viktor.external.idea_rcs.objects.ReinforcedBar")]*[](#Member.bars "Link to this definition")
- create\_bar(*coordinates*, *diameter*, *material*)[](#Member.create_bar "Link to this definition")
Create a reinforced bar on the reinforced cross-section.
* Parameters:
* **coordinates** (`Tuple`\[`float`, `float`]) – (X, Y) coordinate of the bar \[m].
* **diameter** (`float`) – Diameter of the bar \[m].
* **material** ([`MatReinforcement`](https://docs.viktor.ai/sdk/api/external/idea/.md#MatReinforcement "viktor.external.idea_rcs.objects.MatReinforcement")) – Reinforcement material (created by [`create_matreinforcement_ec2()`](#OpenModel.create_matreinforcement_ec2 "viktor.external.idea_rcs.idea_rcs.OpenModel.create_matreinforcement_ec2")).
* Return type:
`None`
* create\_bar\_layer(*\**, *origin*, *diameter*, *material*, *number\_of\_bars*, *delta\_y=None*, *delta\_z=None*)[](#Member.create_bar_layer "Link to this definition")
Create multiple reinforced bars on the reinforced cross-section, positioned on a line.
* Parameters:
* **origin** (`Tuple`\[`float`, `float`]) – Origin point (Y, Z) \[m].
* **diameter** (`float`) – Diameter of the bar \[m].
* **material** ([`MatReinforcement`](https://docs.viktor.ai/sdk/api/external/idea/.md#MatReinforcement "viktor.external.idea_rcs.objects.MatReinforcement")) – Reinforcement material (created by [`create_matreinforcement_ec2()`](#OpenModel.create_matreinforcement_ec2 "viktor.external.idea_rcs.idea_rcs.OpenModel.create_matreinforcement_ec2")).
* **number\_of\_bars** (`int`) – Number of bars (minimum of 2).
* **delta\_y** (`float`) – Distance between origin bar and the last bar in y-direction \[m].
* **delta\_z** (`float`) – Distance between origin bar and the last bar in z-direction \[m].
* Return type:
`None`
- create\_extreme(*\**, *description=None*, *accidental=None*, *fatigue=None*, *frequent=None*, *fundamental=None*, *characteristic=None*, *quasi\_permanent=None*)[](#Member.create_extreme "Link to this definition")
Create an extreme case with corresponding internal forces on the beam for checking.
* Parameters:
* **description** (`str`) – Description of the extreme (default: ‘{section\_name} - E {i}’).
New in v14.6.0
* **accidental** ([`LoadingULS`](https://docs.viktor.ai/sdk/api/external/idea/.md#LoadingULS "viktor.external.idea_rcs.objects.LoadingULS")) – Accidental loading.
* **fatigue** ([`FatigueLoading`](https://docs.viktor.ai/sdk/api/external/idea/.md#FatigueLoading "viktor.external.idea_rcs.objects.FatigueLoading")) – Fatigue loading.
* **frequent** ([`LoadingSLS`](https://docs.viktor.ai/sdk/api/external/idea/.md#LoadingSLS "viktor.external.idea_rcs.objects.LoadingSLS")) – Frequent loading.
* **fundamental** ([`LoadingULS`](https://docs.viktor.ai/sdk/api/external/idea/.md#LoadingULS "viktor.external.idea_rcs.objects.LoadingULS")) – Fundamental loading.
* **characteristic** ([`LoadingSLS`](https://docs.viktor.ai/sdk/api/external/idea/.md#LoadingSLS "viktor.external.idea_rcs.objects.LoadingSLS")) – Characteristic loading.
* **quasi\_permanent** ([`LoadingSLS`](https://docs.viktor.ai/sdk/api/external/idea/.md#LoadingSLS "viktor.external.idea_rcs.objects.LoadingSLS")) – Quasi-Permanent loading.
* Return type:
`None`
* create\_stirrup(*points*, *diameter*, *material*, *distance*, *shear\_check=None*, *torsion\_check=None*, *mandrel\_diameter\_factor=None*, *anchorage\_length=None*)[](#Member.create_stirrup "Link to this definition")
Create a stirrup on the reinforced cross-section.
* Parameters:
* **points** (`Sequence`\[`Tuple`\[`float`, `float`] | `Tuple`\[`Tuple`\[`float`, `float`], `Tuple`\[`float`, `float`]]]) – Sequence of (X, Y) coordinates \[m] of the stirrup vertices, connected by straight line segments. For arc-segments use ((X\_end, Y\_end), (X\_on\_arc, Y\_on\_arc)).
* **diameter** (`float`) – Diameter of the stirrup \[m].
* **material** ([`MatReinforcement`](https://docs.viktor.ai/sdk/api/external/idea/.md#MatReinforcement "viktor.external.idea_rcs.objects.MatReinforcement")) – Reinforcement material (created by [`create_matreinforcement_ec2()`](#OpenModel.create_matreinforcement_ec2 "viktor.external.idea_rcs.idea_rcs.OpenModel.create_matreinforcement_ec2")).
* **distance** (`float`) – Longitudinal distance between stirrups \[m].
* **shear\_check** (`bool`) – Take stirrup into account in shear check (default: False).
* **torsion\_check** (`bool`) – Take stirrup into account in torsion check (default: False).
* **mandrel\_diameter\_factor** (`float`) – Inner diameter of mandrel as multiple of stirrup diameter \[-] (default: 1.0).
* **anchorage\_length** (`float`) – Anchorage length \[m] (default: 0.0).
* Return type:
`None`
- *property *extremes*: List\[[CheckSectionExtreme](https://docs.viktor.ai/sdk/api/external/idea/.md#CheckSectionExtreme "viktor.external.idea_rcs.objects.CheckSectionExtreme")]*[](#Member.extremes "Link to this definition")
* *property *stirrups*: List\[[Stirrup](https://docs.viktor.ai/sdk/api/external/idea/.md#Stirrup "viktor.external.idea_rcs.objects.Stirrup")]*[](#Member.stirrups "Link to this definition")
## Model[](https://docs.viktor.ai/sdk/api/external/idea/.md#_Model "Direct link to Model")
* *class *viktor.external.idea\_rcs.idea\_rcs.Model(*\**, *project\_data=None*, *code\_settings=None*)[](#Model "Link to this definition")
Bases: `_Model`
Can be used to construct an IDEA-RCS model and generate its corresponding input XML file. This file can in turn be used as input of [`IdeaRcsAnalysis`](#IdeaRcsAnalysis "viktor.external.idea_rcs.idea_rcs.IdeaRcsAnalysis"). For a more detailed elaboration, please see the guide.
Alternatively, you can use [`OpenModel`](#OpenModel "viktor.external.idea_rcs.idea_rcs.OpenModel").
Warning
Use this binding at own risk. Whether an input XML file represents a valid model is dependent on many things, e.g. on the combination of certain parameters. The Model does not give any guarantees on this. It is therefore important to always validate your model by hand thoroughly, before using it in an automated way within your app!
Example usage:
```
# Initialize the model.
model = Model() # empty model, or optionally pass ProjectData and/or CodeSettings
# Create the desired material(s).
cs_mat = model.create_concrete_material(ConcreteMaterial.C12_15)
mat_reinf = model.create_reinforcement_material(ReinforcementMaterial.B_400A)
# Create a beam (or other type of member) to be checked.
cross_section = RectSection(0.5, 1.0)
beam = model.create_beam(cross_section, cs_mat)
# Create bars (and stirrups) as desired
bar_locations = [(-0.101, -0.175), (0.101, -0.175), (0.101, 0.175), (-0.101, 0.175)]
bar_diameters = [0.016, 0.016, 0.016, 0.016]
for coords, diameter in zip(bar_locations, bar_diameters):
beam.create_bar(coords, diameter, mat_reinf)
# Add extreme(s)
freq = LoadingSLS(ResultOfInternalForces(N=-100000, My=210000))
fund = LoadingULS(ResultOfInternalForces(N=-99999, My=200000))
beam.create_extreme(frequent=freq, fundamental=fund)
# Generate the input XML file.
input_xml = model.generate_xml_input()
```
* Parameters:
* **project\_data** ([`ProjectData`](https://docs.viktor.ai/sdk/api/external/idea/.md#ProjectData "viktor.external.idea_rcs.objects.ProjectData")) – project\_data (default: IDEA-RCS default project\_data)
* **code\_settings** ([`CodeSettings`](https://docs.viktor.ai/sdk/api/external/idea/.md#CodeSettings "viktor.external.idea_rcs.objects.CodeSettings")) – code and calculation settings (default: IDEA-RCS default settings)
- project\_data[](#Model.project_data "Link to this definition")
* code\_settings[](#Model.code_settings "Link to this definition")
- generate\_xml\_input(*\**, *as\_file=False*)[](#Model.generate_xml_input "Link to this definition")
Generates the input file XML representation of the IDEA-RCS model.
Warning
Whether an input XML file represents a valid model is dependent on many things, e.g. on the combination of certain parameters. The OpenModel does not give any guarantees on this. It is therefore important to always validate your model by hand thoroughly, before using it in an automated way within your app!
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
**as\_file** (`bool`) – return as BytesIO (default) or File
New in v13.5.0
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* create\_beam(*cs*, *material*, *\**, *calculation\_control=None*, *name=None*, *rcs\_name=None*, *design\_member\_name=None*, *exposure\_classes=None*, *coeff\_kx=None*, *creep\_coefficient=None*, *relative\_humidity=None*)[](#Model.create_beam "Link to this definition")
Create a beam section.
* Parameters:
* **cs** ([`SectionPrototype1D`](#SectionPrototype1D "viktor.external.idea_rcs.idea_rcs.SectionPrototype1D")) – Cross-section prototype.
* **material** ([`MatConcrete`](https://docs.viktor.ai/sdk/api/external/idea/.md#MatConcrete "viktor.external.idea_rcs.objects.MatConcrete")) – Material for the cross-section (created by [`create_concrete_material()`](#Model.create_concrete_material "viktor.external.idea_rcs.idea_rcs.Model.create_concrete_material")).
* **calculation\_control** ([`CalculationSetup`](https://docs.viktor.ai/sdk/api/external/idea/.md#CalculationSetup "viktor.external.idea_rcs.objects.CalculationSetup")) – Calculation control settings (default: Capacity N-M(-M) | Shear | Interaction | Stress Limitation | Crack width | Detailing).
* **name** (`str`) – Name of the cross-section (default: ‘S{i}’).
* **rcs\_name** (`str`) – Name of the reinforced cross-section (default: ‘R{i}’).
* **design\_member\_name** (`str`) – Name of the design member (default: ‘M {i}’).
New in v14.6.0
* **exposure\_classes** ([`ExposureClassesDataEc2`](https://docs.viktor.ai/sdk/api/external/idea/.md#ExposureClassesDataEc2 "viktor.external.idea_rcs.objects.ExposureClassesDataEc2")) – Corrosion exposure classes (default: no corrosion).
* **coeff\_kx** (`float`) – (Dutch annex only) Coefficient k\_x acc. 7.3.1 (default: 1.0).
* **creep\_coefficient** (`float`) – Final value of creep coefficient (default: calculated by IDEA-RCS).
* **relative\_humidity** (`float`) – Percentage of relative humidity (default: 65).
* Return type:
[`Beam`](#Beam "viktor.external.idea_rcs.idea_rcs.Beam")
- create\_compression\_member(*cs*, *material*, *\**, *calculation\_control=None*, *name=None*, *rcs\_name=None*, *design\_member\_name=None*, *exposure\_classes=None*, *coeff\_kx=None*, *creep\_coefficient=None*, *relative\_humidity=None*)[](#Model.create_compression_member "Link to this definition")
Create a compression member section.
* Parameters:
* **cs** ([`SectionPrototype1D`](#SectionPrototype1D "viktor.external.idea_rcs.idea_rcs.SectionPrototype1D")) – Cross-section prototype.
* **material** ([`MatConcrete`](https://docs.viktor.ai/sdk/api/external/idea/.md#MatConcrete "viktor.external.idea_rcs.objects.MatConcrete")) – Material for the cross-section (created by [`create_concrete_material()`](#Model.create_concrete_material "viktor.external.idea_rcs.idea_rcs.Model.create_concrete_material")).
* **calculation\_control** ([`CalculationSetup`](https://docs.viktor.ai/sdk/api/external/idea/.md#CalculationSetup "viktor.external.idea_rcs.objects.CalculationSetup")) – Calculation control settings (default: Capacity N-M(-M) | Shear | Interaction | Stress Limitation | Crack width | Detailing).
* **name** (`str`) – Name of the cross-section (default: ‘S{i}’).
* **rcs\_name** (`str`) – Name of the reinforced cross-section (default: ‘R{i}’).
* **design\_member\_name** (`str`) – Name of the design member (default: ‘M {i}’).
New in v14.6.0
* **exposure\_classes** ([`ExposureClassesDataEc2`](https://docs.viktor.ai/sdk/api/external/idea/.md#ExposureClassesDataEc2 "viktor.external.idea_rcs.objects.ExposureClassesDataEc2")) – Corrosion exposure classes (default: no corrosion).
* **coeff\_kx** (`float`) – (Dutch annex only) Coefficient k\_x acc. 7.3.1 (default: 1.0).
* **creep\_coefficient** (`float`) – Final value of creep coefficient (default: calculated by IDEA-RCS).
* **relative\_humidity** (`float`) – Percentage of relative humidity (default: 65).
* Return type:
[`CompressionMember`](#CompressionMember "viktor.external.idea_rcs.idea_rcs.CompressionMember")
* create\_concrete\_material(*base\_material*, *name=None*, *\**, *unit\_mass=2500*, *fck=None*, *stone\_diameter=0.016*, *cement\_class=ConcCementClass.R*, *aggregate\_type=ConcAggregateType.QUARTZITE*, *diagram\_type=ConcDiagramType.PARABOLIC*, *silica\_fume=False*, *plain\_concrete\_diagram=False*, *dep\_params=None*)[](#Model.create_concrete_material "Link to this definition")
Create a concrete material, to be used in [`create_beam()`](#Model.create_beam "viktor.external.idea_rcs.idea_rcs.Model.create_beam") and similar methods.
* Parameters:
* **base\_material** ([`ConcreteMaterial`](https://docs.viktor.ai/sdk/api/external/idea/.md#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")) – IDEA-RCS base material to start with.
* **name** (`str`) – Name of the material (default: base\_material name).
* **unit\_mass** (`float`) – Unit mass \[kg/m3] (default: 2500 kg/m3).
* **fck** (`float`) – Characteristic compressive cylinder strength of concrete at 28 days \[MPa] (default: base\_material fck).
* **stone\_diameter** (`float`) – Aggregate size (default: 16 mm).
* **cement\_class** ([`ConcCementClass`](https://docs.viktor.ai/sdk/api/external/idea/.md#ConcCementClass "viktor.external.idea_rcs.objects.ConcCementClass")) – Cement class (default: R).
* **aggregate\_type** ([`ConcAggregateType`](https://docs.viktor.ai/sdk/api/external/idea/.md#ConcAggregateType "viktor.external.idea_rcs.objects.ConcAggregateType")) – Aggregate type (default: Quartzite).
* **diagram\_type** ([`ConcDiagramType`](https://docs.viktor.ai/sdk/api/external/idea/.md#ConcDiagramType "viktor.external.idea_rcs.objects.ConcDiagramType")) – Type of stress-strain diagram for ULS calculation (default: Parabolic).
* **silica\_fume** (`bool`) – Contains silica fume (default: False) (EN 1992-2:2008-07 only).
* **plain\_concrete\_diagram** (`bool`) – Stress strain diagram with tension part (default: False).
* **dep\_params** ([`ConcDependentParams`](https://docs.viktor.ai/sdk/api/external/idea/.md#ConcDependentParams "viktor.external.idea_rcs.objects.ConcDependentParams")) – Collection of a series of dependent parameters (see ConcDependentParams for more info). If None, values will be calculated based on ‘fck’ (default: None).
* Return type:
[`MatConcreteEc2`](https://docs.viktor.ai/sdk/api/external/idea/.md#MatConcreteEc2 "viktor.external.idea_rcs.objects.MatConcreteEc2")
- create\_one\_way\_slab(*cs*, *material*, *\**, *calculation\_control=None*, *name=None*, *rcs\_name=None*, *design\_member\_name=None*, *exposure\_classes=None*, *coeff\_kx=None*, *creep\_coefficient=None*, *relative\_humidity=None*)[](#Model.create_one_way_slab "Link to this definition")
Create a one-way slab member section.
* Parameters:
* **cs** ([`SectionPrototype1D`](#SectionPrototype1D "viktor.external.idea_rcs.idea_rcs.SectionPrototype1D")) – Cross-section prototype.
* **material** ([`MatConcrete`](https://docs.viktor.ai/sdk/api/external/idea/.md#MatConcrete "viktor.external.idea_rcs.objects.MatConcrete")) – Material for the cross-section (created by [`create_concrete_material()`](#Model.create_concrete_material "viktor.external.idea_rcs.idea_rcs.Model.create_concrete_material")).
* **calculation\_control** ([`CalculationSetup`](https://docs.viktor.ai/sdk/api/external/idea/.md#CalculationSetup "viktor.external.idea_rcs.objects.CalculationSetup")) – Calculation control settings (default: Capacity N-M(-M) | Shear | Interaction | Stress Limitation | Crack width | Detailing).
* **name** (`str`) – Name of the cross-section (default: ‘S{i}’).
* **rcs\_name** (`str`) – Name of the reinforced cross-section (default: ‘R{i}’).
* **design\_member\_name** (`str`) – Name of the design member (default: ‘M {i}’).
New in v14.6.0
* **exposure\_classes** ([`ExposureClassesDataEc2`](https://docs.viktor.ai/sdk/api/external/idea/.md#ExposureClassesDataEc2 "viktor.external.idea_rcs.objects.ExposureClassesDataEc2")) – Corrosion exposure classes (default: no corrosion).
* **coeff\_kx** (`float`) – (Dutch annex only) Coefficient k\_x acc. 7.3.1 (default: 1.0).
* **creep\_coefficient** (`float`) – Final value of creep coefficient (default: calculated by IDEA-RCS).
* **relative\_humidity** (`float`) – Percentage of relative humidity (default: 65).
* Return type:
[`OneWaySlab`](#OneWaySlab "viktor.external.idea_rcs.idea_rcs.OneWaySlab")
* create\_reinforcement\_material(*base\_material*, *name=None*, *\**, *unit\_mass=7850*, *e\_modulus=200000*, *fyk=None*, *ftk\_by\_fyk=None*, *epsuk=None*, *type\_=ReinfType.BARS*, *bar\_surface=BarSurface.RIBBED*, *class\_=ReinfClass.B*, *fabrication=ReinfFabrication.HOT\_ROLLED*, *diagram\_type=ReinfDiagramType.BILINEAR\_INCLINED*)[](#Model.create_reinforcement_material "Link to this definition")
Create a reinforcement material, to be used in `create_reinforcement_bar()`.
* Parameters:
* **base\_material** ([`ReinforcementMaterial`](https://docs.viktor.ai/sdk/api/external/idea/.md#ReinforcementMaterial "viktor.external.idea_rcs.objects.ReinforcementMaterial")) – IDEA-RCS base material to start with.
* **name** (`str`) – Name of the material (default: base\_material name).
* **unit\_mass** (`float`) – Unit mass \[kg/m3] (default: 7850 kg/m3).
* **e\_modulus** (`float`) – Young’s modulus \[MPa] (default: 200000 MPa).
* **fyk** (`float`) – Characteristic yield strength of reinforcement (default: base\_material fyk).
* **ftk\_by\_fyk** (`float`) – factor k = ratio ftk / fyk (default: base\_material k).
* **epsuk** (`float`) – Characteristic strain of reinforcement at maximum load - εuk \[x 1e-4].
* **type** – Type of reinforcement (default: Bars).
* **bar\_surface** ([`BarSurface`](https://docs.viktor.ai/sdk/api/external/idea/.md#BarSurface "viktor.external.idea_rcs.objects.BarSurface")) – Bar surface (default: Ribbed).
* **class** – Class of reinforcement (default: B).
* **fabrication** ([`ReinfFabrication`](https://docs.viktor.ai/sdk/api/external/idea/.md#ReinfFabrication "viktor.external.idea_rcs.objects.ReinfFabrication")) – Fabrication of reinforcement (default: Hot rolled).
* **diagram\_type** ([`ReinfDiagramType`](https://docs.viktor.ai/sdk/api/external/idea/.md#ReinfDiagramType "viktor.external.idea_rcs.objects.ReinfDiagramType")) – Type of material diagram (default: Bilinear with an inclined top branch).
* Return type:
[`MatReinforcementEc2`](https://docs.viktor.ai/sdk/api/external/idea/.md#MatReinforcementEc2 "viktor.external.idea_rcs.objects.MatReinforcementEc2")
## OneWaySlab[](https://docs.viktor.ai/sdk/api/external/idea/.md#_OneWaySlab "Direct link to OneWaySlab")
* *class *viktor.external.idea\_rcs.idea\_rcs.OneWaySlab(*rcs*, *check\_section*)[](#OneWaySlab "Link to this definition")
Bases: [`Member`](#Member "viktor.external.idea_rcs.idea_rcs.Member")
Do not use this \_\_init\_\_ directly, but create the object by [`Model.create_one_way_slab()`](#Model.create_one_way_slab "viktor.external.idea_rcs.idea_rcs.Model.create_one_way_slab").
## OpenModel[](https://docs.viktor.ai/sdk/api/external/idea/.md#_OpenModel "Direct link to OpenModel")
* *class *viktor.external.idea\_rcs.idea\_rcs.OpenModel(*\**, *project\_data=None*, *code\_settings=None*)[](#OpenModel "Link to this definition")
Bases: `_Model`
Can be used to construct an IDEA-RCS model and generate its corresponding input XML file. This file can in turn be used as input of [`IdeaRcsAnalysis`](#IdeaRcsAnalysis "viktor.external.idea_rcs.idea_rcs.IdeaRcsAnalysis"). For a more elaborate example implementation, please see the guide.
The OpenModel follows IDEA’s underlying API. Alternatively, you can use [`Model`](#Model "viktor.external.idea_rcs.idea_rcs.Model").
Warning
Use this binding at own risk. Whether an input XML file represents a valid model is dependent on many things, e.g. on the combination of certain parameters. The OpenModel does not give any guarantees on this. It is therefore important to always validate your model by hand thoroughly, before using it in an automated way within your app!
Example usage:
```
# Initialize the model.
model = OpenModel() # empty model, or optionally pass ProjectData and/or CodeSettings
# Create the concrete section.
mat = model.create_matconcrete_ec2(ConcreteMaterial.C12_15)
cs = model.create_cross_section_parameter(name='cs', cross_section_type=CrossSectionType.RECT, material=mat,
Width=2.0, Height=2.0)
# Create the reinforced cross-section.
rcs = model.create_reinforced_cross_section(name='rcs', cross_section=cs)
# Create bars (and stirrups) as desired
mat_reinf = model.create_matreinforcement_ec2(ReinforcementMaterial.B_400A)
bar_locations = [(-0.101, -0.175), (0.101, -0.175), (0.101, 0.175), (-0.101, 0.175)]
bar_diameters = [0.016, 0.016, 0.016, 0.016]
for coords, diameter in zip(bar_locations, bar_diameters):
rcs.create_bar(coords, diameter, mat_reinf)
# Create a CheckMember.
member = model.create_check_member1d()
# 'Assign' the CheckMember to a CheckSection with the previously defined reinforced section and add extremes.
check_section = model.add_check_section(description='S 1', check_member=member, reinf_section=rcs)
freq = LoadingSLS(ResultOfInternalForces(N=-100000, My=210000))
fund = LoadingULS(ResultOfInternalForces(N=-99999, My=200000))
check_section.create_extreme(frequent=freq, fundamental=fund)
# 'Assign' the necessary additional data to the CheckMember.
model.add_member_data_ec2(member, MemberType.BEAM_SLAB, TwoWaySlabType.SHELL_AS_PLATE)
# Generate the input XML file.
input_xml = model.generate_xml_input()
```
* Parameters:
* **project\_data** ([`ProjectData`](https://docs.viktor.ai/sdk/api/external/idea/.md#ProjectData "viktor.external.idea_rcs.objects.ProjectData")) – project\_data (default: IDEA-RCS default project\_data)
* **code\_settings** ([`CodeSettings`](https://docs.viktor.ai/sdk/api/external/idea/.md#CodeSettings "viktor.external.idea_rcs.objects.CodeSettings")) – code and calculation settings (default: IDEA-RCS default settings)
- project\_data[](#OpenModel.project_data "Link to this definition")
* code\_settings[](#OpenModel.code_settings "Link to this definition")
- generate\_xml\_input(*\**, *as\_file=False*)[](#OpenModel.generate_xml_input "Link to this definition")
Generates the input file XML representation of the IDEA-RCS model.
Warning
Whether an input XML file represents a valid model is dependent on many things, e.g. on the combination of certain parameters. The OpenModel does not give any guarantees on this. It is therefore important to always validate your model by hand thoroughly, before using it in an automated way within your app!
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
**as\_file** (`bool`) – return as BytesIO (default) or File
New in v13.5.0
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* add\_check\_section(*check\_member*, *reinf\_section*, *description=None*)[](#OpenModel.add_check_section "Link to this definition")
Adds a single section check on the given CheckMember. Note that [`add_member_data_ec2()`](#OpenModel.add_member_data_ec2 "viktor.external.idea_rcs.idea_rcs.OpenModel.add_member_data_ec2") must be called subsequently.
* Parameters:
* **check\_member** ([`CheckMember`](https://docs.viktor.ai/sdk/api/external/idea/.md#CheckMember "viktor.external.idea_rcs.objects.CheckMember")) – CheckMember (created by [`create_check_member1d()`](#OpenModel.create_check_member1d "viktor.external.idea_rcs.idea_rcs.OpenModel.create_check_member1d")).
* **reinf\_section** ([`ReinforcedCrossSection`](https://docs.viktor.ai/sdk/api/external/idea/.md#ReinforcedCrossSection "viktor.external.idea_rcs.objects.ReinforcedCrossSection")) – Reinforcement of cross-section (created by [`create_reinforced_cross_section()`](#OpenModel.create_reinforced_cross_section "viktor.external.idea_rcs.idea_rcs.OpenModel.create_reinforced_cross_section")).
* **description** (`str`) – Description/name of the section (default: ‘S{i}’).
* Return type:
[`CheckSection`](https://docs.viktor.ai/sdk/api/external/idea/.md#CheckSection "viktor.external.idea_rcs.objects.CheckSection")
- add\_member\_data\_ec2(*member*, *member\_type*, *two\_way\_slab\_type*, *\**, *calculation\_setup=None*, *coeff\_kx\_for\_wmax=None*, *exposure\_class\_data=None*, *creep\_coefficient=None*, *relative\_humidity=None*)[](#OpenModel.add_member_data_ec2 "Link to this definition")
Adds a concrete member Ec2 data to the model.
* Parameters:
* **member** ([`CheckMember`](https://docs.viktor.ai/sdk/api/external/idea/.md#CheckMember "viktor.external.idea_rcs.objects.CheckMember")) – CheckMember (created by [`create_check_member1d()`](#OpenModel.create_check_member1d "viktor.external.idea_rcs.idea_rcs.OpenModel.create_check_member1d")). Should be previously added to a check section via [`add_check_section()`](#OpenModel.add_check_section "viktor.external.idea_rcs.idea_rcs.OpenModel.add_check_section").
* **member\_type** ([`MemberType`](https://docs.viktor.ai/sdk/api/external/idea/.md#MemberType "viktor.external.idea_rcs.objects.MemberType")) – Structural type of member. Must be a valid type corresponding to the reinf\_section assigned to the member in [`add_check_section()`](#OpenModel.add_check_section "viktor.external.idea_rcs.idea_rcs.OpenModel.add_check_section").
* **two\_way\_slab\_type** ([`TwoWaySlabType`](https://docs.viktor.ai/sdk/api/external/idea/.md#TwoWaySlabType "viktor.external.idea_rcs.objects.TwoWaySlabType")) – Two-way slab type. Must be a valid type corresponding to the reinf\_section assigned to the member in [`add_check_section()`](#OpenModel.add_check_section "viktor.external.idea_rcs.idea_rcs.OpenModel.add_check_section").
* **calculation\_setup** ([`CalculationSetup`](https://docs.viktor.ai/sdk/api/external/idea/.md#CalculationSetup "viktor.external.idea_rcs.objects.CalculationSetup")) – Calculation control settings (default: Capacity N-M(-M) | Shear | Interaction | Stress Limitation | Crack width | Detailing).
* **coeff\_kx\_for\_wmax** (`float`) – (Dutch annex only) Coefficient kx to increase limited concrete crack (default: 1.0).
* **exposure\_class\_data** ([`ExposureClassesDataEc2`](https://docs.viktor.ai/sdk/api/external/idea/.md#ExposureClassesDataEc2 "viktor.external.idea_rcs.objects.ExposureClassesDataEc2")) – Exposure classes (default: no corrosion).
* **creep\_coefficient** (`float`) – Final value of creep coefficient (default: calculated by IDEA-RCS).
* **relative\_humidity** (`float`) – Percentage of relative humidity (default: 65).
* Return type:
`None`
* create\_check\_member1d(*name=None*)[](#OpenModel.create_check_member1d "Link to this definition")
Create a member 1D check, which can be used in [`add_check_section()`](#OpenModel.add_check_section "viktor.external.idea_rcs.idea_rcs.OpenModel.add_check_section") and [`add_member_data_ec2()`](#OpenModel.add_member_data_ec2 "viktor.external.idea_rcs.idea_rcs.OpenModel.add_member_data_ec2").
* Return type:
[`CheckMember1D`](https://docs.viktor.ai/sdk/api/external/idea/.md#CheckMember1D "viktor.external.idea_rcs.objects.CheckMember1D")
- create\_cross\_section\_component(*name=None*)[](#OpenModel.create_cross_section_component "Link to this definition")
Create a cross-section object defined by one or multiple components and add it to the model.
* Parameters:
**name** (`str`) – Name of cross-section (default: ‘’).
* Return type:
[`CrossSectionComponent`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionComponent "viktor.external.idea_rcs.objects.CrossSectionComponent")
* create\_cross\_section\_parameter(*cross\_section\_type*, *material*, *name=None*, *\*\*parameters*)[](#OpenModel.create_cross_section_parameter "Link to this definition")
Create a cross-section object defined by parameters and add it to the model.
* Parameters:
* **cross\_section\_type** ([`CrossSectionType`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")) – Type of cross-section.
* **material** ([`MatConcrete`](https://docs.viktor.ai/sdk/api/external/idea/.md#MatConcrete "viktor.external.idea_rcs.objects.MatConcrete")) – Material (created by [`create_matconcrete_ec2()`](#OpenModel.create_matconcrete_ec2 "viktor.external.idea_rcs.idea_rcs.OpenModel.create_matconcrete_ec2")).
* **name** (`str`) – Name of cross-section (default: ‘’).
* **parameters** (`Any`) – keyword naming should correspond to chosen cross\_section\_type(!).
* Return type:
[`CrossSectionParameter`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionParameter "viktor.external.idea_rcs.objects.CrossSectionParameter")
The following combinations of cross\_section\_type and parameters can be used (see the IDEA StatiCa interface for the naming convention):
* [`O`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType.O "viktor.external.idea_rcs.objects.CrossSectionType.O"): D
* [`RECT`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType.RECT "viktor.external.idea_rcs.objects.CrossSectionType.RECT"): Width, Height
* [`TRAPEZOID`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType.TRAPEZOID "viktor.external.idea_rcs.objects.CrossSectionType.TRAPEZOID"): H, Bb, Bt
* [`IGN`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType.IGN "viktor.external.idea_rcs.objects.CrossSectionType.IGN"): H, Bh, Bs, Ts, Th, Tw
* [`IGH`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType.IGH "viktor.external.idea_rcs.objects.CrossSectionType.IGH"): H, Bh, Bs, Ts, Th, Tw, Bfh, Tfh
* [`BEAM_SHAPE_I_HAUNCH_CHAMFER`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType.BEAM_SHAPE_I_HAUNCH_CHAMFER "viktor.external.idea_rcs.objects.CrossSectionType.BEAM_SHAPE_I_HAUNCH_CHAMFER"): Bbf, Hbf, Hbfh, Bw, H, Htfh, Htf, Btf, Bwh
* [`TG`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType.TG "viktor.external.idea_rcs.objects.CrossSectionType.TG"): Height, Width, TopFlangeWidth, WallWidth
* [`TTFH`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType.TTFH "viktor.external.idea_rcs.objects.CrossSectionType.TTFH"): Height, Width, TopFlangeWidth, WallWidth, TopFlangeHaunch
* [`TGREV`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType.TGREV "viktor.external.idea_rcs.objects.CrossSectionType.TGREV"): Height, Width, TopFlangeWidth, WallWidth
* [`TCHAMFER_1`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType.TCHAMFER_1 "viktor.external.idea_rcs.objects.CrossSectionType.TCHAMFER_1"): Height, Width, TopFlangeWidth, WallWidth, TopFlangeHaunch2, WallHaunch2
* [`TCHAMFER_2`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType.TCHAMFER_2 "viktor.external.idea_rcs.objects.CrossSectionType.TCHAMFER_2"): Height, Width, TopFlangeWidth, WallWidth, TopFlangeHaunch2, WallHaunch1, WallHaunch2
* [`TWH`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType.TWH "viktor.external.idea_rcs.objects.CrossSectionType.TWH"): Height, Width, TopFlangeWidth, WallWidth, WallHaunch
* [`TTFHREV`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType.TTFHREV "viktor.external.idea_rcs.objects.CrossSectionType.TTFHREV"): Height, Width, TopFlangeWidth, WallWidth, TopFlangeHaunch
* [`TWHREV`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSectionType.TWHREV "viktor.external.idea_rcs.objects.CrossSectionType.TWHREV"): Height, Width, TopFlangeWidth, WallWidth, WallHaunch
- create\_matconcrete\_ec2(*base\_material*, *name=None*, *\**, *e\_modulus=32800*, *g\_modulus=13667*, *poisson=0.2*, *unit\_mass=2500*, *specific\_heat=0.6*, *thermal\_expansion=1e-05*, *thermal\_conductivity=45*, *is\_default=False*, *order\_in\_code=1*, *thermal\_state=None*, *fck\_28=None*, *stone\_diameter=0.016*, *cement\_class=ConcCementClass.R*, *aggregate\_type=ConcAggregateType.QUARTZITE*, *diagram\_type=ConcDiagramType.PARABOLIC*, *silica\_fume=False*, *plain\_concrete\_diagram=False*, *dep\_params=None*)[](#OpenModel.create_matconcrete_ec2 "Link to this definition")
Create a material concrete Ec2 object and add it to the model.
* Parameters:
* **base\_material** ([`ConcreteMaterial`](https://docs.viktor.ai/sdk/api/external/idea/.md#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")) – IDEA-RCS base material to start with.
* **name** (`str`) – Name of the material (default: base\_material name).
* **e\_modulus** (`float`) – Young’s modulus \[MPa] (default: 32800 MPa).
* **g\_modulus** (`float`) – Shear modulus \[MPa] (default: 13667 MPa).
* **poisson** (`float`) – Poisson’s ratio (default: 0.2).
* **unit\_mass** (`float`) – Unit mass \[kg/m3] (default: 2500 kg/m3).
* **specific\_heat** (`float`) – Specific heat capacity (default: 0.6).
* **thermal\_expansion** (`float`) – Thermal expansion \[1/K] (default: 1e-05).
* **thermal\_conductivity** (`float`) – Thermal conductivity (default: 45).
* **is\_default** (`bool`) – True if material is default material in IDEA-RCS code (default: False).
* **order\_in\_code** (`int`) – Order of this material in the IDEA-RCS code (default: 1).
* **thermal\_state** ([`ThermalState`](https://docs.viktor.ai/sdk/api/external/idea/.md#ThermalState "viktor.external.idea_rcs.objects.ThermalState")) – Collection of thermal states for expansion, conductivity, specific heat, stress-strain and strain curvatures (default: ThermalState()).
* **fck\_28** (`float`) – Characteristic compressive cylinder strength of concrete at 28 days \[MPa] (default: base\_material fck).
* **stone\_diameter** (`float`) – Aggregate size (default: 16 mm).
* **cement\_class** ([`ConcCementClass`](https://docs.viktor.ai/sdk/api/external/idea/.md#ConcCementClass "viktor.external.idea_rcs.objects.ConcCementClass")) – Cement class (default: R).
* **aggregate\_type** ([`ConcAggregateType`](https://docs.viktor.ai/sdk/api/external/idea/.md#ConcAggregateType "viktor.external.idea_rcs.objects.ConcAggregateType")) – Aggregate type (default: Quartzite).
* **diagram\_type** ([`ConcDiagramType`](https://docs.viktor.ai/sdk/api/external/idea/.md#ConcDiagramType "viktor.external.idea_rcs.objects.ConcDiagramType")) – Type of stress-strain diagram for ULS calculation (default: Parabolic).
* **silica\_fume** (`bool`) – Contains silica fume (default: False) (EN 1992-2:2008-07 only).
* **plain\_concrete\_diagram** (`bool`) – Stress strain diagram with tension part (default: False).
* **dep\_params** ([`ConcDependentParams`](https://docs.viktor.ai/sdk/api/external/idea/.md#ConcDependentParams "viktor.external.idea_rcs.objects.ConcDependentParams")) – Collection of a series of dependent parameters (see ConcDependentParams for more info). If None, values will be calculated based on ‘fck’ (default: None).
* Return type:
[`MatConcreteEc2`](https://docs.viktor.ai/sdk/api/external/idea/.md#MatConcreteEc2 "viktor.external.idea_rcs.objects.MatConcreteEc2")
* create\_matreinforcement\_ec2(*base\_material*, *name=None*, *\**, *e\_modulus=200000*, *g\_modulus=83333*, *poisson=0.2*, *unit\_mass=7850*, *specific\_heat=0.6*, *thermal\_expansion=1e-05*, *thermal\_conductivity=45*, *is\_default=False*, *order\_in\_code=1*, *thermal\_state=None*, *bar\_surface=BarSurface.RIBBED*, *fyk=None*, *ftk\_by\_fyk=None*, *epsuk=None*, *ftk=None*, *class\_=ReinfClass.B*, *type\_=ReinfType.BARS*, *fabrication=ReinfFabrication.HOT\_ROLLED*, *diagram\_type=ReinfDiagramType.BILINEAR\_INCLINED*)[](#OpenModel.create_matreinforcement_ec2 "Link to this definition")
Create a material reinforcement Ec2 object and add it to the model.
* Parameters:
* **base\_material** ([`ReinforcementMaterial`](https://docs.viktor.ai/sdk/api/external/idea/.md#ReinforcementMaterial "viktor.external.idea_rcs.objects.ReinforcementMaterial")) – IDEA-RCS base material to start with.
* **name** (`str`) – Name of the material (default: base\_material name).
* **e\_modulus** (`float`) – Young’s modulus \[MPa] (default: 200000 MPa).
* **g\_modulus** (`float`) – Shear modulus \[MPa] (default: 83333 MPa).
* **poisson** (`float`) – Poisson’s ratio (default: 0.2).
* **unit\_mass** (`float`) – Unit mass \[kg/m3] (default: 7850 kg/m3).
* **specific\_heat** (`float`) – Specific heat capacity (default: 0.6).
* **thermal\_expansion** (`float`) – Thermal expansion \[1/K] (default: 1e-05).
* **thermal\_conductivity** (`float`) – Thermal conductivity (default: 45).
* **is\_default** (`bool`) – True if material is default material in IDEA-RCS code (default: False).
* **order\_in\_code** (`int`) – Order of this material in the IDEA-RCS code (default: 1).
* **thermal\_state** ([`ThermalState`](https://docs.viktor.ai/sdk/api/external/idea/.md#ThermalState "viktor.external.idea_rcs.objects.ThermalState")) – Collection of thermal states for expansion, conductivity, specific heat, stress-strain and strain curvatures (default: ThermalState()).
* **bar\_surface** ([`BarSurface`](https://docs.viktor.ai/sdk/api/external/idea/.md#BarSurface "viktor.external.idea_rcs.objects.BarSurface")) – Bar surface (default: Ribbed).
* **fyk** (`float`) – Characteristic yield strength of reinforcement (default: base\_material fyk).
* **ftk\_by\_fyk** (`float`) – factor k = ratio ftk / fyk (default: base\_material k).
* **epsuk** (`float`) – Characteristic strain of reinforcement at maximum load - εuk \[x 1e-4].
* **ftk** (`float`) – Characteristic tensile strength of reinforcement (default: base\_material ftk).
* **class** – Class of reinforcement (default: B).
* **type** – Type of reinforcement (default: Bars).
* **fabrication** ([`ReinfFabrication`](https://docs.viktor.ai/sdk/api/external/idea/.md#ReinfFabrication "viktor.external.idea_rcs.objects.ReinfFabrication")) – Fabrication of reinforcement (default: Hot rolled).
* **diagram\_type** ([`ReinfDiagramType`](https://docs.viktor.ai/sdk/api/external/idea/.md#ReinfDiagramType "viktor.external.idea_rcs.objects.ReinfDiagramType")) – Type of material diagram (default: Bilinear with an inclined top branch).
* Return type:
[`MatReinforcementEc2`](https://docs.viktor.ai/sdk/api/external/idea/.md#MatReinforcementEc2 "viktor.external.idea_rcs.objects.MatReinforcementEc2")
- create\_reinforced\_cross\_section(*cross\_section*, *name=None*)[](#OpenModel.create_reinforced_cross_section "Link to this definition")
Create a reinforced cross-section object and add it to the model.
* Parameters:
* **cross\_section** ([`CrossSection`](https://docs.viktor.ai/sdk/api/external/idea/.md#CrossSection "viktor.external.idea_rcs.objects.CrossSection")) – Cross-section (created by [`create_cross_section_parameter()`](#OpenModel.create_cross_section_parameter "viktor.external.idea_rcs.idea_rcs.OpenModel.create_cross_section_parameter") or [`create_cross_section_component()`](#OpenModel.create_cross_section_component "viktor.external.idea_rcs.idea_rcs.OpenModel.create_cross_section_component")).
* **name** (`str`) – Name of cross-section (default: ‘R{i}’).
* Return type:
[`ReinforcedCrossSection`](https://docs.viktor.ai/sdk/api/external/idea/.md#ReinforcedCrossSection "viktor.external.idea_rcs.objects.ReinforcedCrossSection")
## OutputFileParser[](https://docs.viktor.ai/sdk/api/external/idea/.md#_OutputFileParser "Direct link to OutputFileParser")
* *class *viktor.external.idea\_rcs.idea\_rcs.OutputFileParser(*xml\_file*)[](#OutputFileParser "Link to this definition")
Helper class to extract results from a IDEA-RCS output file (.xml).
Note, for very large result files we advise to make use of [`RcsOutputFileParser`](#RcsOutputFileParser "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser") instead.
* Parameters:
**xml\_file** (`StringIO`) – valid IDEA-RCS XML output file.
* Raises:
[**ParsingError**](https://docs.viktor.ai/sdk/api/errors/.md#ParsingError "viktor.errors.ParsingError") – if ‘xml\_file’ can not be parsed (not a valid format).
Example usage:
```
parser = OutputFileParser(xml_file)
for section in parser.section_ids:
capacity_results = parser.capacity_results(section)
...
```
In case you require results which are not supported, you can retrieve the raw results using the [`raw_results()`](#OutputFileParser.raw_results "viktor.external.idea_rcs.idea_rcs.OutputFileParser.raw_results") method.
* capacity\_results(*section\_id*)[](#OutputFileParser.capacity_results "Link to this definition")
Get the result of applied internal forces of all extremes for the section with provided ‘section\_id’.
* Parameters:
**section\_id** (`int`) – id of the check section. Must be present in the output file.
* Raises:
[**ParsingError**](https://docs.viktor.ai/sdk/api/errors/.md#ParsingError "viktor.errors.ParsingError") – if ‘section\_id’ is not present in output file.
* Return type:
`List`\[`Dict`\[`str`, `Any`] | `None`]
See [`capacity()`](#RcsOutputFileParser.SectionResult.capacity "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult.capacity") for return format.
- crack\_width\_results(*section\_id*)[](#OutputFileParser.crack_width_results "Link to this definition")
Get the crack width (short/long) results for all extremes for the section with provided ‘section\_id’.
* Parameters:
**section\_id** (`int`) – id of the check section. Must be present in the output file.
* Raises:
[**ParsingError**](https://docs.viktor.ai/sdk/api/errors/.md#ParsingError "viktor.errors.ParsingError") – if ‘section\_id’ is not present in output file.
* Return type:
`List`\[`Dict`\[`str`, `Dict`\[`str`, `Any`] | `None`] | `None`]
See [`crack_width()`](#RcsOutputFileParser.SectionResult.crack_width "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult.crack_width") for return format.
* detailing\_results(*section\_id*)[](#OutputFileParser.detailing_results "Link to this definition")
Get the unity checks of the longitudinal reinforcement and shear reinforcement for all extremes for the section with provided ‘section\_id’.
* Parameters:
**section\_id** (`int`) – id of the check section. Must be present in the output file.
* Raises:
[**ParsingError**](https://docs.viktor.ai/sdk/api/errors/.md#ParsingError "viktor.errors.ParsingError") – if ‘section\_id’ is not present in output file.
* Return type:
`List`\[`Dict`\[`str`, `float` | `None`] | `None`]
See [`detailing()`](#RcsOutputFileParser.SectionResult.detailing "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult.detailing") for return format.
- fatigue\_results(*section\_id*)[](#OutputFileParser.fatigue_results "Link to this definition")
Get the fatigue results for all extremes for the provided ‘section\_id’.
* Parameters:
**section\_id** (`int`) – id of the check section. Must be present in the output file.
* Raises:
[**ParsingError**](https://docs.viktor.ai/sdk/api/errors/.md#ParsingError "viktor.errors.ParsingError") – if ‘section\_id’ is not present in output file.
* Return type:
`List`\[`dict` | `None`]
See [`fatigue()`](#RcsOutputFileParser.SectionResult.fatigue "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult.fatigue") for return format.
* raw\_results()[](#OutputFileParser.raw_results "Link to this definition")
Get the (complete) raw results in dict form. Can be used if results need to be extracted that are not supported by the available methods.
* Return type:
`dict`
- *property *section\_ids*: List\[int]*[](#OutputFileParser.section_ids "Link to this definition")
Get all section ids for which results are present in the result file.
* shear\_results(*section\_id*)[](#OutputFileParser.shear_results "Link to this definition")
Get the shear resistances for all extremes for the section with provided ‘section\_id’.
* Parameters:
**section\_id** (`int`) – id of the check section. Must be present in the output file.
* Raises:
[**ParsingError**](https://docs.viktor.ai/sdk/api/errors/.md#ParsingError "viktor.errors.ParsingError") – if ‘section\_id’ is not present in output file.
* Return type:
`List`\[`Dict`\[`str`, `Any`] | `None`]
See [`shear()`](#RcsOutputFileParser.SectionResult.shear "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult.shear") for return format.
- stress\_limitation\_results(*section\_id*)[](#OutputFileParser.stress_limitation_results "Link to this definition")
Get the short- and long-term stress limitation results for all extremes for provided ‘section\_id’.
* Parameters:
**section\_id** (`int`) – id of the check section. Must be present in the output file.
* Raises:
[**ParsingError**](https://docs.viktor.ai/sdk/api/errors/.md#ParsingError "viktor.errors.ParsingError") – if ‘section\_id’ is not present in output file.
* Return type:
`List`\[`Dict`\[`str`, `float` | `None`] | `None`]
See [`stress_limitation()`](#RcsOutputFileParser.SectionResult.stress_limitation "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult.stress_limitation") for return format.
## RcsOutputFileParser[](https://docs.viktor.ai/sdk/api/external/idea/.md#_RcsOutputFileParser "Direct link to RcsOutputFileParser")
* *class *viktor.external.idea\_rcs.idea\_rcs.RcsOutputFileParser(*xml\_file*)[](#RcsOutputFileParser "Link to this definition")
Parser to extract results from an IDEA-RCS output file (.xml).
Currently the following data can be extracted:
> * [`capacity()`](#RcsOutputFileParser.SectionResult.capacity "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult.capacity")
>
> * [`shear()`](#RcsOutputFileParser.SectionResult.shear "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult.shear")
>
> * [`torsion()`](#RcsOutputFileParser.SectionResult.torsion "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult.torsion") (new in v13.4.0)
>
> * [`interaction()`](#RcsOutputFileParser.SectionResult.interaction "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult.interaction") (new in v13.4.0)
>
> * [`crack_width()`](#RcsOutputFileParser.SectionResult.crack_width "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult.crack_width")
>
> * [`detailing()`](#RcsOutputFileParser.SectionResult.detailing "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult.detailing")
>
> * [`stress_limitation()`](#RcsOutputFileParser.SectionResult.stress_limitation "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult.stress_limitation")
>
> * [`fatigue()`](#RcsOutputFileParser.SectionResult.fatigue "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult.fatigue")
Example using [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File"):
```
xml_file = idea_rcs_analysis.get_output_file(as_file=True)
with xml_file.open_binary() as f:
parser = RcsOutputFileParser(f)
# loop through all sections
for section in parser.section_results():
capacity_results = section.capacity()
shear_results = section.shear()
# or get results for a single section
section_4 = parser.section_result(4)
...
# or loop through all extremes within a section
for extreme in section_4.extremes():
capacity = extreme['capacity']
...
```
Example using BytesIO:
```
xml_file = idea_rcs_analysis.get_output_file()
parser = RcsOutputFileParser(xml_file)
for section in parser.section_results():
...
```
* Parameters:
**xml\_file** (`BinaryIO`) – IDEA-RCS XML output file (.xml).
- *class *SectionResult(*id\_*, *element*)[](#RcsOutputFileParser.SectionResult "Link to this definition")
Parsed result section, on which specific results can be retrieved.
Do not instantiate this object directly, but retrieve it through [`RcsOutputFileParser.section_results()`](#RcsOutputFileParser.section_results "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.section_results").
* capacity()[](#RcsOutputFileParser.SectionResult.capacity "Link to this definition")
Get the capacity results of all extremes for the current section.
Returns a list of dictionaries (or None if not present for a certain extreme) in the following format:
```
[
{
'Fu': {
'N': ,
'Qy': ,
'Qz': ,
'Mx': ,
'My': ,
'Mz':
},
'Fu1': {
... # see 'Fu'
} | None,
'Fu2': {
... # see 'Fu'
} | None,
'CheckValue': ,
'Result': # new in v13.4.0
} | None,
...
]
```
* Return type:
`List`\[`dict` | `None`]
- crack\_width()[](#RcsOutputFileParser.SectionResult.crack_width "Link to this definition")
Get the crack width (short/long) results for all extremes for the current section.
Returns a list of dictionaries (or None if not present for a certain extreme) in the following format:
```
[
{
'short': {
'N': ,
'My': ,
'Mz': ,
'W': ,
'Wlim': ,
'CheckValue': ,
'Result': # new in v13.4.0
} | None,
'long': {
... # see 'short'
} | None,
} | None,
...
]
```
* Return type:
`List`\[`dict` | `None`]
* detailing()[](#RcsOutputFileParser.SectionResult.detailing "Link to this definition")
Get the unity checks of the longitudinal reinforcement and shear reinforcement for all extremes for the current section.
Returns a list of dictionaries (or None if not present for a certain extreme) in the following format:
```
[
{
'longitudinal': | None,
'shear': | None,
'CheckValue': , # new in v13.4.0
'CheckValueLongReinf': , # new in v13.4.0
'CheckValueShearReinf': , # new in v13.4.0
'Result': # new in v13.4.0
} | None,
...
]
```
* Return type:
`List`\[`dict` | `None`]
- extremes()[](#RcsOutputFileParser.SectionResult.extremes "Link to this definition")
Get all results combined per extreme for the current section.
Returns a list of dictionaries in the following format:
```
[
{
'capacity': {...} | None,
'shear': {...} | None,
'torsion': {...} | None, # new in v13.4.0
'interaction': {...} | None, # new in v13.4.0
'crack_width': {...} | None,
'detailing': {...} | None,
'stress_limitation': {...} | None,
'fatigue': {...} | None,
},
...
]
```
* Return type:
`List`\[`dict`]
* fatigue()[](#RcsOutputFileParser.SectionResult.fatigue "Link to this definition")
Get the fatigue results for all extremes for the current section.
Returns a list of dictionaries (or None if not present for a certain extreme) in the following format:
```
[
{
'fatigue': {
'CheckValue': ,
'DecisionMethod': ,
'Result': # new in v13.4.0
},
'shear': {
'max': {
'Ved': ,
'Vrdc': ,
'Vrd': ,
'Vrdmax': ,
'Vrdr': ,
'Vrds': ,
'CheckValue': ,
'Result': # new in v13.4.0
},
'min': {
... # see 'max'
},
}
} | None,
...
]
```
* Return type:
`List`\[`dict` | `None`]
- *property *id\_*: int*[](#RcsOutputFileParser.SectionResult.id_ "Link to this definition")
Returns the ‘SectionId’ of current section.
* interaction()[](#RcsOutputFileParser.SectionResult.interaction "Link to this definition")
New in v13.4.0
Get the interaction results for all extremes for the current section.
Returns a list of dictionaries (or None if not present for a certain extreme) in the following format:
```
[
{
'Ned': ,
'Medy': ,
'Medz': ,
'Ved': ,
'Ted': ,
'CheckValue': ,
'CheckValueShearAndTorsion': ,
'CheckValueShearTorsionAndBending': ,
'Result':
} | None,
...
]
```
* Return type:
`List`\[`dict` | `None`]
- shear()[](#RcsOutputFileParser.SectionResult.shear "Link to this definition")
Get the shear resistances for all extremes for the current section.
Returns a list of dictionaries (or None if not present for a certain extreme) in the following format:
```
[
{
'Ved': ,
'Vrdc': ,
'Vrd': ,
'Vrdmax': ,
'Vrdr': ,
'Vrds': ,
'CheckValue': ,
'Result': # new in v13.4.0
} | None,
...
]
```
* Return type:
`List`\[`dict` | `None`]
* stress\_limitation()[](#RcsOutputFileParser.SectionResult.stress_limitation "Link to this definition")
Get the short- and long-term stress limitation results for all extremes for the current section.
Returns a list of dictionaries (or None if not present for a certain extreme) in the following format:
```
[
{
'Check_7_2_2_Concrete_fck': { # new in v13.4.0
'short': {
'Stress': | None,
'CheckValue': ,
'Result':
} | None,
'long': {
... # see 'short'
} | None
} | None,
'Check_7_2_3_Concrete_fck': { # new in v13.4.0
... # see 'Check_7_2_2_Concrete_fck'
} | None,
'Check_7_2_5_Tendons_fpk': { # new in v13.4.0
... # see 'Check_7_2_2_Concrete_fck'
} | None,
'Check_7_2_5_ReinforcementBars_fyk': { # new in v13.4.0
... # see 'Check_7_2_2_Concrete_fck'
} | None,
'Check_5_10_3_2_Tendons': { # new in v13.4.0
... # see 'Check_7_2_2_Concrete_fck'
} | None,
'Check_5_10_2_1_1_Tendons': { # new in v13.4.0
... # see 'Check_7_2_2_Concrete_fck'
} | None,
'short': {
'Check_7_2_2_Concrete_fck': | None,
... # see above for all keys
} | None,
'long': {
'Check_7_2_2_Concrete_fck': | None,
... # see above for all keys
} | None,
} | None,
...
]
```
* Return type:
`List`\[`dict` | `None`]
- torsion()[](#RcsOutputFileParser.SectionResult.torsion "Link to this definition")
New in v13.4.0
Get the torsion results for all extremes for the current section.
Returns a list of dictionaries (or None if not present for a certain extreme) in the following format:
```
[
{
'Ted': ,
'Trdc': ,
'Trdmax': ,
'Trds': ,
'Trd': ,
'CheckValue': ,
'Result':
} | None,
...
]
```
* Return type:
`List`\[`dict` | `None`]
* section\_result(*id\_*)[](#RcsOutputFileParser.section_result "Link to this definition")
Retrieve the section result of the provided id.
* Return type:
[`SectionResult`](#RcsOutputFileParser.SectionResult "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult")
- section\_results()[](#RcsOutputFileParser.section_results "Link to this definition")
Iterates through all section results.
Usage:
```
for section in parser.section_results():
capacity_results = section.capacity()
if section.id_ == 3:
...
```
* Return type:
`Iterator`\[[`SectionResult`](#RcsOutputFileParser.SectionResult "viktor.external.idea_rcs.idea_rcs.RcsOutputFileParser.SectionResult")]
## RectSection[](https://docs.viktor.ai/sdk/api/external/idea/.md#_RectSection "Direct link to RectSection")
* *class *viktor.external.idea\_rcs.idea\_rcs.RectSection(*width*, *height*)[](#RectSection "Link to this definition")
Bases: [`SectionPrototype1D`](#SectionPrototype1D "viktor.external.idea_rcs.idea_rcs.SectionPrototype1D")
Rectangular section.
The origin is located in the centroid of this section.
* Parameters:
* **width** (`float`) – Width of the section.
* **height** (`float`) – Height of the section.
## SectionPrototype1D[](https://docs.viktor.ai/sdk/api/external/idea/.md#_SectionPrototype1D "Direct link to SectionPrototype1D")
* *class *viktor.external.idea\_rcs.idea\_rcs.SectionPrototype1D[](#SectionPrototype1D "Link to this definition")
Bases: `_SectionPrototype`, `ABC`
Abstract base class of all 1D (beam-like) section prototypes.
## BarSurface[](https://docs.viktor.ai/sdk/api/external/idea/.md#_BarSurface "Direct link to BarSurface")
* *class *viktor.external.idea\_rcs.objects.BarSurface(*\*values*)[](#BarSurface "Link to this definition")
Bases: `Enum`
* RIBBED*: [`BarSurface`](#BarSurface "viktor.external.idea_rcs.objects.BarSurface")** = 1*[](#BarSurface.RIBBED "Link to this definition")
- SMOOTH*: [`BarSurface`](#BarSurface "viktor.external.idea_rcs.objects.BarSurface")** = 0*[](#BarSurface.SMOOTH "Link to this definition")
## CalculationSetup[](https://docs.viktor.ai/sdk/api/external/idea/.md#_CalculationSetup "Direct link to CalculationSetup")
* *class *viktor.external.idea\_rcs.objects.CalculationSetup(*\**, *uls\_response=None*, *uls\_diagram=None*, *uls\_shear=None*, *uls\_torsion=None*, *uls\_interaction=None*, *sls\_crack=None*, *sls\_stress\_limitation=None*, *sls\_stiffnesses=None*, *detailing=None*, *m\_n\_kappa\_diagram=None*, *fatigue=None*, *cross\_section\_characteristics=None*)[](#CalculationSetup "Link to this definition")
Bases: `_OpenObject`
Concrete calculation setup.
* Parameters:
* **uls\_response** (`bool`) – Response N-M(-M) (default: False).
* **uls\_diagram** (`bool`) – Capacity N-M(-M) (default: True).
* **uls\_shear** (`bool`) – Shear (default: True).
* **uls\_torsion** (`bool`) – Torsion (default: True).
* **uls\_interaction** (`bool`) – Interaction (default: True).
* **sls\_crack** (`bool`) – Crack width (default: True).
* **sls\_stress\_limitation** (`bool`) – Stress limitation (default: True).
* **sls\_stiffnesses** (`bool`) – Stiffnesses (default: False).
* **detailing** (`bool`) – Detailing (default: True).
* **m\_n\_kappa\_diagram** (`bool`) – M-N-κ diagram (default: False).
* **fatigue** (`bool`) – Fatigue (default: True).
* **cross\_section\_characteristics** (`bool`) – Cross-section characteristics (default: IDEA-RCS default).
## CheckMember[](https://docs.viktor.ai/sdk/api/external/idea/.md#_CheckMember "Direct link to CheckMember")
* *class *viktor.external.idea\_rcs.objects.CheckMember(*id\_*)[](#CheckMember "Link to this definition")
Bases: `_OpenElementId`, `ABC`
Abstract base class of all check members.
## CheckMember1D[](https://docs.viktor.ai/sdk/api/external/idea/.md#_CheckMember1D "Direct link to CheckMember1D")
* *class *viktor.external.idea\_rcs.objects.CheckMember1D(*id\_*, *name*)[](#CheckMember1D "Link to this definition")
Bases: [`CheckMember`](#CheckMember "viktor.external.idea_rcs.objects.CheckMember")
Do not use this \_\_init\_\_ directly, but create the object by [`create_check_member1d()`](https://docs.viktor.ai/sdk/api/external/idea/.md#OpenModel.create_check_member1d "viktor.external.idea_rcs.idea_rcs.OpenModel.create_check_member1d").
## CheckSection[](https://docs.viktor.ai/sdk/api/external/idea/.md#_CheckSection "Direct link to CheckSection")
* *class *viktor.external.idea\_rcs.objects.CheckSection(*id\_*, *description*, *check\_member*, *reinf\_section*, *extremes=None*)[](#CheckSection "Link to this definition")
Bases: `_OpenElementId`, `ABC`
Abstract base class of all check sections.
* create\_extreme(*\**, *description=None*, *accidental=None*, *fatigue=None*, *frequent=None*, *fundamental=None*, *characteristic=None*, *quasi\_permanent=None*)[](#CheckSection.create_extreme "Link to this definition")
Create an extreme case with corresponding internal forces on the section for checking.
* Parameters:
* **description** (`str`) – Description of the extreme (default: ‘{section\_name} - E {i}’).
New in v14.6.0
* **accidental** ([`LoadingULS`](#LoadingULS "viktor.external.idea_rcs.objects.LoadingULS")) – Accidental loading.
* **fatigue** ([`FatigueLoading`](#FatigueLoading "viktor.external.idea_rcs.objects.FatigueLoading")) – Fatigue loading.
* **frequent** ([`LoadingSLS`](#LoadingSLS "viktor.external.idea_rcs.objects.LoadingSLS")) – Frequent loading.
* **fundamental** ([`LoadingULS`](#LoadingULS "viktor.external.idea_rcs.objects.LoadingULS")) – Fundamental loading.
* **characteristic** ([`LoadingSLS`](#LoadingSLS "viktor.external.idea_rcs.objects.LoadingSLS")) – Characteristic loading.
* **quasi\_permanent** ([`LoadingSLS`](#LoadingSLS "viktor.external.idea_rcs.objects.LoadingSLS")) – Quasi-Permanent loading.
* Return type:
`None`
- *property *extremes*: List\[[CheckSectionExtreme](#CheckSectionExtreme "viktor.external.idea_rcs.objects.CheckSectionExtreme")]*[](#CheckSection.extremes "Link to this definition")
## CheckSectionExtreme[](https://docs.viktor.ai/sdk/api/external/idea/.md#_CheckSectionExtreme "Direct link to CheckSectionExtreme")
* *class *viktor.external.idea\_rcs.objects.CheckSectionExtreme(*accidental=None*, *fatigue=None*, *frequent=None*, *fundamental=None*, *characteristic=None*, *quasi\_permanent=None*, *\**, *description*)[](#CheckSectionExtreme "Link to this definition")
Bases: `_OpenObject`
Abstract base class of all check section extremes.
## CodeSettings[](https://docs.viktor.ai/sdk/api/external/idea/.md#_CodeSettings "Direct link to CodeSettings")
* *class *viktor.external.idea\_rcs.objects.CodeSettings(*\**, *evaluation\_interaction\_diagram=None*, *theta=None*, *theta\_min=None*, *theta\_max=None*, *n\_cycles\_fatigue=None*, *no\_resistance\_concrete\_tension\_1d=None*, *type\_sls\_calculation=None*)[](#CodeSettings "Link to this definition")
Bases: `_OpenObject`
Code and calculation settings.
* Parameters:
* **evaluation\_interaction\_diagram** ([`EvaluationInteractionDiagram`](#EvaluationInteractionDiagram "viktor.external.idea_rcs.objects.EvaluationInteractionDiagram")) – evaluation of interaction diagram (default: NuMuMu)
* **theta** (`float`) – angle \[deg] between the concrete compression strut and the beam axis perpendicular to the shear force (default: set by IDEA)
* **theta\_min** (`float`) – minimum angle \[deg] between the concrete compression strut and the beam axis perpendicular to the shear force (default: set by IDEA)
* **theta\_max** (`float`) – maximum angle \[deg] between the concrete compression strut and the beam axis perpendicular to the shear force (default: set by IDEA)
* **n\_cycles\_fatigue** (`float`) – number of fatigue cycles (\* 10⁶) (default: set by IDEA)
* **no\_resistance\_concrete\_tension\_1d** ([`NoResistanceConcreteTension1d`](#NoResistanceConcreteTension1d "viktor.external.idea_rcs.objects.NoResistanceConcreteTension1d")) – no resistance of concrete in tension - members 1D (default: Extreme)
* **type\_sls\_calculation** ([`TypeSLSCalculation`](#TypeSLSCalculation "viktor.external.idea_rcs.objects.TypeSLSCalculation")) – type of SLS calculation (default: Both)
## ConcAggregateType[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ConcAggregateType "Direct link to ConcAggregateType")
* *class *viktor.external.idea\_rcs.objects.ConcAggregateType(*\*values*)[](#ConcAggregateType "Link to this definition")
Bases: `Enum`
* BASALT*: [`ConcAggregateType`](#ConcAggregateType "viktor.external.idea_rcs.objects.ConcAggregateType")** = 3*[](#ConcAggregateType.BASALT "Link to this definition")
- LIMESTONE*: [`ConcAggregateType`](#ConcAggregateType "viktor.external.idea_rcs.objects.ConcAggregateType")** = 1*[](#ConcAggregateType.LIMESTONE "Link to this definition")
* QUARTZITE*: [`ConcAggregateType`](#ConcAggregateType "viktor.external.idea_rcs.objects.ConcAggregateType")** = 0*[](#ConcAggregateType.QUARTZITE "Link to this definition")
- SANDSTONE*: [`ConcAggregateType`](#ConcAggregateType "viktor.external.idea_rcs.objects.ConcAggregateType")** = 2*[](#ConcAggregateType.SANDSTONE "Link to this definition")
## ConcCementClass[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ConcCementClass "Direct link to ConcCementClass")
* *class *viktor.external.idea\_rcs.objects.ConcCementClass(*\*values*)[](#ConcCementClass "Link to this definition")
Bases: `Enum`
* N*: [`ConcCementClass`](#ConcCementClass "viktor.external.idea_rcs.objects.ConcCementClass")** = 2*[](#ConcCementClass.N "Link to this definition")
- R*: [`ConcCementClass`](#ConcCementClass "viktor.external.idea_rcs.objects.ConcCementClass")** = 1*[](#ConcCementClass.R "Link to this definition")
* S*: [`ConcCementClass`](#ConcCementClass "viktor.external.idea_rcs.objects.ConcCementClass")** = 0*[](#ConcCementClass.S "Link to this definition")
## ConcDependentParams[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ConcDependentParams "Direct link to ConcDependentParams")
* *class *viktor.external.idea\_rcs.objects.ConcDependentParams(*E\_cm*, *eps\_c1*, *eps\_c2*, *eps\_c3*, *eps\_cu1*, *eps\_cu2*, *eps\_cu3*, *F\_ctm*, *F\_ctk\_0\_05*, *F\_ctk\_0\_95*, *n\_factor*, *F\_cm*)[](#ConcDependentParams "Link to this definition")
Bases: `_OpenObject`
Collection of all MatConcreteEc2 dependent parameters.
* Parameters:
* **E\_cm** (`float`) – Secant modulus of elasticity of concrete \[MPa]
* **eps\_c1** (`float`) – Compressive strain in the concrete - εc1 \[-]
* **eps\_c2** (`float`) – Compressive strain in the concrete - εc2 \[-]
* **eps\_c3** (`float`) – Compressive strain in the concrete - εc3 \[-]
* **eps\_cu1** (`float`) – Ultimate compressive strain in the concrete - εcu1 \[-]
* **eps\_cu2** (`float`) – Ultimate compressive strain in the concrete - εcu2 \[-]
* **eps\_cu3** (`float`) – Ultimate compressive strain in the concrete - εcu3 \[-]
* **F\_ctm** (`float`) – Mean value of axial tensile strength of concrete \[MPa]
* **F\_ctk\_0\_05** (`float`) – Characteristic axial tensile strength of concrete 5% quantile \[MPa]
* **F\_ctk\_0\_95** (`float`) – Characteristic axial tensile strength of concrete 95% quantile \[MPa]
* **n\_factor** (`float`) – Coefficient n-factor - necessary parabolic part of stress-strain diagram - n \[-]
* **F\_cm** (`float`) – Mean value of concrete cylinder compressive strength \[MPa]
## ConcDiagramType[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ConcDiagramType "Direct link to ConcDiagramType")
* *class *viktor.external.idea\_rcs.objects.ConcDiagramType(*\*values*)[](#ConcDiagramType "Link to this definition")
Bases: `Enum`
* BILINEAR*: [`ConcDiagramType`](#ConcDiagramType "viktor.external.idea_rcs.objects.ConcDiagramType")** = 0*[](#ConcDiagramType.BILINEAR "Link to this definition")
- PARABOLIC*: [`ConcDiagramType`](#ConcDiagramType "viktor.external.idea_rcs.objects.ConcDiagramType")** = 1*[](#ConcDiagramType.PARABOLIC "Link to this definition")
* USER*: [`ConcDiagramType`](#ConcDiagramType "viktor.external.idea_rcs.objects.ConcDiagramType")** = 2*[](#ConcDiagramType.USER "Link to this definition")
## ConcreteMaterial[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ConcreteMaterial "Direct link to ConcreteMaterial")
* *class *viktor.external.idea\_rcs.objects.ConcreteMaterial(*\*values*)[](#ConcreteMaterial "Link to this definition")
Bases: `Enum`
* C100\_115*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 15*[](#ConcreteMaterial.C100_115 "Link to this definition")
- C12\_15*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 1*[](#ConcreteMaterial.C12_15 "Link to this definition")
* C16\_20*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 2*[](#ConcreteMaterial.C16_20 "Link to this definition")
- C20\_25*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 3*[](#ConcreteMaterial.C20_25 "Link to this definition")
* C25\_30*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 4*[](#ConcreteMaterial.C25_30 "Link to this definition")
- C30\_37*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 5*[](#ConcreteMaterial.C30_37 "Link to this definition")
* C35\_45*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 6*[](#ConcreteMaterial.C35_45 "Link to this definition")
- C40\_50*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 7*[](#ConcreteMaterial.C40_50 "Link to this definition")
* C45\_55*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 8*[](#ConcreteMaterial.C45_55 "Link to this definition")
- C50\_60*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 9*[](#ConcreteMaterial.C50_60 "Link to this definition")
* C55\_67*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 10*[](#ConcreteMaterial.C55_67 "Link to this definition")
- C60\_75*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 11*[](#ConcreteMaterial.C60_75 "Link to this definition")
* C70\_85*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 12*[](#ConcreteMaterial.C70_85 "Link to this definition")
- C80\_95*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 13*[](#ConcreteMaterial.C80_95 "Link to this definition")
* C90\_105*: [`ConcreteMaterial`](#ConcreteMaterial "viktor.external.idea_rcs.objects.ConcreteMaterial")** = 14*[](#ConcreteMaterial.C90_105 "Link to this definition")
## ConcreteMemberData[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ConcreteMemberData "Direct link to ConcreteMemberData")
* *class *viktor.external.idea\_rcs.objects.ConcreteMemberData(*element*, *member\_type*, *two\_way\_slab\_type*, *calculation\_setup=None*)[](#ConcreteMemberData "Link to this definition")
Bases: `_OpenObject`, `ABC`
Abstract base class of all concrete member data.
## ConcreteMemberDataEc2[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ConcreteMemberDataEc2 "Direct link to ConcreteMemberDataEc2")
* *class *viktor.external.idea\_rcs.objects.ConcreteMemberDataEc2(*element*, *member\_type*, *two\_way\_slab\_type*, *calculation\_setup=None*, *coeff\_kx\_for\_wmax=None*, *exposure\_class\_data=None*, *creep\_coefficient=None*, *relative\_humidity=None*)[](#ConcreteMemberDataEc2 "Link to this definition")
Bases: [`ConcreteMemberData`](#ConcreteMemberData "viktor.external.idea_rcs.objects.ConcreteMemberData")
Do not use this \_\_init\_\_ directly, but create the object by [`add_member_data_ec2()`](https://docs.viktor.ai/sdk/api/external/idea/.md#OpenModel.add_member_data_ec2 "viktor.external.idea_rcs.idea_rcs.OpenModel.add_member_data_ec2").
## CrossSection[](https://docs.viktor.ai/sdk/api/external/idea/.md#_CrossSection "Direct link to CrossSection")
* *class *viktor.external.idea\_rcs.objects.CrossSection(*id\_*, *name*)[](#CrossSection "Link to this definition")
Bases: `_OpenElementId`, `ABC`
Abstract base class of all cross-sections.
## CrossSectionComponent[](https://docs.viktor.ai/sdk/api/external/idea/.md#_CrossSectionComponent "Direct link to CrossSectionComponent")
* *class *viktor.external.idea\_rcs.objects.CrossSectionComponent(*id\_*, *name*)[](#CrossSectionComponent "Link to this definition")
Bases: [`CrossSection`](#CrossSection "viktor.external.idea_rcs.objects.CrossSection")
Do not use this \_\_init\_\_ directly, but create the object by [`create_cross_section_component()`](https://docs.viktor.ai/sdk/api/external/idea/.md#OpenModel.create_cross_section_component "viktor.external.idea_rcs.idea_rcs.OpenModel.create_cross_section_component").
* create\_component(*outline*, *material*, *\**, *openings=None*)[](#CrossSectionComponent.create_component "Link to this definition")
Create a component to build up the cross-section.
* Parameters:
* **outline** (`Sequence`\[`Tuple`\[`float`, `float`]]) – Vertices which define the outline of the section (y, z). A minimum of 3 vertices is required, the outline is automatically closed.
* **material** ([`MatConcrete`](#MatConcrete "viktor.external.idea_rcs.objects.MatConcrete")) – Material (created by [`create_matconcrete_ec2()`](https://docs.viktor.ai/sdk/api/external/idea/.md#OpenModel.create_matconcrete_ec2 "viktor.external.idea_rcs.idea_rcs.OpenModel.create_matconcrete_ec2")).
* **openings** (`Sequence`\[`Sequence`\[`Tuple`\[`float`, `float`]]]) – One or multiple openings, defined by vertices (y, z). A minimum of 3 vertices per opening is required, the opening is automatically closed.
* Return type:
`None`
## CrossSectionParameter[](https://docs.viktor.ai/sdk/api/external/idea/.md#_CrossSectionParameter "Direct link to CrossSectionParameter")
* *class *viktor.external.idea\_rcs.objects.CrossSectionParameter(*id\_*, *name*, *cross\_section\_type*, *material*, *\*\*parameters*)[](#CrossSectionParameter "Link to this definition")
Bases: [`CrossSection`](#CrossSection "viktor.external.idea_rcs.objects.CrossSection")
Do not use this \_\_init\_\_ directly, but create the object by [`create_cross_section_parameter()`](https://docs.viktor.ai/sdk/api/external/idea/.md#OpenModel.create_cross_section_parameter "viktor.external.idea_rcs.idea_rcs.OpenModel.create_cross_section_parameter").
## CrossSectionType[](https://docs.viktor.ai/sdk/api/external/idea/.md#_CrossSectionType "Direct link to CrossSectionType")
* *class *viktor.external.idea\_rcs.objects.CrossSectionType(*\*values*)[](#CrossSectionType "Link to this definition")
Bases: `Enum`
* BEAM\_SHAPE\_BOX*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 79*[](#CrossSectionType.BEAM_SHAPE_BOX "Link to this definition")
- BEAM\_SHAPE\_BOX\_1*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 80*[](#CrossSectionType.BEAM_SHAPE_BOX_1 "Link to this definition")
* BEAM\_SHAPE\_IREV\_DEGEN*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 83*[](#CrossSectionType.BEAM_SHAPE_IREV_DEGEN "Link to this definition")
- BEAM\_SHAPE\_IREV\_DEGEN\_ADD*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 84*[](#CrossSectionType.BEAM_SHAPE_IREV_DEGEN_ADD "Link to this definition")
* BEAM\_SHAPE\_I\_HAUNCH\_CHAMFER*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 76*[](#CrossSectionType.BEAM_SHAPE_I_HAUNCH_CHAMFER "Link to this definition")
- BEAM\_SHAPE\_I\_HAUNCH\_CHAMFER\_ASYM*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 77*[](#CrossSectionType.BEAM_SHAPE_I_HAUNCH_CHAMFER_ASYM "Link to this definition")
* BEAM\_SHAPE\_I\_Z\_DEGEN*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 88*[](#CrossSectionType.BEAM_SHAPE_I_Z_DEGEN "Link to this definition")
- BEAM\_SHAPE\_L\_DEGEN*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 89*[](#CrossSectionType.BEAM_SHAPE_L_DEGEN "Link to this definition")
* BEAM\_SHAPE\_REV\_U*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 78*[](#CrossSectionType.BEAM_SHAPE_REV_U "Link to this definition")
- BEAM\_SHAPE\_TREV\_CHAMFER\_HAUNCH\_D*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 82*[](#CrossSectionType.BEAM_SHAPE_TREV_CHAMFER_HAUNCH_D "Link to this definition")
* BEAM\_SHAPE\_TREV\_CHAMFER\_HAUNCH\_S*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 81*[](#CrossSectionType.BEAM_SHAPE_TREV_CHAMFER_HAUNCH_S "Link to this definition")
- BEAM\_SHAPE\_TREV\_DEGEN*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 85*[](#CrossSectionType.BEAM_SHAPE_TREV_DEGEN "Link to this definition")
* BEAM\_SHAPE\_TREV\_DEGEN\_ADD*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 86*[](#CrossSectionType.BEAM_SHAPE_TREV_DEGEN_ADD "Link to this definition")
- BEAM\_SHAPE\_Z\_DEGEN*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 87*[](#CrossSectionType.BEAM_SHAPE_Z_DEGEN "Link to this definition")
* BOX\_2I*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 18*[](#CrossSectionType.BOX_2I "Link to this definition")
- BOX\_2L*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 21*[](#CrossSectionType.BOX_2L "Link to this definition")
* BOX\_2U*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 19*[](#CrossSectionType.BOX_2U "Link to this definition")
- BOX\_2U\_2PI*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 20*[](#CrossSectionType.BOX_2U_2PI "Link to this definition")
* BOX\_4L*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 22*[](#CrossSectionType.BOX_4L "Link to this definition")
- BOX\_FL*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 16*[](#CrossSectionType.BOX_FL "Link to this definition")
* BOX\_WEB*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 17*[](#CrossSectionType.BOX_WEB "Link to this definition")
- CHS\_G*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 34*[](#CrossSectionType.CHS_G "Link to this definition")
* CHS\_PAR*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 101*[](#CrossSectionType.CHS_PAR "Link to this definition")
- COMPOSITE\_BEAM\_BOX*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 53*[](#CrossSectionType.COMPOSITE_BEAM_BOX "Link to this definition")
* COMPOSITE\_BEAM\_BOX\_1*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 54*[](#CrossSectionType.COMPOSITE_BEAM_BOX_1 "Link to this definition")
- COMPOSITE\_BEAM\_IGEN\_T*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 55*[](#CrossSectionType.COMPOSITE_BEAM_IGEN_T "Link to this definition")
* COMPOSITE\_BEAM\_L\_LEFT*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 56*[](#CrossSectionType.COMPOSITE_BEAM_L_LEFT "Link to this definition")
- COMPOSITE\_BEAM\_PLATE*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 57*[](#CrossSectionType.COMPOSITE_BEAM_PLATE "Link to this definition")
* COMPOSITE\_BEAM\_R\_RES\_T*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 58*[](#CrossSectionType.COMPOSITE_BEAM_R_RES_T "Link to this definition")
- COMPOSITE\_BEAM\_R\_RES\_T\_1*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 59*[](#CrossSectionType.COMPOSITE_BEAM_R_RES_T_1 "Link to this definition")
* COMPOSITE\_BEAM\_R\_T*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 60*[](#CrossSectionType.COMPOSITE_BEAM_R_T "Link to this definition")
- COMPOSITE\_BEAM\_SHAPE\_CHAMF*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 61*[](#CrossSectionType.COMPOSITE_BEAM_SHAPE_CHAMF "Link to this definition")
* COMPOSITE\_BEAM\_SHAPE\_CHAMF\_ASYM*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 62*[](#CrossSectionType.COMPOSITE_BEAM_SHAPE_CHAMF_ASYM "Link to this definition")
- COMPOSITE\_BEAM\_SHAPE\_IGEN*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 63*[](#CrossSectionType.COMPOSITE_BEAM_SHAPE_IGEN "Link to this definition")
* COMPOSITE\_BEAM\_SHAPE\_I\_T*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 64*[](#CrossSectionType.COMPOSITE_BEAM_SHAPE_I_T "Link to this definition")
- COMPOSITE\_BEAM\_SHAPE\_I\_T\_ASYM*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 65*[](#CrossSectionType.COMPOSITE_BEAM_SHAPE_I_T_ASYM "Link to this definition")
* COMPOSITE\_BEAM\_SHAPE\_T\_T*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 75*[](#CrossSectionType.COMPOSITE_BEAM_SHAPE_T_T "Link to this definition")
- COMPOSITE\_BEAM\_TRAPEZOID*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 67*[](#CrossSectionType.COMPOSITE_BEAM_TRAPEZOID "Link to this definition")
* COMPOSITE\_BEAM\_TRES\_T*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 68*[](#CrossSectionType.COMPOSITE_BEAM_TRES_T "Link to this definition")
- COMPOSITE\_BEAM\_TREV*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 69*[](#CrossSectionType.COMPOSITE_BEAM_TREV "Link to this definition")
* COMPOSITE\_BEAM\_TREV\_RES\_I*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 70*[](#CrossSectionType.COMPOSITE_BEAM_TREV_RES_I "Link to this definition")
- COMPOSITE\_BEAM\_TREV\_RES\_I\_1*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 71*[](#CrossSectionType.COMPOSITE_BEAM_TREV_RES_I_1 "Link to this definition")
* COMPOSITE\_BEAM\_TREV\_RES\_R*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 72*[](#CrossSectionType.COMPOSITE_BEAM_TREV_RES_R "Link to this definition")
- COMPOSITE\_BEAM\_TREV\_RES\_R\_1*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 73*[](#CrossSectionType.COMPOSITE_BEAM_TREV_RES_R_1 "Link to this definition")
* COMPOSITE\_BEAM\_TREV\_T*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 74*[](#CrossSectionType.COMPOSITE_BEAM_TREV_T "Link to this definition")
- COMPOSITE\_BEAM\_T\_LEFT*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 66*[](#CrossSectionType.COMPOSITE_BEAM_T_LEFT "Link to this definition")
* GENERAL*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 38*[](#CrossSectionType.GENERAL "Link to this definition")
- GENERAL\_CONCRETE*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 52*[](#CrossSectionType.GENERAL_CONCRETE "Link to this definition")
* GENERAL\_STEEL*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 51*[](#CrossSectionType.GENERAL_STEEL "Link to this definition")
- IGH*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 29*[](#CrossSectionType.IGH "Link to this definition")
* IGN*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 28*[](#CrossSectionType.IGN "Link to this definition")
- IW*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 23*[](#CrossSectionType.IW "Link to this definition")
* IWN*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 24*[](#CrossSectionType.IWN "Link to this definition")
- LG*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 31*[](#CrossSectionType.LG "Link to this definition")
* LG\_MIRRORED*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 32*[](#CrossSectionType.LG_MIRRORED "Link to this definition")
- O*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 26*[](#CrossSectionType.O "Link to this definition")
* ONE\_COMPONENT\_CSS*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 0*[](#CrossSectionType.ONE_COMPONENT_CSS "Link to this definition")
- OVAL*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 37*[](#CrossSectionType.OVAL "Link to this definition")
* RECT*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 27*[](#CrossSectionType.RECT "Link to this definition")
- RHS\_G*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 36*[](#CrossSectionType.RHS_G "Link to this definition")
* ROLLED\_2I*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 39*[](#CrossSectionType.ROLLED_2I "Link to this definition")
- ROLLED\_ANGLE*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 2*[](#CrossSectionType.ROLLED_ANGLE "Link to this definition")
* ROLLED\_CHS*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 5*[](#CrossSectionType.ROLLED_CHS "Link to this definition")
- ROLLED\_DOUBLE\_LT*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 10*[](#CrossSectionType.ROLLED_DOUBLE_LT "Link to this definition")
* ROLLED\_DOUBLE\_LU*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 11*[](#CrossSectionType.ROLLED_DOUBLE_LU "Link to this definition")
- ROLLED\_DOUBLE\_UC*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 8*[](#CrossSectionType.ROLLED_DOUBLE_UC "Link to this definition")
* ROLLED\_DOUBLE\_UO*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 7*[](#CrossSectionType.ROLLED_DOUBLE_UO "Link to this definition")
- ROLLED\_I*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 1*[](#CrossSectionType.ROLLED_I "Link to this definition")
* ROLLED\_I\_PAR*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 13*[](#CrossSectionType.ROLLED_I_PAR "Link to this definition")
- ROLLED\_L\_PAR*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 15*[](#CrossSectionType.ROLLED_L_PAR "Link to this definition")
* ROLLED\_RHS*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 6*[](#CrossSectionType.ROLLED_RHS "Link to this definition")
- ROLLED\_T*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 3*[](#CrossSectionType.ROLLED_T "Link to this definition")
* ROLLED\_TI*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 12*[](#CrossSectionType.ROLLED_TI "Link to this definition")
- ROLLED\_U*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 4*[](#CrossSectionType.ROLLED_U "Link to this definition")
* ROLLED\_U\_PAR*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 14*[](#CrossSectionType.ROLLED_U_PAR "Link to this definition")
- SG*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 50*[](#CrossSectionType.SG "Link to this definition")
* TCHAMFER\_1*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 46*[](#CrossSectionType.TCHAMFER_1 "Link to this definition")
- TCHAMFER\_2*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 47*[](#CrossSectionType.TCHAMFER_2 "Link to this definition")
* TG*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 30*[](#CrossSectionType.TG "Link to this definition")
- TGREV*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 43*[](#CrossSectionType.TGREV "Link to this definition")
* TRAPEZOID*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 40*[](#CrossSectionType.TRAPEZOID "Link to this definition")
- TT*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 48*[](#CrossSectionType.TT "Link to this definition")
* TT1*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 49*[](#CrossSectionType.TT1 "Link to this definition")
- TTFH*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 41*[](#CrossSectionType.TTFH "Link to this definition")
* TTFHREV*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 44*[](#CrossSectionType.TTFHREV "Link to this definition")
- TW*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 25*[](#CrossSectionType.TW "Link to this definition")
* TWH*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 42*[](#CrossSectionType.TWH "Link to this definition")
- TWHREV*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 45*[](#CrossSectionType.TWHREV "Link to this definition")
* UG*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 33*[](#CrossSectionType.UG "Link to this definition")
- UNIQUE\_NAME*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 1001*[](#CrossSectionType.UNIQUE_NAME "Link to this definition")
* ZG*: [`CrossSectionType`](#CrossSectionType "viktor.external.idea_rcs.objects.CrossSectionType")** = 35*[](#CrossSectionType.ZG "Link to this definition")
## EvaluationInteractionDiagram[](https://docs.viktor.ai/sdk/api/external/idea/.md#_EvaluationInteractionDiagram "Direct link to EvaluationInteractionDiagram")
* *class *viktor.external.idea\_rcs.objects.EvaluationInteractionDiagram(*\*values*)[](#EvaluationInteractionDiagram "Link to this definition")
Bases: `Enum`
* NU\_MU\_MU*: [`EvaluationInteractionDiagram`](#EvaluationInteractionDiagram "viktor.external.idea_rcs.objects.EvaluationInteractionDiagram")** = 0*[](#EvaluationInteractionDiagram.NU_MU_MU "Link to this definition")
- NU\_M\_M*: [`EvaluationInteractionDiagram`](#EvaluationInteractionDiagram "viktor.external.idea_rcs.objects.EvaluationInteractionDiagram")** = 1*[](#EvaluationInteractionDiagram.NU_M_M "Link to this definition")
* N\_MU\_MU*: [`EvaluationInteractionDiagram`](#EvaluationInteractionDiagram "viktor.external.idea_rcs.objects.EvaluationInteractionDiagram")** = 2*[](#EvaluationInteractionDiagram.N_MU_MU "Link to this definition")
## ExposureClassEc2Carbonation[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ExposureClassEc2Carbonation "Direct link to ExposureClassEc2Carbonation")
* *class *viktor.external.idea\_rcs.objects.ExposureClassEc2Carbonation(*\*values*)[](#ExposureClassEc2Carbonation "Link to this definition")
Bases: `Enum`
* XC1*: [`ExposureClassEc2Carbonation`](#ExposureClassEc2Carbonation "viktor.external.idea_rcs.objects.ExposureClassEc2Carbonation")** = 1*[](#ExposureClassEc2Carbonation.XC1 "Link to this definition")
- XC2*: [`ExposureClassEc2Carbonation`](#ExposureClassEc2Carbonation "viktor.external.idea_rcs.objects.ExposureClassEc2Carbonation")** = 2*[](#ExposureClassEc2Carbonation.XC2 "Link to this definition")
* XC3*: [`ExposureClassEc2Carbonation`](#ExposureClassEc2Carbonation "viktor.external.idea_rcs.objects.ExposureClassEc2Carbonation")** = 3*[](#ExposureClassEc2Carbonation.XC3 "Link to this definition")
- XC4*: [`ExposureClassEc2Carbonation`](#ExposureClassEc2Carbonation "viktor.external.idea_rcs.objects.ExposureClassEc2Carbonation")** = 4*[](#ExposureClassEc2Carbonation.XC4 "Link to this definition")
## ExposureClassEc2ChemicalAttack[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ExposureClassEc2ChemicalAttack "Direct link to ExposureClassEc2ChemicalAttack")
* *class *viktor.external.idea\_rcs.objects.ExposureClassEc2ChemicalAttack(*\*values*)[](#ExposureClassEc2ChemicalAttack "Link to this definition")
Bases: `Enum`
* XA1*: [`ExposureClassEc2ChemicalAttack`](#ExposureClassEc2ChemicalAttack "viktor.external.idea_rcs.objects.ExposureClassEc2ChemicalAttack")** = 1*[](#ExposureClassEc2ChemicalAttack.XA1 "Link to this definition")
- XA2*: [`ExposureClassEc2ChemicalAttack`](#ExposureClassEc2ChemicalAttack "viktor.external.idea_rcs.objects.ExposureClassEc2ChemicalAttack")** = 2*[](#ExposureClassEc2ChemicalAttack.XA2 "Link to this definition")
* XA3*: [`ExposureClassEc2ChemicalAttack`](#ExposureClassEc2ChemicalAttack "viktor.external.idea_rcs.objects.ExposureClassEc2ChemicalAttack")** = 3*[](#ExposureClassEc2ChemicalAttack.XA3 "Link to this definition")
## ExposureClassEc2Chlorides[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ExposureClassEc2Chlorides "Direct link to ExposureClassEc2Chlorides")
* *class *viktor.external.idea\_rcs.objects.ExposureClassEc2Chlorides(*\*values*)[](#ExposureClassEc2Chlorides "Link to this definition")
Bases: `Enum`
* XD1*: [`ExposureClassEc2Chlorides`](#ExposureClassEc2Chlorides "viktor.external.idea_rcs.objects.ExposureClassEc2Chlorides")** = 1*[](#ExposureClassEc2Chlorides.XD1 "Link to this definition")
- XD2*: [`ExposureClassEc2Chlorides`](#ExposureClassEc2Chlorides "viktor.external.idea_rcs.objects.ExposureClassEc2Chlorides")** = 2*[](#ExposureClassEc2Chlorides.XD2 "Link to this definition")
* XD3*: [`ExposureClassEc2Chlorides`](#ExposureClassEc2Chlorides "viktor.external.idea_rcs.objects.ExposureClassEc2Chlorides")** = 3*[](#ExposureClassEc2Chlorides.XD3 "Link to this definition")
## ExposureClassEc2ChloridesFromSea[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ExposureClassEc2ChloridesFromSea "Direct link to ExposureClassEc2ChloridesFromSea")
* *class *viktor.external.idea\_rcs.objects.ExposureClassEc2ChloridesFromSea(*\*values*)[](#ExposureClassEc2ChloridesFromSea "Link to this definition")
Bases: `Enum`
* XS1*: [`ExposureClassEc2ChloridesFromSea`](#ExposureClassEc2ChloridesFromSea "viktor.external.idea_rcs.objects.ExposureClassEc2ChloridesFromSea")** = 1*[](#ExposureClassEc2ChloridesFromSea.XS1 "Link to this definition")
- XS2*: [`ExposureClassEc2ChloridesFromSea`](#ExposureClassEc2ChloridesFromSea "viktor.external.idea_rcs.objects.ExposureClassEc2ChloridesFromSea")** = 2*[](#ExposureClassEc2ChloridesFromSea.XS2 "Link to this definition")
* XS3*: [`ExposureClassEc2ChloridesFromSea`](#ExposureClassEc2ChloridesFromSea "viktor.external.idea_rcs.objects.ExposureClassEc2ChloridesFromSea")** = 3*[](#ExposureClassEc2ChloridesFromSea.XS3 "Link to this definition")
## ExposureClassEc2FreezeAttack[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ExposureClassEc2FreezeAttack "Direct link to ExposureClassEc2FreezeAttack")
* *class *viktor.external.idea\_rcs.objects.ExposureClassEc2FreezeAttack(*\*values*)[](#ExposureClassEc2FreezeAttack "Link to this definition")
Bases: `Enum`
* XF1*: [`ExposureClassEc2FreezeAttack`](#ExposureClassEc2FreezeAttack "viktor.external.idea_rcs.objects.ExposureClassEc2FreezeAttack")** = 1*[](#ExposureClassEc2FreezeAttack.XF1 "Link to this definition")
- XF2*: [`ExposureClassEc2FreezeAttack`](#ExposureClassEc2FreezeAttack "viktor.external.idea_rcs.objects.ExposureClassEc2FreezeAttack")** = 2*[](#ExposureClassEc2FreezeAttack.XF2 "Link to this definition")
* XF3*: [`ExposureClassEc2FreezeAttack`](#ExposureClassEc2FreezeAttack "viktor.external.idea_rcs.objects.ExposureClassEc2FreezeAttack")** = 3*[](#ExposureClassEc2FreezeAttack.XF3 "Link to this definition")
- XF4*: [`ExposureClassEc2FreezeAttack`](#ExposureClassEc2FreezeAttack "viktor.external.idea_rcs.objects.ExposureClassEc2FreezeAttack")** = 4*[](#ExposureClassEc2FreezeAttack.XF4 "Link to this definition")
## ExposureClassesDataEc2[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ExposureClassesDataEc2 "Direct link to ExposureClassesDataEc2")
* *class *viktor.external.idea\_rcs.objects.ExposureClassesDataEc2(*\**, *carbonation=None*, *chlorides=None*, *chlorides\_from\_sea=None*, *freeze\_attack=None*, *chemical\_attack=None*)[](#ExposureClassesDataEc2 "Link to this definition")
Bases: `_OpenObject`
Exposure Classes Ec2.
* Parameters:
* **carbonation** ([`ExposureClassEc2Carbonation`](#ExposureClassEc2Carbonation "viktor.external.idea_rcs.objects.ExposureClassEc2Carbonation")) – Carbonation (default: None).
* **chlorides** ([`ExposureClassEc2Chlorides`](#ExposureClassEc2Chlorides "viktor.external.idea_rcs.objects.ExposureClassEc2Chlorides")) – Chlorides (default: None).
* **chlorides\_from\_sea** ([`ExposureClassEc2ChloridesFromSea`](#ExposureClassEc2ChloridesFromSea "viktor.external.idea_rcs.objects.ExposureClassEc2ChloridesFromSea")) – Chlorides from sea (default: None).
* **freeze\_attack** ([`ExposureClassEc2FreezeAttack`](#ExposureClassEc2FreezeAttack "viktor.external.idea_rcs.objects.ExposureClassEc2FreezeAttack")) – Freeze/Thaw Attack (default: None).
* **chemical\_attack** ([`ExposureClassEc2ChemicalAttack`](#ExposureClassEc2ChemicalAttack "viktor.external.idea_rcs.objects.ExposureClassEc2ChemicalAttack")) – Chemical Attack (default: None).
## FatigueLoading[](https://docs.viktor.ai/sdk/api/external/idea/.md#_FatigueLoading "Direct link to FatigueLoading")
* *class *viktor.external.idea\_rcs.objects.FatigueLoading(*max\_loading*, *min\_loading*)[](#FatigueLoading "Link to this definition")
Bases: `_OpenObject`
Fatigue loading.
* Parameters:
* **max\_loading** ([`LoadingULS`](#LoadingULS "viktor.external.idea_rcs.objects.LoadingULS")) – Max. cyclic loading.
* **min\_loading** ([`LoadingULS`](#LoadingULS "viktor.external.idea_rcs.objects.LoadingULS")) – Min. cyclic loading.
## LoadingSLS[](https://docs.viktor.ai/sdk/api/external/idea/.md#_LoadingSLS "Direct link to LoadingSLS")
* *class *viktor.external.idea\_rcs.objects.LoadingSLS(*internal\_forces*, *internal\_forces\_imperfection=None*)[](#LoadingSLS "Link to this definition")
Bases: `_OpenObject`
Loading SLS.
* Parameters:
* **internal\_forces** ([`ResultOfInternalForces`](#ResultOfInternalForces "viktor.external.idea_rcs.objects.ResultOfInternalForces")) – Internal force in section.
* **internal\_forces\_imperfection** ([`ResultOfInternalForces`](#ResultOfInternalForces "viktor.external.idea_rcs.objects.ResultOfInternalForces")) – Internal forces of imperfection effect.
## LoadingULS[](https://docs.viktor.ai/sdk/api/external/idea/.md#_LoadingULS "Direct link to LoadingULS")
* *class *viktor.external.idea\_rcs.objects.LoadingULS(*internal\_forces*, *internal\_forces\_second\_order=None*, *internal\_forces\_begin=None*, *internal\_forces\_end=None*, *internal\_forces\_imperfection=None*)[](#LoadingULS "Link to this definition")
Bases: `_OpenObject`
Loading ULS.
* Parameters:
* **internal\_forces** ([`ResultOfInternalForces`](#ResultOfInternalForces "viktor.external.idea_rcs.objects.ResultOfInternalForces")) – Internal force in section.
* **internal\_forces\_second\_order** ([`ResultOfInternalForces`](#ResultOfInternalForces "viktor.external.idea_rcs.objects.ResultOfInternalForces")) – Internal forces of 2nd order effect.
* **internal\_forces\_begin** ([`ResultOfInternalForces`](#ResultOfInternalForces "viktor.external.idea_rcs.objects.ResultOfInternalForces")) – Internal forces at the beginning.
* **internal\_forces\_end** ([`ResultOfInternalForces`](#ResultOfInternalForces "viktor.external.idea_rcs.objects.ResultOfInternalForces")) – Internal forces at the end.
* **internal\_forces\_imperfection** ([`ResultOfInternalForces`](#ResultOfInternalForces "viktor.external.idea_rcs.objects.ResultOfInternalForces")) – Internal forces of imperfection effect.
## MatConcrete[](https://docs.viktor.ai/sdk/api/external/idea/.md#_MatConcrete "Direct link to MatConcrete")
* *class *viktor.external.idea\_rcs.objects.MatConcrete(*id\_*, *name*, *e\_modulus*, *g\_modulus*, *poisson*, *unit\_mass*, *specific\_heat*, *thermal\_expansion*, *thermal\_conductivity*, *is\_default*, *order\_in\_code*, *thermal\_state*)[](#MatConcrete "Link to this definition")
Bases: `_Material`, `ABC`
Abstract base class of all concrete materials.
## MatConcreteEc2[](https://docs.viktor.ai/sdk/api/external/idea/.md#_MatConcreteEc2 "Direct link to MatConcreteEc2")
* *class *viktor.external.idea\_rcs.objects.MatConcreteEc2(*id\_*, *name*, *e\_modulus*, *g\_modulus*, *poisson*, *unit\_mass*, *specific\_heat*, *thermal\_expansion*, *thermal\_conductivity*, *is\_default*, *order\_in\_code*, *thermal\_state*, *fck*, *stone\_diameter*, *cement\_class*, *aggregate\_type*, *diagram\_type*, *silica\_fume*, *plain\_concrete\_diagram*, *dep\_params=None*)[](#MatConcreteEc2 "Link to this definition")
Bases: [`MatConcrete`](#MatConcrete "viktor.external.idea_rcs.objects.MatConcrete")
Do not use this \_\_init\_\_ directly, but create the object by [`create_matconcrete_ec2()`](https://docs.viktor.ai/sdk/api/external/idea/.md#OpenModel.create_matconcrete_ec2 "viktor.external.idea_rcs.idea_rcs.OpenModel.create_matconcrete_ec2").
## MatReinforcement[](https://docs.viktor.ai/sdk/api/external/idea/.md#_MatReinforcement "Direct link to MatReinforcement")
* *class *viktor.external.idea\_rcs.objects.MatReinforcement(*id\_*, *name*, *e\_modulus*, *g\_modulus*, *poisson*, *unit\_mass*, *specific\_heat*, *thermal\_expansion*, *thermal\_conductivity*, *is\_default*, *order\_in\_code*, *thermal\_state*, *bar\_surface*)[](#MatReinforcement "Link to this definition")
Bases: `_Material`, `ABC`
Abstract base class of all material reinforcements.
## MatReinforcementEc2[](https://docs.viktor.ai/sdk/api/external/idea/.md#_MatReinforcementEc2 "Direct link to MatReinforcementEc2")
* *class *viktor.external.idea\_rcs.objects.MatReinforcementEc2(*id\_*, *name*, *e\_modulus*, *g\_modulus*, *poisson*, *unit\_mass*, *specific\_heat*, *thermal\_expansion*, *thermal\_conductivity*, *is\_default*, *order\_in\_code*, *thermal\_state*, *bar\_surface*, *fyk*, *ftk\_by\_fyk*, *epsuk*, *ftk*, *class\_*, *type\_*, *fabrication*, *diagram\_type*)[](#MatReinforcementEc2 "Link to this definition")
Bases: [`MatReinforcement`](#MatReinforcement "viktor.external.idea_rcs.objects.MatReinforcement")
Do not use this \_\_init\_\_ directly, but create the object by [`create_matreinforcement_ec2()`](https://docs.viktor.ai/sdk/api/external/idea/.md#OpenModel.create_matreinforcement_ec2 "viktor.external.idea_rcs.idea_rcs.OpenModel.create_matreinforcement_ec2").
## MemberType[](https://docs.viktor.ai/sdk/api/external/idea/.md#_MemberType "Direct link to MemberType")
* *class *viktor.external.idea\_rcs.objects.MemberType(*\*values*)[](#MemberType "Link to this definition")
Bases: `Enum`
* BEAM*: [`MemberType`](#MemberType "viktor.external.idea_rcs.objects.MemberType")** = 1*[](#MemberType.BEAM "Link to this definition")
- BEAM\_SLAB*: [`MemberType`](#MemberType "viktor.external.idea_rcs.objects.MemberType")** = 4*[](#MemberType.BEAM_SLAB "Link to this definition")
* COLUMN*: [`MemberType`](#MemberType "viktor.external.idea_rcs.objects.MemberType")** = 2*[](#MemberType.COLUMN "Link to this definition")
- HOLLOW\_CORE\_SLAB*: [`MemberType`](#MemberType "viktor.external.idea_rcs.objects.MemberType")** = 8*[](#MemberType.HOLLOW_CORE_SLAB "Link to this definition")
* PLATE*: [`MemberType`](#MemberType "viktor.external.idea_rcs.objects.MemberType")** = 32*[](#MemberType.PLATE "Link to this definition")
- TWO\_WAY\_SLAB*: [`MemberType`](#MemberType "viktor.external.idea_rcs.objects.MemberType")** = 16*[](#MemberType.TWO_WAY_SLAB "Link to this definition")
* UNDEFINED*: [`MemberType`](#MemberType "viktor.external.idea_rcs.objects.MemberType")** = 0*[](#MemberType.UNDEFINED "Link to this definition")
- WALL*: [`MemberType`](#MemberType "viktor.external.idea_rcs.objects.MemberType")** = 64*[](#MemberType.WALL "Link to this definition")
## NationalAnnex[](https://docs.viktor.ai/sdk/api/external/idea/.md#_NationalAnnex "Direct link to NationalAnnex")
* *class *viktor.external.idea\_rcs.objects.NationalAnnex(*\*values*)[](#NationalAnnex "Link to this definition")
Bases: `Enum`
* BELGIUM*: [`NationalAnnex`](#NationalAnnex "viktor.external.idea_rcs.objects.NationalAnnex")** = 'Belgian'*[](#NationalAnnex.BELGIUM "Link to this definition")
- DUTCH*: [`NationalAnnex`](#NationalAnnex "viktor.external.idea_rcs.objects.NationalAnnex")** = 'Dutch'*[](#NationalAnnex.DUTCH "Link to this definition")
* NO\_ANNEX*: [`NationalAnnex`](#NationalAnnex "viktor.external.idea_rcs.objects.NationalAnnex")** = 'NoAnnex'*[](#NationalAnnex.NO_ANNEX "Link to this definition")
## NoResistanceConcreteTension1d[](https://docs.viktor.ai/sdk/api/external/idea/.md#_NoResistanceConcreteTension1d "Direct link to NoResistanceConcreteTension1d")
* *class *viktor.external.idea\_rcs.objects.NoResistanceConcreteTension1d(*\*values*)[](#NoResistanceConcreteTension1d "Link to this definition")
Bases: `Enum`
* ALWAYS*: [`NoResistanceConcreteTension1d`](#NoResistanceConcreteTension1d "viktor.external.idea_rcs.objects.NoResistanceConcreteTension1d")** = 2*[](#NoResistanceConcreteTension1d.ALWAYS "Link to this definition")
- EXTREME*: [`NoResistanceConcreteTension1d`](#NoResistanceConcreteTension1d "viktor.external.idea_rcs.objects.NoResistanceConcreteTension1d")** = 0*[](#NoResistanceConcreteTension1d.EXTREME "Link to this definition")
* SECTION*: [`NoResistanceConcreteTension1d`](#NoResistanceConcreteTension1d "viktor.external.idea_rcs.objects.NoResistanceConcreteTension1d")** = 1*[](#NoResistanceConcreteTension1d.SECTION "Link to this definition")
## ProjectData[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ProjectData "Direct link to ProjectData")
* *class *viktor.external.idea\_rcs.objects.ProjectData(*\**, *national\_annex=None*, *fatigue\_check=False*, *name=None*, *number=None*, *description=None*, *author=None*, *date=None*, *design\_working\_life=None*)[](#ProjectData "Link to this definition")
Bases: `_OpenObject`
Project data.
* Parameters:
* **name** (`str`) – Project name
New in v14.6.0
* **number** (`str`) – Project number
New in v14.6.0
* **description** (`str`) – Project description
New in v14.6.0
* **author** (`str`) – Author
New in v14.6.0
* **date** (`date`) – Date (default: today)
New in v14.6.0
* **national\_annex** ([`NationalAnnex`](#NationalAnnex "viktor.external.idea_rcs.objects.NationalAnnex")) – national annex (default: No national annex (EN))
* **fatigue\_check** (`bool`) – functionality - fatigue (default: false)
* **design\_working\_life** (`Literal`\[`50`, `75`, `100`]) – Design working life (default: 50)
New in v14.6.0
## ReinfClass[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ReinfClass "Direct link to ReinfClass")
* *class *viktor.external.idea\_rcs.objects.ReinfClass(*\*values*)[](#ReinfClass "Link to this definition")
Bases: `Enum`
* A*: [`ReinfClass`](#ReinfClass "viktor.external.idea_rcs.objects.ReinfClass")** = 0*[](#ReinfClass.A "Link to this definition")
- B*: [`ReinfClass`](#ReinfClass "viktor.external.idea_rcs.objects.ReinfClass")** = 1*[](#ReinfClass.B "Link to this definition")
* C*: [`ReinfClass`](#ReinfClass "viktor.external.idea_rcs.objects.ReinfClass")** = 2*[](#ReinfClass.C "Link to this definition")
## ReinfDiagramType[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ReinfDiagramType "Direct link to ReinfDiagramType")
* *class *viktor.external.idea\_rcs.objects.ReinfDiagramType(*\*values*)[](#ReinfDiagramType "Link to this definition")
Bases: `Enum`
* BILINEAR\_INCLINED*: [`ReinfDiagramType`](#ReinfDiagramType "viktor.external.idea_rcs.objects.ReinfDiagramType")** = 0*[](#ReinfDiagramType.BILINEAR_INCLINED "Link to this definition")
- BILINEAR\_NOT\_INCLINED*: [`ReinfDiagramType`](#ReinfDiagramType "viktor.external.idea_rcs.objects.ReinfDiagramType")** = 1*[](#ReinfDiagramType.BILINEAR_NOT_INCLINED "Link to this definition")
* USER*: [`ReinfDiagramType`](#ReinfDiagramType "viktor.external.idea_rcs.objects.ReinfDiagramType")** = 2*[](#ReinfDiagramType.USER "Link to this definition")
## ReinfFabrication[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ReinfFabrication "Direct link to ReinfFabrication")
* *class *viktor.external.idea\_rcs.objects.ReinfFabrication(*\*values*)[](#ReinfFabrication "Link to this definition")
Bases: `Enum`
* COLD\_WORKED*: [`ReinfFabrication`](#ReinfFabrication "viktor.external.idea_rcs.objects.ReinfFabrication")** = 1*[](#ReinfFabrication.COLD_WORKED "Link to this definition")
- HOT\_ROLLED*: [`ReinfFabrication`](#ReinfFabrication "viktor.external.idea_rcs.objects.ReinfFabrication")** = 0*[](#ReinfFabrication.HOT_ROLLED "Link to this definition")
## ReinfType[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ReinfType "Direct link to ReinfType")
* *class *viktor.external.idea\_rcs.objects.ReinfType(*\*values*)[](#ReinfType "Link to this definition")
Bases: `Enum`
* BARS*: [`ReinfType`](#ReinfType "viktor.external.idea_rcs.objects.ReinfType")** = 0*[](#ReinfType.BARS "Link to this definition")
- DECOILED\_RODS*: [`ReinfType`](#ReinfType "viktor.external.idea_rcs.objects.ReinfType")** = 1*[](#ReinfType.DECOILED_RODS "Link to this definition")
* LATTICE\_GIRDERS*: [`ReinfType`](#ReinfType "viktor.external.idea_rcs.objects.ReinfType")** = 3*[](#ReinfType.LATTICE_GIRDERS "Link to this definition")
- WIRE\_FABRICS*: [`ReinfType`](#ReinfType "viktor.external.idea_rcs.objects.ReinfType")** = 2*[](#ReinfType.WIRE_FABRICS "Link to this definition")
## ReinforcedBar[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ReinforcedBar "Direct link to ReinforcedBar")
* *class *viktor.external.idea\_rcs.objects.ReinforcedBar(*coordinates*, *diameter*, *material*)[](#ReinforcedBar "Link to this definition")
Bases: `_OpenObject`
Do not use this \_\_init\_\_ directly, but create the object by [`ReinforcedCrossSection.create_bar()`](#ReinforcedCrossSection.create_bar "viktor.external.idea_rcs.objects.ReinforcedCrossSection.create_bar").
* *property *coordinates*: Tuple\[float, float]*[](#ReinforcedBar.coordinates "Link to this definition")
- *property *diameter*: float*[](#ReinforcedBar.diameter "Link to this definition")
* *property *material\_id*: int*[](#ReinforcedBar.material_id "Link to this definition")
## ReinforcedCrossSection[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ReinforcedCrossSection "Direct link to ReinforcedCrossSection")
* *class *viktor.external.idea\_rcs.objects.ReinforcedCrossSection(*id\_*, *name*, *cross\_section*, *bars=None*, *stirrups=None*)[](#ReinforcedCrossSection "Link to this definition")
Bases: `_OpenElementId`
Do not use this \_\_init\_\_ directly, but create the object by [`create_reinforced_cross_section()`](https://docs.viktor.ai/sdk/api/external/idea/.md#OpenModel.create_reinforced_cross_section "viktor.external.idea_rcs.idea_rcs.OpenModel.create_reinforced_cross_section").
* *property *bars*: List\[[ReinforcedBar](#ReinforcedBar "viktor.external.idea_rcs.objects.ReinforcedBar")]*[](#ReinforcedCrossSection.bars "Link to this definition")
- create\_bar(*coordinates*, *diameter*, *material*)[](#ReinforcedCrossSection.create_bar "Link to this definition")
Create a reinforced bar on the reinforced cross-section.
* Parameters:
* **coordinates** (`Tuple`\[`float`, `float`]) – (X, Y) coordinate of the bar \[m].
* **diameter** (`float`) – Diameter of the bar \[m].
* **material** ([`MatReinforcement`](#MatReinforcement "viktor.external.idea_rcs.objects.MatReinforcement")) – Reinforcement material (created by [`create_matreinforcement_ec2()`](https://docs.viktor.ai/sdk/api/external/idea/.md#OpenModel.create_matreinforcement_ec2 "viktor.external.idea_rcs.idea_rcs.OpenModel.create_matreinforcement_ec2")).
* Return type:
`None`
* create\_bar\_layer(*\**, *origin*, *diameter*, *material*, *number\_of\_bars*, *delta\_y=None*, *delta\_z=None*)[](#ReinforcedCrossSection.create_bar_layer "Link to this definition")
Create multiple reinforced bars on the reinforced cross-section, positioned on a line.
* Parameters:
* **origin** (`Tuple`\[`float`, `float`]) – Origin point (Y, Z) \[m].
* **diameter** (`float`) – Diameter of the bar \[m].
* **material** ([`MatReinforcement`](#MatReinforcement "viktor.external.idea_rcs.objects.MatReinforcement")) – Reinforcement material (created by [`create_matreinforcement_ec2()`](https://docs.viktor.ai/sdk/api/external/idea/.md#OpenModel.create_matreinforcement_ec2 "viktor.external.idea_rcs.idea_rcs.OpenModel.create_matreinforcement_ec2")).
* **number\_of\_bars** (`int`) – Number of bars (minimum of 2).
* **delta\_y** (`float`) – Distance between origin bar and the last bar in y-direction \[m].
* **delta\_z** (`float`) – Distance between origin bar and the last bar in z-direction \[m].
* Return type:
`None`
- create\_stirrup(*points*, *diameter*, *material*, *distance*, *shear\_check=None*, *torsion\_check=None*, *mandrel\_diameter\_factor=None*, *anchorage\_length=None*)[](#ReinforcedCrossSection.create_stirrup "Link to this definition")
Create a stirrup on the reinforced cross-section.
* Parameters:
* **points** (`Sequence`\[`Tuple`\[`float`, `float`] | `Tuple`\[`Tuple`\[`float`, `float`], `Tuple`\[`float`, `float`]]]) – Sequence of (X, Y) coordinates \[m] of the stirrup vertices, connected by straight line segments. For arc-segments use ((X\_end, Y\_end), (X\_on\_arc, Y\_on\_arc)).
* **diameter** (`float`) – Diameter of the stirrup \[m].
* **material** ([`MatReinforcement`](#MatReinforcement "viktor.external.idea_rcs.objects.MatReinforcement")) – Reinforcement material (created by [`create_matreinforcement_ec2()`](https://docs.viktor.ai/sdk/api/external/idea/.md#OpenModel.create_matreinforcement_ec2 "viktor.external.idea_rcs.idea_rcs.OpenModel.create_matreinforcement_ec2")).
* **distance** (`float`) – Longitudinal distance between stirrups \[m].
* **shear\_check** (`bool`) – Take stirrup into account in shear check (default: False).
* **torsion\_check** (`bool`) – Take stirrup into account in torsion check (default: False).
* **mandrel\_diameter\_factor** (`float`) – Inner diameter of mandrel as multiple of stirrup diameter \[-] (default: 1.0).
* **anchorage\_length** (`float`) – Anchorage length \[m] (default: 0.0).
* Return type:
`None`
* *property *stirrups*: List\[[Stirrup](#Stirrup "viktor.external.idea_rcs.objects.Stirrup")]*[](#ReinforcedCrossSection.stirrups "Link to this definition")
## ReinforcementMaterial[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ReinforcementMaterial "Direct link to ReinforcementMaterial")
* *class *viktor.external.idea\_rcs.objects.ReinforcementMaterial(*\*values*)[](#ReinforcementMaterial "Link to this definition")
Bases: `Enum`
* B\_400A*: [`ReinforcementMaterial`](#ReinforcementMaterial "viktor.external.idea_rcs.objects.ReinforcementMaterial")** = 1*[](#ReinforcementMaterial.B_400A "Link to this definition")
- B\_400B*: [`ReinforcementMaterial`](#ReinforcementMaterial "viktor.external.idea_rcs.objects.ReinforcementMaterial")** = 4*[](#ReinforcementMaterial.B_400B "Link to this definition")
* B\_400C*: [`ReinforcementMaterial`](#ReinforcementMaterial "viktor.external.idea_rcs.objects.ReinforcementMaterial")** = 7*[](#ReinforcementMaterial.B_400C "Link to this definition")
- B\_500A*: [`ReinforcementMaterial`](#ReinforcementMaterial "viktor.external.idea_rcs.objects.ReinforcementMaterial")** = 2*[](#ReinforcementMaterial.B_500A "Link to this definition")
* B\_500B*: [`ReinforcementMaterial`](#ReinforcementMaterial "viktor.external.idea_rcs.objects.ReinforcementMaterial")** = 5*[](#ReinforcementMaterial.B_500B "Link to this definition")
- B\_500C*: [`ReinforcementMaterial`](#ReinforcementMaterial "viktor.external.idea_rcs.objects.ReinforcementMaterial")** = 8*[](#ReinforcementMaterial.B_500C "Link to this definition")
* B\_550A*: [`ReinforcementMaterial`](#ReinforcementMaterial "viktor.external.idea_rcs.objects.ReinforcementMaterial")** = 10*[](#ReinforcementMaterial.B_550A "Link to this definition")
- B\_550B*: [`ReinforcementMaterial`](#ReinforcementMaterial "viktor.external.idea_rcs.objects.ReinforcementMaterial")** = 11*[](#ReinforcementMaterial.B_550B "Link to this definition")
* B\_600A*: [`ReinforcementMaterial`](#ReinforcementMaterial "viktor.external.idea_rcs.objects.ReinforcementMaterial")** = 3*[](#ReinforcementMaterial.B_600A "Link to this definition")
- B\_600B*: [`ReinforcementMaterial`](#ReinforcementMaterial "viktor.external.idea_rcs.objects.ReinforcementMaterial")** = 6*[](#ReinforcementMaterial.B_600B "Link to this definition")
* B\_600C*: [`ReinforcementMaterial`](#ReinforcementMaterial "viktor.external.idea_rcs.objects.ReinforcementMaterial")** = 9*[](#ReinforcementMaterial.B_600C "Link to this definition")
## ResultOfInternalForces[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ResultOfInternalForces "Direct link to ResultOfInternalForces")
* *class *viktor.external.idea\_rcs.objects.ResultOfInternalForces(*N=0.0*, *Qy=0.0*, *Qz=0.0*, *Mx=0.0*, *My=0.0*, *Mz=0.0*)[](#ResultOfInternalForces "Link to this definition")
Bases: `_OpenObject`
Result of internal forces at a certain location.
* Parameters:
* **N** (`float`) – Normal force (default: 0.0).
* **Qy** (`float`) – Shear force in y direction (default: 0.0).
* **Qz** (`float`) – Shear force in z direction (default: 0.0).
* **Mx** (`float`) – Bending moment around x-axis (default: 0.0).
* **My** (`float`) – Bending moment around y-axis (default: 0.0).
* **Mz** (`float`) – Bending moment around z-axis (default: 0.0).
## StandardCheckSection[](https://docs.viktor.ai/sdk/api/external/idea/.md#_StandardCheckSection "Direct link to StandardCheckSection")
* *class *viktor.external.idea\_rcs.objects.StandardCheckSection(*id\_*, *description*, *check\_member*, *reinf\_section*, *extremes=None*)[](#StandardCheckSection "Link to this definition")
Bases: [`CheckSection`](#CheckSection "viktor.external.idea_rcs.objects.CheckSection")
Do not use this \_\_init\_\_ directly, but create the object by [`add_check_section()`](https://docs.viktor.ai/sdk/api/external/idea/.md#OpenModel.add_check_section "viktor.external.idea_rcs.idea_rcs.OpenModel.add_check_section").
## StandardCheckSectionExtreme[](https://docs.viktor.ai/sdk/api/external/idea/.md#_StandardCheckSectionExtreme "Direct link to StandardCheckSectionExtreme")
* *class *viktor.external.idea\_rcs.objects.StandardCheckSectionExtreme(*\**, *accidental=None*, *frequent=None*, *fundamental=None*, *characteristic=None*, *quasi\_permanent=None*, *fatigue=None*, *description*)[](#StandardCheckSectionExtreme "Link to this definition")
Bases: [`CheckSectionExtreme`](#CheckSectionExtreme "viktor.external.idea_rcs.objects.CheckSectionExtreme")
Do not use this \_\_init\_\_ directly, but create the object by [`CheckSection.create_extreme()`](#CheckSection.create_extreme "viktor.external.idea_rcs.objects.CheckSection.create_extreme").
## Stirrup[](https://docs.viktor.ai/sdk/api/external/idea/.md#_Stirrup "Direct link to Stirrup")
* *class *viktor.external.idea\_rcs.objects.Stirrup(*points*, *diameter*, *material*, *distance*, *shear\_check=None*, *torsion\_check=None*, *mandrel\_diameter\_factor=None*, *anchorage\_length=None*)[](#Stirrup "Link to this definition")
Bases: `_OpenObject`
Do not use this \_\_init\_\_ directly, but create the object by [`ReinforcedCrossSection.create_stirrup()`](#ReinforcedCrossSection.create_stirrup "viktor.external.idea_rcs.objects.ReinforcedCrossSection.create_stirrup").
* *property *anchorage\_length*: float*[](#Stirrup.anchorage_length "Link to this definition")
- *property *mandrel\_diameter\_factor*: float*[](#Stirrup.mandrel_diameter_factor "Link to this definition")
* *property *material\_id*: int*[](#Stirrup.material_id "Link to this definition")
- *property *points*: Sequence\[Tuple\[float, float] | Tuple\[Tuple\[float, float], Tuple\[float, float]]]*[](#Stirrup.points "Link to this definition")
* *property *shear\_check*: bool*[](#Stirrup.shear_check "Link to this definition")
- *property *torsion\_check*: bool*[](#Stirrup.torsion_check "Link to this definition")
## ThermalState[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ThermalState "Direct link to ThermalState")
* *class *viktor.external.idea\_rcs.objects.ThermalState(*expansion=ThermalStateType.NONE*, *conductivity=ThermalStateType.NONE*, *specific\_heat=ThermalStateType.NONE*, *stress\_strain=ThermalStateType.NONE*, *strain=ThermalStateType.NONE*)[](#ThermalState "Link to this definition")
Bases: `_OpenObject`
Collection of thermal states for expansion, conductivity, specific heat, stress-strain and strain.
* Parameters:
* **expansion** ([`ThermalStateType`](#ThermalStateType "viktor.external.idea_rcs.objects.ThermalStateType")) – state of thermal expansion curvature.
* **conductivity** ([`ThermalStateType`](#ThermalStateType "viktor.external.idea_rcs.objects.ThermalStateType")) – state of thermal conductivity curvature.
* **specific\_heat** ([`ThermalStateType`](#ThermalStateType "viktor.external.idea_rcs.objects.ThermalStateType")) – state of thermal specific heat curvature.
* **stress\_strain** ([`ThermalStateType`](#ThermalStateType "viktor.external.idea_rcs.objects.ThermalStateType")) – state of thermal specific stress-strain curvature.
* **strain** ([`ThermalStateType`](#ThermalStateType "viktor.external.idea_rcs.objects.ThermalStateType")) – state of thermal strain curvature.
## ThermalStateType[](https://docs.viktor.ai/sdk/api/external/idea/.md#_ThermalStateType "Direct link to ThermalStateType")
* *class *viktor.external.idea\_rcs.objects.ThermalStateType(*\*values*)[](#ThermalStateType "Link to this definition")
Bases: `Enum`
* CODE*: [`ThermalStateType`](#ThermalStateType "viktor.external.idea_rcs.objects.ThermalStateType")** = 1*[](#ThermalStateType.CODE "Link to this definition")
- NONE*: [`ThermalStateType`](#ThermalStateType "viktor.external.idea_rcs.objects.ThermalStateType")** = 0*[](#ThermalStateType.NONE "Link to this definition")
* USER*: [`ThermalStateType`](#ThermalStateType "viktor.external.idea_rcs.objects.ThermalStateType")** = 5*[](#ThermalStateType.USER "Link to this definition")
## TwoWaySlabType[](https://docs.viktor.ai/sdk/api/external/idea/.md#_TwoWaySlabType "Direct link to TwoWaySlabType")
* *class *viktor.external.idea\_rcs.objects.TwoWaySlabType(*\*values*)[](#TwoWaySlabType "Link to this definition")
Bases: `Enum`
* DEEP\_BEAM*: [`TwoWaySlabType`](#TwoWaySlabType "viktor.external.idea_rcs.objects.TwoWaySlabType")** = 2*[](#TwoWaySlabType.DEEP_BEAM "Link to this definition")
- SHELL\_AS\_PLATE*: [`TwoWaySlabType`](#TwoWaySlabType "viktor.external.idea_rcs.objects.TwoWaySlabType")** = 3*[](#TwoWaySlabType.SHELL_AS_PLATE "Link to this definition")
* SHELL\_AS\_WALL*: [`TwoWaySlabType`](#TwoWaySlabType "viktor.external.idea_rcs.objects.TwoWaySlabType")** = 4*[](#TwoWaySlabType.SHELL_AS_WALL "Link to this definition")
- SLAB*: [`TwoWaySlabType`](#TwoWaySlabType "viktor.external.idea_rcs.objects.TwoWaySlabType")** = 0*[](#TwoWaySlabType.SLAB "Link to this definition")
* WALL*: [`TwoWaySlabType`](#TwoWaySlabType "viktor.external.idea_rcs.objects.TwoWaySlabType")** = 1*[](#TwoWaySlabType.WALL "Link to this definition")
## TypeSLSCalculation[](https://docs.viktor.ai/sdk/api/external/idea/.md#_TypeSLSCalculation "Direct link to TypeSLSCalculation")
* *class *viktor.external.idea\_rcs.objects.TypeSLSCalculation(*\*values*)[](#TypeSLSCalculation "Link to this definition")
Bases: `Enum`
* BOTH*: [`TypeSLSCalculation`](#TypeSLSCalculation "viktor.external.idea_rcs.objects.TypeSLSCalculation")** = 0*[](#TypeSLSCalculation.BOTH "Link to this definition")
- LONG\_TERM*: [`TypeSLSCalculation`](#TypeSLSCalculation "viktor.external.idea_rcs.objects.TypeSLSCalculation")** = 2*[](#TypeSLSCalculation.LONG_TERM "Link to this definition")
* SHORT\_TERM*: [`TypeSLSCalculation`](#TypeSLSCalculation "viktor.external.idea_rcs.objects.TypeSLSCalculation")** = 1*[](#TypeSLSCalculation.SHORT_TERM "Link to this definition")
---
# viktor.external.matlab
## MatlabAnalysis[](https://docs.viktor.ai/sdk/api/external/matlab/.md#_MatlabAnalysis "Direct link to MatlabAnalysis")
* *class *viktor.external.matlab.MatlabAnalysis(*files=None*, *executable\_key='matlab'*, *output\_filenames=None*)[](#MatlabAnalysis "Link to this definition")
Bases: [`GenericAnalysis`](https://docs.viktor.ai/sdk/api/external/generic/.md#GenericAnalysis "viktor.external.generic.GenericAnalysis")
New in 14.17.0
MatlabAnalysis can be used to evaluate a matlab script on third-party infrastructure. The script is expected to be blocking, i.e. if the executable is invoked from command prompt, it should wait until the script is finished. For security purposes the executable that should be called has to be defined in the configuration file of the worker.
Usage:
```
files = [
('input1.txt', file1),
('input2.txt', file2)
]
analysis = MatlabAnalysis(files=files, output_filenames=["output.txt"])
analysis.execute(timeout=60)
output_file = analysis.get_output_file("output.txt")
```
Exceptions which can be raised during calculation:
> * [`viktor.errors.LicenseError`](https://docs.viktor.ai/sdk/api/errors/.md#LicenseError "viktor.errors.LicenseError"): no license available
>
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
* **files** (`List`\[`Tuple`\[`str`, `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]] | `None`) – Files that are transferred to the working directory on the server. Each file is a tuple containing the content and the filename which is used to save on the infrastructure.
* **executable\_key** (`str`) – The key of the executable that needs to be evaluated. This key should be present in the configuration file of the worker, defaults to run\_matlab.
* **output\_filenames** (`List`\[`str`]) – A list of filenames (including extension) that are to be transferred back to the SDK. This filename is relative to the working directory.
* Raises:
**ValueError** – when no attribute is included in call.
---
# viktor.external.plaxis
## PlaxisAnalysis[](https://docs.viktor.ai/sdk/api/external/plaxis/.md#_PlaxisAnalysis "Direct link to PlaxisAnalysis")
* *class *viktor.external.plaxis.PlaxisAnalysis(*script=None*, *script\_key=''*, *files=None*, *output\_filenames=None*)[](#PlaxisAnalysis "Link to this definition")
Bases: [`PythonAnalysis`](https://docs.viktor.ai/sdk/api/external/python/.md#PythonAnalysis "viktor.external.python.PythonAnalysis")
New in 14.17.0
PlaxisAnalysis can be used to evaluate a plaxis-python script on third-party infrastructure. The script is expected to be blocking, i.e. if the script is invoked from command prompt, it should wait until the executable is finished. The default behaviour, is that the python script is defined within the app and send to the worker to be executed on third-party infrastructure. If desired (due to security considerations) the worker can be configured to only run local scripts. These scripts must be defined the in worker configuration file and can be selected through the script\_key.
Usage:
```
script = vkt.File.from_path(Path(__file__).parent / "run_plaxis.py")
files = [
('input1.txt', file1),
]
analysis = PlaxisAnalysis(script=script, files=files, output_filenames=["output.txt"])
analysis.execute(timeout=60)
output_file = analysis.get_output_file("output.txt")
```
Exceptions which can be raised during calculation:
> * [`viktor.errors.LicenseError`](https://docs.viktor.ai/sdk/api/errors/.md#LicenseError "viktor.errors.LicenseError"): no license available
>
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
* **script** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Script file that is transferred to the working directory on the server.
* **script\_key** (`str`) – The key of the script that needs to be run. Only use this when the worker is configured to run local scripts. This key should be present in the configuration file of the worker.
* **files** (`List`\[`Tuple`\[`str`, `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]]) – Additional files that are transferred to the working directory on the server. Each file is a tuple containing the content and the filename which is used to save on the infrastructure.
* **output\_filenames** (`List`\[`str`]) – A list of filenames (including extension) that are to be transferred back to the app. This filename is relative to the working directory.
Either one of ‘script’ or ‘script\_key’ should be defined.
* Raises:
**ValueError** – when neither ‘script’ or ‘script\_key’ is included OR when both are included.
---
# viktor.external.python
## PythonAnalysis[](https://docs.viktor.ai/sdk/api/external/python/.md#_PythonAnalysis "Direct link to PythonAnalysis")
* *class *viktor.external.python.PythonAnalysis(*script=None*, *script\_key=''*, *files=None*, *output\_filenames=None*)[](#PythonAnalysis "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
New in 14.17.0
PythonAnalysis can be used to evaluate a python script on third-party infrastructure. The script is expected to be blocking, i.e. if the script is invoked from command prompt, it should wait until the executable is finished. The default behaviour, is that the python script is defined within the app and send to the worker to be executed on third-party infrastructure. If desired (due to security considerations) the worker can be configured to only run local scripts. These scripts must be defined the in worker configuration file and can be selected through the script\_key.
Usage:
```
script = vkt.File.from_path(Path(__file__).parent / "my_script.py")
files = [
('input1.txt', file1),
]
python_analysis = PythonAnalysis(script=script, files=files, output_filenames=["output.txt"])
python_analysis.execute(timeout=60)
output_file = python_analysis.get_output_file("output.txt")
```
Exceptions which can be raised during calculation:
> * [`viktor.errors.LicenseError`](https://docs.viktor.ai/sdk/api/errors/.md#LicenseError "viktor.errors.LicenseError"): no license available
>
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
* **script** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Script file that is transferred to the working directory on the server.
* **script\_key** (`str`) – The key of the script that needs to be run. Only use this when the worker is configured to run local scripts. This key should be present in the configuration file of the worker.
* **files** (`List`\[`Tuple`\[`str`, `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]]) – Additional files that are transferred to the working directory on the server. Each file is a tuple containing the content and the filename which is used to save on the infrastructure.
* **output\_filenames** (`List`\[`str`]) – A list of filenames (including extension) that are to be transferred back to the app. This filename is relative to the working directory.
Either one of ‘script’ or ‘script\_key’ should be defined.
* Raises:
**ValueError** – when neither ‘script’ or ‘script\_key’ is included OR when both are included.
- get\_output\_file(*filename*)[](#PythonAnalysis.get_output_file "Link to this definition")
Method can be used to retrieve the results generated by running an external analysis. Call method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") first and [`get_output_file()`](#PythonAnalysis.get_output_file "viktor.external.python.PythonAnalysis.get_output_file") afterwards.
* Parameters:
**filename** (`str`) – The name of the file (including extension) that you want to get.
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
---
# viktor.external.revit
## RevitAnalysis[](https://docs.viktor.ai/sdk/api/external/revit/.md#_RevitAnalysis "Direct link to RevitAnalysis")
* *class *viktor.external.revit.RevitAnalysis(*script=None*, *script\_key=''*, *files=None*, *output\_filenames=None*)[](#RevitAnalysis "Link to this definition")
Bases: [`PythonAnalysis`](https://docs.viktor.ai/sdk/api/external/python/.md#PythonAnalysis "viktor.external.python.PythonAnalysis")
New in 14.17.0
RevitAnalysis can be used to evaluate a revit-python script on third-party infrastructure. The script is expected to be blocking, i.e. if the script is invoked from command prompt, it should wait until the executable is finished. The default behaviour, is that the python script is defined within the app and send to the worker to be executed on third-party infrastructure. If desired (due to security considerations) the worker can be configured to only run local scripts. These scripts must be defined the in worker configuration file and can be selected through the script\_key.
Usage:
```
script = vkt.File.from_path(Path(__file__).parent / "run_revit.py")
files = [
('input1.txt', file1),
('input2.txt', file2)
]
analysis = RevitAnalysis(script=script, files=files, output_filenames=["output.txt"])
analysis.execute(timeout=60)
output_file = analysis.get_output_file("output.txt", as_file=True)
```
Exceptions which can be raised during calculation:
> * [`viktor.errors.LicenseError`](https://docs.viktor.ai/sdk/api/errors/.md#LicenseError "viktor.errors.LicenseError"): no license available
>
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
* **script** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Script file that is transferred to the working directory on the server.
* **script\_key** (`str`) – The key of the script that needs to be run. Only use this when the worker is configured to run local scripts. This key should be present in the configuration file of the worker.
* **files** (`List`\[`Tuple`\[`str`, `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]]) – Additional files that are transferred to the working directory on the server. Each file is a tuple containing the content and the filename which is used to save on the infrastructure.
* **output\_filenames** (`List`\[`str`]) – A list of filenames (including extension) that are to be transferred back to the app. This filename is relative to the working directory.
Either one of ‘script’ or ‘script\_key’ should be defined.
* Raises:
**ValueError** – when neither ‘script’ or ‘script\_key’ is included OR when both are included.
---
# viktor.external.rfem
## CopyNodalLoadAction[](https://docs.viktor.ai/sdk/api/external/rfem/.md#_CopyNodalLoadAction "Direct link to CopyNodalLoadAction")
* *class *viktor.external.rfem.CopyNodalLoadAction(*copy\_from\_to*, *loading\_type=LoadingType.LOAD\_CASE*, *\**, *factor=1.0*)[](#CopyNodalLoadAction "Link to this definition")
Bases: [`RFEMAction`](#RFEMAction "viktor.external.rfem.RFEMAction")
Copy the nodal load from one load case to the other, applying a factor on the magnitude.
* Note: only the 1st nodal load is copied from and to each load case/combination, other loads are ignored. Make
sure that at least 1 such nodal load exists in both the copy-from and copy-to load cases/combinations.
- Parameters:
* **copy\_from\_to** (`List`\[`Tuple`\[`int`, `int`]]) – a list of load case/combination numbers to copy (from, to)
* **loading\_type** ([`LoadingType`](#LoadingType "viktor.external.rfem.LoadingType")) – defines if integers in ‘copy\_from\_to’ must be interpreted as load case (LOAD\_CASE) or load combination (LOAD\_COMBINATION) numbers (default: LOAD\_CASE)
* **factor** (`float`) – factor to be applied on the nodal load magnitude (default: 1.0)
## EnergyOptimizationAction[](https://docs.viktor.ai/sdk/api/external/rfem/.md#_EnergyOptimizationAction "Direct link to EnergyOptimizationAction")
* *class *viktor.external.rfem.EnergyOptimizationAction(*load\_cases*, *loading\_type=LoadingType.LOAD\_CASE*, *\**, *goal*, *accuracy*)[](#EnergyOptimizationAction "Link to this definition")
Bases: [`RFEMAction`](#RFEMAction "viktor.external.rfem.RFEMAction")
* Performs an iterative analysis (consisting of a series of RFEM analyses) to solve for the magnitude of the
1st nodal load, such that the energy at that node (approximately) equals the ‘goal’. The iteration comes to a finish if the change in displacement at the node is lower than the specified ‘accuracy’. This is done for each of the load cases specified.
- Parameters:
* **load\_cases** (`List`\[`int`]) – a list of load cases/combinations to do a energy optimization calculation for. None for all load cases/combinations (default: None).
* **loading\_type** ([`LoadingType`](#LoadingType "viktor.external.rfem.LoadingType")) – defines if integers in ‘load\_cases’ must be interpreted as load case (LOAD\_CASE) or load combination (LOAD\_COMBINATION) numbers (default: LOAD\_CASE)
* **goal** (`float`) – energy level \[Nm] for which the calculation tries to solve the 1st nodal load. Same goal is used for all load cases/combinations.
* **accuracy** (`float`) – change in displacement \[m] of the node corresponding to the 1st nodal load at which the iteration will successfully return. A lower accuracy in general means more iterations. Same accuracy is used for all load cases/combinations.
## LoadingType[](https://docs.viktor.ai/sdk/api/external/rfem/.md#_LoadingType "Direct link to LoadingType")
* *class *viktor.external.rfem.LoadingType(*\*values*)[](#LoadingType "Link to this definition")
Bases: `Enum`
* LOAD\_CASE*: [`LoadingType`](#LoadingType "viktor.external.rfem.LoadingType")** = 1*[](#LoadingType.LOAD_CASE "Link to this definition")
- LOAD\_COMBINATION*: [`LoadingType`](#LoadingType "viktor.external.rfem.LoadingType")** = 2*[](#LoadingType.LOAD_COMBINATION "Link to this definition")
## RFEMAction[](https://docs.viktor.ai/sdk/api/external/rfem/.md#_RFEMAction "Direct link to RFEMAction")
* *class *viktor.external.rfem.RFEMAction(*id\_*)[](#RFEMAction "Link to this definition")
Bases: `ABC`
Abstract base class of all RFEM action objects.
## RFEMAnalysis[](https://docs.viktor.ai/sdk/api/external/rfem/.md#_RFEMAnalysis "Direct link to RFEMAnalysis")
* *class *viktor.external.rfem.RFEMAnalysis(*rfx\_file*, *actions*)[](#RFEMAnalysis "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
RFEMAnalysis can be used to perform an analysis with RFEM on third-party infrastructure. To start an analysis call the method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"), with an appropriate timeout (in seconds). To retrieve the model call [`get_model()`](#RFEMAnalysis.get_model "viktor.external.rfem.RFEMAnalysis.get_model") and for results call [`get_result()`](#RFEMAnalysis.get_result "viktor.external.rfem.RFEMAnalysis.get_result") for the desired load combination (only after [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute")).
Exceptions which can be raised during calculation:
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
Example usage:
```
# SLS
sls_cases = [1, 2, 3]
sls_optimization = EnergyOptimizationAction(sls_cases, goal=10000, accuracy=0.1) # goal = 10 kNm, accuracy = 10 cm
# ALS
als_cases = [4, 5, 6]
als_optimization = EnergyOptimizationAction(als_cases, goal=15000, accuracy=0.1) # goal = 15 kNm, accuracy = 10 cm
# ULS
uls_cases = [7, 8, 9]
uls_creation = CopyNodalLoadAction(list(zip(sls_cases, uls_cases)), factor=1.5) # ULS = SLS x 1.5
# Write action
write_result_action = WriteResultsAction(sls_cases + als_cases + uls_cases) # or can be left empty = all cases
actions = [sls_optimization, als_optimization, uls_creation, write_result_action]
rfem_analysis = RFEMAnalysis(rfx_file=my_rfx_file, actions=actions) # my_rfx_file contains the desired load cases and nodal loads
rfem_analysis.execute(timeout=300)
model = rfem_analysis.get_model()
result_lc1 = rfem_analysis.get_result(1)
result_lc2 = rfem_analysis.get_result(2)
```
* Parameters:
* **rfx\_file** (`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – RFEM input file
* **actions** (`List`\[[`RFEMAction`](#RFEMAction "viktor.external.rfem.RFEMAction")]) –
list of actions to be performed sequentially. Possible actions are:
* [`EnergyOptimizationAction`](#EnergyOptimizationAction "viktor.external.rfem.EnergyOptimizationAction")
* [`CopyNodalLoadAction`](#CopyNodalLoadAction "viktor.external.rfem.CopyNodalLoadAction")
* [`WriteResultsAction`](#WriteResultsAction "viktor.external.rfem.WriteResultsAction") (required for [`get_result()`](#RFEMAnalysis.get_result "viktor.external.rfem.RFEMAnalysis.get_result"))
- get\_model(*\**, *as\_file=False*)[](#RFEMAnalysis.get_model "Link to this definition")
Get the model that is returned after the RFEM analysis.
* Parameters:
**as\_file** (`bool`) – Return as BytesIO (default) or File
New in v13.5.0
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* get\_result(*load\_case*, *\**, *as\_file=False*)[](#RFEMAnalysis.get_result "Link to this definition")
Get the nodal deformations (X, Y, Z) \[m] and member internal forces (Location \[m], My and Mz \[Nm], Fy and Fz \[N]) for a certain load case/combination number.
* Parameters:
* **load\_case** (`int`) – number of the load case/combination to get the result for. A ‘WriteResultsAction’ must have been performed on the corresponding load case/combination to be available.
* **as\_file** (`bool`) – Return as BytesIO (default) or File
New in v13.5.0
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
## WriteResultsAction[](https://docs.viktor.ai/sdk/api/external/rfem/.md#_WriteResultsAction "Direct link to WriteResultsAction")
* *class *viktor.external.rfem.WriteResultsAction(*load\_cases=None*, *loading\_type=LoadingType.LOAD\_CASE*)[](#WriteResultsAction "Link to this definition")
Bases: [`RFEMAction`](#RFEMAction "viktor.external.rfem.RFEMAction")
Write all nodal deformations (X, Y, Z) and member internal forces (Location, My, Mz, Fy, Fz) for the model in current state, for each of the load cases/combinations requested, so that it is available in [`get_result()`](#RFEMAnalysis.get_result "viktor.external.rfem.RFEMAnalysis.get_result").
* Parameters:
* **load\_cases** (`List`\[`int`]) – a list of load cases/combinations to write the results for. None for all load cases/combinations (default: None).
* **loading\_type** ([`LoadingType`](#LoadingType "viktor.external.rfem.LoadingType")) – defines if integers in ‘load\_cases’ must be interpreted as load case (LOAD\_CASE) or load combination (LOAD\_COMBINATION) numbers (default: LOAD\_CASE)
---
# viktor.external.robot
## RobotAnalysis[](https://docs.viktor.ai/sdk/api/external/robot/.md#_RobotAnalysis "Direct link to RobotAnalysis")
* *class *viktor.external.robot.RobotAnalysis(*input\_file*, *\**, *return\_model=True*, *return\_results=True*, *requested\_results=None*)[](#RobotAnalysis "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
Perform an analysis using Autodesk Robot on a third-party worker. To start an analysis call the method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"), with an appropriate timeout (in seconds).
To retrieve the results call the method [`get_results()`](#RobotAnalysis.get_results "viktor.external.robot.RobotAnalysis.get_results"), after [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"). The evaluated model file can be retrieved by calling [`get_model_file()`](#RobotAnalysis.get_model_file "viktor.external.robot.RobotAnalysis.get_model_file"). Usage:
```
robot_analysis = RobotAnalysis(input_file, return_model=True)
robot_analysis.execute(timeout=10)
results = robot_analysis.get_results()
model_file = robot_analysis.get_model_file()
```
Exceptions which can be raised during calculation:
> * [`ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
* **input\_file** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Robot input file in STR format
* **return\_results** (`bool`) – If True, an analysis will be run and the result file is returned.
* **return\_model** (`bool`) – If True, the model file (.rtd) is returned.
* **requested\_results** (`dict`) – (optional) Dictionary containing the requested results. If requested\_results is None and return\_results is True, the worker will return all results. For the allowed components see the Autodesk Robot SDK documentation. The dictionary should be formatted as follows:
```
{
"bar_forces": List[string],
"bar_displacements": List[string],
"bar_stresses": List[string],
"bar_deflections": List[string],
"node_reactions": List[string],
"node_displacements": List[string],
}
```
* get\_model\_file()[](#RobotAnalysis.get_model_file "Link to this definition")
Retrieve the model file (only if return\_model = True) in .rtd format.
[`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") must be called first.
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
- get\_results()[](#RobotAnalysis.get_results "Link to this definition")
Retrieve the results (only if return\_results = True). `execute()` must be called first.
The format of the returned dictionary is:
```
{
'bar_forces': {
'1': { # case id
'1': { # bar id
'0.000000': { # positions
'FX': 26070.462297973572 # components
}
}
}
},
'bar_displacements': {
'1': {
'1': {
'0.000000': {
'RX': 0
}
}
}
},
'bar_stresses': {
'1': {
'1': {
'0.000000': {
'FXSX': 19750.350225737555
}
}
}
},
'bar_deflections': {
'1': {
'1': {
'0.000000': {
'PosUX': 0
}
}
}
},
'node_reactions': {
'1': { # case id
'1': { # node id
'FX': -9.89530235528946e-09 # components
}
}
},
'node_displacements': {
'1': {
'1': {
'RX': 0
}
}
}
}
```
* Return type:
`dict` | `None`
---
# viktor.external.sap2000
## SAP2000Analysis[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_SAP2000Analysis "Direct link to SAP2000Analysis")
* *class *viktor.external.sap2000.sap2000.SAP2000Analysis(*script=None*, *script\_key=''*, *files=None*, *output\_filenames=None*)[](#SAP2000Analysis "Link to this definition")
Bases: [`PythonAnalysis`](https://docs.viktor.ai/sdk/api/external/python/.md#PythonAnalysis "viktor.external.python.PythonAnalysis")
New in 14.17.0
SAP2000Analysis can be used to evaluate a SAP2000-python script on third-party infrastructure. The script is expected to be blocking, i.e. if the script is invoked from command prompt, it should wait until the executable is finished. The default behaviour, is that the python script is defined within the app and send to the worker to be executed on third-party infrastructure. If desired (due to security considerations) the worker can be configured to only run local scripts. These scripts must be defined the in worker configuration file and can be selected through the script\_key.
Usage:
```
script = vkt.File.from_path(Path(__file__).parent / "run_sap2000.py")
files = [
('input1.txt', file1),
]
analysis = SAP2000Analysis(script=script, files=files, output_filenames=["output.txt"])
analysis.execute(timeout=60)
output_file = analysis.get_output_file("output.txt")
```
Exceptions which can be raised during calculation:
> * [`viktor.errors.LicenseError`](https://docs.viktor.ai/sdk/api/errors/.md#LicenseError "viktor.errors.LicenseError"): no license available
>
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
* **script** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Script file that is transferred to the working directory on the server.
* **script\_key** (`str`) – The key of the script that needs to be run. Only use this when the worker is configured to run local scripts. This key should be present in the configuration file of the worker.
* **files** (`List`\[`Tuple`\[`str`, `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]]) – Additional files that are transferred to the working directory on the server. Each file is a tuple containing the content and the filename which is used to save on the infrastructure.
* **output\_filenames** (`List`\[`str`]) – A list of filenames (including extension) that are to be transferred back to the app. This filename is relative to the working directory.
Either one of ‘script’ or ‘script\_key’ should be defined.
* Raises:
**ValueError** – when neither ‘script’ or ‘script\_key’ is included OR when both are included.
## SAP2000Connection[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_SAP2000Connection "Direct link to SAP2000Connection")
* *class *viktor.external.sap2000.sap2000.SAP2000Connection(*session*)[](#SAP2000Connection "Link to this definition")
Bases: `_CSIConnection`
New in 14.32.0
The `sap` object returned by [`connect()`](#connect "viktor.external.sap2000.sap2000.connect") or [`attach()`](#attach "viktor.external.sap2000.sap2000.attach"), used to control SAP2000 through the SAP2000 OAPI. Use the default OAPI calls with comtypes syntax. Each call returns the OAPI result: the status code, or `[*out_params, status]` when the call has output parameters.
The SDK sends calls to the worker in chunks. A result is read when your code first uses its value: in `==`, `if`, `float()`, `int()`, `str()`, `print()` or a loop. A failed call raises [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError") at that read, with the call and your line. Two things do not read a result: passing it to a later call, and unpacking it into names. So the example below sends all three calls in one chunk. `result is None` is always `False` on an unread result; use `== None`. Pass `defer=False` to [`connect()`](#connect "viktor.external.sap2000.sap2000.connect") / [`attach()`](#attach "viktor.external.sap2000.sap2000.attach") to send each call on its own.
```
name, ret = sap.FrameObj.AddByCoord(0, 0, 0, 6, 0, 0, "", "Default", "Beam", "Global")
sap.FrameObj.SetSection(name, "W12X26")
```
See [`batch()`](#SAP2000Connection.batch "viktor.external.sap2000.sap2000.SAP2000Connection.batch") when one loop makes more than a few hundred calls.
Warning
Do not instantiate this class directly; obtain it from [`connect()`](#connect "viktor.external.sap2000.sap2000.connect") or [`attach()`](#attach "viktor.external.sap2000.sap2000.attach").
* batch()[](#SAP2000Connection.batch "Link to this definition")
New in v14.37.0
Send all calls of the block to the worker as one job when the block ends. Without the block the SDK sends calls in chunks of a few hundred, each one round trip. The gain grows with the size of the block; below a few hundred calls it changes nothing. You cannot read a result inside the block: a read raises `RuntimeError`. So do `isinstance()`, `print()`, `str()` and `repr()` on a result. Read the results after the block. The block runs as one job under the session `timeout` (300 s by default). For a very large block, increase `timeout` in [`connect()`](#connect "viktor.external.sap2000.sap2000.connect") / [`attach()`](#attach "viktor.external.sap2000.sap2000.attach").
```
with sap.batch():
for x, y in points: # 5000 points
name, ret = sap.FrameObj.AddByCoord(x, y, 0, x, y, 3, "", "W12X26")
sap.FrameObj.SetGroupAssign(name, "Columns")
# 10000 calls went to the worker in one job
```
Needs a deferred connection (`defer=True`). Blocks cannot be nested. Calls made before the block are sent when the block starts.
* Return type:
`ContextManager`\[`None`, `bool` | `None`]
- *property *application*: Any*[](#SAP2000Connection.application "Link to this definition")
Call OAPI members on the top-level application object rather than the SapModel.
Example:
```
sap.application.Hide()
version = sap.application.GetOAPIVersionNumber()
```
## attach[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_attach "Direct link to attach")
* viktor.external.sap2000.sap2000.attach(*timeout=300*, *defer=True*)[](#attach "Link to this definition")
New in 14.33.0
Attach to the SAP2000 instance already running on the worker machine and control it through the SAP2000 OAPI, like [`connect()`](#connect "viktor.external.sap2000.sap2000.connect"), but without starting a fresh instance. Typical use: a personal worker on the engineer’s own machine, so the app acts on the model they have open on screen.
Warning
This is a BETA feature.
Requires a worker of kind `sap2000connect`. Declare it in your [viktor.config.toml](https://docs.viktor.ai/docs/create-apps/references/viktor-config-toml/):
```
worker_integrations = [
"sap2000connect",
]
```
Usage:
```
import viktor as vkt
with vkt.sap2000.attach(timeout=60) as sap:
[pt_i, pt_j, ret] = sap.FrameObj.GetPoints("B1", "", "") # reads the model open in SAP2000
ret = sap.View.RefreshView() # changes show in the user's window
```
Closing the session detaches without exiting the instance. The app can change the attached model but not save it in place: `File.Save` requires a relative filename and writes into the session directory.
Note
The OAPI members you call on `sap` (e.g. `sap.FrameObj.AddByCoord`) mirror the SAP2000 OAPI and are surfaced through IDE autocomplete rather than listed here. Look them up in the SAP2000 OAPI reference: the CSI OAPI help file (`.chm`) in your SAP2000 installation directory (e.g. `C:/Program Files/Computers and Structures/SAP2000 /`), or on CSI’s [developer site](https://www.csiamerica.com/developer).
* Parameters:
* **timeout** (`int`) – timeout in seconds for one chunk of calls; also bounds the attach itself, so keep it at or above the platform’s 30 second bind window.
* **defer** (`bool`) – queue calls and send them to the worker in chunks; a result is fetched when your code first reads it (default: True). False sends every call at once and returns plain values.
New in v14.37.0
* Return type:
[`SAP2000Connection`](#SAP2000Connection "viktor.external.sap2000.sap2000.SAP2000Connection")
Exceptions which can be raised during execution:
> * [`viktor.errors.WorkerSessionAttachError`](https://docs.viktor.ai/sdk/api/errors/.md#WorkerSessionAttachError "viktor.errors.WorkerSessionAttachError"): the attach failed, e.g. no SAP2000 is running on the worker machine, or the running instance is a different product. `reason` names the cause; that set is open.
>
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error during a call. Error message provides more information.
>
> * [`viktor.errors.WorkerSessionError`](https://docs.viktor.ai/sdk/api/errors/.md#WorkerSessionError "viktor.errors.WorkerSessionError"): the session was lost after attaching (e.g. the user closed the SAP2000 instance). The session cannot be resumed; start a new one to continue.
>
> * TimeoutError: a chunk of calls took longer than `timeout`
## connect[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_connect "Direct link to connect")
* viktor.external.sap2000.sap2000.connect(*timeout=300*, *defer=True*)[](#connect "Link to this definition")
New in 14.32.0
Connect to SAP2000 running on a connected VIKTOR worker and control it through the SAP2000 OAPI directly from your app, as shown below. Always starts a fresh, empty instance; to act on the instance already running on the worker machine instead, use [`attach()`](#attach "viktor.external.sap2000.sap2000.attach").
Warning
This is a BETA feature.
Requires a worker of kind `sap2000connect`. Declare it in your [viktor.config.toml](https://docs.viktor.ai/docs/create-apps/references/viktor-config-toml/):
```
worker_integrations = [
"sap2000connect",
]
```
Usage:
```
import viktor as vkt
with vkt.sap2000.connect(timeout=60) as sap:
ret = sap.InitializeNewModel(vkt.sap2000.eUnits.kN_m_C) # a call returns the status code
[beam_name, ret] = sap.FrameObj.AddByCoord(0, 0, 0, 6, 0, 0, "", "Default", "Beam", "Global")
[pt_i, pt_j, ret] = sap.FrameObj.GetPoints(beam_name, "", "") # ...or out-params, then status
sap.File.Save("model.sdb") # use a relative filename, not an absolute path
```
Note
The OAPI members you call on `sap` (e.g. `sap.FrameObj.AddByCoord`) mirror the SAP2000 OAPI and are surfaced through IDE autocomplete rather than listed here. Look them up in the SAP2000 OAPI reference: the CSI OAPI help file (`.chm`) in your SAP2000 installation directory (e.g. `C:/Program Files/Computers and Structures/SAP2000 /`), or on CSI’s [developer site](https://www.csiamerica.com/developer).
* Parameters:
* **timeout** (`int`) – timeout in seconds for one chunk of calls.
* **defer** (`bool`) – queue calls and send them to the worker in chunks; a result is fetched when your code first reads it (default: True). False sends every call at once and returns plain values.
New in v14.37.0
* Return type:
[`SAP2000Connection`](#SAP2000Connection "viktor.external.sap2000.sap2000.SAP2000Connection")
Exceptions which can be raised during execution:
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information. A host whose SAP2000 license is not activated also fails this way: SAP2000 blocks on an interactive sign-in dialog that the worker cannot answer, so starting it up times out.
>
> * [`viktor.errors.WorkerSessionError`](https://docs.viktor.ai/sdk/api/errors/.md#WorkerSessionError "viktor.errors.WorkerSessionError"): the session was lost (e.g. its SAP2000 instance was torn down). The session cannot be resumed; start a new one to continue.
>
> * TimeoutError: a chunk of calls took longer than `timeout`
SAP2000 enum values, generated from SAP2000 27.1.0 (Ultimate).
## e2DFrameType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_e2DFrameType "Direct link to e2DFrameType")
* *class *viktor.external.sap2000.enums.e2DFrameType(*\*values*)[](#e2DFrameType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `e2DFrameType` values, mirroring the product API’s names so code reads like its docs.
* ConcentricBraced* = 1*[](#e2DFrameType.ConcentricBraced "Link to this definition")
- EccentricBraced* = 2*[](#e2DFrameType.EccentricBraced "Link to this definition")
* PortalFrame* = 0*[](#e2DFrameType.PortalFrame "Link to this definition")
## e3DFrameType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_e3DFrameType "Direct link to e3DFrameType")
* *class *viktor.external.sap2000.enums.e3DFrameType(*\*values*)[](#e3DFrameType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `e3DFrameType` values, mirroring the product API’s names so code reads like its docs.
* BeamSlab* = 2*[](#e3DFrameType.BeamSlab "Link to this definition")
- FlatPlate* = 3*[](#e3DFrameType.FlatPlate "Link to this definition")
* OpenFrame* = 0*[](#e3DFrameType.OpenFrame "Link to this definition")
- PerimeterFrame* = 1*[](#e3DFrameType.PerimeterFrame "Link to this definition")
## eBridgeCodeAASHTO[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeCodeAASHTO "Direct link to eBridgeCodeAASHTO")
* *class *viktor.external.sap2000.enums.eBridgeCodeAASHTO(*\*values*)[](#eBridgeCodeAASHTO "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeCodeAASHTO` values, mirroring the product API’s names so code reads like its docs.
* AASHTO\_LRFD\_2007* = 1*[](#eBridgeCodeAASHTO.AASHTO_LRFD_2007 "Link to this definition")
- AASHTO\_LRFD\_2012* = 2*[](#eBridgeCodeAASHTO.AASHTO_LRFD_2012 "Link to this definition")
* AASHTO\_LRFD\_2014* = 3*[](#eBridgeCodeAASHTO.AASHTO_LRFD_2014 "Link to this definition")
- AASHTO\_LRFD\_2017* = 4*[](#eBridgeCodeAASHTO.AASHTO_LRFD_2017 "Link to this definition")
* AASHTO\_LRFD\_2020* = 5*[](#eBridgeCodeAASHTO.AASHTO_LRFD_2020 "Link to this definition")
- AASHTO\_STD\_2002* = 0*[](#eBridgeCodeAASHTO.AASHTO_STD_2002 "Link to this definition")
## eBridgeCodeInterims[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeCodeInterims "Direct link to eBridgeCodeInterims")
* *class *viktor.external.sap2000.enums.eBridgeCodeInterims(*\*values*)[](#eBridgeCodeInterims "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeCodeInterims` values, mirroring the product API’s names so code reads like its docs.
* Interim\_2011* = 1*[](#eBridgeCodeInterims.Interim_2011 "Link to this definition")
- Interim\_2012* = 2*[](#eBridgeCodeInterims.Interim_2012 "Link to this definition")
* Interim\_2013* = 3*[](#eBridgeCodeInterims.Interim_2013 "Link to this definition")
- Interim\_2014* = 4*[](#eBridgeCodeInterims.Interim_2014 "Link to this definition")
* Interim\_2015* = 5*[](#eBridgeCodeInterims.Interim_2015 "Link to this definition")
- NoInterims* = 0*[](#eBridgeCodeInterims.NoInterims "Link to this definition")
## eBridgeObjectBentPart[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeObjectBentPart "Direct link to eBridgeObjectBentPart")
* *class *viktor.external.sap2000.enums.eBridgeObjectBentPart(*\*values*)[](#eBridgeObjectBentPart "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeObjectBentPart` values, mirroring the product API’s names so code reads like its docs.
* Bearing* = 3*[](#eBridgeObjectBentPart.Bearing "Link to this definition")
- CapBeam* = 1*[](#eBridgeObjectBentPart.CapBeam "Link to this definition")
* Column* = 2*[](#eBridgeObjectBentPart.Column "Link to this definition")
- Wall* = 4*[](#eBridgeObjectBentPart.Wall "Link to this definition")
## eBridgeObjectFoundationPart[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeObjectFoundationPart "Direct link to eBridgeObjectFoundationPart")
* *class *viktor.external.sap2000.enums.eBridgeObjectFoundationPart(*\*values*)[](#eBridgeObjectFoundationPart "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeObjectFoundationPart` values, mirroring the product API’s names so code reads like its docs.
* Footing* = 1*[](#eBridgeObjectFoundationPart.Footing "Link to this definition")
- FoundationSpring* = 4*[](#eBridgeObjectFoundationPart.FoundationSpring "Link to this definition")
* Pile* = 3*[](#eBridgeObjectFoundationPart.Pile "Link to this definition")
- PileCap* = 2*[](#eBridgeObjectFoundationPart.PileCap "Link to this definition")
## eBridgeObjectType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeObjectType "Direct link to eBridgeObjectType")
* *class *viktor.external.sap2000.enums.eBridgeObjectType(*\*values*)[](#eBridgeObjectType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeObjectType` values, mirroring the product API’s names so code reads like its docs.
* General* = 0*[](#eBridgeObjectType.General "Link to this definition")
- Segmental* = 1*[](#eBridgeObjectType.Segmental "Link to this definition")
## eBridgeObjectUserPointType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeObjectUserPointType "Direct link to eBridgeObjectUserPointType")
* *class *viktor.external.sap2000.enums.eBridgeObjectUserPointType(*\*values*)[](#eBridgeObjectUserPointType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeObjectUserPointType` values, mirroring the product API’s names so code reads like its docs.
* General* = 0*[](#eBridgeObjectUserPointType.General "Link to this definition")
- SegmentalTendon* = 1*[](#eBridgeObjectUserPointType.SegmentalTendon "Link to this definition")
## eBridgeResponseDesignRating[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeResponseDesignRating "Direct link to eBridgeResponseDesignRating")
* *class *viktor.external.sap2000.enums.eBridgeResponseDesignRating(*\*values*)[](#eBridgeResponseDesignRating "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeResponseDesignRating` values, mirroring the product API’s names so code reads like its docs.
* Design\_Crack\_Bot\_Crack\_Width* = 55*[](#eBridgeResponseDesignRating.Design_Crack_Bot_Crack_Width "Link to this definition")
- Design\_Crack\_Top\_Bot\_Crack\_Widths* = 56*[](#eBridgeResponseDesignRating.Design_Crack_Top_Bot_Crack_Widths "Link to this definition")
* Design\_Crack\_Top\_Crack\_Width* = 54*[](#eBridgeResponseDesignRating.Design_Crack_Top_Crack_Width "Link to this definition")
- Design\_Fatigue\_Bot\_Flange\_Lateral\_Bending\_Stress\_Range* = 75*[](#eBridgeResponseDesignRating.Design_Fatigue_Bot_Flange_Lateral_Bending_Stress_Range "Link to this definition")
* Design\_Fatigue\_Bot\_Flange\_Tensile\_Stress\_Range\_Without\_FLB* = 74*[](#eBridgeResponseDesignRating.Design_Fatigue_Bot_Flange_Tensile_Stress_Range_Without_FLB "Link to this definition")
- Design\_Fatigue\_DC\_Ratio\_Web\_Shear* = 76*[](#eBridgeResponseDesignRating.Design_Fatigue_DC_Ratio_Web_Shear "Link to this definition")
* Design\_Fatigue\_Top\_Flange\_Tensile\_Stress\_Range\_Without\_FLB* = 73*[](#eBridgeResponseDesignRating.Design_Fatigue_Top_Flange_Tensile_Stress_Range_Without_FLB "Link to this definition")
- Design\_Flexure\_Moment\_About\_Horizontal\_Axis\_M3* = 64*[](#eBridgeResponseDesignRating.Design_Flexure_Moment_About_Horizontal_Axis_M3 "Link to this definition")
* Design\_Principal\_Stress\_Beam\_Web\_Bot* = 61*[](#eBridgeResponseDesignRating.Design_Principal_Stress_Beam_Web_Bot "Link to this definition")
- Design\_Principal\_Stress\_Beam\_Web\_Top* = 60*[](#eBridgeResponseDesignRating.Design_Principal_Stress_Beam_Web_Top "Link to this definition")
* Design\_Principal\_Stress\_Envelope* = 57*[](#eBridgeResponseDesignRating.Design_Principal_Stress_Envelope "Link to this definition")
- Design\_Principal\_Stress\_Neutral\_Axis* = 62*[](#eBridgeResponseDesignRating.Design_Principal_Stress_Neutral_Axis "Link to this definition")
* Design\_Principal\_Stress\_Web\_Bot* = 59*[](#eBridgeResponseDesignRating.Design_Principal_Stress_Web_Bot "Link to this definition")
- Design\_Principal\_Stress\_Web\_Top* = 58*[](#eBridgeResponseDesignRating.Design_Principal_Stress_Web_Top "Link to this definition")
* Design\_Shear\_Controlling\_DC\_Ratio* = 43*[](#eBridgeResponseDesignRating.Design_Shear_Controlling_DC_Ratio "Link to this definition")
- Design\_Shear\_Controlling\_Shear\_DC\_Ratio* = 34*[](#eBridgeResponseDesignRating.Design_Shear_Controlling_Shear_DC_Ratio "Link to this definition")
* Design\_Shear\_Controlling\_Torsion\_DC\_Ratio* = 35*[](#eBridgeResponseDesignRating.Design_Shear_Controlling_Torsion_DC_Ratio "Link to this definition")
- Design\_Shear\_Demand\_Concrete\_Shear\_Capacity\_Ratio* = 33*[](#eBridgeResponseDesignRating.Design_Shear_Demand_Concrete_Shear_Capacity_Ratio "Link to this definition")
* Design\_Shear\_Longit\_Rebar\_Area* = 45*[](#eBridgeResponseDesignRating.Design_Shear_Longit_Rebar_Area "Link to this definition")
- Design\_Shear\_Longit\_Rebar\_Area\_Beam* = 50*[](#eBridgeResponseDesignRating.Design_Shear_Longit_Rebar_Area_Beam "Link to this definition")
* Design\_Shear\_Longit\_Rebar\_Area\_Bot\_Flange* = 48*[](#eBridgeResponseDesignRating.Design_Shear_Longit_Rebar_Area_Bot_Flange "Link to this definition")
- Design\_Shear\_Longit\_Rebar\_Area\_Bot\_Slab* = 46*[](#eBridgeResponseDesignRating.Design_Shear_Longit_Rebar_Area_Bot_Slab "Link to this definition")
* Design\_Shear\_Longit\_Rebar\_Area\_Slab* = 49*[](#eBridgeResponseDesignRating.Design_Shear_Longit_Rebar_Area_Slab "Link to this definition")
- Design\_Shear\_Longit\_Rebar\_Area\_Top\_Slab* = 47*[](#eBridgeResponseDesignRating.Design_Shear_Longit_Rebar_Area_Top_Slab "Link to this definition")
* Design\_Shear\_Longit\_Torsional\_Rebar\_Area\_PerL* = 51*[](#eBridgeResponseDesignRating.Design_Shear_Longit_Torsional_Rebar_Area_PerL "Link to this definition")
- Design\_Shear\_Rebar\_Area\_PerL* = 44*[](#eBridgeResponseDesignRating.Design_Shear_Rebar_Area_PerL "Link to this definition")
* Design\_Shear\_Required\_Extra\_Longit\_Rebar\_Area* = 37*[](#eBridgeResponseDesignRating.Design_Shear_Required_Extra_Longit_Rebar_Area "Link to this definition")
- Design\_Shear\_Required\_Extra\_Longit\_Rebar\_Area\_Beam* = 42*[](#eBridgeResponseDesignRating.Design_Shear_Required_Extra_Longit_Rebar_Area_Beam "Link to this definition")
* Design\_Shear\_Required\_Extra\_Longit\_Rebar\_Area\_Bot\_Slab* = 39*[](#eBridgeResponseDesignRating.Design_Shear_Required_Extra_Longit_Rebar_Area_Bot_Slab "Link to this definition")
- Design\_Shear\_Required\_Extra\_Longit\_Rebar\_Area\_For\_Torsion* = 38*[](#eBridgeResponseDesignRating.Design_Shear_Required_Extra_Longit_Rebar_Area_For_Torsion "Link to this definition")
* Design\_Shear\_Required\_Extra\_Longit\_Rebar\_Area\_Slab* = 41*[](#eBridgeResponseDesignRating.Design_Shear_Required_Extra_Longit_Rebar_Area_Slab "Link to this definition")
- Design\_Shear\_Required\_Extra\_Longit\_Rebar\_Area\_Top\_Slab* = 40*[](#eBridgeResponseDesignRating.Design_Shear_Required_Extra_Longit_Rebar_Area_Top_Slab "Link to this definition")
* Design\_Shear\_Required\_Extra\_Shear\_Rebar\_Area\_PerL* = 36*[](#eBridgeResponseDesignRating.Design_Shear_Required_Extra_Shear_Rebar_Area_PerL "Link to this definition")
- Design\_Shear\_Torsion\_Plus\_Shear\_Rebar\_Area\_PerL* = 53*[](#eBridgeResponseDesignRating.Design_Shear_Torsion_Plus_Shear_Rebar_Area_PerL "Link to this definition")
* Design\_Shear\_Torsion\_Rebar\_Area\_PerL* = 52*[](#eBridgeResponseDesignRating.Design_Shear_Torsion_Rebar_Area_PerL "Link to this definition")
- Design\_Strength\_DC\_Ratio\_FlexureShearInteract\_Neg* = 71*[](#eBridgeResponseDesignRating.Design_Strength_DC_Ratio_FlexureShearInteract_Neg "Link to this definition")
* Design\_Strength\_DC\_Ratio\_FlexureShearInteract\_Pos* = 70*[](#eBridgeResponseDesignRating.Design_Strength_DC_Ratio_FlexureShearInteract_Pos "Link to this definition")
- Design\_Strength\_DC\_Ratio\_Negative\_Moment* = 66*[](#eBridgeResponseDesignRating.Design_Strength_DC_Ratio_Negative_Moment "Link to this definition")
* Design\_Strength\_DC\_Ratio\_Net\_Section\_Fracture\_Neg* = 69*[](#eBridgeResponseDesignRating.Design_Strength_DC_Ratio_Net_Section_Fracture_Neg "Link to this definition")
- Design\_Strength\_DC\_Ratio\_Net\_Section\_Fracture\_Pos* = 68*[](#eBridgeResponseDesignRating.Design_Strength_DC_Ratio_Net_Section_Fracture_Pos "Link to this definition")
* Design\_Strength\_DC\_Ratio\_Positive\_Moment* = 65*[](#eBridgeResponseDesignRating.Design_Strength_DC_Ratio_Positive_Moment "Link to this definition")
- Design\_Strength\_DC\_Ratio\_Shear* = 67*[](#eBridgeResponseDesignRating.Design_Strength_DC_Ratio_Shear "Link to this definition")
* Design\_Strength\_Total\_Nominal\_Shear\_Force\_6\_10\_10\_4\_2* = 72*[](#eBridgeResponseDesignRating.Design_Strength_Total_Nominal_Shear_Force_6_10_10_4_2 "Link to this definition")
- Design\_Tendon\_Stress\_Controlling\_DC\_Ratio* = 63*[](#eBridgeResponseDesignRating.Design_Tendon_Stress_Controlling_DC_Ratio "Link to this definition")
* Rating\_ASM\_Rating* = 94*[](#eBridgeResponseDesignRating.Rating_ASM_Rating "Link to this definition")
- Rating\_Flexure* = 81*[](#eBridgeResponseDesignRating.Rating_Flexure "Link to this definition")
* Rating\_Flexure\_Factored\_Moment\_Resistance* = 82*[](#eBridgeResponseDesignRating.Rating_Flexure_Factored_Moment_Resistance "Link to this definition")
- Rating\_Flexure\_Factored\_Moment\_Resistance\_UMr* = 83*[](#eBridgeResponseDesignRating.Rating_Flexure_Factored_Moment_Resistance_UMr "Link to this definition")
* Rating\_Flexure\_Live\_load\_Capacity\_Factor\_F* = 84*[](#eBridgeResponseDesignRating.Rating_Flexure_Live_load_Capacity_Factor_F "Link to this definition")
- Rating\_LFM\_Service\_Rating* = 96*[](#eBridgeResponseDesignRating.Rating_LFM_Service_Rating "Link to this definition")
* Rating\_LFM\_Strength\_Rating* = 95*[](#eBridgeResponseDesignRating.Rating_LFM_Strength_Rating "Link to this definition")
- Rating\_MinRebar\_Flexure\_Rating* = 92*[](#eBridgeResponseDesignRating.Rating_MinRebar_Flexure_Rating "Link to this definition")
* Rating\_MinRebar\_Min\_Of\_Abs\_1\_2Mcr\_And\_Abs\_1\_33Mu\_For\_Neg* = 91*[](#eBridgeResponseDesignRating.Rating_MinRebar_Min_Of_Abs_1_2Mcr_And_Abs_1_33Mu_For_Neg "Link to this definition")
- Rating\_MinRebar\_Min\_Of\_Abs\_1\_2Mcr\_And\_Abs\_1\_33Mu\_For\_Pos* = 90*[](#eBridgeResponseDesignRating.Rating_MinRebar_Min_Of_Abs_1_2Mcr_And_Abs_1_33Mu_For_Pos "Link to this definition")
* Rating\_Service* = 93*[](#eBridgeResponseDesignRating.Rating_Service "Link to this definition")
- Rating\_Service\_Flexure\_Rating* = 89*[](#eBridgeResponseDesignRating.Rating_Service_Flexure_Rating "Link to this definition")
* Rating\_Shear* = 77*[](#eBridgeResponseDesignRating.Rating_Shear "Link to this definition")
- Rating\_Shear\_Factored\_Shear\_Resistance* = 78*[](#eBridgeResponseDesignRating.Rating_Shear_Factored_Shear_Resistance "Link to this definition")
* Rating\_Shear\_Factored\_Shear\_Resistance\_UVr* = 79*[](#eBridgeResponseDesignRating.Rating_Shear_Factored_Shear_Resistance_UVr "Link to this definition")
- Rating\_Shear\_Live\_load\_Capacity\_Factor\_F* = 80*[](#eBridgeResponseDesignRating.Rating_Shear_Live_load_Capacity_Factor_F "Link to this definition")
* Rating\_Strength\_Flexure\_Rating* = 86*[](#eBridgeResponseDesignRating.Rating_Strength_Flexure_Rating "Link to this definition")
- Rating\_Strength\_Live\_load\_Capacity\_Factor\_F\_Moment\_M3* = 87*[](#eBridgeResponseDesignRating.Rating_Strength_Live_load_Capacity_Factor_F_Moment_M3 "Link to this definition")
* Rating\_Strength\_Live\_load\_Capacity\_Factor\_F\_Shear\_V2* = 88*[](#eBridgeResponseDesignRating.Rating_Strength_Live_load_Capacity_Factor_F_Shear_V2 "Link to this definition")
- Rating\_Strength\_Shear\_Rating* = 85*[](#eBridgeResponseDesignRating.Rating_Strength_Shear_Rating "Link to this definition")
* S11\_Longitudinal\_Beam\_Bot\_Center* = 39*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Bot_Center "Link to this definition")
- S11\_Longitudinal\_Beam\_Bot\_Envelope* = 32*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Bot_Envelope "Link to this definition")
* S11\_Longitudinal\_Beam\_Bot\_Left* = 29*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Bot_Left "Link to this definition")
- S11\_Longitudinal\_Beam\_Bot\_Right* = 31*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Bot_Right "Link to this definition")
* S11\_Longitudinal\_Beam\_Top\_Center* = 10*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Top_Center "Link to this definition")
- S11\_Longitudinal\_Beam\_Top\_Envelope* = 12*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Top_Envelope "Link to this definition")
* S11\_Longitudinal\_Beam\_Top\_Left* = 9*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Top_Left "Link to this definition")
- S11\_Longitudinal\_Beam\_Top\_Right* = 11*[](#eBridgeResponseDesignRating.S11_Longitudinal_Beam_Top_Right "Link to this definition")
* S11\_Longitudinal\_Bot\_Center* = 15*[](#eBridgeResponseDesignRating.S11_Longitudinal_Bot_Center "Link to this definition")
- S11\_Longitudinal\_Bot\_Envelope* = 18*[](#eBridgeResponseDesignRating.S11_Longitudinal_Bot_Envelope "Link to this definition")
* S11\_Longitudinal\_Bot\_Left* = 13*[](#eBridgeResponseDesignRating.S11_Longitudinal_Bot_Left "Link to this definition")
- S11\_Longitudinal\_Bot\_Left\_Corner* = 14*[](#eBridgeResponseDesignRating.S11_Longitudinal_Bot_Left_Corner "Link to this definition")
* S11\_Longitudinal\_Bot\_Right* = 16*[](#eBridgeResponseDesignRating.S11_Longitudinal_Bot_Right "Link to this definition")
- S11\_Longitudinal\_Bot\_Right\_Corner* = 17*[](#eBridgeResponseDesignRating.S11_Longitudinal_Bot_Right_Corner "Link to this definition")
* S11\_Longitudinal\_Girder\_Bot\_Envelope* = 21*[](#eBridgeResponseDesignRating.S11_Longitudinal_Girder_Bot_Envelope "Link to this definition")
- S11\_Longitudinal\_Girder\_Bot\_Left* = 19*[](#eBridgeResponseDesignRating.S11_Longitudinal_Girder_Bot_Left "Link to this definition")
* S11\_Longitudinal\_Girder\_Bot\_Right* = 20*[](#eBridgeResponseDesignRating.S11_Longitudinal_Girder_Bot_Right "Link to this definition")
- S11\_Longitudinal\_Slab\_Bot\_Beam\_Center* = 24*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Bot_Beam_Center "Link to this definition")
* S11\_Longitudinal\_Slab\_Bot\_Beam\_Left* = 23*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Bot_Beam_Left "Link to this definition")
- S11\_Longitudinal\_Slab\_Bot\_Beam\_Right* = 25*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Bot_Beam_Right "Link to this definition")
* S11\_Longitudinal\_Slab\_Bot\_Center* = 26*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Bot_Center "Link to this definition")
- S11\_Longitudinal\_Slab\_Bot\_Envelope* = 28*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Bot_Envelope "Link to this definition")
* S11\_Longitudinal\_Slab\_Bot\_Left* = 22*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Bot_Left "Link to this definition")
- S11\_Longitudinal\_Slab\_Bot\_Right* = 27*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Bot_Right "Link to this definition")
* S11\_Longitudinal\_Slab\_Top\_Beam\_Center* = 6*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Top_Beam_Center "Link to this definition")
- S11\_Longitudinal\_Slab\_Top\_Center* = 5*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Top_Center "Link to this definition")
* S11\_Longitudinal\_Slab\_Top\_Envelope* = 8*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Top_Envelope "Link to this definition")
- S11\_Longitudinal\_Slab\_Top\_Left* = 4*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Top_Left "Link to this definition")
* S11\_Longitudinal\_Slab\_Top\_Right* = 7*[](#eBridgeResponseDesignRating.S11_Longitudinal_Slab_Top_Right "Link to this definition")
- S11\_Longitudinal\_Top\_Center* = 1*[](#eBridgeResponseDesignRating.S11_Longitudinal_Top_Center "Link to this definition")
* S11\_Longitudinal\_Top\_Envelope* = 3*[](#eBridgeResponseDesignRating.S11_Longitudinal_Top_Envelope "Link to this definition")
- S11\_Longitudinal\_Top\_Left* = 0*[](#eBridgeResponseDesignRating.S11_Longitudinal_Top_Left "Link to this definition")
* S11\_Longitudinal\_Top\_Right* = 2*[](#eBridgeResponseDesignRating.S11_Longitudinal_Top_Right "Link to this definition")
## eBridgeResponseDisplDOF[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeResponseDisplDOF "Direct link to eBridgeResponseDisplDOF")
* *class *viktor.external.sap2000.enums.eBridgeResponseDisplDOF(*\*values*)[](#eBridgeResponseDisplDOF "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeResponseDisplDOF` values, mirroring the product API’s names so code reads like its docs.
* Avg\_Longitudinal\_Rotation* = 4*[](#eBridgeResponseDisplDOF.Avg_Longitudinal_Rotation "Link to this definition")
- Longitudinal\_Displacement* = 2*[](#eBridgeResponseDisplDOF.Longitudinal_Displacement "Link to this definition")
* Longitudinal\_Rotation* = 3*[](#eBridgeResponseDisplDOF.Longitudinal_Rotation "Link to this definition")
- Transverse\_Displacement* = 1*[](#eBridgeResponseDisplDOF.Transverse_Displacement "Link to this definition")
* Vertical\_Displacement* = 0*[](#eBridgeResponseDisplDOF.Vertical_Displacement "Link to this definition")
## eBridgeResponseDisplLoc[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeResponseDisplLoc "Direct link to eBridgeResponseDisplLoc")
* *class *viktor.external.sap2000.enums.eBridgeResponseDisplLoc(*\*values*)[](#eBridgeResponseDisplLoc "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeResponseDisplLoc` values, mirroring the product API’s names so code reads like its docs.
* Left\_Web* = 5*[](#eBridgeResponseDisplLoc.Left_Web "Link to this definition")
- Left\_Web\_Bottom* = 4*[](#eBridgeResponseDisplLoc.Left_Web_Bottom "Link to this definition")
* Left\_Web\_Top* = 3*[](#eBridgeResponseDisplLoc.Left_Web_Top "Link to this definition")
- Right\_Web* = 8*[](#eBridgeResponseDisplLoc.Right_Web "Link to this definition")
* Right\_Web\_Bottom* = 7*[](#eBridgeResponseDisplLoc.Right_Web_Bottom "Link to this definition")
- Right\_Web\_Top* = 6*[](#eBridgeResponseDisplLoc.Right_Web_Top "Link to this definition")
* Slab\_Center* = 9*[](#eBridgeResponseDisplLoc.Slab_Center "Link to this definition")
- Web* = 2*[](#eBridgeResponseDisplLoc.Web "Link to this definition")
* Web\_Bottom* = 1*[](#eBridgeResponseDisplLoc.Web_Bottom "Link to this definition")
- Web\_Top* = 0*[](#eBridgeResponseDisplLoc.Web_Top "Link to this definition")
## eBridgeResponseForce[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeResponseForce "Direct link to eBridgeResponseForce")
* *class *viktor.external.sap2000.enums.eBridgeResponseForce(*\*values*)[](#eBridgeResponseForce "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeResponseForce` values, mirroring the product API’s names so code reads like its docs.
* Axial\_Force\_P* = 1*[](#eBridgeResponseForce.Axial_Force_P "Link to this definition")
- Moment\_About\_Horizontal\_Axis\_M3* = 6*[](#eBridgeResponseForce.Moment_About_Horizontal_Axis_M3 "Link to this definition")
* Moment\_About\_Vertical\_Axis\_M2* = 5*[](#eBridgeResponseForce.Moment_About_Vertical_Axis_M2 "Link to this definition")
- Shear\_Horizontal\_V3* = 3*[](#eBridgeResponseForce.Shear_Horizontal_V3 "Link to this definition")
* Shear\_Vertical\_V2* = 2*[](#eBridgeResponseForce.Shear_Vertical_V2 "Link to this definition")
- Torsion\_T* = 4*[](#eBridgeResponseForce.Torsion_T "Link to this definition")
## eBridgeResponsePart[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeResponsePart "Direct link to eBridgeResponsePart")
* *class *viktor.external.sap2000.enums.eBridgeResponsePart(*\*values*)[](#eBridgeResponsePart "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeResponsePart` values, mirroring the product API’s names so code reads like its docs.
* All\_Beams* = 7*[](#eBridgeResponsePart.All_Beams "Link to this definition")
- All\_Girders* = 6*[](#eBridgeResponsePart.All_Girders "Link to this definition")
* All\_Slabs* = 9*[](#eBridgeResponsePart.All_Slabs "Link to this definition")
- All\_Webs* = 8*[](#eBridgeResponsePart.All_Webs "Link to this definition")
* Beam* = 3*[](#eBridgeResponsePart.Beam "Link to this definition")
- Entire\_Bridge\_Section* = 1*[](#eBridgeResponsePart.Entire_Bridge_Section "Link to this definition")
* Entire\_Section\_Plus\_All\_Girders* = 10*[](#eBridgeResponsePart.Entire_Section_Plus_All_Girders "Link to this definition")
- Girder* = 2*[](#eBridgeResponsePart.Girder "Link to this definition")
* Slab* = 5*[](#eBridgeResponsePart.Slab "Link to this definition")
- Web* = 4*[](#eBridgeResponsePart.Web "Link to this definition")
## eBridgeResponseStress[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeResponseStress "Direct link to eBridgeResponseStress")
* *class *viktor.external.sap2000.enums.eBridgeResponseStress(*\*values*)[](#eBridgeResponseStress "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeResponseStress` values, mirroring the product API’s names so code reads like its docs.
* S11\_Lateral\_Bending\_Bot* = 25*[](#eBridgeResponseStress.S11_Lateral_Bending_Bot "Link to this definition")
- S11\_Lateral\_Bending\_Top* = 22*[](#eBridgeResponseStress.S11_Lateral_Bending_Top "Link to this definition")
* S11\_Lateral\_Bending\_Top\_ULeft* = 23*[](#eBridgeResponseStress.S11_Lateral_Bending_Top_ULeft "Link to this definition")
- S11\_Lateral\_Bending\_Top\_URight* = 24*[](#eBridgeResponseStress.S11_Lateral_Bending_Top_URight "Link to this definition")
* S11\_Longitudinal\_Bot\_Beam\_Left* = 16*[](#eBridgeResponseStress.S11_Longitudinal_Bot_Beam_Left "Link to this definition")
- S11\_Longitudinal\_Bot\_Beam\_Right* = 17*[](#eBridgeResponseStress.S11_Longitudinal_Bot_Beam_Right "Link to this definition")
* S11\_Longitudinal\_Bot\_Center* = 14*[](#eBridgeResponseStress.S11_Longitudinal_Bot_Center "Link to this definition")
- S11\_Longitudinal\_Bot\_Envelope* = 18*[](#eBridgeResponseStress.S11_Longitudinal_Bot_Envelope "Link to this definition")
* S11\_Longitudinal\_Bot\_Left* = 13*[](#eBridgeResponseStress.S11_Longitudinal_Bot_Left "Link to this definition")
- S11\_Longitudinal\_Bot\_Right* = 15*[](#eBridgeResponseStress.S11_Longitudinal_Bot_Right "Link to this definition")
* S11\_Longitudinal\_Top\_Beam\_Center* = 3*[](#eBridgeResponseStress.S11_Longitudinal_Top_Beam_Center "Link to this definition")
- S11\_Longitudinal\_Top\_Bot\_Center* = 20*[](#eBridgeResponseStress.S11_Longitudinal_Top_Bot_Center "Link to this definition")
* S11\_Longitudinal\_Top\_Bot\_Left* = 19*[](#eBridgeResponseStress.S11_Longitudinal_Top_Bot_Left "Link to this definition")
- S11\_Longitudinal\_Top\_Bot\_Right* = 21*[](#eBridgeResponseStress.S11_Longitudinal_Top_Bot_Right "Link to this definition")
* S11\_Longitudinal\_Top\_Center* = 1*[](#eBridgeResponseStress.S11_Longitudinal_Top_Center "Link to this definition")
- S11\_Longitudinal\_Top\_Envelope* = 4*[](#eBridgeResponseStress.S11_Longitudinal_Top_Envelope "Link to this definition")
* S11\_Longitudinal\_Top\_Left* = 0*[](#eBridgeResponseStress.S11_Longitudinal_Top_Left "Link to this definition")
- S11\_Longitudinal\_Top\_Right* = 2*[](#eBridgeResponseStress.S11_Longitudinal_Top_Right "Link to this definition")
* S11\_Longitudinal\_Top\_ULeft\_Center* = 6*[](#eBridgeResponseStress.S11_Longitudinal_Top_ULeft_Center "Link to this definition")
- S11\_Longitudinal\_Top\_ULeft\_Envelope* = 8*[](#eBridgeResponseStress.S11_Longitudinal_Top_ULeft_Envelope "Link to this definition")
* S11\_Longitudinal\_Top\_ULeft\_Left* = 5*[](#eBridgeResponseStress.S11_Longitudinal_Top_ULeft_Left "Link to this definition")
- S11\_Longitudinal\_Top\_ULeft\_Right* = 7*[](#eBridgeResponseStress.S11_Longitudinal_Top_ULeft_Right "Link to this definition")
* S11\_Longitudinal\_Top\_URight\_Center* = 10*[](#eBridgeResponseStress.S11_Longitudinal_Top_URight_Center "Link to this definition")
- S11\_Longitudinal\_Top\_URight\_Envelope* = 12*[](#eBridgeResponseStress.S11_Longitudinal_Top_URight_Envelope "Link to this definition")
* S11\_Longitudinal\_Top\_URight\_Left* = 9*[](#eBridgeResponseStress.S11_Longitudinal_Top_URight_Left "Link to this definition")
- S11\_Longitudinal\_Top\_URight\_Right* = 11*[](#eBridgeResponseStress.S11_Longitudinal_Top_URight_Right "Link to this definition")
## eBridgeSegmentConstructionMethod[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeSegmentConstructionMethod "Direct link to eBridgeSegmentConstructionMethod")
* *class *viktor.external.sap2000.enums.eBridgeSegmentConstructionMethod(*\*values*)[](#eBridgeSegmentConstructionMethod "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeSegmentConstructionMethod` values, mirroring the product API’s names so code reads like its docs.
* CastInPlace* = 1*[](#eBridgeSegmentConstructionMethod.CastInPlace "Link to this definition")
- Precast* = 0*[](#eBridgeSegmentConstructionMethod.Precast "Link to this definition")
## eBridgeSegmentType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeSegmentType "Direct link to eBridgeSegmentType")
* *class *viktor.external.sap2000.enums.eBridgeSegmentType(*\*values*)[](#eBridgeSegmentType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeSegmentType` values, mirroring the product API’s names so code reads like its docs.
* Closure* = 3*[](#eBridgeSegmentType.Closure "Link to this definition")
- PierTable* = 1*[](#eBridgeSegmentType.PierTable "Link to this definition")
* Rigid* = 0*[](#eBridgeSegmentType.Rigid "Link to this definition")
- Segment* = 2*[](#eBridgeSegmentType.Segment "Link to this definition")
## eBridgeTendonCategory[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eBridgeTendonCategory "Direct link to eBridgeTendonCategory")
* *class *viktor.external.sap2000.enums.eBridgeTendonCategory(*\*values*)[](#eBridgeTendonCategory "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eBridgeTendonCategory` values, mirroring the product API’s names so code reads like its docs.
* BottomSpan* = 2*[](#eBridgeTendonCategory.BottomSpan "Link to this definition")
- Cantilever* = 1*[](#eBridgeTendonCategory.Cantilever "Link to this definition")
* Continuity* = 4*[](#eBridgeTendonCategory.Continuity "Link to this definition")
- General* = 0*[](#eBridgeTendonCategory.General "Link to this definition")
* TopSpan* = 3*[](#eBridgeTendonCategory.TopSpan "Link to this definition")
## eCNameType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eCNameType "Direct link to eCNameType")
* *class *viktor.external.sap2000.enums.eCNameType(*\*values*)[](#eCNameType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eCNameType` values, mirroring the product API’s names so code reads like its docs.
* LoadCase* = 0*[](#eCNameType.LoadCase "Link to this definition")
- LoadCombo* = 1*[](#eCNameType.LoadCombo "Link to this definition")
## eConstraintAxis[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eConstraintAxis "Direct link to eConstraintAxis")
* *class *viktor.external.sap2000.enums.eConstraintAxis(*\*values*)[](#eConstraintAxis "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eConstraintAxis` values, mirroring the product API’s names so code reads like its docs.
* AutoAxis* = 4*[](#eConstraintAxis.AutoAxis "Link to this definition")
- X* = 1*[](#eConstraintAxis.X "Link to this definition")
* Y* = 2*[](#eConstraintAxis.Y "Link to this definition")
- Z* = 3*[](#eConstraintAxis.Z "Link to this definition")
## eConstraintType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eConstraintType "Direct link to eConstraintType")
* *class *viktor.external.sap2000.enums.eConstraintType(*\*values*)[](#eConstraintType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eConstraintType` values, mirroring the product API’s names so code reads like its docs.
* Beam* = 5*[](#eConstraintType.Beam "Link to this definition")
- Body* = 1*[](#eConstraintType.Body "Link to this definition")
* Diaphragm* = 2*[](#eConstraintType.Diaphragm "Link to this definition")
- Equal* = 6*[](#eConstraintType.Equal "Link to this definition")
* Line* = 13*[](#eConstraintType.Line "Link to this definition")
- Local* = 7*[](#eConstraintType.Local "Link to this definition")
* Plate* = 3*[](#eConstraintType.Plate "Link to this definition")
- Rod* = 4*[](#eConstraintType.Rod "Link to this definition")
* Weld* = 8*[](#eConstraintType.Weld "Link to this definition")
## eDesignActionType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eDesignActionType "Direct link to eDesignActionType")
* *class *viktor.external.sap2000.enums.eDesignActionType(*\*values*)[](#eDesignActionType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eDesignActionType` values, mirroring the product API’s names so code reads like its docs.
* LongTermComposite* = 3*[](#eDesignActionType.LongTermComposite "Link to this definition")
- NonComposite* = 1*[](#eDesignActionType.NonComposite "Link to this definition")
* Other* = 5*[](#eDesignActionType.Other "Link to this definition")
- ShortTermComposite* = 2*[](#eDesignActionType.ShortTermComposite "Link to this definition")
* Staged* = 4*[](#eDesignActionType.Staged "Link to this definition")
## eForce[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eForce "Direct link to eForce")
* *class *viktor.external.sap2000.enums.eForce(*\*values*)[](#eForce "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eForce` values, mirroring the product API’s names so code reads like its docs.
* N* = 3*[](#eForce.N "Link to this definition")
- NotApplicable* = 0*[](#eForce.NotApplicable "Link to this definition")
* kN* = 4*[](#eForce.kN "Link to this definition")
- kgf* = 5*[](#eForce.kgf "Link to this definition")
* kip* = 2*[](#eForce.kip "Link to this definition")
- lb* = 1*[](#eForce.lb "Link to this definition")
* tonf* = 6*[](#eForce.tonf "Link to this definition")
## eFramePropType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eFramePropType "Direct link to eFramePropType")
* *class *viktor.external.sap2000.enums.eFramePropType(*\*values*)[](#eFramePropType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eFramePropType` values, mirroring the product API’s names so code reads like its docs.
* Angle* = 4*[](#eFramePropType.Angle "Link to this definition")
- Auto* = 12*[](#eFramePropType.Auto "Link to this definition")
* Box* = 6*[](#eFramePropType.Box "Link to this definition")
- Bridge* = 16*[](#eFramePropType.Bridge "Link to this definition")
* BucklingRestrainedBrace* = 33*[](#eFramePropType.BucklingRestrainedBrace "Link to this definition")
- BuiltupICoverplate* = 23*[](#eFramePropType.BuiltupICoverplate "Link to this definition")
* BuiltupIHybrid* = 26*[](#eFramePropType.BuiltupIHybrid "Link to this definition")
- BuiltupUHybrid* = 27*[](#eFramePropType.BuiltupUHybrid "Link to this definition")
* Channel* = 2*[](#eFramePropType.Channel "Link to this definition")
- Circle* = 9*[](#eFramePropType.Circle "Link to this definition")
* Cold\_2C* = 18*[](#eFramePropType.Cold_2C "Link to this definition")
- Cold\_2L* = 21*[](#eFramePropType.Cold_2L "Link to this definition")
* Cold\_Box* = 42*[](#eFramePropType.Cold_Box "Link to this definition")
- Cold\_C* = 17*[](#eFramePropType.Cold_C "Link to this definition")
* Cold\_Hat* = 22*[](#eFramePropType.Cold_Hat "Link to this definition")
- Cold\_I* = 43*[](#eFramePropType.Cold_I "Link to this definition")
* Cold\_L* = 20*[](#eFramePropType.Cold_L "Link to this definition")
- Cold\_Pipe* = 44*[](#eFramePropType.Cold_Pipe "Link to this definition")
* Cold\_T* = 45*[](#eFramePropType.Cold_T "Link to this definition")
- Cold\_Z* = 19*[](#eFramePropType.Cold_Z "Link to this definition")
* ConcreteBox* = 36*[](#eFramePropType.ConcreteBox "Link to this definition")
- ConcreteCross* = 38*[](#eFramePropType.ConcreteCross "Link to this definition")
* ConcretePipe* = 37*[](#eFramePropType.ConcretePipe "Link to this definition")
- ConcreteTee* = 35*[](#eFramePropType.ConcreteTee "Link to this definition")
* Concrete\_L* = 28*[](#eFramePropType.Concrete_L "Link to this definition")
- CoreBrace\_BRB* = 34*[](#eFramePropType.CoreBrace_BRB "Link to this definition")
* DbChannel* = 11*[](#eFramePropType.DbChannel "Link to this definition")
- DblAngle* = 5*[](#eFramePropType.DblAngle "Link to this definition")
* EncasedCircle* = 32*[](#eFramePropType.EncasedCircle "Link to this definition")
- EncasedRectangle* = 31*[](#eFramePropType.EncasedRectangle "Link to this definition")
* FilledPipe* = 30*[](#eFramePropType.FilledPipe "Link to this definition")
- FilledTube* = 29*[](#eFramePropType.FilledTube "Link to this definition")
* General* = 10*[](#eFramePropType.General "Link to this definition")
- I* = 1*[](#eFramePropType.I "Link to this definition")
* Joist* = 15*[](#eFramePropType.Joist "Link to this definition")
- PCCGirderBox* = 47*[](#eFramePropType.PCCGirderBox "Link to this definition")
* PCCGirderI* = 24*[](#eFramePropType.PCCGirderI "Link to this definition")
- PCCGirderSuperT* = 41*[](#eFramePropType.PCCGirderSuperT "Link to this definition")
* PCCGirderU* = 25*[](#eFramePropType.PCCGirderU "Link to this definition")
- Pipe* = 7*[](#eFramePropType.Pipe "Link to this definition")
* Rectangular* = 8*[](#eFramePropType.Rectangular "Link to this definition")
- SD* = 13*[](#eFramePropType.SD "Link to this definition")
* SteelPlate* = 39*[](#eFramePropType.SteelPlate "Link to this definition")
- SteelRod* = 40*[](#eFramePropType.SteelRod "Link to this definition")
* T* = 3*[](#eFramePropType.T "Link to this definition")
- Trapezoidal* = 46*[](#eFramePropType.Trapezoidal "Link to this definition")
* Variable* = 14*[](#eFramePropType.Variable "Link to this definition")
## eHingeDistributionType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eHingeDistributionType "Direct link to eHingeDistributionType")
* *class *viktor.external.sap2000.enums.eHingeDistributionType(*\*values*)[](#eHingeDistributionType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eHingeDistributionType` values, mirroring the product API’s names so code reads like its docs.
* ContinuousSupport* = 4*[](#eHingeDistributionType.ContinuousSupport "Link to this definition")
- DistributedPlasticity* = 2*[](#eHingeDistributionType.DistributedPlasticity "Link to this definition")
* EqualSpacing* = 3*[](#eHingeDistributionType.EqualSpacing "Link to this definition")
- NonlinearBeamColumn* = 1*[](#eHingeDistributionType.NonlinearBeamColumn "Link to this definition")
* UserDefined* = 5*[](#eHingeDistributionType.UserDefined "Link to this definition")
## eHingeLengthOverwriteType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eHingeLengthOverwriteType "Direct link to eHingeLengthOverwriteType")
* *class *viktor.external.sap2000.enums.eHingeLengthOverwriteType(*\*values*)[](#eHingeLengthOverwriteType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eHingeLengthOverwriteType` values, mirroring the product API’s names so code reads like its docs.
* Absolute* = 2*[](#eHingeLengthOverwriteType.Absolute "Link to this definition")
- None\_* = 1*[](#eHingeLengthOverwriteType.None_ "Link to this definition")
* Relative* = 3*[](#eHingeLengthOverwriteType.Relative "Link to this definition")
## eHingeLocationType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eHingeLocationType "Direct link to eHingeLocationType")
* *class *viktor.external.sap2000.enums.eHingeLocationType(*\*values*)[](#eHingeLocationType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eHingeLocationType` values, mirroring the product API’s names so code reads like its docs.
* OffsetFromIEnd* = 2*[](#eHingeLocationType.OffsetFromIEnd "Link to this definition")
- OffsetFromJEnd* = 3*[](#eHingeLocationType.OffsetFromJEnd "Link to this definition")
* RelativeDistance* = 1*[](#eHingeLocationType.RelativeDistance "Link to this definition")
## eItemType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eItemType "Direct link to eItemType")
* *class *viktor.external.sap2000.enums.eItemType(*\*values*)[](#eItemType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eItemType` values, mirroring the product API’s names so code reads like its docs.
* Group* = 1*[](#eItemType.Group "Link to this definition")
- Objects* = 0*[](#eItemType.Objects "Link to this definition")
* SelectedObjects* = 2*[](#eItemType.SelectedObjects "Link to this definition")
## eItemTypeElm[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eItemTypeElm "Direct link to eItemTypeElm")
* *class *viktor.external.sap2000.enums.eItemTypeElm(*\*values*)[](#eItemTypeElm "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eItemTypeElm` values, mirroring the product API’s names so code reads like its docs.
* Element* = 1*[](#eItemTypeElm.Element "Link to this definition")
- GroupElm* = 2*[](#eItemTypeElm.GroupElm "Link to this definition")
* ObjectElm* = 0*[](#eItemTypeElm.ObjectElm "Link to this definition")
- SelectionElm* = 3*[](#eItemTypeElm.SelectionElm "Link to this definition")
## eLength[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eLength "Direct link to eLength")
* *class *viktor.external.sap2000.enums.eLength(*\*values*)[](#eLength "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eLength` values, mirroring the product API’s names so code reads like its docs.
* NotApplicable* = 0*[](#eLength.NotApplicable "Link to this definition")
- cm* = 5*[](#eLength.cm "Link to this definition")
* ft* = 2*[](#eLength.ft "Link to this definition")
- inch* = 1*[](#eLength.inch "Link to this definition")
* m* = 6*[](#eLength.m "Link to this definition")
- micron* = 3*[](#eLength.micron "Link to this definition")
* mm* = 4*[](#eLength.mm "Link to this definition")
## eLinkPropType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eLinkPropType "Direct link to eLinkPropType")
* *class *viktor.external.sap2000.enums.eLinkPropType(*\*values*)[](#eLinkPropType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eLinkPropType` values, mirroring the product API’s names so code reads like its docs.
* Damper* = 2*[](#eLinkPropType.Damper "Link to this definition")
- DamperBilinear* = 13*[](#eLinkPropType.DamperBilinear "Link to this definition")
* DamperFrictionSpring* = 14*[](#eLinkPropType.DamperFrictionSpring "Link to this definition")
- DamperLinearExponential* = 12*[](#eLinkPropType.DamperLinearExponential "Link to this definition")
* Gap* = 3*[](#eLinkPropType.Gap "Link to this definition")
- Hook* = 4*[](#eLinkPropType.Hook "Link to this definition")
* Isolator1* = 6*[](#eLinkPropType.Isolator1 "Link to this definition")
- Isolator2* = 7*[](#eLinkPropType.Isolator2 "Link to this definition")
* Isolator3* = 10*[](#eLinkPropType.Isolator3 "Link to this definition")
- Isolator4* = 11*[](#eLinkPropType.Isolator4 "Link to this definition")
* Linear* = 1*[](#eLinkPropType.Linear "Link to this definition")
- MultilinearElastic* = 8*[](#eLinkPropType.MultilinearElastic "Link to this definition")
* MultilinearPlastic* = 9*[](#eLinkPropType.MultilinearPlastic "Link to this definition")
- PlasticWen* = 5*[](#eLinkPropType.PlasticWen "Link to this definition")
## eLoadCaseType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eLoadCaseType "Direct link to eLoadCaseType")
* *class *viktor.external.sap2000.enums.eLoadCaseType(*\*values*)[](#eLoadCaseType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eLoadCaseType` values, mirroring the product API’s names so code reads like its docs.
* Buckling* = 10*[](#eLoadCaseType.Buckling "Link to this definition")
- ExternalResults* = 15*[](#eLoadCaseType.ExternalResults "Link to this definition")
* HyperStatic* = 14*[](#eLoadCaseType.HyperStatic "Link to this definition")
- LinearDynamic* = 7*[](#eLoadCaseType.LinearDynamic "Link to this definition")
* LinearHistory* = 5*[](#eLoadCaseType.LinearHistory "Link to this definition")
- LinearStatic* = 1*[](#eLoadCaseType.LinearStatic "Link to this definition")
* LinearStaticMultiStep* = 13*[](#eLoadCaseType.LinearStaticMultiStep "Link to this definition")
- Modal* = 3*[](#eLoadCaseType.Modal "Link to this definition")
* MovingLoad* = 9*[](#eLoadCaseType.MovingLoad "Link to this definition")
- NonlinearDynamic* = 8*[](#eLoadCaseType.NonlinearDynamic "Link to this definition")
* NonlinearHistory* = 6*[](#eLoadCaseType.NonlinearHistory "Link to this definition")
- NonlinearStatic* = 2*[](#eLoadCaseType.NonlinearStatic "Link to this definition")
* NonlinearStaticMultiStep* = 17*[](#eLoadCaseType.NonlinearStaticMultiStep "Link to this definition")
- PowerSpectralDensity* = 12*[](#eLoadCaseType.PowerSpectralDensity "Link to this definition")
* ResponseSpectrum* = 4*[](#eLoadCaseType.ResponseSpectrum "Link to this definition")
- StagedConstruction* = 16*[](#eLoadCaseType.StagedConstruction "Link to this definition")
* SteadyState* = 11*[](#eLoadCaseType.SteadyState "Link to this definition")
## eLoadPatternType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eLoadPatternType "Direct link to eLoadPatternType")
* *class *viktor.external.sap2000.enums.eLoadPatternType(*\*values*)[](#eLoadPatternType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eLoadPatternType` values, mirroring the product API’s names so code reads like its docs.
* ActiveEarthPressure* = 45*[](#eLoadPatternType.ActiveEarthPressure "Link to this definition")
- Bouyancy* = 36*[](#eLoadPatternType.Bouyancy "Link to this definition")
* Braking* = 15*[](#eLoadPatternType.Braking "Link to this definition")
- Centrifugal* = 16*[](#eLoadPatternType.Centrifugal "Link to this definition")
* Construction* = 39*[](#eLoadPatternType.Construction "Link to this definition")
- Creep* = 29*[](#eLoadPatternType.Creep "Link to this definition")
* Dead* = 1*[](#eLoadPatternType.Dead "Link to this definition")
- DeadManufacture* = 42*[](#eLoadPatternType.DeadManufacture "Link to this definition")
* DeadWater* = 41*[](#eLoadPatternType.DeadWater "Link to this definition")
- DeadWearing* = 40*[](#eLoadPatternType.DeadWearing "Link to this definition")
* DownDrag* = 23*[](#eLoadPatternType.DownDrag "Link to this definition")
- EarthHydrostatic* = 43*[](#eLoadPatternType.EarthHydrostatic "Link to this definition")
* EarthSurcharge* = 22*[](#eLoadPatternType.EarthSurcharge "Link to this definition")
- EuroLm1Char* = 48*[](#eLoadPatternType.EuroLm1Char "Link to this definition")
* EuroLm1Freq* = 49*[](#eLoadPatternType.EuroLm1Freq "Link to this definition")
- EuroLm2* = 50*[](#eLoadPatternType.EuroLm2 "Link to this definition")
* EuroLm3* = 51*[](#eLoadPatternType.EuroLm3 "Link to this definition")
- EuroLm4* = 52*[](#eLoadPatternType.EuroLm4 "Link to this definition")
* Friction* = 17*[](#eLoadPatternType.Friction "Link to this definition")
- HorizontalEarthPressure* = 20*[](#eLoadPatternType.HorizontalEarthPressure "Link to this definition")
* Hyperstatic* = 35*[](#eLoadPatternType.Hyperstatic "Link to this definition")
- Ice* = 18*[](#eLoadPatternType.Ice "Link to this definition")
* Impact* = 38*[](#eLoadPatternType.Impact "Link to this definition")
- Live* = 3*[](#eLoadPatternType.Live "Link to this definition")
* LiveLoadSurcharge* = 31*[](#eLoadPatternType.LiveLoadSurcharge "Link to this definition")
- LockedInForces* = 32*[](#eLoadPatternType.LockedInForces "Link to this definition")
* Move* = 9*[](#eLoadPatternType.Move "Link to this definition")
- MoveDeflection* = 57*[](#eLoadPatternType.MoveDeflection "Link to this definition")
* MoveFatigue* = 55*[](#eLoadPatternType.MoveFatigue "Link to this definition")
- MoveFatiguePermit* = 56*[](#eLoadPatternType.MoveFatiguePermit "Link to this definition")
* MoveTrain* = 58*[](#eLoadPatternType.MoveTrain "Link to this definition")
- Notional* = 12*[](#eLoadPatternType.Notional "Link to this definition")
* Other* = 8*[](#eLoadPatternType.Other "Link to this definition")
- PassiveEarthPressure* = 44*[](#eLoadPatternType.PassiveEarthPressure "Link to this definition")
* PatternAuto* = 60*[](#eLoadPatternType.PatternAuto "Link to this definition")
- PatternLive* = 13*[](#eLoadPatternType.PatternLive "Link to this definition")
* PedestrianLL* = 33*[](#eLoadPatternType.PedestrianLL "Link to this definition")
- PedestrianLLReduced* = 46*[](#eLoadPatternType.PedestrianLLReduced "Link to this definition")
* Permit* = 54*[](#eLoadPatternType.Permit "Link to this definition")
- Prestress* = 34*[](#eLoadPatternType.Prestress "Link to this definition")
* PrestressTransfer* = 59*[](#eLoadPatternType.PrestressTransfer "Link to this definition")
- Quake* = 5*[](#eLoadPatternType.Quake "Link to this definition")
* QuakeDrift* = 61*[](#eLoadPatternType.QuakeDrift "Link to this definition")
- QuakeVerticalOnly* = 62*[](#eLoadPatternType.QuakeVerticalOnly "Link to this definition")
* ReduceLive* = 4*[](#eLoadPatternType.ReduceLive "Link to this definition")
- Rooflive* = 11*[](#eLoadPatternType.Rooflive "Link to this definition")
* SeaState* = 53*[](#eLoadPatternType.SeaState "Link to this definition")
- Settlement* = 27*[](#eLoadPatternType.Settlement "Link to this definition")
* Shrinkage* = 28*[](#eLoadPatternType.Shrinkage "Link to this definition")
- Snow* = 7*[](#eLoadPatternType.Snow "Link to this definition")
* SnowHighAltitude* = 47*[](#eLoadPatternType.SnowHighAltitude "Link to this definition")
- StreamFlow* = 37*[](#eLoadPatternType.StreamFlow "Link to this definition")
* SuperDead* = 2*[](#eLoadPatternType.SuperDead "Link to this definition")
- Temperature* = 10*[](#eLoadPatternType.Temperature "Link to this definition")
* TemperatureGradient* = 26*[](#eLoadPatternType.TemperatureGradient "Link to this definition")
- VehicleCollision* = 24*[](#eLoadPatternType.VehicleCollision "Link to this definition")
* VerticalEarthPressure* = 21*[](#eLoadPatternType.VerticalEarthPressure "Link to this definition")
- VesselCollision* = 25*[](#eLoadPatternType.VesselCollision "Link to this definition")
* WaterloadPressure* = 30*[](#eLoadPatternType.WaterloadPressure "Link to this definition")
- Wave* = 14*[](#eLoadPatternType.Wave "Link to this definition")
* Wind* = 6*[](#eLoadPatternType.Wind "Link to this definition")
- WindOnLiveLoad* = 19*[](#eLoadPatternType.WindOnLiveLoad "Link to this definition")
## eMatCoupledType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eMatCoupledType "Direct link to eMatCoupledType")
* *class *viktor.external.sap2000.enums.eMatCoupledType(*\*values*)[](#eMatCoupledType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eMatCoupledType` values, mirroring the product API’s names so code reads like its docs.
* FariaConcreteDamagePlasticity* = 4*[](#eMatCoupledType.FariaConcreteDamagePlasticity "Link to this definition")
- ModifiedDarwinPecknoldConcrete* = 3*[](#eMatCoupledType.ModifiedDarwinPecknoldConcrete "Link to this definition")
* None\_* = 1*[](#eMatCoupledType.None_ "Link to this definition")
- VonMisesPlasticity* = 2*[](#eMatCoupledType.VonMisesPlasticity "Link to this definition")
## eMatType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eMatType "Direct link to eMatType")
* *class *viktor.external.sap2000.enums.eMatType(*\*values*)[](#eMatType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eMatType` values, mirroring the product API’s names so code reads like its docs.
* Aluminum* = 4*[](#eMatType.Aluminum "Link to this definition")
- ColdFormed* = 5*[](#eMatType.ColdFormed "Link to this definition")
* Concrete* = 2*[](#eMatType.Concrete "Link to this definition")
- Masonry* = 8*[](#eMatType.Masonry "Link to this definition")
* NoDesign* = 3*[](#eMatType.NoDesign "Link to this definition")
- Rebar* = 6*[](#eMatType.Rebar "Link to this definition")
* Steel* = 1*[](#eMatType.Steel "Link to this definition")
- Tendon* = 7*[](#eMatType.Tendon "Link to this definition")
## eMatTypeAluminum[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eMatTypeAluminum "Direct link to eMatTypeAluminum")
* *class *viktor.external.sap2000.enums.eMatTypeAluminum(*\*values*)[](#eMatTypeAluminum "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eMatTypeAluminum` values, mirroring the product API’s names so code reads like its docs.
* SubType\_5052\_H34* = 3*[](#eMatTypeAluminum.SubType_5052_H34 "Link to this definition")
- SubType\_6061\_T6* = 1*[](#eMatTypeAluminum.SubType_6061_T6 "Link to this definition")
* SubType\_6063\_T6* = 2*[](#eMatTypeAluminum.SubType_6063_T6 "Link to this definition")
## eMatTypeColdFormed[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eMatTypeColdFormed "Direct link to eMatTypeColdFormed")
* *class *viktor.external.sap2000.enums.eMatTypeColdFormed(*\*values*)[](#eMatTypeColdFormed "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eMatTypeColdFormed` values, mirroring the product API’s names so code reads like its docs.
* ASTM\_A653SQGr33* = 1*[](#eMatTypeColdFormed.ASTM_A653SQGr33 "Link to this definition")
- ASTM\_A653SQGr50* = 2*[](#eMatTypeColdFormed.ASTM_A653SQGr50 "Link to this definition")
## eMatTypeConcrete[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eMatTypeConcrete "Direct link to eMatTypeConcrete")
* *class *viktor.external.sap2000.enums.eMatTypeConcrete(*\*values*)[](#eMatTypeConcrete "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eMatTypeConcrete` values, mirroring the product API’s names so code reads like its docs.
* Chinese\_C20\_NormalWeight* = 9*[](#eMatTypeConcrete.Chinese_C20_NormalWeight "Link to this definition")
- Chinese\_C30\_NormalWeight* = 10*[](#eMatTypeConcrete.Chinese_C30_NormalWeight "Link to this definition")
* Chinese\_C40\_NormalWeight* = 11*[](#eMatTypeConcrete.Chinese_C40_NormalWeight "Link to this definition")
- EN\_C12\_NormalWeight* = 22*[](#eMatTypeConcrete.EN_C12_NormalWeight "Link to this definition")
* EN\_C16\_NormalWeight* = 23*[](#eMatTypeConcrete.EN_C16_NormalWeight "Link to this definition")
- EN\_C20\_NormalWeight* = 24*[](#eMatTypeConcrete.EN_C20_NormalWeight "Link to this definition")
* EN\_C25\_NormalWeight* = 25*[](#eMatTypeConcrete.EN_C25_NormalWeight "Link to this definition")
- EN\_C30\_NormalWeight* = 26*[](#eMatTypeConcrete.EN_C30_NormalWeight "Link to this definition")
* EN\_C35\_NormalWeight* = 27*[](#eMatTypeConcrete.EN_C35_NormalWeight "Link to this definition")
- EN\_C40\_NormalWeight* = 28*[](#eMatTypeConcrete.EN_C40_NormalWeight "Link to this definition")
* EN\_C45\_NormalWeight* = 29*[](#eMatTypeConcrete.EN_C45_NormalWeight "Link to this definition")
- EN\_C50\_NormalWeight* = 30*[](#eMatTypeConcrete.EN_C50_NormalWeight "Link to this definition")
* EN\_C55\_NormalWeight* = 31*[](#eMatTypeConcrete.EN_C55_NormalWeight "Link to this definition")
- EN\_C60\_NormalWeight* = 32*[](#eMatTypeConcrete.EN_C60_NormalWeight "Link to this definition")
* EN\_C70\_NormalWeight* = 33*[](#eMatTypeConcrete.EN_C70_NormalWeight "Link to this definition")
- EN\_C80\_NormalWeight* = 34*[](#eMatTypeConcrete.EN_C80_NormalWeight "Link to this definition")
* EN\_C90\_NormalWeight* = 35*[](#eMatTypeConcrete.EN_C90_NormalWeight "Link to this definition")
- FC3000\_LightWeight* = 5*[](#eMatTypeConcrete.FC3000_LightWeight "Link to this definition")
* FC3000\_NormalWeight* = 1*[](#eMatTypeConcrete.FC3000_NormalWeight "Link to this definition")
- FC4000\_LightWeight* = 6*[](#eMatTypeConcrete.FC4000_LightWeight "Link to this definition")
* FC4000\_NormalWeight* = 2*[](#eMatTypeConcrete.FC4000_NormalWeight "Link to this definition")
- FC5000\_LightWeight* = 7*[](#eMatTypeConcrete.FC5000_LightWeight "Link to this definition")
* FC5000\_NormalWeight* = 3*[](#eMatTypeConcrete.FC5000_NormalWeight "Link to this definition")
- FC6000\_LightWeight* = 8*[](#eMatTypeConcrete.FC6000_LightWeight "Link to this definition")
* FC6000\_NormalWeight* = 4*[](#eMatTypeConcrete.FC6000_NormalWeight "Link to this definition")
- Indian\_M15\_NormalWeight* = 12*[](#eMatTypeConcrete.Indian_M15_NormalWeight "Link to this definition")
* Indian\_M20\_NormalWeight* = 13*[](#eMatTypeConcrete.Indian_M20_NormalWeight "Link to this definition")
- Indian\_M25\_NormalWeight* = 14*[](#eMatTypeConcrete.Indian_M25_NormalWeight "Link to this definition")
* Indian\_M30\_NormalWeight* = 15*[](#eMatTypeConcrete.Indian_M30_NormalWeight "Link to this definition")
- Indian\_M35\_NormalWeight* = 16*[](#eMatTypeConcrete.Indian_M35_NormalWeight "Link to this definition")
* Indian\_M40\_NormalWeight* = 17*[](#eMatTypeConcrete.Indian_M40_NormalWeight "Link to this definition")
- Indian\_M45\_NormalWeight* = 18*[](#eMatTypeConcrete.Indian_M45_NormalWeight "Link to this definition")
* Indian\_M50\_NormalWeight* = 19*[](#eMatTypeConcrete.Indian_M50_NormalWeight "Link to this definition")
- Indian\_M55\_NormalWeight* = 20*[](#eMatTypeConcrete.Indian_M55_NormalWeight "Link to this definition")
* Indian\_M60\_NormalWeight* = 21*[](#eMatTypeConcrete.Indian_M60_NormalWeight "Link to this definition")
## eMatTypeRebar[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eMatTypeRebar "Direct link to eMatTypeRebar")
* *class *viktor.external.sap2000.enums.eMatTypeRebar(*\*values*)[](#eMatTypeRebar "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eMatTypeRebar` values, mirroring the product API’s names so code reads like its docs.
* ASTM\_A615Gr40* = 1*[](#eMatTypeRebar.ASTM_A615Gr40 "Link to this definition")
- ASTM\_A615Gr60* = 2*[](#eMatTypeRebar.ASTM_A615Gr60 "Link to this definition")
* ASTM\_A615Gr75* = 3*[](#eMatTypeRebar.ASTM_A615Gr75 "Link to this definition")
- ASTM\_A706* = 4*[](#eMatTypeRebar.ASTM_A706 "Link to this definition")
* Chinese\_HPB235* = 5*[](#eMatTypeRebar.Chinese_HPB235 "Link to this definition")
- Chinese\_HRB335* = 6*[](#eMatTypeRebar.Chinese_HRB335 "Link to this definition")
* Chinese\_HRB400* = 7*[](#eMatTypeRebar.Chinese_HRB400 "Link to this definition")
- Indian\_HYSD415* = 9*[](#eMatTypeRebar.Indian_HYSD415 "Link to this definition")
* Indian\_HYSD500* = 10*[](#eMatTypeRebar.Indian_HYSD500 "Link to this definition")
- Indian\_HYSD550* = 11*[](#eMatTypeRebar.Indian_HYSD550 "Link to this definition")
* Indian\_Mild250* = 8*[](#eMatTypeRebar.Indian_Mild250 "Link to this definition")
## eMatTypeSteel[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eMatTypeSteel "Direct link to eMatTypeSteel")
* *class *viktor.external.sap2000.enums.eMatTypeSteel(*\*values*)[](#eMatTypeSteel "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eMatTypeSteel` values, mirroring the product API’s names so code reads like its docs.
* ASTM\_A36* = 1*[](#eMatTypeSteel.ASTM_A36 "Link to this definition")
- ASTM\_A500GrB\_Fy42* = 3*[](#eMatTypeSteel.ASTM_A500GrB_Fy42 "Link to this definition")
* ASTM\_A500GrB\_Fy46* = 4*[](#eMatTypeSteel.ASTM_A500GrB_Fy46 "Link to this definition")
- ASTM\_A53GrB* = 2*[](#eMatTypeSteel.ASTM_A53GrB "Link to this definition")
* ASTM\_A572Gr50* = 5*[](#eMatTypeSteel.ASTM_A572Gr50 "Link to this definition")
- ASTM\_A913Gr50* = 6*[](#eMatTypeSteel.ASTM_A913Gr50 "Link to this definition")
* ASTM\_A992\_Fy50* = 7*[](#eMatTypeSteel.ASTM_A992_Fy50 "Link to this definition")
- Chinese\_Q235* = 8*[](#eMatTypeSteel.Chinese_Q235 "Link to this definition")
* Chinese\_Q345* = 9*[](#eMatTypeSteel.Chinese_Q345 "Link to this definition")
- Chinese\_Q355* = 16*[](#eMatTypeSteel.Chinese_Q355 "Link to this definition")
* EN100252\_S235* = 12*[](#eMatTypeSteel.EN100252_S235 "Link to this definition")
- EN100252\_S275* = 13*[](#eMatTypeSteel.EN100252_S275 "Link to this definition")
* EN100252\_S355* = 14*[](#eMatTypeSteel.EN100252_S355 "Link to this definition")
- EN100252\_S450* = 15*[](#eMatTypeSteel.EN100252_S450 "Link to this definition")
* Indian\_Fe250* = 10*[](#eMatTypeSteel.Indian_Fe250 "Link to this definition")
- Indian\_Fe345* = 11*[](#eMatTypeSteel.Indian_Fe345 "Link to this definition")
## eMatTypeTendon[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eMatTypeTendon "Direct link to eMatTypeTendon")
* *class *viktor.external.sap2000.enums.eMatTypeTendon(*\*values*)[](#eMatTypeTendon "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eMatTypeTendon` values, mirroring the product API’s names so code reads like its docs.
* ASTM\_A416Gr250* = 1*[](#eMatTypeTendon.ASTM_A416Gr250 "Link to this definition")
- ASTM\_A416Gr270* = 2*[](#eMatTypeTendon.ASTM_A416Gr270 "Link to this definition")
## eNamedSetType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eNamedSetType "Direct link to eNamedSetType")
* *class *viktor.external.sap2000.enums.eNamedSetType(*\*values*)[](#eNamedSetType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eNamedSetType` values, mirroring the product API’s names so code reads like its docs.
* All* = 0*[](#eNamedSetType.All "Link to this definition")
- BridgeCalculationReport* = 17*[](#eNamedSetType.BridgeCalculationReport "Link to this definition")
* BridgeCalculationReportSub* = 18*[](#eNamedSetType.BridgeCalculationReportSub "Link to this definition")
- BridgeSeismicReport* = 15*[](#eNamedSetType.BridgeSeismicReport "Link to this definition")
* BridgeSuperstructureResponse* = 16*[](#eNamedSetType.BridgeSuperstructureResponse "Link to this definition")
- JointTHResponseSpectra* = 8*[](#eNamedSetType.JointTHResponseSpectra "Link to this definition")
* NamedDisplay* = 9*[](#eNamedSetType.NamedDisplay "Link to this definition")
- PlotFunctionTraces* = 10*[](#eNamedSetType.PlotFunctionTraces "Link to this definition")
* PushoverCurve* = 11*[](#eNamedSetType.PushoverCurve "Link to this definition")
- RunAnalysis* = 2*[](#eNamedSetType.RunAnalysis "Link to this definition")
* RunBridgeDesignSeismic* = 5*[](#eNamedSetType.RunBridgeDesignSeismic "Link to this definition")
- RunBridgeDesignSubstructure* = 4*[](#eNamedSetType.RunBridgeDesignSubstructure "Link to this definition")
* RunBridgeDesignSuperstructure* = 3*[](#eNamedSetType.RunBridgeDesignSuperstructure "Link to this definition")
- RunBridgeRatingSuperstructure* = 6*[](#eNamedSetType.RunBridgeRatingSuperstructure "Link to this definition")
* RunMemberRating* = 7*[](#eNamedSetType.RunMemberRating "Link to this definition")
- TableGroupSuperset* = 14*[](#eNamedSetType.TableGroupSuperset "Link to this definition")
* TableSet* = 13*[](#eNamedSetType.TableSet "Link to this definition")
- UpdateBridgeObject* = 1*[](#eNamedSetType.UpdateBridgeObject "Link to this definition")
* VirtualWork* = 12*[](#eNamedSetType.VirtualWork "Link to this definition")
## eObjType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eObjType "Direct link to eObjType")
* *class *viktor.external.sap2000.enums.eObjType(*\*values*)[](#eObjType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eObjType` values, mirroring the product API’s names so code reads like its docs.
* Area* = 3*[](#eObjType.Area "Link to this definition")
- Frame* = 2*[](#eObjType.Frame "Link to this definition")
* Point* = 1*[](#eObjType.Point "Link to this definition")
- Solid* = 6*[](#eObjType.Solid "Link to this definition")
## eReturnCode[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eReturnCode "Direct link to eReturnCode")
* *class *viktor.external.sap2000.enums.eReturnCode(*\*values*)[](#eReturnCode "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eReturnCode` values, mirroring the product API’s names so code reads like its docs.
* Deprecated* = -98*[](#eReturnCode.Deprecated "Link to this definition")
- NoError* = 0*[](#eReturnCode.NoError "Link to this definition")
* NotApplicable* = -100*[](#eReturnCode.NotApplicable "Link to this definition")
- NotImplemented* = -99*[](#eReturnCode.NotImplemented "Link to this definition")
* TableDoesNotExist* = -96*[](#eReturnCode.TableDoesNotExist "Link to this definition")
- TableIsObsolete* = -97*[](#eReturnCode.TableIsObsolete "Link to this definition")
* UnspecifiedError* = 1*[](#eReturnCode.UnspecifiedError "Link to this definition")
## eSolidPropFormulationType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eSolidPropFormulationType "Direct link to eSolidPropFormulationType")
* *class *viktor.external.sap2000.enums.eSolidPropFormulationType(*\*values*)[](#eSolidPropFormulationType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eSolidPropFormulationType` values, mirroring the product API’s names so code reads like its docs.
* LegacyQuadratic* = 1*[](#eSolidPropFormulationType.LegacyQuadratic "Link to this definition")
- LegacyStandard* = 0*[](#eSolidPropFormulationType.LegacyStandard "Link to this definition")
* Quadratic* = 3*[](#eSolidPropFormulationType.Quadratic "Link to this definition")
- Standard* = 2*[](#eSolidPropFormulationType.Standard "Link to this definition")
## eSuperObjectClass[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eSuperObjectClass "Direct link to eSuperObjectClass")
* *class *viktor.external.sap2000.enums.eSuperObjectClass(*\*values*)[](#eSuperObjectClass "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eSuperObjectClass` values, mirroring the product API’s names so code reads like its docs.
* BridgeFoundation* = 3*[](#eSuperObjectClass.BridgeFoundation "Link to this definition")
- Foundation* = 2*[](#eSuperObjectClass.Foundation "Link to this definition")
* None\_* = 0*[](#eSuperObjectClass.None_ "Link to this definition")
- SuperObject* = 1*[](#eSuperObjectClass.SuperObject "Link to this definition")
## eTemperature[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eTemperature "Direct link to eTemperature")
* *class *viktor.external.sap2000.enums.eTemperature(*\*values*)[](#eTemperature "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eTemperature` values, mirroring the product API’s names so code reads like its docs.
* C* = 2*[](#eTemperature.C "Link to this definition")
- F* = 1*[](#eTemperature.F "Link to this definition")
* NotApplicable* = 0*[](#eTemperature.NotApplicable "Link to this definition")
## eTemplateType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eTemplateType "Direct link to eTemplateType")
* *class *viktor.external.sap2000.enums.eTemplateType(*\*values*)[](#eTemplateType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eTemplateType` values, mirroring the product API’s names so code reads like its docs.
* Advanced* = 17*[](#eTemplateType.Advanced "Link to this definition")
- Barrel* = 12*[](#eTemplateType.Barrel "Link to this definition")
* Beam* = 2*[](#eTemplateType.Beam "Link to this definition")
- BracedFrame* = 7*[](#eTemplateType.BracedFrame "Link to this definition")
* Bridge* = 11*[](#eTemplateType.Bridge "Link to this definition")
- BridgeWizard* = 23*[](#eTemplateType.BridgeWizard "Link to this definition")
* CableBridges* = 29*[](#eTemplateType.CableBridges "Link to this definition")
- Clear* = 1*[](#eTemplateType.Clear "Link to this definition")
* Cylinder* = 13*[](#eTemplateType.Cylinder "Link to this definition")
- Dome* = 14*[](#eTemplateType.Dome "Link to this definition")
* EccentricFrame* = 8*[](#eTemplateType.EccentricFrame "Link to this definition")
- Floor* = 16*[](#eTemplateType.Floor "Link to this definition")
* Frame2D* = 21*[](#eTemplateType.Frame2D "Link to this definition")
- Frame3D* = 22*[](#eTemplateType.Frame3D "Link to this definition")
* Grid* = 0*[](#eTemplateType.Grid "Link to this definition")
- PerimeterFrame* = 9*[](#eTemplateType.PerimeterFrame "Link to this definition")
* PipesAndPlates* = 24*[](#eTemplateType.PipesAndPlates "Link to this definition")
- PortalFrame* = 6*[](#eTemplateType.PortalFrame "Link to this definition")
* ShearWall* = 15*[](#eTemplateType.ShearWall "Link to this definition")
- Shells* = 25*[](#eTemplateType.Shells "Link to this definition")
* SlopedTruss* = 3*[](#eTemplateType.SlopedTruss "Link to this definition")
- SolidModels* = 26*[](#eTemplateType.SolidModels "Link to this definition")
* SpaceFrame* = 10*[](#eTemplateType.SpaceFrame "Link to this definition")
- SpaceTruss* = 5*[](#eTemplateType.SpaceTruss "Link to this definition")
* Staircases* = 28*[](#eTemplateType.Staircases "Link to this definition")
- StorageStructures* = 27*[](#eTemplateType.StorageStructures "Link to this definition")
* Truss2D* = 19*[](#eTemplateType.Truss2D "Link to this definition")
- Truss3D* = 20*[](#eTemplateType.Truss3D "Link to this definition")
* UndergoundConcrete* = 18*[](#eTemplateType.UndergoundConcrete "Link to this definition")
- VerticalTruss* = 4*[](#eTemplateType.VerticalTruss "Link to this definition")
## eUnits[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eUnits "Direct link to eUnits")
* *class *viktor.external.sap2000.enums.eUnits(*\*values*)[](#eUnits "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eUnits` values, mirroring the product API’s names so code reads like its docs.
* N\_cm\_C* = 15*[](#eUnits.N_cm_C "Link to this definition")
- N\_m\_C* = 10*[](#eUnits.N_m_C "Link to this definition")
* N\_mm\_C* = 9*[](#eUnits.N_mm_C "Link to this definition")
- Ton\_cm\_C* = 16*[](#eUnits.Ton_cm_C "Link to this definition")
* Ton\_m\_C* = 12*[](#eUnits.Ton_m_C "Link to this definition")
- Ton\_mm\_C* = 11*[](#eUnits.Ton_mm_C "Link to this definition")
* kN\_cm\_C* = 13*[](#eUnits.kN_cm_C "Link to this definition")
- kN\_m\_C* = 6*[](#eUnits.kN_m_C "Link to this definition")
* kN\_mm\_C* = 5*[](#eUnits.kN_mm_C "Link to this definition")
- kgf\_cm\_C* = 14*[](#eUnits.kgf_cm_C "Link to this definition")
* kgf\_m\_C* = 8*[](#eUnits.kgf_m_C "Link to this definition")
- kgf\_mm\_C* = 7*[](#eUnits.kgf_mm_C "Link to this definition")
* kip\_ft\_F* = 4*[](#eUnits.kip_ft_F "Link to this definition")
- kip\_in\_F* = 3*[](#eUnits.kip_in_F "Link to this definition")
* lb\_ft\_F* = 2*[](#eUnits.lb_ft_F "Link to this definition")
- lb\_in\_F* = 1*[](#eUnits.lb_in_F "Link to this definition")
## eWallPierRebarLayerType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eWallPierRebarLayerType "Direct link to eWallPierRebarLayerType")
* *class *viktor.external.sap2000.enums.eWallPierRebarLayerType(*\*values*)[](#eWallPierRebarLayerType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eWallPierRebarLayerType` values, mirroring the product API’s names so code reads like its docs.
* Confinement\_EndZoneI* = 5*[](#eWallPierRebarLayerType.Confinement_EndZoneI "Link to this definition")
- Confinement\_EndZoneJ* = 6*[](#eWallPierRebarLayerType.Confinement_EndZoneJ "Link to this definition")
* Diagonal\_Each* = 7*[](#eWallPierRebarLayerType.Diagonal_Each "Link to this definition")
- Horizontal\_Distributed\_MiddleZone\_Eachface* = 2*[](#eWallPierRebarLayerType.Horizontal_Distributed_MiddleZone_Eachface "Link to this definition")
* Vertical\_Distributed\_EndZoneI\_Total* = 3*[](#eWallPierRebarLayerType.Vertical_Distributed_EndZoneI_Total "Link to this definition")
- Vertical\_Distributed\_EndZoneJ\_Total* = 4*[](#eWallPierRebarLayerType.Vertical_Distributed_EndZoneJ_Total "Link to this definition")
* Vertical\_Distributed\_MiddleZone\_Eachface* = 1*[](#eWallPierRebarLayerType.Vertical_Distributed_MiddleZone_Eachface "Link to this definition")
## eWallSpandrelRebarLayerType[](https://docs.viktor.ai/sdk/api/external/sap2000/.md#_eWallSpandrelRebarLayerType "Direct link to eWallSpandrelRebarLayerType")
* *class *viktor.external.sap2000.enums.eWallSpandrelRebarLayerType(*\*values*)[](#eWallSpandrelRebarLayerType "Link to this definition")
Bases: `IntEnum`
New in 14.32.0
SAP2000 `eWallSpandrelRebarLayerType` values, mirroring the product API’s names so code reads like its docs.
* Diagonal\_Each* = 5*[](#eWallSpandrelRebarLayerType.Diagonal_Each "Link to this definition")
- Horizontal\_Bottom\_Total* = 2*[](#eWallSpandrelRebarLayerType.Horizontal_Bottom_Total "Link to this definition")
* Horizontal\_Distributed\_Eachface* = 3*[](#eWallSpandrelRebarLayerType.Horizontal_Distributed_Eachface "Link to this definition")
- Horizontal\_Top\_Total* = 1*[](#eWallSpandrelRebarLayerType.Horizontal_Top_Total "Link to this definition")
* Vertical\_Ties\_Distributed* = 4*[](#eWallSpandrelRebarLayerType.Vertical_Ties_Distributed "Link to this definition")
---
# viktor.external.scia
## CalcSetting[](https://docs.viktor.ai/sdk/api/external/scia/.md#_CalcSetting "Direct link to CalcSetting")
* *class *viktor.external.scia.scia.CalcSetting(*\*values*)[](#CalcSetting "Link to this definition")
Bases: `Enum`
Enumeration of calculation settings:
* CSS*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'CSS'*[](#CalcSetting.CSS "Link to this definition")
- EIG*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'EIG'*[](#CalcSetting.EIG "Link to this definition")
* INF*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'INF'*[](#CalcSetting.INF "Link to this definition")
- LIN*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'LIN'*[](#CalcSetting.LIN "Link to this definition")
* MOB*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'MOB'*[](#CalcSetting.MOB "Link to this definition")
- NEL*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'NEL'*[](#CalcSetting.NEL "Link to this definition")
* NOC*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'NOC'*[](#CalcSetting.NOC "Link to this definition")
- NONE*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'NONE'*[](#CalcSetting.NONE "Link to this definition")
* NPH*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'NPH'*[](#CalcSetting.NPH "Link to this definition")
- NST*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'NST'*[](#CalcSetting.NST "Link to this definition")
* PHA*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'PHA'*[](#CalcSetting.PHA "Link to this definition")
- SLN*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'SLN'*[](#CalcSetting.SLN "Link to this definition")
* STB*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'STB'*[](#CalcSetting.STB "Link to this definition")
- TDA*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'TDA'*[](#CalcSetting.TDA "Link to this definition")
* TID*: [`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")** = 'TID'*[](#CalcSetting.TID "Link to this definition")
## Model[](https://docs.viktor.ai/sdk/api/external/scia/.md#_Model "Direct link to Model")
* *class *viktor.external.scia.scia.Model(*\**, *mesh\_setup=None*, *solver\_setup=None*, *project\_data=None*)[](#Model "Link to this definition")
This Model can be used to construct a SCIA model and generate its corresponding input XML file. This file can in turn be used as input of [`SciaAnalysis`](#SciaAnalysis "viktor.external.scia.scia.SciaAnalysis"). For a more detailed elaboration, please see the tutorial.
Example usage:
```
# Initialize the model
model = Model()
# Construct the geometry
n1 = model.create_node('K:1', 0, 0, 0)
n2 = model.create_node('K:2', 1, 0, 0)
css = model.create_circular_cross_section('css', Material(123, 'some_material'), 100)
beam = model.create_beam(n1, n2, css)
#Construct the boundary conditions
freedom = (PointSupport.Freedom.RIGID, PointSupport.Freedom.RIGID, PointSupport.Freedom.RIGID,
PointSupport.Freedom.RIGID, PointSupport.Freedom.RIGID, PointSupport.Freedom.RIGID)
model.create_point_support('Sn1', n1, PointSupport.Type.STANDARD, freedom, (0, 0, 0, 0, 0, 0),
PointSupport.CSys.GLOBAL)
# Construct a load combination
load_group = model.create_load_group('LG1', LoadGroup.LoadOption.VARIABLE, LoadGroup.RelationOption.STANDARD,
LoadGroup.LoadTypeOption.CAT_A)
load_case = model.create_variable_load_case('LC1', 'My first load case', load_group,
LoadCase.VariableLoadType.STATIC, LoadCase.Specification.STANDARD, LoadCase.Duration.SHORT)
model.create_load_combination('C1', LoadCombination.Type.ENVELOPE_ULTIMATE, {load_case: 1})
# Generate the input XML file
input_xml = model.generate_xml_input()
```
* Parameters:
* **mesh\_setup** ([`MeshSetup`](https://docs.viktor.ai/sdk/api/external/scia/.md#MeshSetup "viktor.external.scia.object.MeshSetup")) – Optional mesh settings.
* **solver\_setup** ([`SolverSetup`](https://docs.viktor.ai/sdk/api/external/scia/.md#SolverSetup "viktor.external.scia.object.SolverSetup")) – Optional solver settings
New in v13.1.0
.
* **project\_data** ([`ProjectData`](https://docs.viktor.ai/sdk/api/external/scia/.md#ProjectData "viktor.external.scia.object.ProjectData")) – Optional project settings
New in v13.1.0
.
- *property *arbitrary\_profiles*: Tuple\[[ArbitraryProfile](https://docs.viktor.ai/sdk/api/external/scia/.md#ArbitraryProfile "viktor.external.scia.object.ArbitraryProfile"), ...]*[](#Model.arbitrary_profiles "Link to this definition")
* *property *averaging\_strips*: Tuple\[[AveragingStrip](https://docs.viktor.ai/sdk/api/external/scia/.md#AveragingStrip "viktor.external.scia.object.AveragingStrip"), ...]*[](#Model.averaging_strips "Link to this definition")
- *property *beams*: Tuple\[[Beam](https://docs.viktor.ai/sdk/api/external/scia/.md#Beam "viktor.external.scia.object.Beam"), ...]*[](#Model.beams "Link to this definition")
* *property *concrete\_materials*: Tuple\[[Concrete](https://docs.viktor.ai/sdk/api/external/scia/.md#Concrete "viktor.external.scia.object.Concrete"), ...]*[](#Model.concrete_materials "Link to this definition")
- create\_arbitrary\_profile(*name*, *beam*, *c\_def*, *cross\_section*, *spans*)[](#Model.create_arbitrary_profile "Link to this definition")
Method to construct an arbitrary profile.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **beam** ([`Beam`](https://docs.viktor.ai/sdk/api/external/scia/.md#Beam "viktor.external.scia.object.Beam")) – beam object ([`create_beam()`](#Model.create_beam "viktor.external.scia.scia.Model.create_beam")).
* **c\_def** ([`CDef`](https://docs.viktor.ai/sdk/api/external/scia/.md#ArbitraryProfile.CDef "viktor.external.scia.object.ArbitraryProfile.CDef")) – enumeration of coordinate definition types
* **cross\_section** ([`CrossSection`](https://docs.viktor.ai/sdk/api/external/scia/.md#CrossSection "viktor.external.scia.object.CrossSection")) – previously created cross-section object
* **spans** (`List`\[[`ArbitraryProfileSpan`](https://docs.viktor.ai/sdk/api/external/scia/.md#ArbitraryProfileSpan "viktor.external.scia.object.ArbitraryProfileSpan")]) – list of arbitrary profile span objects ([`create_arbitrary_profile_span()`](#Model.create_arbitrary_profile_span "viktor.external.scia.scia.Model.create_arbitrary_profile_span")).
* Return type:
[`ArbitraryProfile`](https://docs.viktor.ai/sdk/api/external/scia/.md#ArbitraryProfile "viktor.external.scia.object.ArbitraryProfile")
* create\_arbitrary\_profile\_span(*length*, *type\_of\_css*, *cross\_section\_start*, *cross\_section\_end*, *alignment*)[](#Model.create_arbitrary_profile_span "Link to this definition")
Method to construct an arbitrary profile span, which is necessary to construct an arbitrary profile.
* Parameters:
* **length** (`float`) – length of the span
* **type\_of\_css** ([`TypeOfCss`](https://docs.viktor.ai/sdk/api/external/scia/.md#ArbitraryProfileSpan.TypeOfCss "viktor.external.scia.object.ArbitraryProfileSpan.TypeOfCss")) – enumeration of cross-section types
* **cross\_section\_start** ([`CrossSection`](https://docs.viktor.ai/sdk/api/external/scia/.md#CrossSection "viktor.external.scia.object.CrossSection")) – previously created cross-section object at the start point
* **cross\_section\_end** ([`CrossSection`](https://docs.viktor.ai/sdk/api/external/scia/.md#CrossSection "viktor.external.scia.object.CrossSection")) – previously created cross-section object at the end point
* **alignment** ([`Alignment`](https://docs.viktor.ai/sdk/api/external/scia/.md#ArbitraryProfileSpan.Alignment "viktor.external.scia.object.ArbitraryProfileSpan.Alignment")) – enumeration of alignment types
* Return type:
[`ArbitraryProfileSpan`](https://docs.viktor.ai/sdk/api/external/scia/.md#ArbitraryProfileSpan "viktor.external.scia.object.ArbitraryProfileSpan")
- create\_averaging\_strip(*plane*, *\**, *strip\_type*, *point\_1*, *width*, *length*, *angle*, *direction*, *name=None*)[](#Model.create_averaging_strip "Link to this definition")
New in v14.3.0
Method to construct an averaging strip, which can be used for the automatic averaging of peak results.
* Parameters:
* **plane** ([`Plane`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane")) – plane object ([`create_plane()`](#Model.create_plane "viktor.external.scia.scia.Model.create_plane")).
* **strip\_type** ([`Type`](https://docs.viktor.ai/sdk/api/external/scia/.md#AveragingStrip.Type "viktor.external.scia.object.AveragingStrip.Type")) – Currently only Point type is supported
* **point\_1** (`Tuple`\[`float`, `float`, `float`]) – tuple of coordinates (x, y, z) of the center position in \[m]
* **width** (`float`) – width of the strip in \[m]
* **length** (`float`) – length of the strip in \[m]
* **angle** (`float`) – defines the direction of the strip \[deg]
* **direction** ([`Direction`](https://docs.viktor.ai/sdk/api/external/scia/.md#AveragingStrip.Direction "viktor.external.scia.object.AveragingStrip.Direction")) – direction in which the averaging is to be calculated
* **name** (`str`) – name which will be shown in SCIA (default: ‘RS{i}’)
* Return type:
[`AveragingStrip`](https://docs.viktor.ai/sdk/api/external/scia/.md#AveragingStrip "viktor.external.scia.object.AveragingStrip")
* create\_beam(*begin\_node*, *end\_node*, *cross\_section*, *\**, *name=None*, *ez=None*, *lcs\_rotation=None*, *layer=None*)[](#Model.create_beam "Link to this definition")
Method to construct a beam.
* Parameters:
* **begin\_node** ([`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")) – node object ([`create_node()`](#Model.create_node "viktor.external.scia.scia.Model.create_node")) at the start of the beam.
* **end\_node** ([`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")) – node object ([`create_node()`](#Model.create_node "viktor.external.scia.scia.Model.create_node")) at the end of the beam.
* **cross\_section** ([`CrossSection`](https://docs.viktor.ai/sdk/api/external/scia/.md#CrossSection "viktor.external.scia.object.CrossSection")) – previously created cross-section object
* **name** (`str`) – name which will be shown in SCIA (default: ‘B{i}’)
* **ez** (`float`) – eccentricity in Z-direction w\.r.t. the beam’s center line in \[m] (default: 0)
* **lcs\_rotation** (`float`) – rotation of local coordinate system \[deg] (default: 0)
* **layer** ([`Layer`](https://docs.viktor.ai/sdk/api/external/scia/.md#Layer "viktor.external.scia.object.Layer")) – layer object ([`create_layer()`](#Model.create_layer "viktor.external.scia.scia.Model.create_layer")) to which the beam will be added
* Return type:
[`Beam`](https://docs.viktor.ai/sdk/api/external/scia/.md#Beam "viktor.external.scia.object.Beam")
- create\_circular\_composed\_cross\_section(*name*, *material*, *material\_2*, *diameter*, *thickness*)[](#Model.create_circular_composed_cross_section "Link to this definition")
Method to construct a circular cross-section, composed of two materials.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **material** ([`Material`](https://docs.viktor.ai/sdk/api/external/scia/.md#Material "viktor.external.scia.object.Material")) – outer material of the cross-section
* **material\_2** ([`Material`](https://docs.viktor.ai/sdk/api/external/scia/.md#Material "viktor.external.scia.object.Material")) – inner material of the cross-section
* **diameter** (`float`) – diameter of the cross-section in \[m]
* **thickness** (`float`) – thickness in \[m]
* Return type:
[`CircularComposedCrossSection`](https://docs.viktor.ai/sdk/api/external/scia/.md#CircularComposedCrossSection "viktor.external.scia.object.CircularComposedCrossSection")
* create\_circular\_cross\_section(*name*, *material*, *diameter*)[](#Model.create_circular_cross_section "Link to this definition")
Method to construct a circular cross-section.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **material** ([`Material`](https://docs.viktor.ai/sdk/api/external/scia/.md#Material "viktor.external.scia.object.Material")) – material of the cross-section
* **diameter** (`float`) – diameter of the cross-section in \[m]
* Return type:
[`CircularCrossSection`](https://docs.viktor.ai/sdk/api/external/scia/.md#CircularCrossSection "viktor.external.scia.object.CircularCrossSection")
- create\_circular\_hollow\_cross\_section(*name*, *material*, *diameter*, *thickness*)[](#Model.create_circular_hollow_cross_section "Link to this definition")
Method to construct a circular hollow cross-section.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **material** ([`Material`](https://docs.viktor.ai/sdk/api/external/scia/.md#Material "viktor.external.scia.object.Material")) – material of the cross-section
* **diameter** (`float`) – diameter of the cross-section in \[m]
* **thickness** (`float`) – thickness in \[m]
* Return type:
[`CircularHollowCrossSection`](https://docs.viktor.ai/sdk/api/external/scia/.md#CircularHollowCrossSection "viktor.external.scia.object.CircularHollowCrossSection")
* create\_circular\_plane(*center\_node*, *diameter*, *thickness*, *\**, *material*, *axis=None*, *name=None*, *plane\_type=None*, *layer=None*, *internal\_nodes=None*, *swap\_orientation=None*, *lcs\_rotation=None*, *fem\_model=None*, *orthotropy=None*)[](#Model.create_circular_plane "Link to this definition")
Method to construct a circular 2D member.
* Parameters:
* **center\_node** ([`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")) – node object ([`create_node()`](#Model.create_node "viktor.external.scia.scia.Model.create_node")) located at the center of the plane
* **diameter** (`float`) – diameter of the plane \[m]
* **thickness** (`float`) – thickness of the plane \[m]
* **material** ([`Material`](https://docs.viktor.ai/sdk/api/external/scia/.md#Material "viktor.external.scia.object.Material")) – `Material` of the plane
* **axis** ([`Vector`](https://docs.viktor.ai/sdk/api/geometry/.md#Vector "viktor.geometry.Vector") | `Tuple`\[`float`, `float`, `float`]) – axis direction (default: (0, 0, 1))
* **name** (`str`) – name which will be shown in SCIA (default: ‘S{i}’)
* **plane\_type** ([`Type`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane.Type "viktor.external.scia.object.Plane.Type")) – enumeration of plane types (default: PLATE)
* **layer** ([`Layer`](https://docs.viktor.ai/sdk/api/external/scia/.md#Layer "viktor.external.scia.object.Layer")) – layer object ([`create_layer()`](#Model.create_layer "viktor.external.scia.scia.Model.create_layer")) to which the plane will be added
* **internal\_nodes** (`List`\[[`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")]) – list of internal node objects (default: None)
* **swap\_orientation** (`bool`) – whereas to swap the plate orientation (default: False)
* **lcs\_rotation** (`float`) – rotation of the local coordinate system \[deg] (default: 0.0)
* **fem\_model** ([`FEMModel`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane.FEMModel "viktor.external.scia.object.Plane.FEMModel")) – FEM model to be used in the calculation (default: isotropic)
* **orthotropy** ([`Orthotropy`](https://docs.viktor.ai/sdk/api/external/scia/.md#Orthotropy "viktor.external.scia.object.Orthotropy")) – type of orthotropy (only for fem\_model = ORTHOTROPIC)
* Return type:
[`Plane`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane")
- create\_cross\_link(*beam\_1*, *beam\_2*, *\**, *name=None*)[](#Model.create_cross_link "Link to this definition")
New in v13.1.0
Method to construct a cross-link, connecting two beams.
* Parameters:
* **beam\_1** ([`Beam`](https://docs.viktor.ai/sdk/api/external/scia/.md#Beam "viktor.external.scia.object.Beam")) – first beam ([`create_beam()`](#Model.create_beam "viktor.external.scia.scia.Model.create_beam"))
* **beam\_2** ([`Beam`](https://docs.viktor.ai/sdk/api/external/scia/.md#Beam "viktor.external.scia.object.Beam")) – second beam ([`create_beam()`](#Model.create_beam "viktor.external.scia.scia.Model.create_beam"))
* **name** (`str`) – name which will be shown in SCIA (default: ‘CL{i}’)
* Return type:
[`CrossLink`](https://docs.viktor.ai/sdk/api/external/scia/.md#CrossLink "viktor.external.scia.object.CrossLink")
* create\_free\_line\_load(*name*, *load\_case*, *point\_1*, *point\_2*, *direction*, *magnitude\_1*, *magnitude\_2*)[](#Model.create_free_line_load "Link to this definition")
Method to construct a free line load.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **load\_case** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – previously created load case object in which the load should be placed
* **point\_1** (`Tuple`\[`float`, `float`]) – XY coordinate of the first point
* **point\_2** (`Tuple`\[`float`, `float`]) – XY coordinate of the second point
* **direction** ([`Direction`](https://docs.viktor.ai/sdk/api/external/scia/.md#FreeLoad.Direction "viktor.external.scia.object.FreeLoad.Direction")) – enumeration of direction options
* **magnitude\_1** (`float`) – magnitude of the load in point\_1 in \[N]
* **magnitude\_2** (`float`) – magnitude of the load in point\_2 in \[N]
* Return type:
[`FreeLineLoad`](https://docs.viktor.ai/sdk/api/external/scia/.md#FreeLineLoad "viktor.external.scia.object.FreeLineLoad")
- create\_free\_point\_load(*name*, *load\_case*, *direction*, *magnitude*, *position*)[](#Model.create_free_point_load "Link to this definition")
Method to construct a free point load.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **load\_case** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – previously created load case object in which the load should be placed
* **direction** ([`Direction`](https://docs.viktor.ai/sdk/api/external/scia/.md#FreeLoad.Direction "viktor.external.scia.object.FreeLoad.Direction")) – enumeration of direction options
* **magnitude** (`float`) – magnitude of the load in \[N]
* **position** (`Tuple`\[`float`, `float`]) – XY coordinate of the load
* Return type:
[`FreePointLoad`](https://docs.viktor.ai/sdk/api/external/scia/.md#FreePointLoad "viktor.external.scia.object.FreePointLoad")
* create\_free\_surface\_load(*name*, *load\_case*, *direction*, *q1*, *q2=None*, *q3=None*, *points=None*, *\**, *distribution=None*, *selection=None*)[](#Model.create_free_surface_load "Link to this definition")
Method to construct a free surface load.
Note: can only be defined in XY-plane.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **load\_case** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – previously created load case object in which the load should be placed
* **direction** ([`Direction`](https://docs.viktor.ai/sdk/api/external/scia/.md#FreeLoad.Direction "viktor.external.scia.object.FreeLoad.Direction")) – direction of the load
* **q1** (`float`) – magnitude of the load in the first point in \[N]
* **q2** (`float`) – magnitude of the load in the second point in \[N] (distribution = DIR\_X | DIR\_Y | POINTS only)
* **q3** (`float`) – magnitude of the load in the third point in \[N] (distribution = POINTS only)
* **points** (`List`\[`Tuple`\[`float`, `float`]]) – list of XY coordinates (at least 3). If distribution = DIR\_X | DIR\_Y: q1 and q2 are applied to points\[0] and points\[1] respectively. If distribution = POINTS: q1, q2 and q3 are applied to points\[0], points\[1] and points\[2] respectively.
* **distribution** ([`Distribution`](https://docs.viktor.ai/sdk/api/external/scia/.md#FreeSurfaceLoad.Distribution "viktor.external.scia.object.FreeSurfaceLoad.Distribution")) – distribution of the load (default: POINTS)
* **selection** (`List`\[[`Plane`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane")]) – selection of 1 or more planes ([`create_plane()`](#Model.create_plane "viktor.external.scia.scia.Model.create_plane")) to generate the load on (default: select = auto)
* Return type:
[`FreeSurfaceLoad`](https://docs.viktor.ai/sdk/api/external/scia/.md#FreeSurfaceLoad "viktor.external.scia.object.FreeSurfaceLoad")
- create\_general\_cross\_section(*elements*, *\**, *name=None*)[](#Model.create_general_cross_section "Link to this definition")
New in v14.7.0
Construct a general cross-section.
* Parameters:
* **name** (`str`) – name of the cross-section (default: ‘CS{i}’)
* **elements** (`Sequence`\[[`GeneralCrossSectionElement`](https://docs.viktor.ai/sdk/api/external/scia/.md#GeneralCrossSectionElement "viktor.external.scia.object.GeneralCrossSectionElement")]) – elements (polygon + openings) that build up the cross-section
* Return type:
[`GeneralCrossSection`](https://docs.viktor.ai/sdk/api/external/scia/.md#GeneralCrossSection "viktor.external.scia.object.GeneralCrossSection")
* create\_general\_cross\_section\_element(*name*, *element\_type*, *points*, *\**, *material=None*)[](#Model.create_general_cross_section_element "Link to this definition")
New in v14.7.0
Construct a general cross-section element, which is necessary to construct a general cross-section.
* Parameters:
* **name** (`str`) – name of the element
* **element\_type** ([`Type`](https://docs.viktor.ai/sdk/api/external/scia/.md#GeneralCrossSectionElement.Type "viktor.external.scia.object.GeneralCrossSectionElement.Type")) – element type
* **points** (`Sequence`\[`Tuple`\[`float`, `float`]]) – outline of the element
* **material** ([`Material`](https://docs.viktor.ai/sdk/api/external/scia/.md#Material "viktor.external.scia.object.Material")) – material of the element
* Return type:
[`GeneralCrossSectionElement`](https://docs.viktor.ai/sdk/api/external/scia/.md#GeneralCrossSectionElement "viktor.external.scia.object.GeneralCrossSectionElement")
- create\_hinge\_on\_beam(*beam*, *position*, *\**, *name=None*, *freedom\_ux=Freedom.RIGID*, *freedom\_uy=Freedom.RIGID*, *freedom\_uz=Freedom.RIGID*, *freedom\_fix=Freedom.RIGID*, *freedom\_fiy=Freedom.FREE*, *freedom\_fiz=Freedom.RIGID*, *stiffness\_ux=0*, *stiffness\_uy=0*, *stiffness\_uz=0*, *stiffness\_fix=0*, *stiffness\_fiy=0*, *stiffness\_fiz=0*)[](#Model.create_hinge_on_beam "Link to this definition")
Create a hinge on a beam.
* Parameters:
* **beam** ([`Beam`](https://docs.viktor.ai/sdk/api/external/scia/.md#Beam "viktor.external.scia.object.Beam")) – Beam of appliance ([`create_beam()`](#Model.create_beam "viktor.external.scia.scia.Model.create_beam")).
* **position** ([`Position`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnBeam.Position "viktor.external.scia.object.HingeOnBeam.Position")) – Position of appliance.
* **name** (`str`) – Name of the hinge (default: ‘H{i}’).
* **freedom\_ux** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom")) – Freedom in ux (default: rigid).
* **freedom\_uy** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom")) – Freedom in uy (default: rigid).
* **freedom\_uz** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom")) – Freedom in uz (default: rigid).
* **freedom\_fix** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom")) – Freedom in fix (default: rigid).
* **freedom\_fiy** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom")) – Freedom in fiy (default: free).
* **freedom\_fiz** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom")) – Freedom in fiz (default: rigid).
* **stiffness\_ux** (`float`) – Stiffness in ux \[N/m], only used if freedom in ux = flexible (default: 0.0).
* **stiffness\_uy** (`float`) – Stiffness in uy \[N/m], only used if freedom in uy = flexible (default: 0.0).
* **stiffness\_uz** (`float`) – Stiffness in uz \[N/m], only used if freedom in uz = flexible (default: 0.0).
* **stiffness\_fix** (`float`) – Stiffness in fix \[Nm/rad], only used if freedom in fix = flexible (default: 0.0).
* **stiffness\_fiy** (`float`) – Stiffness in fiy \[Nm/rad], only used if freedom in fiy = flexible (default: 0.0).
* **stiffness\_fiz** (`float`) – Stiffness in fiz \[Nm/rad], only used if freedom in fiz = flexible (default: 0.0).
* Return type:
[`HingeOnBeam`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnBeam "viktor.external.scia.object.HingeOnBeam")
* create\_hinge\_on\_plane(*edge*, *\**, *name=None*, *ux=None*, *stiffness\_ux=None*, *uy=None*, *stiffness\_uy=None*, *uz=None*, *stiffness\_uz=None*, *fix=None*, *stiffness\_fix=None*, *c\_def=None*, *position\_x1=None*, *position\_x2=None*, *origin=None*)[](#Model.create_hinge_on_plane "Link to this definition")
Method to construct a hinge on a plane edge.
* Parameters:
* **edge** (`Tuple`\[[`Plane`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane"), `int`] | [`InternalEdge`](https://docs.viktor.ai/sdk/api/external/scia/.md#InternalEdge "viktor.external.scia.object.InternalEdge")) – tuple of a plane object ([`create_plane()`](#Model.create_plane "viktor.external.scia.scia.Model.create_plane")) and edge number to which the hinge will be attached (1 = between plane.corner\_nodes\[0] and plane.corner\_nodes\[1], etc.), or InternalEdge ([`create_internal_edge()`](#Model.create_internal_edge "viktor.external.scia.scia.Model.create_internal_edge"))
* **name** (`str`) – name which will be shown in SCIA (default: ‘L{i}’)
* **ux** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnPlane.Freedom "viktor.external.scia.object.HingeOnPlane.Freedom")) – Freedom in ux (default: RIGID).
* **stiffness\_ux** (`float`) – Stiffness in ux \[N/m2], only used if freedom in ux = flexible (default: 0.0).
* **uy** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnPlane.Freedom "viktor.external.scia.object.HingeOnPlane.Freedom")) – Freedom in uy (default: RIGID).
* **stiffness\_uy** (`float`) – Stiffness in uy \[N/m2], only used if freedom in uy = flexible (default: 0.0).
* **uz** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnPlane.Freedom "viktor.external.scia.object.HingeOnPlane.Freedom")) – Freedom in uz (default: RIGID).
* **stiffness\_uz** (`float`) – Stiffness in uz \[N/m2], only used if freedom in uz = flexible (default: 0.0).
* **fix** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnPlane.Freedom "viktor.external.scia.object.HingeOnPlane.Freedom")) – Freedom in fix (default: FREE).
* **stiffness\_fix** (`float`) – Stiffness in fix \[Nm/m/rad], only used if freedom in fix = flexible (default: 0.0).
* **c\_def** ([`CDef`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnPlane.CDef "viktor.external.scia.object.HingeOnPlane.CDef")) – coordinate definition (default: RELATIVE)
* **position\_x1** (`float`) – position of p1 along the edge with respect to origin (\[m] if c\_def = ABSOLUTE, else \[-]) (default: 0.0)
* **position\_x2** (`float`) – position of p2 along the edge with respect to origin (\[m] if c\_def = ABSOLUTE, else \[-]) (default: 1.0)
* **origin** ([`Origin`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnPlane.Origin "viktor.external.scia.object.HingeOnPlane.Origin")) – reference for position\_x1 and position\_x2 (default: FROM\_START)
* Return type:
[`HingeOnPlane`](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnPlane "viktor.external.scia.object.HingeOnPlane")
- create\_integration\_strip(*plane*, *point\_1*, *point\_2*, *width*)[](#Model.create_integration_strip "Link to this definition")
Method to construct an integration strip, which can be used to receive calculation results on its position.
* Parameters:
* **plane** ([`Plane`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane")) – plane object ([`create_plane()`](#Model.create_plane "viktor.external.scia.scia.Model.create_plane")).
* **point\_1** (`Tuple`\[`float`, `float`, `float`]) – tuple of coordinates (x, y, z) of the start position in \[m]
* **point\_2** (`Tuple`\[`float`, `float`, `float`]) – tuple of coordinates (x, y, z) of the end position in \[m]
* **width** (`float`) – width of the strip in \[m]
* Return type:
[`IntegrationStrip`](https://docs.viktor.ai/sdk/api/external/scia/.md#IntegrationStrip "viktor.external.scia.object.IntegrationStrip")
* create\_internal\_edge(*plane*, *node\_1*, *node\_2*, *\**, *name=None*)[](#Model.create_internal_edge "Link to this definition")
Method to construct an internal edge in a 2D member.
* Parameters:
* **plane** ([`Plane`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane")) – plane object ([`create_plane()`](#Model.create_plane "viktor.external.scia.scia.Model.create_plane"))
* **node\_1** ([`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")) – node object ([`create_node()`](#Model.create_node "viktor.external.scia.scia.Model.create_node")) at the start of the edge
* **node\_2** ([`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")) – node object ([`create_node()`](#Model.create_node "viktor.external.scia.scia.Model.create_node")) at the end of the edge
* **name** (`str`) – name which will be shown in SCIA (default: ‘ES{i}’)
* Return type:
[`InternalEdge`](https://docs.viktor.ai/sdk/api/external/scia/.md#InternalEdge "viktor.external.scia.object.InternalEdge")
- create\_layer(*name=None*, *\**, *comment=None*, *structural\_model\_only=None*, *current\_used\_activity=None*)[](#Model.create_layer "Link to this definition")
Method to construct a layer.
Duplicate layer names are not allowed.
* Parameters:
* **name** (`str`) – name of the layer (default: ‘Layer{i}’)
* **comment** (`str`) – optional comment
* **structural\_model\_only** (`bool`) – when ‘True’, the layer is NOT taken into account for the calculation (default: False)
* **current\_used\_activity** (`bool`) – defines if the layer is visible or not on the screen (default: True)
* Return type:
[`Layer`](https://docs.viktor.ai/sdk/api/external/scia/.md#Layer "viktor.external.scia.object.Layer")
* create\_library\_cross\_section(*section*, *profile*, *material*, *\**, *name=None*)[](#Model.create_library_cross_section "Link to this definition")
New in v13.1.0
Method to construct a cross-section that is part of the cross-section library.
* Parameters:
* **section** ([`Section`](https://docs.viktor.ai/sdk/api/external/scia/.md#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")) – section type (e.g. LibraryCrossSection.Section.I)
* **profile** (`str`) – profile name including dimensions (e.g. “SHS30/30/2.0”)
* **material** ([`Material`](https://docs.viktor.ai/sdk/api/external/scia/.md#Material "viktor.external.scia.object.Material")) – material of the cross-section
* **name** (`str`) – name of the cross-section (default: ‘CS{i}’)
* Return type:
[`LibraryCrossSection`](https://docs.viktor.ai/sdk/api/external/scia/.md#LibraryCrossSection "viktor.external.scia.object.LibraryCrossSection")
- create\_line\_load(*name*, *load\_case*, *beam*, *load\_type*, *distribution*, *load\_start*, *load\_end*, *direction*, *position\_start*, *position\_end*, *c\_def*, *c\_sys*, *origin*, *ey*, *ez*)[](#Model.create_line_load "Link to this definition")
Method to construct a line load on a beam.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **load\_case** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – previously created load case object in which the load should be placed
* **beam** ([`Beam`](https://docs.viktor.ai/sdk/api/external/scia/.md#Beam "viktor.external.scia.object.Beam")) – beam object ([`create_beam()`](#Model.create_beam "viktor.external.scia.scia.Model.create_beam")) to which the load should be applied
* **load\_type** ([`Type`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineLoad.Type "viktor.external.scia.object.LineLoad.Type")) – enumeration of load types
* **distribution** ([`Distribution`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineLoad.Distribution "viktor.external.scia.object.LineLoad.Distribution")) – enumeration of distribution options
* **load\_start** (`float`) – magnitude of the load at the start point in \[N]
* **load\_end** (`float`) – magnitude of the load at the end point in \[N]
* **direction** ([`Direction`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineLoad.Direction "viktor.external.scia.object.LineLoad.Direction")) – enumeration of directions
* **position\_start** (`float`) – position of the start point on the beam in \[m]
* **position\_end** (`float`) – position of the end point on the beam in \[m]
* **c\_def** ([`CDef`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineLoad.CDef "viktor.external.scia.object.LineLoad.CDef")) – enumeration of coordinate definition types
* **c\_sys** ([`CSys`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineLoad.CSys "viktor.external.scia.object.LineLoad.CSys")) – enumeration of coordinate system types
* **origin** ([`Origin`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineLoad.Origin "viktor.external.scia.object.LineLoad.Origin")) – enumeration of origin types
* **ey** (`float`) – eccentricity in Y-direction w\.r.t. the beam’s center line in \[m]
* **ez** (`float`) – eccentricity in Z-direction w\.r.t. the beam’s center line in \[m]
* Return type:
[`LineLoad`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineLoad "viktor.external.scia.object.LineLoad")
* create\_line\_load\_on\_plane(*edge*, *p1*, *p2=None*, *\**, *load\_case*, *direction=None*, *name=None*, *location=None*, *c\_sys=None*, *c\_def=None*, *position\_x1=None*, *position\_x2=None*, *origin=None*)[](#Model.create_line_load_on_plane "Link to this definition")
Method to construct a line load on a plane edge.
* Parameters:
* **edge** (`Tuple`\[[`Plane`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane"), `int`] | [`InternalEdge`](https://docs.viktor.ai/sdk/api/external/scia/.md#InternalEdge "viktor.external.scia.object.InternalEdge")) – tuple of a plane object ([`create_plane()`](#Model.create_plane "viktor.external.scia.scia.Model.create_plane")) and edge number to which the load will be applied (1 = between plane.corner\_nodes\[0] and plane.corner\_nodes\[1], etc.), or InternalEdge ([`create_internal_edge()`](#Model.create_internal_edge "viktor.external.scia.scia.Model.create_internal_edge"))
* **p1** (`float`) – magnitude of the load \[N/m] on point 1
* **p2** (`float`) – magnitude of the load \[N/m] on point 2. None for uniform load (with magnitude p1) (default: None)
* **load\_case** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – previously created load case object in which the load should be applied
* **direction** ([`Direction`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineForceSurface.Direction "viktor.external.scia.object.LineForceSurface.Direction")) – direction of the load (default: Z)
* **name** (`str`) – name which will be shown in SCIA (default: ‘LFS{i}’)
* **location** ([`Location`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineForceSurface.Location "viktor.external.scia.object.LineForceSurface.Location")) – location type (default: LENGTH)
* **c\_sys** ([`CSys`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineForceSurface.CSys "viktor.external.scia.object.LineForceSurface.CSys")) – coordinate system (default: LOCAL)
* **c\_def** ([`CDef`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineForceSurface.CDef "viktor.external.scia.object.LineForceSurface.CDef")) – coordinate definition (default: RELATIVE)
* **position\_x1** (`float`) – position of p1 along the edge with respect to origin (\[m] if c\_def = ABSOLUTE, else \[-]) (default: 0.0)
* **position\_x2** (`float`) – position of p2 along the edge with respect to origin (\[m] if c\_def = ABSOLUTE, else \[-]) (default: 1.0)
* **origin** ([`Origin`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineForceSurface.Origin "viktor.external.scia.object.LineForceSurface.Origin")) – reference for position\_x1 and position\_x2 (default: FROM\_START)
* Return type:
[`LineForceSurface`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineForceSurface "viktor.external.scia.object.LineForceSurface")
- create\_line\_moment\_on\_beam(*beam*, *load\_case*, *m1*, *m2=None*, *\**, *name=None*, *direction=None*, *c\_def=None*, *position\_x1=None*, *position\_x2=None*, *origin=None*)[](#Model.create_line_moment_on_beam "Link to this definition")
Method to construct a line moment on a beam.
* Parameters:
* **beam** ([`Beam`](https://docs.viktor.ai/sdk/api/external/scia/.md#Beam "viktor.external.scia.object.Beam")) – beam object ([`create_beam()`](#Model.create_beam "viktor.external.scia.scia.Model.create_beam")) to which the load should be applied
* **load\_case** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – previously created load case object in which the load should be applied
* **m1** (`float`) – magnitude of the moment \[Nm/m] on point 1
* **m2** (`float`) – magnitude of the moment \[Nm/m] on point 2. None for uniform load (with magnitude m1) (default: None)
* **name** (`str`) – name which will be shown in SCIA (default: ‘LM{i}’)
* **direction** ([`Direction`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineMomentOnBeam.Direction "viktor.external.scia.object.LineMomentOnBeam.Direction")) – direction of the moment (default: Z)
* **c\_def** ([`CDef`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineMomentOnBeam.CDef "viktor.external.scia.object.LineMomentOnBeam.CDef")) – coordinate definition (default: RELATIVE)
* **position\_x1** (`float`) – position of p1 along the beam with respect to origin (\[m] if c\_def = ABSOLUTE, else \[-]) (default: 0.0)
* **position\_x2** (`float`) – position of p2 along the beam with respect to origin (\[m] if c\_def = ABSOLUTE, else \[-]) (default: 1.0)
* **origin** ([`Origin`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineMomentOnBeam.Origin "viktor.external.scia.object.LineMomentOnBeam.Origin")) – reference for position\_x1 and position\_x2 (default: FROM\_START)
* Return type:
[`LineMomentOnBeam`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineMomentOnBeam "viktor.external.scia.object.LineMomentOnBeam")
* create\_line\_moment\_on\_plane(*edge*, *m1*, *m2=None*, *\**, *load\_case*, *name=None*, *direction=None*, *c\_def=None*, *position\_x1=None*, *position\_x2=None*, *origin=None*)[](#Model.create_line_moment_on_plane "Link to this definition")
Method to construct a line moment on a plane edge.
* Parameters:
* **edge** (`Tuple`\[[`Plane`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane"), `int`] | [`InternalEdge`](https://docs.viktor.ai/sdk/api/external/scia/.md#InternalEdge "viktor.external.scia.object.InternalEdge")) – tuple of the plane object ([`create_plane()`](#Model.create_plane "viktor.external.scia.scia.Model.create_plane")) and edge number to which the load should be applied (1 = between plane.corner\_nodes\[0] and plane.corner\_nodes\[1], etc.), or InternalEdge ([`create_internal_edge()`](#Model.create_internal_edge "viktor.external.scia.scia.Model.create_internal_edge"))
* **m1** (`float`) – magnitude of the moment \[Nm/m] on point 1
* **m2** (`float`) – magnitude of the moment \[Nm/m] on point 2. None for uniform load (with magnitude m1) (default: None)
* **load\_case** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – previously created load case object in which the load should be applied
* **name** (`str`) – name which will be shown in SCIA (default: ‘LMS{i}’)
* **direction** ([`Direction`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineMomentOnPlane.Direction "viktor.external.scia.object.LineMomentOnPlane.Direction")) – direction of the moment (default: Z)
* **c\_def** ([`CDef`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineMomentOnPlane.CDef "viktor.external.scia.object.LineMomentOnPlane.CDef")) – coordinate definition (default: RELATIVE)
* **position\_x1** (`float`) – position of p1 along the edge with respect to origin (\[m] if c\_def = ABSOLUTE, else \[-]) (default: 0.0)
* **position\_x2** (`float`) – position of p2 along the edge with respect to origin (\[m] if c\_def = ABSOLUTE, else \[-]) (default: 1.0)
* **origin** ([`Origin`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineMomentOnPlane.Origin "viktor.external.scia.object.LineMomentOnPlane.Origin")) – reference for position\_x1 and position\_x2 (default: FROM\_START)
* Return type:
[`LineMomentOnPlane`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineMomentOnPlane "viktor.external.scia.object.LineMomentOnPlane")
- create\_line\_support\_on\_beam(*beam*, *\**, *name=None*, *x=None*, *stiffness\_x=None*, *function\_x=None*, *y=None*, *stiffness\_y=None*, *function\_y=None*, *z=None*, *stiffness\_z=None*, *function\_z=None*, *rx=None*, *stiffness\_rx=None*, *function\_rx=None*, *ry=None*, *stiffness\_ry=None*, *function\_ry=None*, *rz=None*, *stiffness\_rz=None*, *function\_rz=None*, *c\_sys=None*, *extent=None*, *c\_def=None*, *position\_x1=None*, *position\_x2=None*, *origin=None*)[](#Model.create_line_support_on_beam "Link to this definition")
Method to construct a line support on a beam.
* Parameters:
* **beam** ([`Beam`](https://docs.viktor.ai/sdk/api/external/scia/.md#Beam "viktor.external.scia.object.Beam")) – beam object ([`create_beam()`](#Model.create_beam "viktor.external.scia.scia.Model.create_beam")) to which the line support will be applied
* **name** (`str`) – name which will be shown in SCIA (default: ‘Slb{i}’)
* **x** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")) – constraint type in X-direction (default: RIGID)
* **stiffness\_x** (`float`) – stiffness in X-direction \[N/m2] (only for x = FLEXIBLE | FLEXIBLE\_PRESS\_ONLY | FLEXIBLE\_TENSION\_ONLY | NONLINEAR)
* **function\_x** ([`NonLinearFunction`](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearFunction "viktor.external.scia.object.NonLinearFunction")) – non-linear function in X-direction (only for x = NONLINEAR)
* **y** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")) – constraint type in Y-direction (default: RIGID)
* **stiffness\_y** (`float`) – stiffness in Y-direction \[N/m2] (only for y = FLEXIBLE | FLEXIBLE\_PRESS\_ONLY | FLEXIBLE\_TENSION\_ONLY | NONLINEAR)
* **function\_y** ([`NonLinearFunction`](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearFunction "viktor.external.scia.object.NonLinearFunction")) – non-linear function in Y-direction (only for y = NONLINEAR)
* **z** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")) – constraint type in Z-direction (default: RIGID)
* **stiffness\_z** (`float`) – stiffness in Z-direction \[N/m2] (only for z = FLEXIBLE | FLEXIBLE\_PRESS\_ONLY | FLEXIBLE\_TENSION\_ONLY | NONLINEAR)
* **function\_z** ([`NonLinearFunction`](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearFunction "viktor.external.scia.object.NonLinearFunction")) – non-linear function in Z-direction (only for z = NONLINEAR)
* **rx** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")) – constraint type in X-rotation (default: RIGID)
* **stiffness\_rx** (`float`) – stiffness in X-rotation \[Nm/m/rad] (only for rx = FLEXIBLE | NONLINEAR)
* **function\_rx** ([`NonLinearFunction`](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearFunction "viktor.external.scia.object.NonLinearFunction")) – non-linear function in X-rotation (only for rx = NONLINEAR)
* **ry** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")) – constraint type in Y-rotation (default: RIGID)
* **stiffness\_ry** (`float`) – stiffness in Y-rotation \[Nm/m/rad] (only for ry = FLEXIBLE | NONLINEAR)
* **function\_ry** ([`NonLinearFunction`](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearFunction "viktor.external.scia.object.NonLinearFunction")) – non-linear function in Y-rotation (only for ry = NONLINEAR)
* **rz** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")) – constraint type in Z-rotation (default: RIGID)
* **stiffness\_rz** (`float`) – stiffness in Z-rotation \[Nm/m/rad] (only for rz = FLEXIBLE | NONLINEAR)
* **function\_rz** ([`NonLinearFunction`](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearFunction "viktor.external.scia.object.NonLinearFunction")) – non-linear function in Z-rotation (only for rz = NONLINEAR)
* **c\_sys** ([`CSys`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.CSys "viktor.external.scia.object.LineSupport.CSys")) – coordinate system (default: LOCAL)
* **extent** ([`Extent`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Extent "viktor.external.scia.object.LineSupport.Extent")) – extension of support (default: FULL)
* **c\_def** ([`CDef`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.CDef "viktor.external.scia.object.LineSupport.CDef")) – coordinate definition (default: RELATIVE)
* **position\_x1** (`float`) – start of support along the edge with respect to origin (\[m] if c\_def = ABSOLUTE, else \[-]) (default: 0.0)
* **position\_x2** (`float`) – end of support along the edge with respect to origin (\[m] if c\_def = ABSOLUTE, else \[-]) (default: 1.0)
* **origin** ([`Origin`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Origin "viktor.external.scia.object.LineSupport.Origin")) – reference for position\_x1 and position\_x2 (default: FROM\_START)
* Return type:
[`LineSupportLine`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupportLine "viktor.external.scia.object.LineSupportLine")
* create\_line\_support\_on\_plane(*edge*, *\**, *name=None*, *x=None*, *stiffness\_x=None*, *y=None*, *stiffness\_y=None*, *z=None*, *stiffness\_z=None*, *rx=None*, *stiffness\_rx=None*, *ry=None*, *stiffness\_ry=None*, *rz=None*, *stiffness\_rz=None*, *c\_sys=None*, *c\_def=None*, *position\_x1=None*, *position\_x2=None*, *origin=None*)[](#Model.create_line_support_on_plane "Link to this definition")
Method to construct a line support on a plane edge.
* Parameters:
* **edge** (`Tuple`\[[`Plane`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane"), `int`] | [`InternalEdge`](https://docs.viktor.ai/sdk/api/external/scia/.md#InternalEdge "viktor.external.scia.object.InternalEdge")) – tuple of the plane object ([`create_plane()`](#Model.create_plane "viktor.external.scia.scia.Model.create_plane")) and edge number to which the load should be applied (1 = between plane.corner\_nodes\[0] and plane.corner\_nodes\[1], etc.), or InternalEdge ([`create_internal_edge()`](#Model.create_internal_edge "viktor.external.scia.scia.Model.create_internal_edge"))
* **name** (`str`) – name which will be shown in SCIA (default: ‘Sle{i}’)
* **x** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")) – constraint type in X-direction (default: FREE)
* **stiffness\_x** (`float`) – stiffness in X-direction \[N/m2] (only for x = FLEXIBLE)
* **y** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")) – constraint type in Y-direction (default: FREE)
* **stiffness\_y** (`float`) – stiffness in Y-direction \[N/m2] (only for y = FLEXIBLE)
* **z** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")) – constraint type in Z-direction (default: FREE)
* **stiffness\_z** (`float`) – stiffness in Z-direction \[N/m2] (only for z = FLEXIBLE)
* **rx** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")) – constraint type in X-rotation (default: FREE)
* **stiffness\_rx** (`float`) – stiffness in X-rotation \[Nm/m/rad] (only for rx = FLEXIBLE)
* **ry** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")) – constraint type in Y-rotation (default: FREE)
* **stiffness\_ry** (`float`) – stiffness in Y-rotation \[Nm/m/rad] (only for ry = FLEXIBLE)
* **rz** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")) – constraint type in Z-rotation (default: FREE)
* **stiffness\_rz** (`float`) – stiffness in Z-rotation \[Nm/m/rad] (only for rz = FLEXIBLE)
* **c\_sys** ([`CSys`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.CSys "viktor.external.scia.object.LineSupport.CSys")) – coordinate system (default: GLOBAL)
* **c\_def** ([`CDef`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.CDef "viktor.external.scia.object.LineSupport.CDef")) – coordinate definition (default: RELATIVE)
* **position\_x1** (`float`) – start of support along the edge with respect to origin (\[m] if c\_def = ABSOLUTE, else \[-]) (default: 0.0)
* **position\_x2** (`float`) – end of support along the edge with respect to origin (\[m] if c\_def = ABSOLUTE, else \[-]) (default: 1.0)
* **origin** ([`Origin`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupport.Origin "viktor.external.scia.object.LineSupport.Origin")) – reference for position\_x1 and position\_x2 (default: FROM\_START)
* Return type:
[`LineSupportSurface`](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupportSurface "viktor.external.scia.object.LineSupportSurface")
- create\_load\_combination(*name*, *load\_type*, *load\_cases*, *\**, *description=None*)[](#Model.create_load_combination "Link to this definition")
Method to construct a load combination.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **load\_type** ([`Type`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCombination.Type "viktor.external.scia.object.LoadCombination.Type")) – enumeration of load types
* **load\_cases** (`Dict`\[[`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase"), `float`]) – dictionary of previously created load case object(s) with corresponding coefficient
* **description** (`str`) – description of the load combination
New in v13.1.0
* Return type:
[`LoadCombination`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCombination "viktor.external.scia.object.LoadCombination")
* create\_load\_group(*name*, *load\_option*, *relation=None*, *load\_type=None*)[](#Model.create_load_group "Link to this definition")
Method to construct a load group.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **load\_option** ([`LoadOption`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadGroup.LoadOption "viktor.external.scia.object.LoadGroup.LoadOption")) – enumeration of load option types
* **relation** ([`RelationOption`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadGroup.RelationOption "viktor.external.scia.object.LoadGroup.RelationOption")) – enumeration of relation types
* **load\_type** ([`LoadTypeOption`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption")) – enumeration of load types
* Return type:
[`LoadGroup`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadGroup "viktor.external.scia.object.LoadGroup")
- create\_node(*name*, *x*, *y*, *z*)[](#Model.create_node "Link to this definition")
Method to construct a node.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **x** (`float`) – X-coordinate in \[m]
* **y** (`float`) – Y-coordinate in \[m]
* **z** (`float`) – Z-coordinate in \[m]
* Return type:
[`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")
* create\_nonlinear\_function(*name*, *function\_type*, *positive\_end*, *negative\_end*, *impulse*)[](#Model.create_nonlinear_function "Link to this definition")
Method to construct a non-linear function.
* Parameters:
* **name** (`str`) – name of the function
* **function\_type** ([`Type`](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearFunction.Type "viktor.external.scia.object.NonLinearFunction.Type")) – type of function
* **positive\_end** ([`Support`](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearFunction.Support "viktor.external.scia.object.NonLinearFunction.Support")) – type of support at positive end
* **negative\_end** ([`Support`](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearFunction.Support "viktor.external.scia.object.NonLinearFunction.Support")) – type of support at negative end
* **impulse** (`List`\[`Tuple`\[`float`, `float`]]) – impulse function X-Y values in \[m, N] (if function\_type = TRANSLATION), \[rad, Nm] (if function\_type = ROTATION), or \[m, Pa] (if function\_type = NONLINEAR\_SUBSOIL)
* Return type:
[`NonLinearFunction`](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearFunction "viktor.external.scia.object.NonLinearFunction")
- create\_nonlinear\_load\_combination(*load\_type*, *load\_cases*, *\**, *name=None*, *description=None*)[](#Model.create_nonlinear_load_combination "Link to this definition")
Create a non-linear load combination.
* Parameters:
* **load\_type** ([`Type`](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearLoadCombination.Type "viktor.external.scia.object.NonLinearLoadCombination.Type")) – type of combination
* **load\_cases** (`Dict`\[[`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase"), `float`]) – dictionary of previously created load case object(s) with corresponding coefficient
* **name** (`str`) – name which will be shown in SCIA (default: ‘NC{i}’)
* **description** (`str`) – description of the load combination
New in v13.1.0
* Return type:
[`NonLinearLoadCombination`](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearLoadCombination "viktor.external.scia.object.NonLinearLoadCombination")
* create\_numerical\_cross\_section(*name*, *material*, *\**, *A=None*, *Ay=None*, *Az=None*, *AL=None*, *AD=None*, *cYUCS=None*, *cZUCS=None*, *alpha=None*, *Iy=None*, *Iz=None*, *Wely=None*, *Welz=None*, *Wply=None*, *Wplz=None*, *Mply\_plus=None*, *Mply\_min=None*, *Mplz\_plus=None*, *Mplz\_min=None*, *dy=None*, *dz=None*, *It=None*, *Iw=None*, *beta\_y=None*, *beta\_z=None*)[](#Model.create_numerical_cross_section "Link to this definition")
Method to construct a numerical cross-section.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **material** ([`Material`](https://docs.viktor.ai/sdk/api/external/scia/.md#Material "viktor.external.scia.object.Material")) – material of the cross-section
* **A** (`float`) – cross-sectional area \[m²]
* **Ay** (`float`) – shear area in y-direction \[m²]
* **Az** (`float`) – shear area in z-direction \[m²]
* **AL** (`float`) – circumference per unit length \[m²/m]
* **AD** (`float`) – drying surface per unit length \[m²/m]
* **cYUCS** (`float`) – centroid in y-direction of input axis system \[mm]
* **cZUCS** (`float`) – centroid in z-direction of input axis system \[mm]
* **alpha** (`float`) – rotation angle of axis system \[deg]
* **Iy** (`float`) – moment of inertia about the y-axis \[m⁴]
* **Iz** (`float`) – moment of inertia about the z-axis \[m⁴]
* **Wely** (`float`) – elastic section modulus about the y-axis \[m³]
* **Welz** (`float`) – elastic section modulus about the z-axis \[m³]
* **Wply** (`float`) – plastic section modulus about the y-axis \[m³]
* **Wplz** (`float`) – plastic section modulus about the z-axis \[m³]
* **Mply\_plus** (`float`) – plastic moment about the y-axis for positive My moment \[Nm]
* **Mply\_min** (`float`) – plastic moment about the y-axis for negative My moment \[Nm]
* **Mplz\_plus** (`float`) – plastic moment about the z-axis for positive My moment \[Nm]
* **Mplz\_min** (`float`) – plastic moment about the z-axis for negative My moment \[Nm]
* **dy** (`float`) – shear center coordinate in y-axis, measured from centroid \[mm]
* **dz** (`float`) – shear center coordinate in z-axis, measured from centroid \[mm]
* **It** (`float`) – torsional constant \[m⁴]
* **Iw** (`float`) – warping constant \[m⁶]
* **beta\_y** (`float`) – mono-symmetry constant about the y-axis \[mm]
* **beta\_z** (`float`) – mono-symmetry constant about the z-axis \[mm]
* Return type:
[`NumericalCrossSection`](https://docs.viktor.ai/sdk/api/external/scia/.md#NumericalCrossSection "viktor.external.scia.object.NumericalCrossSection")
- create\_open\_slab(*name*, *plane*, *corner\_nodes*)[](#Model.create_open_slab "Link to this definition")
Method to construct an open slab in a 2D member.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **plane** ([`Plane`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane")) – plane object ([`create_plane()`](#Model.create_plane "viktor.external.scia.scia.Model.create_plane")).
* **corner\_nodes** (`List`\[[`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")]) – list of node objects located at the corners
* Return type:
[`OpenSlab`](https://docs.viktor.ai/sdk/api/external/scia/.md#OpenSlab "viktor.external.scia.object.OpenSlab")
* create\_orthotropy(*name*, *material*, *thickness*, *D11=None*, *D22=None*, *D12=None*, *D33=None*, *D44=None*, *D55=None*, *d11=None*, *d22=None*, *d12=None*, *d33=None*, *kxy=None*, *kyx=None*)[](#Model.create_orthotropy "Link to this definition")
Method to construct a type of orthotropy.
* Parameters:
* **name** (`str`) – name of the orthotropy
* **material** ([`Material`](https://docs.viktor.ai/sdk/api/external/scia/.md#Material "viktor.external.scia.object.Material")) – material
* **thickness** (`float`) – thickness of the plate / wall \[m]
* **D11** (`float`) – (plate) stiffness matrix parameter \[Nm]
* **D22** (`float`) – (plate) stiffness matrix parameter \[Nm]
* **D12** (`float`) – (plate) stiffness matrix parameter \[Nm]
* **D33** (`float`) – (plate) stiffness matrix parameter \[Nm]
* **D44** (`float`) – (plate) stiffness matrix parameter \[N/m]
* **D55** (`float`) – (plate) stiffness matrix parameter \[N/m]
* **d11** (`float`) – (membrane) stiffness matrix parameter \[N/m]
* **d22** (`float`) – (membrane) stiffness matrix parameter \[N/m]
* **d12** (`float`) – (membrane) stiffness matrix parameter \[N/m]
* **d33** (`float`) – (membrane) stiffness matrix parameter \[N/m]
* **kxy** (`float`) – stiffness coefficient \[N/m]
* **kyx** (`float`) – stiffness coefficient \[N/m]
* Return type:
[`Orthotropy`](https://docs.viktor.ai/sdk/api/external/scia/.md#Orthotropy "viktor.external.scia.object.Orthotropy")
- create\_permanent\_load\_case(*name*, *description*, *load\_group*, *load\_type*, *direction=None*, *primary\_effect=None*)[](#Model.create_permanent_load_case "Link to this definition")
Method to construct a permanent load case.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **description** (`str`) – description which will be shown in SCIA
* **load\_group** ([`LoadGroup`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadGroup "viktor.external.scia.object.LoadGroup")) – load group object ([`create_load_group()`](#Model.create_load_group "viktor.external.scia.scia.Model.create_load_group")) in which the load case should be placed.
* **load\_type** ([`PermanentLoadType`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase.PermanentLoadType "viktor.external.scia.object.LoadCase.PermanentLoadType")) – permanent load types
* **direction** ([`Direction`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase.Direction "viktor.external.scia.object.LoadCase.Direction")) – load direction in case of a *SELF\_WEIGHT* load type (default: NEG\_Z)
* **primary\_effect** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – previously created load case object in case the selected load type is *PRIMARY\_EFFECT*
* Return type:
[`PermanentLoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#PermanentLoadCase "viktor.external.scia.object.PermanentLoadCase")
* create\_plane(*corner\_nodes*, *thickness*, *\**, *material*, *name=None*, *plane\_type=None*, *layer=None*, *internal\_nodes=None*, *swap\_orientation=None*, *lcs\_rotation=None*, *fem\_model=None*, *orthotropy=None*)[](#Model.create_plane "Link to this definition")
Method to construct a 2D member.
* Parameters:
* **corner\_nodes** (`List`\[[`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")]) – list of node objects located at the corners
* **thickness** (`float`) – thickness of the plane in \[m]
* **material** ([`Material`](https://docs.viktor.ai/sdk/api/external/scia/.md#Material "viktor.external.scia.object.Material")) – `Material` of the plane
* **name** (`str`) – name which will be shown in SCIA (default: ‘S{i}’)
* **plane\_type** ([`Type`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane.Type "viktor.external.scia.object.Plane.Type")) – enumeration of plane types (default: PLATE)
* **layer** ([`Layer`](https://docs.viktor.ai/sdk/api/external/scia/.md#Layer "viktor.external.scia.object.Layer")) – layer object ([`create_layer()`](#Model.create_layer "viktor.external.scia.scia.Model.create_layer")) to which the plane will be added
* **internal\_nodes** (`List`\[[`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")]) – list of internal node objects (default: None)
* **swap\_orientation** (`bool`) – whereas to swap the plate orientation (default: False)
* **lcs\_rotation** (`float`) – rotation of the local coordinate system \[deg] (default: 0.0)
* **fem\_model** ([`FEMModel`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane.FEMModel "viktor.external.scia.object.Plane.FEMModel")) – FEM model to be used in the calculation (default: isotropic)
* **orthotropy** ([`Orthotropy`](https://docs.viktor.ai/sdk/api/external/scia/.md#Orthotropy "viktor.external.scia.object.Orthotropy")) – type of orthotropy (only for fem\_model = ORTHOTROPIC)
* Return type:
[`Plane`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane")
- create\_point\_load(*name*, *load\_case*, *beam*, *direction*, *load\_type*, *load\_value*, *c\_sys=None*, *c\_def=None*, *position\_x=None*, *origin=None*, *repeat=None*, *ey=None*, *ez=None*, *\**, *angle=None*)[](#Model.create_point_load "Link to this definition")
Method to construct a point load on a beam.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **load\_case** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – previously created load case object in which the load should be placed
* **beam** ([`Beam`](https://docs.viktor.ai/sdk/api/external/scia/.md#Beam "viktor.external.scia.object.Beam")) – beam object ([`create_beam()`](#Model.create_beam "viktor.external.scia.scia.Model.create_beam")) to which the load should be applied
* **direction** ([`Direction`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointLoad.Direction "viktor.external.scia.object.PointLoad.Direction")) – enumeration of directions
* **load\_type** ([`Type`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointLoad.Type "viktor.external.scia.object.PointLoad.Type")) – enumeration of load types
* **load\_value** (`float`) – magnitude of the load in \[N]
* **c\_sys** ([`CSys`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointLoad.CSys "viktor.external.scia.object.PointLoad.CSys")) – enumeration of coordinate system types (default: global)
* **c\_def** ([`CDef`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointLoad.CDef "viktor.external.scia.object.PointLoad.CDef")) – enumeration of coordinate definition types (default: relative)
* **position\_x** (`float`) – position of the load (default: 0)
* **origin** ([`Origin`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointLoad.Origin "viktor.external.scia.object.PointLoad.Origin")) – enumeration of origin types (default: from start)
* **repeat** (`int`) – number of loads acting on the beam, distributed uniformly (default: 1)
* **ey** (`float`) – eccentricity in Y-direction w\.r.t. the beam’s center line in \[m] (default: 0)
* **ez** (`float`) – eccentricity in Z-direction w\.r.t. the beam’s center line in \[m] (default: 0)
* **angle** (`Tuple`\[`float`, `float`, `float`]) – angle (Rx, Ry, Rz) \[deg] of the load around the respective X-, Y- and Z-axis (default: 0)
* Return type:
[`PointLoad`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointLoad "viktor.external.scia.object.PointLoad")
* create\_point\_load\_node(*node*, *load\_case*, *load*, *\**, *name=None*, *direction=None*, *c\_sys=None*, *angle=None*)[](#Model.create_point_load_node "Link to this definition")
Method to construct a point load in a node.
* Parameters:
* **node** ([`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")) – node object ([`create_node()`](#Model.create_node "viktor.external.scia.scia.Model.create_node")) on which the load should be applied
* **load\_case** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – previously created load case object in which the load should be placed
* **load** (`float`) – magnitude of the load in \[N]
* **name** (`str`) – name which will be shown in SCIA (default: ‘F{i}’)
* **direction** ([`Direction`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointLoadNode.Direction "viktor.external.scia.object.PointLoadNode.Direction")) – direction of the load (default: Z)
* **c\_sys** ([`CSys`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointLoadNode.CSys "viktor.external.scia.object.PointLoadNode.CSys")) – coordinate system (default: global)
* **angle** (`Tuple`\[`float`, `float`, `float`]) – angle (Rx, Ry, Rz) \[deg] of the load around the respective global X-, Y- and Z-axis
* Return type:
[`PointLoadNode`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointLoadNode "viktor.external.scia.object.PointLoadNode")
- create\_point\_moment\_node(*node*, *load\_case*, *load*, *direction*, *name=None*, *c\_sys=CSys.GLOBAL*)[](#Model.create_point_moment_node "Link to this definition")
Create a point moment on an existing node.
* Parameters:
* **node** ([`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")) – Node of appliance ([`create_node()`](#Model.create_node "viktor.external.scia.scia.Model.create_node")).
* **load\_case** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – Previously created load case of appliance.
* **load** (`float`) – Magnitude of the load \[Nm].
* **direction** ([`Direction`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointMomentNode.Direction "viktor.external.scia.object.PointMomentNode.Direction")) – Direction of the load.
* **name** (`str`) – Name of the load in SCIA (default: ‘M{i}’).
* **c\_sys** ([`CSys`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointMomentNode.CSys "viktor.external.scia.object.PointMomentNode.CSys")) – Coordinate system (default: global).
* Return type:
[`PointMomentNode`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointMomentNode "viktor.external.scia.object.PointMomentNode")
* create\_point\_support(*name*, *node*, *spring\_type*, *freedom*, *stiffness*, *c\_sys*, *default\_size=0.2*, *\**, *angle=None*)[](#Model.create_point_support "Link to this definition")
Method to construct a point support.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **node** ([`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")) – node object ([`create_node()`](#Model.create_node "viktor.external.scia.scia.Model.create_node")) to which the support will be attached.
* **spring\_type** ([`Type`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupport.Type "viktor.external.scia.object.PointSupport.Type")) – enumeration of spring types
* **freedom** (`Tuple`\[[`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupport.Freedom "viktor.external.scia.object.PointSupport.Freedom"), [`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupport.Freedom "viktor.external.scia.object.PointSupport.Freedom"), [`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupport.Freedom "viktor.external.scia.object.PointSupport.Freedom"), [`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupport.Freedom "viktor.external.scia.object.PointSupport.Freedom"), [`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupport.Freedom "viktor.external.scia.object.PointSupport.Freedom"), [`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupport.Freedom "viktor.external.scia.object.PointSupport.Freedom")]) – tuple of component constraints in the order (X, Y, Z, Rx, Ry, Rz)
* **stiffness** (`Tuple`\[`float`, `float`, `float`, `float`, `float`, `float`]) – tuple of component stiffness in the order (X, Y, Z, Rx, Ry, Rz) in \[N/m]
* **c\_sys** ([`CSys`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupport.CSys "viktor.external.scia.object.PointSupport.CSys")) – enumeration of coordinate system types
* **default\_size** (`float`) – default size in \[m]
* **angle** (`Tuple`\[`float`, `float`, `float`]) – angle (Rx, Ry, Rz) \[deg] of the support around the respective global X-, Y- and Z-axis
* Return type:
[`PointSupport`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupport "viktor.external.scia.object.PointSupport")
- create\_point\_support\_on\_beam(*beam*, *\**, *name=None*, *x=None*, *stiffness\_x=None*, *y=None*, *stiffness\_y=None*, *z=None*, *stiffness\_z=None*, *rx=None*, *stiffness\_rx=None*, *ry=None*, *stiffness\_ry=None*, *rz=None*, *stiffness\_rz=None*, *default\_size=None*, *c\_sys=None*, *c\_def=None*, *position\_x=None*, *origin=None*, *repeat=None*, *delta\_x=None*)[](#Model.create_point_support_on_beam "Link to this definition")
Method to construct a point support on a beam.
* Parameters:
* **beam** ([`Beam`](https://docs.viktor.ai/sdk/api/external/scia/.md#Beam "viktor.external.scia.object.Beam")) – beam object ([`create_beam()`](#Model.create_beam "viktor.external.scia.scia.Model.create_beam")) to which the line support will be applied
* **name** (`str`) – name which will be shown in SCIA (default: ‘Sb{i}’)
* **x** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupportLine.Freedom "viktor.external.scia.object.PointSupportLine.Freedom")) – constraint type in X-direction (default: RIGID)
* **stiffness\_x** (`float`) – stiffness in X-direction \[N/m] (only for x = FLEXIBLE)
* **y** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupportLine.Freedom "viktor.external.scia.object.PointSupportLine.Freedom")) – constraint type in Y-direction (default: RIGID)
* **stiffness\_y** (`float`) – stiffness in Y-direction \[N/m] (only for y = FLEXIBLE)
* **z** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupportLine.Freedom "viktor.external.scia.object.PointSupportLine.Freedom")) – constraint type in Z-direction (default: RIGID)
* **stiffness\_z** (`float`) – stiffness in Z-direction \[N/m] (only for z = FLEXIBLE)
* **rx** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupportLine.Freedom "viktor.external.scia.object.PointSupportLine.Freedom")) – constraint type in X-rotation (default: RIGID)
* **stiffness\_rx** (`float`) – stiffness in X-rotation \[Nm/rad] (only for rx = FLEXIBLE)
* **ry** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupportLine.Freedom "viktor.external.scia.object.PointSupportLine.Freedom")) – constraint type in Y-rotation (default: RIGID)
* **stiffness\_ry** (`float`) – stiffness in Y-rotation \[Nm/rad] (only for ry = FLEXIBLE)
* **rz** ([`Freedom`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupportLine.Freedom "viktor.external.scia.object.PointSupportLine.Freedom")) – constraint type in Z-rotation (default: RIGID)
* **stiffness\_rz** (`float`) – stiffness in Z-rotation \[Nm/rad] (only for rz = FLEXIBLE)
* **default\_size** (`float`) – size of the support \[m] (default: 0.2)
* **c\_sys** ([`CSys`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupportLine.CSys "viktor.external.scia.object.PointSupportLine.CSys")) – coordinate system (default: GLOBAL)
* **c\_def** ([`CDef`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupportLine.CDef "viktor.external.scia.object.PointSupportLine.CDef")) – c\_def: coordinate definition (default: RELATIVE)
* **position\_x** (`float`) – position of the load (\[m] if c\_def = ABSOLUTE, else \[-]) (default: 0)
* **origin** ([`Origin`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupportLine.Origin "viktor.external.scia.object.PointSupportLine.Origin")) – reference for position\_x (default: FROM\_START)
* **repeat** (`int`) – number of uniformly distributed supports (default: 1)
* **delta\_x** (`float`) – distance between supports (\[m] if c\_def = ABSOLUTE, else \[-]) (only for repeat > 1)
* Return type:
[`PointSupportLine`](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupportLine "viktor.external.scia.object.PointSupportLine")
* create\_rectangular\_cross\_section(*name*, *material*, *width*, *height*)[](#Model.create_rectangular_cross_section "Link to this definition")
Method to construct a rectangular cross-section.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **material** ([`Material`](https://docs.viktor.ai/sdk/api/external/scia/.md#Material "viktor.external.scia.object.Material")) – material of the cross-section
* **width** (`float`) – width of the cross-section in \[m]
* **height** (`float`) – height of the cross-section in \[m]
* Return type:
[`RectangularCrossSection`](https://docs.viktor.ai/sdk/api/external/scia/.md#RectangularCrossSection "viktor.external.scia.object.RectangularCrossSection")
- create\_result\_class(*name*, *combinations=None*, *nonlinear\_combinations=None*)[](#Model.create_result_class "Link to this definition")
Method to construct a result class.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **combinations** (`List`\[[`LoadCombination`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCombination "viktor.external.scia.object.LoadCombination")]) – list of load combination objects ([`create_load_combination()`](#Model.create_load_combination "viktor.external.scia.scia.Model.create_load_combination"))
* **nonlinear\_combinations** (`List`\[[`NonLinearLoadCombination`](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearLoadCombination "viktor.external.scia.object.NonLinearLoadCombination")]) – list of nonlinear load combination objects ([`create_nonlinear_load_combination()`](#Model.create_nonlinear_load_combination "viktor.external.scia.scia.Model.create_nonlinear_load_combination"))
* Return type:
[`ResultClass`](https://docs.viktor.ai/sdk/api/external/scia/.md#ResultClass "viktor.external.scia.object.ResultClass")
* create\_rigid\_arm(*name*, *master\_node*, *slave\_node*, *hinge\_on\_master*, *hinge\_on\_slave*)[](#Model.create_rigid_arm "Link to this definition")
Method to construct a rigid arm.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **master\_node** ([`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")) – node object ([`create_node()`](#Model.create_node "viktor.external.scia.scia.Model.create_node")).
* **slave\_node** ([`Node`](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node")) – node object ([`create_node()`](#Model.create_node "viktor.external.scia.scia.Model.create_node")).
* **hinge\_on\_master** (`bool`) – True to insert a hinge on the master node
* **hinge\_on\_slave** (`bool`) – True to insert a hinge on the slave node
* Return type:
[`RigidArm`](https://docs.viktor.ai/sdk/api/external/scia/.md#RigidArm "viktor.external.scia.object.RigidArm")
- create\_section\_on\_beam(*name*, *beam*, *c\_def*, *position\_x*, *origin*, *repeat*, *delta\_x*)[](#Model.create_section_on_beam "Link to this definition")
Method to construct a section on a beam, which can be used to receive calculation results on its position.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **beam** ([`Beam`](https://docs.viktor.ai/sdk/api/external/scia/.md#Beam "viktor.external.scia.object.Beam")) – beam object ([`create_beam()`](#Model.create_beam "viktor.external.scia.scia.Model.create_beam")).
* **c\_def** ([`CDef`](https://docs.viktor.ai/sdk/api/external/scia/.md#SectionOnBeam.CDef "viktor.external.scia.object.SectionOnBeam.CDef")) – enumeration of coordinate definition types
* **position\_x** (`float`) – position of the section on the beam
* **origin** ([`Origin`](https://docs.viktor.ai/sdk/api/external/scia/.md#SectionOnBeam.Origin "viktor.external.scia.object.SectionOnBeam.Origin")) – enumeration of origin types
* **repeat** (`int`) – number of section defined at the same time
* **delta\_x** (`float`) – if repeat is greater than 1, this value defines the distance between individual sections
* Return type:
[`SectionOnBeam`](https://docs.viktor.ai/sdk/api/external/scia/.md#SectionOnBeam "viktor.external.scia.object.SectionOnBeam")
* create\_section\_on\_plane(*point\_1*, *point\_2*, *\**, *name*, *draw=None*, *direction\_of\_cut=None*)[](#Model.create_section_on_plane "Link to this definition")
Method to construct a section on a plane, which can be used to receive calculation results on its position.
* Parameters:
* **point\_1** (`Tuple`\[`float`, `float`, `float`]) – tuple of coordinates (x, y, z) of the start position in \[m]
* **point\_2** (`Tuple`\[`float`, `float`, `float`]) – tuple of coordinates (x, y, z) of the end position in \[m]
* **name** (`str`) – name which will be shown in SCIA (default: SE{i})
* **draw** ([`Draw`](https://docs.viktor.ai/sdk/api/external/scia/.md#SectionOnPlane.Draw "viktor.external.scia.object.SectionOnPlane.Draw")) – defines the plane in which the section is drawn (default: Z\_DIRECTION)
* **direction\_of\_cut** (`Tuple`\[`float`, `float`, `float`]) – in-plane vector (x, y, z) which defines the direction of cut in \[m] (default: (0, 0, 1))
* Return type:
[`SectionOnPlane`](https://docs.viktor.ai/sdk/api/external/scia/.md#SectionOnPlane "viktor.external.scia.object.SectionOnPlane")
- create\_selection(*name*, *objects*)[](#Model.create_selection "Link to this definition")
New in v14.1.0
Method to construct a named selection.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **objects** (`List`\[[`SciaObject`](https://docs.viktor.ai/sdk/api/external/scia/.md#SciaObject "viktor.external.scia.object.SciaObject")]) – object(s) created within this model
* Return type:
[`Selection`](https://docs.viktor.ai/sdk/api/external/scia/.md#Selection "viktor.external.scia.object.Selection")
* create\_subsoil(*name*, *\**, *stiffness*, *c1x=None*, *c1y=None*, *c1z=None*, *nonlinear\_function=None*, *c2x=None*, *c2y=None*, *is\_drained=None*, *water\_air\_in\_clay\_subgrade=None*, *specific\_weight=None*, *fi=None*, *sigma\_oc=None*, *c=None*, *cu=None*)[](#Model.create_subsoil "Link to this definition")
Method to construct a subsoil.
* Parameters:
* **name** (`str`) – name of the subsoil
* **stiffness** (`float`) – stiffness c1z \[N/m3]
* **c1x** (`float`) – stiffness c1x \[N/m3] (default: 50000000)
* **c1y** (`float`) – stiffness c1y \[N/m3] (default: 50000000)
* **c1z** ([`C1z`](https://docs.viktor.ai/sdk/api/external/scia/.md#Subsoil.C1z "viktor.external.scia.object.Subsoil.C1z")) – type for c1z (default: FLEXIBLE)
* **nonlinear\_function** ([`NonLinearFunction`](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearFunction "viktor.external.scia.object.NonLinearFunction")) – nonlinear function ([`create_nonlinear_function()`](#Model.create_nonlinear_function "viktor.external.scia.scia.Model.create_nonlinear_function")) (c1z = NONLINEAR\_FUNCTION only)
* **c2x** (`float`) – \[N/m]
* **c2y** (`float`) – \[N/m]
* **is\_drained** (`bool`) – True for ‘drained’, False for ‘undrained’ (default: False)
* **water\_air\_in\_clay\_subgrade** (`bool`) – (default: False)
* **specific\_weight** (`float`) – specific weight \[kg/m3] (default: 0.0)
* **fi** (`float`) – fi’ \[deg] (default: 0.0)
* **sigma\_oc** (`float`) – sigma oc \[Pa] (default: 0.0)
* **c** (`float`) – c’ \[Pa] (default: 0.0)
* **cu** (`float`) – \[Pa] (default: 0.0)
* Return type:
[`Subsoil`](https://docs.viktor.ai/sdk/api/external/scia/.md#Subsoil "viktor.external.scia.object.Subsoil")
- create\_surface\_load(*name*, *load\_case*, *plane*, *direction*, *load\_type*, *load\_value*, *c\_sys*, *location*)[](#Model.create_surface_load "Link to this definition")
Method to construct a surface load on a plane.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **load\_case** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – previously created load case object in which the load should be placed
* **plane** ([`Plane`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane")) – plane object ([`create_plane()`](#Model.create_plane "viktor.external.scia.scia.Model.create_plane")) to which the load should be applied
* **direction** ([`Direction`](https://docs.viktor.ai/sdk/api/external/scia/.md#SurfaceLoad.Direction "viktor.external.scia.object.SurfaceLoad.Direction")) – enumeration of directions
* **load\_type** ([`Type`](https://docs.viktor.ai/sdk/api/external/scia/.md#SurfaceLoad.Type "viktor.external.scia.object.SurfaceLoad.Type")) – enumeration of load types
* **load\_value** (`float`) – magnitude of the load in \[N]
* **c\_sys** ([`CSys`](https://docs.viktor.ai/sdk/api/external/scia/.md#SurfaceLoad.CSys "viktor.external.scia.object.SurfaceLoad.CSys")) – enumeration of coordinate system types
* **location** ([`Location`](https://docs.viktor.ai/sdk/api/external/scia/.md#SurfaceLoad.Location "viktor.external.scia.object.SurfaceLoad.Location")) – enumeration of location options
* Return type:
[`SurfaceLoad`](https://docs.viktor.ai/sdk/api/external/scia/.md#SurfaceLoad "viktor.external.scia.object.SurfaceLoad")
* create\_surface\_support(*plane*, *subsoil*, *\**, *name=None*)[](#Model.create_surface_support "Link to this definition")
Method to construct a surface support.
* Parameters:
* **plane** ([`Plane`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane")) – plane object ([`create_plane()`](#Model.create_plane "viktor.external.scia.scia.Model.create_plane")) to which the support will be attached
* **subsoil** ([`Subsoil`](https://docs.viktor.ai/sdk/api/external/scia/.md#Subsoil "viktor.external.scia.object.Subsoil")) – subsoil object ([`create_subsoil()`](#Model.create_subsoil "viktor.external.scia.scia.Model.create_subsoil")) representing the support
* **name** (`str`) – name which will be shown in SCIA
* Return type:
[`SurfaceSupportSurface`](https://docs.viktor.ai/sdk/api/external/scia/.md#SurfaceSupportSurface "viktor.external.scia.object.SurfaceSupportSurface")
- create\_thermal\_load(*name*, *load\_case*, *beam*, *distribution*, *delta*, *left\_delta*, *right\_delta*, *top\_delta*, *bottom\_delta*, *position\_start*, *position\_end*, *c\_def*, *origin*)[](#Model.create_thermal_load "Link to this definition")
Method to construct a temperature load on a beam.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **load\_case** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – previously created load case object in which the load should be placed
* **beam** ([`Beam`](https://docs.viktor.ai/sdk/api/external/scia/.md#Beam "viktor.external.scia.object.Beam")) – beam object ([`create_beam()`](#Model.create_beam "viktor.external.scia.scia.Model.create_beam")) to which the load should be applied
* **distribution** ([`Distribution`](https://docs.viktor.ai/sdk/api/external/scia/.md#ThermalLoad.Distribution "viktor.external.scia.object.ThermalLoad.Distribution")) – enumeration of distribution options
* **delta** (`float`) – temperature difference in case of a *CONSTANT* distribution
* **left\_delta** (`float`) – temperature difference in +Y direction
* **right\_delta** (`float`) – temperature difference in -Y direction
* **top\_delta** (`float`) – temperature difference in +Z direction
* **bottom\_delta** (`float`) – temperature difference in -Z direction
* **position\_start** (`float`) – position of the start point on the beam in \[m]
* **position\_end** (`float`) – position of the end point on the beam in \[m]
* **c\_def** ([`CDef`](https://docs.viktor.ai/sdk/api/external/scia/.md#ThermalLoad.CDef "viktor.external.scia.object.ThermalLoad.CDef")) – enumeration of coordinate definition types
* **origin** ([`Origin`](https://docs.viktor.ai/sdk/api/external/scia/.md#ThermalLoad.Origin "viktor.external.scia.object.ThermalLoad.Origin")) – enumeration of origin types
* Return type:
[`ThermalLoad`](https://docs.viktor.ai/sdk/api/external/scia/.md#ThermalLoad "viktor.external.scia.object.ThermalLoad")
* create\_thermal\_surface\_load(*name*, *load\_case*, *plane*, *delta=None*, *top\_delta=None*, *bottom\_delta=None*)[](#Model.create_thermal_surface_load "Link to this definition")
Method to construct a temperature load on a plane.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **load\_case** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – previously created load case object in which the load should be placed
* **plane** ([`Plane`](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane")) – plane object ([`create_plane()`](#Model.create_plane "viktor.external.scia.scia.Model.create_plane")) to which the load should be applied
* **delta** (`float`) – temperature difference in case of a constant distribution
* **top\_delta** (`float`) – temperature difference in +Z direction
* **bottom\_delta** (`float`) – temperature difference in -Z direction
* Return type:
[`ThermalSurfaceLoad`](https://docs.viktor.ai/sdk/api/external/scia/.md#ThermalSurfaceLoad "viktor.external.scia.object.ThermalSurfaceLoad")
- create\_variable\_load\_case(*name*, *description*, *load\_group*, *load\_type*, *specification=None*, *duration=None*, *primary\_effect=None*)[](#Model.create_variable_load_case "Link to this definition")
Method to construct a variable load case.
* Parameters:
* **name** (`str`) – name which will be shown in SCIA
* **description** (`str`) – description which will be shown in SCIA
* **load\_group** ([`LoadGroup`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadGroup "viktor.external.scia.object.LoadGroup")) – load group object ([`create_load_group()`](#Model.create_load_group "viktor.external.scia.scia.Model.create_load_group")) in which the load case should be placed.
* **load\_type** ([`VariableLoadType`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase.VariableLoadType "viktor.external.scia.object.LoadCase.VariableLoadType")) – enumeration of variable load types
* **specification** ([`Specification`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase.Specification "viktor.external.scia.object.LoadCase.Specification")) – enumeration of specification types
* **duration** ([`Duration`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase.Duration "viktor.external.scia.object.LoadCase.Duration")) – enumeration of duration types
* **primary\_effect** ([`LoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase")) – previously created load case object in case the selected load type is *PRIMARY\_EFFECT*
* Return type:
[`VariableLoadCase`](https://docs.viktor.ai/sdk/api/external/scia/.md#VariableLoadCase "viktor.external.scia.object.VariableLoadCase")
* *property *cross\_links*: Tuple\[[CrossLink](https://docs.viktor.ai/sdk/api/external/scia/.md#CrossLink "viktor.external.scia.object.CrossLink"), ...]*[](#Model.cross_links "Link to this definition")
New in v13.1.0
- *property *cross\_sections*: Tuple\[[CrossSection](https://docs.viktor.ai/sdk/api/external/scia/.md#CrossSection "viktor.external.scia.object.CrossSection"), ...]*[](#Model.cross_sections "Link to this definition")
* *property *free\_line\_loads*: Tuple\[[FreeLineLoad](https://docs.viktor.ai/sdk/api/external/scia/.md#FreeLineLoad "viktor.external.scia.object.FreeLineLoad"), ...]*[](#Model.free_line_loads "Link to this definition")
- *property *free\_point\_loads*: Tuple\[[FreePointLoad](https://docs.viktor.ai/sdk/api/external/scia/.md#FreePointLoad "viktor.external.scia.object.FreePointLoad"), ...]*[](#Model.free_point_loads "Link to this definition")
* *property *free\_surface\_loads*: Tuple\[[FreeSurfaceLoad](https://docs.viktor.ai/sdk/api/external/scia/.md#FreeSurfaceLoad "viktor.external.scia.object.FreeSurfaceLoad"), ...]*[](#Model.free_surface_loads "Link to this definition")
- generate\_xml\_input(*as\_file=False*)[](#Model.generate_xml_input "Link to this definition")
Returns the input file XML representation of the SCIA model and corresponding .def file.
Note
This method needs to be mocked in (automated) unit and integration tests.
* Return type:
`Tuple`\[`BytesIO`, `BytesIO`] | `Tuple`\[[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File"), [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]
* Returns:
* File if as\_file = True
* BytesIO if as\_file = False (default)
* *property *hinges\_on\_beam*: Tuple\[[HingeOnBeam](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnBeam "viktor.external.scia.object.HingeOnBeam"), ...]*[](#Model.hinges_on_beam "Link to this definition")
- *property *hinges\_on\_plane*: Tuple\[[HingeOnPlane](https://docs.viktor.ai/sdk/api/external/scia/.md#HingeOnPlane "viktor.external.scia.object.HingeOnPlane"), ...]*[](#Model.hinges_on_plane "Link to this definition")
* *property *integration\_strips*: Tuple\[[IntegrationStrip](https://docs.viktor.ai/sdk/api/external/scia/.md#IntegrationStrip "viktor.external.scia.object.IntegrationStrip"), ...]*[](#Model.integration_strips "Link to this definition")
- *property *internal\_edges*: Tuple\[[InternalEdge](https://docs.viktor.ai/sdk/api/external/scia/.md#InternalEdge "viktor.external.scia.object.InternalEdge"), ...]*[](#Model.internal_edges "Link to this definition")
* *property *layers*: Tuple\[[Layer](https://docs.viktor.ai/sdk/api/external/scia/.md#Layer "viktor.external.scia.object.Layer"), ...]*[](#Model.layers "Link to this definition")
- *property *line\_force\_surface\_list*: Tuple\[[LineForceSurface](https://docs.viktor.ai/sdk/api/external/scia/.md#LineForceSurface "viktor.external.scia.object.LineForceSurface"), ...]*[](#Model.line_force_surface_list "Link to this definition")
* *property *line\_loads*: Tuple\[[LineLoad](https://docs.viktor.ai/sdk/api/external/scia/.md#LineLoad "viktor.external.scia.object.LineLoad"), ...]*[](#Model.line_loads "Link to this definition")
- *property *line\_moments\_on\_beam*: Tuple\[[LineMomentOnBeam](https://docs.viktor.ai/sdk/api/external/scia/.md#LineMomentOnBeam "viktor.external.scia.object.LineMomentOnBeam"), ...]*[](#Model.line_moments_on_beam "Link to this definition")
* *property *line\_moments\_on\_plane*: Tuple\[[LineMomentOnPlane](https://docs.viktor.ai/sdk/api/external/scia/.md#LineMomentOnPlane "viktor.external.scia.object.LineMomentOnPlane"), ...]*[](#Model.line_moments_on_plane "Link to this definition")
- *property *line\_supports\_line*: Tuple\[[LineSupportLine](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupportLine "viktor.external.scia.object.LineSupportLine"), ...]*[](#Model.line_supports_line "Link to this definition")
* *property *line\_supports\_surface*: Tuple\[[LineSupportSurface](https://docs.viktor.ai/sdk/api/external/scia/.md#LineSupportSurface "viktor.external.scia.object.LineSupportSurface"), ...]*[](#Model.line_supports_surface "Link to this definition")
- *property *load\_cases*: Tuple\[[LoadCase](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCase "viktor.external.scia.object.LoadCase"), ...]*[](#Model.load_cases "Link to this definition")
* *property *load\_combinations*: Tuple\[[LoadCombination](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadCombination "viktor.external.scia.object.LoadCombination"), ...]*[](#Model.load_combinations "Link to this definition")
- *property *load\_groups*: Tuple\[[LoadGroup](https://docs.viktor.ai/sdk/api/external/scia/.md#LoadGroup "viktor.external.scia.object.LoadGroup"), ...]*[](#Model.load_groups "Link to this definition")
* *property *mesh\_setup*: [MeshSetup](https://docs.viktor.ai/sdk/api/external/scia/.md#MeshSetup "viktor.external.scia.object.MeshSetup")*[](#Model.mesh_setup "Link to this definition")
- *property *nodes*: Tuple\[[Node](https://docs.viktor.ai/sdk/api/external/scia/.md#Node "viktor.external.scia.object.Node"), ...]*[](#Model.nodes "Link to this definition")
* *property *nonlinear\_functions*: Tuple\[[NonLinearFunction](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearFunction "viktor.external.scia.object.NonLinearFunction"), ...]*[](#Model.nonlinear_functions "Link to this definition")
- *property *nonlinear\_load\_combinations*: Tuple\[[NonLinearLoadCombination](https://docs.viktor.ai/sdk/api/external/scia/.md#NonLinearLoadCombination "viktor.external.scia.object.NonLinearLoadCombination"), ...]*[](#Model.nonlinear_load_combinations "Link to this definition")
* *property *open\_slabs*: Tuple\[[OpenSlab](https://docs.viktor.ai/sdk/api/external/scia/.md#OpenSlab "viktor.external.scia.object.OpenSlab"), ...]*[](#Model.open_slabs "Link to this definition")
- *property *orthotropy\_objects*: Tuple\[[Orthotropy](https://docs.viktor.ai/sdk/api/external/scia/.md#Orthotropy "viktor.external.scia.object.Orthotropy"), ...]*[](#Model.orthotropy_objects "Link to this definition")
* *property *planes*: Tuple\[[Plane](https://docs.viktor.ai/sdk/api/external/scia/.md#Plane "viktor.external.scia.object.Plane"), ...]*[](#Model.planes "Link to this definition")
- *property *point\_loads*: Tuple\[[PointLoad](https://docs.viktor.ai/sdk/api/external/scia/.md#PointLoad "viktor.external.scia.object.PointLoad"), ...]*[](#Model.point_loads "Link to this definition")
* *property *point\_loads\_node*: Tuple\[[PointLoadNode](https://docs.viktor.ai/sdk/api/external/scia/.md#PointLoadNode "viktor.external.scia.object.PointLoadNode"), ...]*[](#Model.point_loads_node "Link to this definition")
- *property *point\_moments\_node*: Tuple\[[PointMomentNode](https://docs.viktor.ai/sdk/api/external/scia/.md#PointMomentNode "viktor.external.scia.object.PointMomentNode"), ...]*[](#Model.point_moments_node "Link to this definition")
* *property *point\_supports*: Tuple\[[PointSupport](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupport "viktor.external.scia.object.PointSupport"), ...]*[](#Model.point_supports "Link to this definition")
- *property *point\_supports\_line*: Tuple\[[PointSupportLine](https://docs.viktor.ai/sdk/api/external/scia/.md#PointSupportLine "viktor.external.scia.object.PointSupportLine"), ...]*[](#Model.point_supports_line "Link to this definition")
* *property *project\_data*: [ProjectData](https://docs.viktor.ai/sdk/api/external/scia/.md#ProjectData "viktor.external.scia.object.ProjectData")*[](#Model.project_data "Link to this definition")
New in v13.1.0
- *property *result\_classes*: Tuple\[[ResultClass](https://docs.viktor.ai/sdk/api/external/scia/.md#ResultClass "viktor.external.scia.object.ResultClass"), ...]*[](#Model.result_classes "Link to this definition")
* *property *rigid\_arms*: Tuple\[[RigidArm](https://docs.viktor.ai/sdk/api/external/scia/.md#RigidArm "viktor.external.scia.object.RigidArm"), ...]*[](#Model.rigid_arms "Link to this definition")
- *property *sections\_on\_beam*: Tuple\[[SectionOnBeam](https://docs.viktor.ai/sdk/api/external/scia/.md#SectionOnBeam "viktor.external.scia.object.SectionOnBeam"), ...]*[](#Model.sections_on_beam "Link to this definition")
* *property *sections\_on\_plane*: Tuple\[[SectionOnPlane](https://docs.viktor.ai/sdk/api/external/scia/.md#SectionOnPlane "viktor.external.scia.object.SectionOnPlane"), ...]*[](#Model.sections_on_plane "Link to this definition")
- *property *selections*: Tuple\[[Selection](https://docs.viktor.ai/sdk/api/external/scia/.md#Selection "viktor.external.scia.object.Selection"), ...]*[](#Model.selections "Link to this definition")
* *property *solver\_setup*: [SolverSetup](https://docs.viktor.ai/sdk/api/external/scia/.md#SolverSetup "viktor.external.scia.object.SolverSetup")*[](#Model.solver_setup "Link to this definition")
New in v13.1.0
- *property *subsoils*: Tuple\[[Subsoil](https://docs.viktor.ai/sdk/api/external/scia/.md#Subsoil "viktor.external.scia.object.Subsoil"), ...]*[](#Model.subsoils "Link to this definition")
* *property *surface\_loads*: Tuple\[[SurfaceLoad](https://docs.viktor.ai/sdk/api/external/scia/.md#SurfaceLoad "viktor.external.scia.object.SurfaceLoad"), ...]*[](#Model.surface_loads "Link to this definition")
- *property *surface\_supports*: Tuple\[[SurfaceSupportSurface](https://docs.viktor.ai/sdk/api/external/scia/.md#SurfaceSupportSurface "viktor.external.scia.object.SurfaceSupportSurface"), ...]*[](#Model.surface_supports "Link to this definition")
* *property *thermal\_loads*: Tuple\[[ThermalLoad](https://docs.viktor.ai/sdk/api/external/scia/.md#ThermalLoad "viktor.external.scia.object.ThermalLoad"), ...]*[](#Model.thermal_loads "Link to this definition")
- *property *thermal\_surface\_loads*: Tuple\[[ThermalSurfaceLoad](https://docs.viktor.ai/sdk/api/external/scia/.md#ThermalSurfaceLoad "viktor.external.scia.object.ThermalSurfaceLoad"), ...]*[](#Model.thermal_surface_loads "Link to this definition")
* update\_concrete\_material(*object\_id*, *name*, *part*, *thermal\_expansion=None*, *unit\_mass=None*, *wet\_density=None*, *e\_modulus=None*, *poisson=None*, *g\_modulus=None*, *log\_decrement=None*, *specific\_heat=None*, *thermal\_conductivity=None*, *\**, *fck=None*)[](#Model.update_concrete_material "Link to this definition")
This method can update specific properties of an already existing concrete material in the \*.esa model.
* Parameters:
* **object\_id** (`int`) – id of the material in SCIA
* **name** (`str`) – name which will be shown in SCIA
* **part** ([`ECPart`](https://docs.viktor.ai/sdk/api/external/scia/.md#Concrete.ECPart "viktor.external.scia.object.Concrete.ECPart")) – enumeration of concrete types
* **thermal\_expansion** (`float`) – thermal expansion in \[m/mK]
* **unit\_mass** (`float`) – density in \[kg/m3]
* **wet\_density** (`float`) – wet density in \[kg/m3]
* **e\_modulus** (`float`) – Young’s modulus in \[Pa]
* **poisson** (`float`) – Poisson ratio
* **g\_modulus** (`float`) – shear modulus in \[Pa]
* **log\_decrement** (`float`) – log. decrement
* **specific\_heat** (`float`) – specific heat in \[J/kgK]
* **thermal\_conductivity** (`float`) – thermal conductivity in \[W/mK]
* **fck** (`float`) – characteristic compressive cylinder strength \[Pa]
* Return type:
[`Concrete`](https://docs.viktor.ai/sdk/api/external/scia/.md#Concrete "viktor.external.scia.object.Concrete")
## OutputFileParser[](https://docs.viktor.ai/sdk/api/external/scia/.md#_OutputFileParser "Direct link to OutputFileParser")
* *class *viktor.external.scia.scia.OutputFileParser[](#OutputFileParser "Link to this definition")
Helper class to extract results from a SCIA output file (.xml).
Example using BytesIO:
```
xml_output_file = scia_analysis.get_xml_output_file()
result_table = OutputFileParser.get_result(xml_output_file, 'Reactions')
another_result_table = OutputFileParser.get_result(xml_output_file, '2D internal forces')
```
Example using [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File"):
```
xml_output_file = scia_analysis.get_xml_output_file(as_file=True)
with xml_output_file.open_binary() as f:
result_table = OutputFileParser.get_result(f, 'Reactions')
another_result_table = OutputFileParser.get_result(f, '2D internal forces')
```
* *classmethod *get\_result(*file*, *table\_name*, *\**, *parent=None*)[](#OutputFileParser.get_result "Link to this definition")
Retrieve the results of an output XML by ‘table\_name’. This corresponds to the ‘name’ attribute that is found in the XML table, e.g. “Result classes - UGT” in the example below:
```
```
In case indenting has been used in the SCIA I/O doc, multiple tables with the name ‘table\_name’ will be found. A parent name can be specified as input to account for this indenting (up to 1 indent level). If indenting is used but no parent name is specified, this method will return the first ‘table\_name’ table it can find.
* Parameters:
* **file** (`BinaryIO`) – SCIA output file (.xml).
* **table\_name** (`str`) – Name of the result table to be extracted from the output XML.
* **parent** (`str`) – Name of the parent, e.g. a result class.
* Return type:
`Dict`\[`str`, `dict`]
- :raises [`viktor.errors.SciaParsingError`](https://docs.viktor.ai/sdk/api/errors/.md#SciaParsingError "viktor.errors.SciaParsingError"):
* if table ‘table\_name’ could not be found in the provided output file
* if no results were found in the XML table ‘table\_name’
## ResultType[](https://docs.viktor.ai/sdk/api/external/scia/.md#_ResultType "Direct link to ResultType")
* *class *viktor.external.scia.scia.ResultType(*\*values*)[](#ResultType "Link to this definition")
Bases: `Enum`
Enumeration of result types:
* ENGINEERING\_REPORT*: [`ResultType`](#ResultType "viktor.external.scia.scia.ResultType")** = 'ENGINEERING\_REPORT'*[](#ResultType.ENGINEERING_REPORT "Link to this definition")
- MODEL*: [`ResultType`](#ResultType "viktor.external.scia.scia.ResultType")** = 'MODEL'*[](#ResultType.MODEL "Link to this definition")
* NONE*: [`ResultType`](#ResultType "viktor.external.scia.scia.ResultType")** = 'XML'*[](#ResultType.NONE "Link to this definition")
## SciaAnalysis[](https://docs.viktor.ai/sdk/api/external/scia/.md#_SciaAnalysis "Direct link to SciaAnalysis")
* *class *viktor.external.scia.scia.SciaAnalysis(*input\_file*, *xml\_def\_file*, *scia\_model*, *calculation\_setting=CalcSetting.LIN*, *xml\_doc\_name='output'*, *\**, *result\_type=ResultType.MODEL*, *output\_document=''*)[](#SciaAnalysis "Link to this definition")
Bases: [`ExternalProgram`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram "viktor.external.external_program.ExternalProgram")
SciaAnalysis can be used to perform an analysis using SCIA on a third-party worker. To start an analysis call the method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute"), with an appropriate timeout (in seconds). To retrieve the output file call the method [`get_xml_output_file()`](#SciaAnalysis.get_xml_output_file "viktor.external.scia.scia.SciaAnalysis.get_xml_output_file") after [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute").
Usage:
```
input_file = BytesIO("scia input file content".encode())
xml_def_file = BytesIO("scia xml def file content".encode())
scia_model = BytesIO("scia model content".encode())
scia_analysis = SciaAnalysis(input_file=input_file, xml_def_file=xml_def_file, scia_model=scia_model)
scia_analysis.execute(timeout=600)
xml_output_file = scia_analysis.get_xml_output_file()
```
Besides the output XML file, you can also retrieve the updated SCIA model. This is achieved using the result\_type:
```
scia_analysis = SciaAnalysis(input_file=input_file, xml_def_file=xml_def_file, scia_model=scia_model,
result_type=ResultType.MODEL)
scia_analysis.execute(timeout=600)
updated_esa_file = scia_analysis.get_updated_esa_model()
```
or the Engineering Report:
```
scia_analysis = SciaAnalysis(input_file=input_file, xml_def_file=xml_def_file, scia_model=scia_model,
result_type=ResultType.ENGINEERING_REPORT, output_document='report1')
scia_analysis.execute(timeout=600)
engineering_report = scia_analysis.get_engineering_report()
```
Exceptions which can be raised during calculation:
> * [`viktor.errors.LicenseError`](https://docs.viktor.ai/sdk/api/errors/.md#LicenseError "viktor.errors.LicenseError"): no license available
>
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
* **input\_file** (`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – SCIA input .xml file.
* **xml\_def\_file** (`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – SCIA input .def file.
* **scia\_model** (`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – SCIA .esa model.
* **calculation\_setting** ([`CalcSetting`](#CalcSetting "viktor.external.scia.scia.CalcSetting")) –
Available calculation settings according to the documentation of ESA\_XML.exe:
* NONE = without any recalculations
* NOC = No calculation
* LIN = Linear calculation (Delete all calculated results when exists)
* NEL = Nonlinear calculation
* CON = Nonlinear concrete calculation
* EIG = Eigen frequencies calculation
* STB = Stability calculation
* INF = Influence lines calculation
* MOB = Mobile loads calculation
* TDA = TDA calculation
* SLN = Soilin calculation
* PHA = Phases calculation
* NPH = Nonlinear phases
* CSS = Recalculation of cross sections
* NST = Nonlinear stability
* TID = Test of input data - solver link only
* **xml\_doc\_name** (`str`) – Name of XML IO document for export.
* **result\_type** ([`ResultType`](#ResultType "viktor.external.scia.scia.ResultType")) –
Type of output which should be returned besides the output.xml:
* ResultType.NONE returns nothing
* ResultType.MODEL returns the updated SCIA model (.esa) after calculation
* ResultType.ENGINEERING\_REPORT returns the specified engineering report
* **output\_document** (`str`) – Document name of the report which should be returned. This name should match the exact name of the report as defined in the .esa model.
* Raises:
**ValueError** – if Engineering Report is selected as result\_type, but no output\_document is specified.
- get\_engineering\_report(*as\_file=False*)[](#SciaAnalysis.get_engineering_report "Link to this definition")
Method can be used to retrieve the Engineering Report (.pdf). Make sure to call method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") first and [`get_engineering_report()`](#SciaAnalysis.get_engineering_report "viktor.external.scia.scia.SciaAnalysis.get_engineering_report") afterwards.
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
* Returns:
* File, if as\_file = True
* BytesIO, if as\_file = False (default)
* get\_updated\_esa\_model(*as\_file=False*)[](#SciaAnalysis.get_updated_esa_model "Link to this definition")
Method can be used to retrieve the updated SCIA model file (.esa), which contains the data that is read into the model while calling ESA\_XML.exe. Make sure to call method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") first and [`get_updated_esa_model()`](#SciaAnalysis.get_updated_esa_model "viktor.external.scia.scia.SciaAnalysis.get_updated_esa_model") afterwards.
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
* Returns:
* File, if as\_file = True
* BytesIO, if as\_file = False (default)
- *static *get\_xml\_def\_name(*input\_file*)[](#SciaAnalysis.get_xml_def_name "Link to this definition")
* Return type:
`str`
* get\_xml\_output\_file(*as\_file=False*)[](#SciaAnalysis.get_xml_output_file "Link to this definition")
Method can be used to retrieve the results generated by running an external analysis. This method returns the output XML file that is generated by SCIA. Make sure to call method [`execute()`](https://docs.viktor.ai/sdk/api/external/external-program/.md#ExternalProgram.execute "viktor.external.external_program.ExternalProgram.execute") first and [`get_xml_output_file()`](#SciaAnalysis.get_xml_output_file "viktor.external.scia.scia.SciaAnalysis.get_xml_output_file") afterwards.
* Return type:
`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `None`
* Returns:
* File, if as\_file = True
* BytesIO, if as\_file = False (default)
## ArbitraryProfile[](https://docs.viktor.ai/sdk/api/external/scia/.md#_ArbitraryProfile "Direct link to ArbitraryProfile")
* *class *viktor.external.scia.object.ArbitraryProfile(*object\_id*, *name*, *beam*, *c\_def*, *cross\_section*, *spans*)[](#ArbitraryProfile "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_arbitrary_profile()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_arbitrary_profile "viktor.external.scia.scia.Model.create_arbitrary_profile")
* *class *CDef(*\*values*)[](#ArbitraryProfile.CDef "Link to this definition")
Bases: `Enum`
* **ABSOLUTE** - absolute
* **RELATIVE** - relative
- ABSOLUTE*: [`CDef`](#ArbitraryProfile.CDef "viktor.external.scia.object.ArbitraryProfile.CDef")** = 0*[](#ArbitraryProfile.CDef.ABSOLUTE "Link to this definition")
* RELATIVE*: [`CDef`](#ArbitraryProfile.CDef "viktor.external.scia.object.ArbitraryProfile.CDef")** = 1*[](#ArbitraryProfile.CDef.RELATIVE "Link to this definition")
- *property *beam*: [Beam](#Beam "viktor.external.scia.object.Beam")*[](#ArbitraryProfile.beam "Link to this definition")
* *property *cross\_section*: [CrossSection](#CrossSection "viktor.external.scia.object.CrossSection")*[](#ArbitraryProfile.cross_section "Link to this definition")
- *property *spans*: List\[[ArbitraryProfileSpan](#ArbitraryProfileSpan "viktor.external.scia.object.ArbitraryProfileSpan")]*[](#ArbitraryProfile.spans "Link to this definition")
## ArbitraryProfileSpan[](https://docs.viktor.ai/sdk/api/external/scia/.md#_ArbitraryProfileSpan "Direct link to ArbitraryProfileSpan")
* *class *viktor.external.scia.object.ArbitraryProfileSpan(*length*, *type\_of\_css*, *cross\_section\_start*, *cross\_section\_end*, *alignment*)[](#ArbitraryProfileSpan "Link to this definition")
Do not use this \_\_init\_\_ directly, but create the object by [`create_arbitrary_profile_span()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_arbitrary_profile_span "viktor.external.scia.scia.Model.create_arbitrary_profile_span")
* *class *Alignment(*\*values*)[](#ArbitraryProfileSpan.Alignment "Link to this definition")
Bases: `Enum`
* **DEFAULT** - see “Default” at
* **CENTER\_LINE** - see “Centre line” at
* **TOP\_SURFACE** - see “Top surface” at
* **BOTTOM\_SURFACE** - see “Bottom surface” at
* **LEFT\_SURFACE** - see “Left surface” at
* **RIGHT\_SURFACE** - see “Right surface” at
* **TOP\_LEFT** -
* **TOP\_RIGHT** -
* **BOTTOM\_LEFT** -
* **BOTTOM\_RIGHT** -
- BOTTOM\_LEFT*: [`Alignment`](#ArbitraryProfileSpan.Alignment "viktor.external.scia.object.ArbitraryProfileSpan.Alignment")** = 8*[](#ArbitraryProfileSpan.Alignment.BOTTOM_LEFT "Link to this definition")
* BOTTOM\_RIGHT*: [`Alignment`](#ArbitraryProfileSpan.Alignment "viktor.external.scia.object.ArbitraryProfileSpan.Alignment")** = 9*[](#ArbitraryProfileSpan.Alignment.BOTTOM_RIGHT "Link to this definition")
- BOTTOM\_SURFACE*: [`Alignment`](#ArbitraryProfileSpan.Alignment "viktor.external.scia.object.ArbitraryProfileSpan.Alignment")** = 3*[](#ArbitraryProfileSpan.Alignment.BOTTOM_SURFACE "Link to this definition")
* CENTER\_LINE*: [`Alignment`](#ArbitraryProfileSpan.Alignment "viktor.external.scia.object.ArbitraryProfileSpan.Alignment")** = 1*[](#ArbitraryProfileSpan.Alignment.CENTER_LINE "Link to this definition")
- DEFAULT*: [`Alignment`](#ArbitraryProfileSpan.Alignment "viktor.external.scia.object.ArbitraryProfileSpan.Alignment")** = 0*[](#ArbitraryProfileSpan.Alignment.DEFAULT "Link to this definition")
* LEFT\_SURFACE*: [`Alignment`](#ArbitraryProfileSpan.Alignment "viktor.external.scia.object.ArbitraryProfileSpan.Alignment")** = 4*[](#ArbitraryProfileSpan.Alignment.LEFT_SURFACE "Link to this definition")
- RIGHT\_SURFACE*: [`Alignment`](#ArbitraryProfileSpan.Alignment "viktor.external.scia.object.ArbitraryProfileSpan.Alignment")** = 5*[](#ArbitraryProfileSpan.Alignment.RIGHT_SURFACE "Link to this definition")
* TOP\_LEFT*: [`Alignment`](#ArbitraryProfileSpan.Alignment "viktor.external.scia.object.ArbitraryProfileSpan.Alignment")** = 6*[](#ArbitraryProfileSpan.Alignment.TOP_LEFT "Link to this definition")
- TOP\_RIGHT*: [`Alignment`](#ArbitraryProfileSpan.Alignment "viktor.external.scia.object.ArbitraryProfileSpan.Alignment")** = 7*[](#ArbitraryProfileSpan.Alignment.TOP_RIGHT "Link to this definition")
* TOP\_SURFACE*: [`Alignment`](#ArbitraryProfileSpan.Alignment "viktor.external.scia.object.ArbitraryProfileSpan.Alignment")** = 2*[](#ArbitraryProfileSpan.Alignment.TOP_SURFACE "Link to this definition")
- *class *TypeOfCss(*\*values*)[](#ArbitraryProfileSpan.TypeOfCss "Link to this definition")
Bases: `Enum`
* **PRISMATIC** - The cross-section of the span is constant.
* **PARAM\_HAUNCH** - A standard haunch is inserted into the span.
* **TWO\_CSS** - Two cross-sections corresponding to the two end-points of the span are defined. The cross-section varies over the span from one section to the other.
- PARAM\_HAUNCH*: [`TypeOfCss`](#ArbitraryProfileSpan.TypeOfCss "viktor.external.scia.object.ArbitraryProfileSpan.TypeOfCss")** = 1*[](#ArbitraryProfileSpan.TypeOfCss.PARAM_HAUNCH "Link to this definition")
* PRISMATIC*: [`TypeOfCss`](#ArbitraryProfileSpan.TypeOfCss "viktor.external.scia.object.ArbitraryProfileSpan.TypeOfCss")** = 0*[](#ArbitraryProfileSpan.TypeOfCss.PRISMATIC "Link to this definition")
- TWO\_CSS*: [`TypeOfCss`](#ArbitraryProfileSpan.TypeOfCss "viktor.external.scia.object.ArbitraryProfileSpan.TypeOfCss")** = 2*[](#ArbitraryProfileSpan.TypeOfCss.TWO_CSS "Link to this definition")
* *property *cross\_section\_end*: [CrossSection](#CrossSection "viktor.external.scia.object.CrossSection")*[](#ArbitraryProfileSpan.cross_section_end "Link to this definition")
- *property *cross\_section\_start*: [CrossSection](#CrossSection "viktor.external.scia.object.CrossSection")*[](#ArbitraryProfileSpan.cross_section_start "Link to this definition")
## AveragingStrip[](https://docs.viktor.ai/sdk/api/external/scia/.md#_AveragingStrip "Direct link to AveragingStrip")
* *class *viktor.external.scia.object.AveragingStrip(*object\_id*, *name*, *plane*, *strip\_type*, *point\_1*, *width*, *length*, *angle*, *direction*)[](#AveragingStrip "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_averaging_strip()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_averaging_strip "viktor.external.scia.scia.Model.create_averaging_strip")
* *class *Direction(*\*values*)[](#AveragingStrip.Direction "Link to this definition")
Bases: `Enum`
* BOTH*: [`Direction`](#AveragingStrip.Direction "viktor.external.scia.object.AveragingStrip.Direction")** = 2*[](#AveragingStrip.Direction.BOTH "Link to this definition")
- LONGITUDINAL*: [`Direction`](#AveragingStrip.Direction "viktor.external.scia.object.AveragingStrip.Direction")** = 0*[](#AveragingStrip.Direction.LONGITUDINAL "Link to this definition")
* NONE*: [`Direction`](#AveragingStrip.Direction "viktor.external.scia.object.AveragingStrip.Direction")** = 3*[](#AveragingStrip.Direction.NONE "Link to this definition")
- PERPENDICULAR*: [`Direction`](#AveragingStrip.Direction "viktor.external.scia.object.AveragingStrip.Direction")** = 1*[](#AveragingStrip.Direction.PERPENDICULAR "Link to this definition")
- *class *Type(*\*values*)[](#AveragingStrip.Type "Link to this definition")
Bases: `Enum`
* POINT*: AveragingStrip.POINT** = 1*[](#AveragingStrip.Type.POINT "Link to this definition")
* *property *plane*: [Plane](#Plane "viktor.external.scia.object.Plane")*[](#AveragingStrip.plane "Link to this definition")
## Beam[](https://docs.viktor.ai/sdk/api/external/scia/.md#_Beam "Direct link to Beam")
* *class *viktor.external.scia.object.Beam(*object\_id*, *name*, *begin\_node*, *end\_node*, *cross\_section*, *ez=None*, *lcs\_rotation=None*, *layer=None*)[](#Beam "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_beam()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_beam "viktor.external.scia.scia.Model.create_beam")
* *property *begin\_node*: [Node](#Node "viktor.external.scia.object.Node")*[](#Beam.begin_node "Link to this definition")
- *property *cross\_section*: [CrossSection](#CrossSection "viktor.external.scia.object.CrossSection")*[](#Beam.cross_section "Link to this definition")
* *property *end\_node*: [Node](#Node "viktor.external.scia.object.Node")*[](#Beam.end_node "Link to this definition")
- *property *ez*: float*[](#Beam.ez "Link to this definition")
## CircularComposedCrossSection[](https://docs.viktor.ai/sdk/api/external/scia/.md#_CircularComposedCrossSection "Direct link to CircularComposedCrossSection")
* *class *viktor.external.scia.object.CircularComposedCrossSection(*object\_id*, *name*, *material*, *material\_2*, *diameter*, *thickness*)[](#CircularComposedCrossSection "Link to this definition")
Bases: [`ComposedCrossSection`](#ComposedCrossSection "viktor.external.scia.object.ComposedCrossSection")
Do not use this \_\_init\_\_ directly, but create the object by [`create_circular_composed_cross_section()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_circular_composed_cross_section "viktor.external.scia.scia.Model.create_circular_composed_cross_section")
## CircularCrossSection[](https://docs.viktor.ai/sdk/api/external/scia/.md#_CircularCrossSection "Direct link to CircularCrossSection")
* *class *viktor.external.scia.object.CircularCrossSection(*object\_id*, *name*, *material*, *diameter*)[](#CircularCrossSection "Link to this definition")
Bases: [`CrossSection`](#CrossSection "viktor.external.scia.object.CrossSection")
Do not use this \_\_init\_\_ directly, but create the object by [`create_circular_cross_section()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_circular_cross_section "viktor.external.scia.scia.Model.create_circular_cross_section")
## CircularHollowCrossSection[](https://docs.viktor.ai/sdk/api/external/scia/.md#_CircularHollowCrossSection "Direct link to CircularHollowCrossSection")
* *class *viktor.external.scia.object.CircularHollowCrossSection(*object\_id*, *name*, *material*, *diameter*, *thickness*)[](#CircularHollowCrossSection "Link to this definition")
Bases: [`CrossSection`](#CrossSection "viktor.external.scia.object.CrossSection")
Do not use this \_\_init\_\_ directly, but create the object by [`create_circular_hollow_cross_section()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_circular_hollow_cross_section "viktor.external.scia.scia.Model.create_circular_hollow_cross_section")
## ComposedCrossSection[](https://docs.viktor.ai/sdk/api/external/scia/.md#_ComposedCrossSection "Direct link to ComposedCrossSection")
* *class *viktor.external.scia.object.ComposedCrossSection(*object\_id*, *name*, *material*, *material\_2*)[](#ComposedCrossSection "Link to this definition")
Bases: [`CrossSection`](#CrossSection "viktor.external.scia.object.CrossSection")
Abstract base class of all cross sections, composed of two materials.
## Concrete[](https://docs.viktor.ai/sdk/api/external/scia/.md#_Concrete "Direct link to Concrete")
* *class *viktor.external.scia.object.Concrete(*object\_id*, *name*, *part*, *thermal\_expansion=None*, *unit\_mass=None*, *wet\_density=None*, *e\_modulus=None*, *poisson=None*, *g\_modulus=None*, *log\_decrement=None*, *specific\_heat=None*, *thermal\_conductivity=None*, *\**, *fck=None*)[](#Concrete "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`update_concrete_material()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.update_concrete_material "viktor.external.scia.scia.Model.update_concrete_material")
* *class *ECPart(*\*values*)[](#Concrete.ECPart "Link to this definition")
Bases: `Enum`
* **GENERAL** - concrete EN 1992-1-1
* **BRIDGES** - concrete EN 1992-2
- BRIDGES*: [`ECPart`](#Concrete.ECPart "viktor.external.scia.object.Concrete.ECPart")** = 1*[](#Concrete.ECPart.BRIDGES "Link to this definition")
* GENERAL*: [`ECPart`](#Concrete.ECPart "viktor.external.scia.object.Concrete.ECPart")** = 0*[](#Concrete.ECPart.GENERAL "Link to this definition")
- *property *ec\_part*: [ECPart](#Concrete.ECPart "viktor.external.scia.object.Concrete.ECPart")*[](#Concrete.ec_part "Link to this definition")
## CrossLink[](https://docs.viktor.ai/sdk/api/external/scia/.md#_CrossLink "Direct link to CrossLink")
* *class *viktor.external.scia.object.CrossLink(*object\_id*, *name*, *beam\_1*, *beam\_2*)[](#CrossLink "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_cross_link()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_cross_link "viktor.external.scia.scia.Model.create_cross_link")
## CrossSection[](https://docs.viktor.ai/sdk/api/external/scia/.md#_CrossSection "Direct link to CrossSection")
* *class *viktor.external.scia.object.CrossSection(*object\_id*, *name*, *material*)[](#CrossSection "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Abstract base class of all cross sections.
## FreeLineLoad[](https://docs.viktor.ai/sdk/api/external/scia/.md#_FreeLineLoad "Direct link to FreeLineLoad")
* *class *viktor.external.scia.object.FreeLineLoad(*object\_id*, *name*, *load\_case*, *point\_1*, *point\_2*, *direction*, *magnitude\_1*, *magnitude\_2*, *distribution=Distribution.TRAPEZOIDAL*, *validity=Validity.ALL*, *load\_type=Type.FORCE*, *select=Select.AUTO*, *system=CSys.GLOBAL*, *location=Location.LENGTH*)[](#FreeLineLoad "Link to this definition")
Bases: [`FreeLoad`](#FreeLoad "viktor.external.scia.object.FreeLoad")
Do not use this \_\_init\_\_ directly, but create the object by [`create_free_line_load()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_free_line_load "viktor.external.scia.scia.Model.create_free_line_load")
* *class *Distribution(*\*values*)[](#FreeLineLoad.Distribution "Link to this definition")
Bases: `Enum`
* TRAPEZOIDAL*: [`Distribution`](#FreeLineLoad.Distribution "viktor.external.scia.object.FreeLineLoad.Distribution")** = 1*[](#FreeLineLoad.Distribution.TRAPEZOIDAL "Link to this definition")
- UNIFORM*: [`Distribution`](#FreeLineLoad.Distribution "viktor.external.scia.object.FreeLineLoad.Distribution")** = 0*[](#FreeLineLoad.Distribution.UNIFORM "Link to this definition")
## FreeLoad[](https://docs.viktor.ai/sdk/api/external/scia/.md#_FreeLoad "Direct link to FreeLoad")
* *class *viktor.external.scia.object.FreeLoad(*object\_id*, *name*, *load\_case*, *direction*, *select*, *validity=None*, *load\_type=None*, *c\_sys=None*)[](#FreeLoad "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Abstract base class of all free loads.
* Do not use this \_\_init\_\_ directly, but create the object by [`create_free_point_load()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_free_point_load "viktor.external.scia.scia.Model.create_free_point_load"),
[`create_free_line_load()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_free_line_load "viktor.external.scia.scia.Model.create_free_line_load") or [`create_free_surface_load()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_free_surface_load "viktor.external.scia.scia.Model.create_free_surface_load")
- *class *CSys(*\*values*)[](#FreeLoad.CSys "Link to this definition")
Bases: `Enum`
* GLOBAL*: [`CSys`](#FreeLoad.CSys "viktor.external.scia.object.FreeLoad.CSys")** = 0*[](#FreeLoad.CSys.GLOBAL "Link to this definition")
- LOAD\_LCS*: [`CSys`](#FreeLoad.CSys "viktor.external.scia.object.FreeLoad.CSys")** = 2*[](#FreeLoad.CSys.LOAD_LCS "Link to this definition")
* MEMBER\_LCS*: [`CSys`](#FreeLoad.CSys "viktor.external.scia.object.FreeLoad.CSys")** = 1*[](#FreeLoad.CSys.MEMBER_LCS "Link to this definition")
* *class *Direction(*\*values*)[](#FreeLoad.Direction "Link to this definition")
Bases: `Enum`
* X*: [`Direction`](#FreeLoad.Direction "viktor.external.scia.object.FreeLoad.Direction")** = 0*[](#FreeLoad.Direction.X "Link to this definition")
- Y*: [`Direction`](#FreeLoad.Direction "viktor.external.scia.object.FreeLoad.Direction")** = 1*[](#FreeLoad.Direction.Y "Link to this definition")
* Z*: [`Direction`](#FreeLoad.Direction "viktor.external.scia.object.FreeLoad.Direction")** = 2*[](#FreeLoad.Direction.Z "Link to this definition")
- *class *Location(*\*values*)[](#FreeLoad.Location "Link to this definition")
Bases: `Enum`
* LENGTH*: [`Location`](#FreeLoad.Location "viktor.external.scia.object.FreeLoad.Location")** = 0*[](#FreeLoad.Location.LENGTH "Link to this definition")
- PROJECTION*: [`Location`](#FreeLoad.Location "viktor.external.scia.object.FreeLoad.Location")** = 1*[](#FreeLoad.Location.PROJECTION "Link to this definition")
* *class *Select(*\*values*)[](#FreeLoad.Select "Link to this definition")
Bases: `Enum`
* AUTO*: [`Select`](#FreeLoad.Select "viktor.external.scia.object.FreeLoad.Select")** = 0*[](#FreeLoad.Select.AUTO "Link to this definition")
- SELECT*: [`Select`](#FreeLoad.Select "viktor.external.scia.object.FreeLoad.Select")** = 1*[](#FreeLoad.Select.SELECT "Link to this definition")
- *class *Type(*\*values*)[](#FreeLoad.Type "Link to this definition")
Bases: `Enum`
* FORCE*: [`Type`](#FreeLoad.Type "viktor.external.scia.object.FreeLoad.Type")** = 0*[](#FreeLoad.Type.FORCE "Link to this definition")
* *class *Validity(*\*values*)[](#FreeLoad.Validity "Link to this definition")
Bases: `Enum`
* ALL*: [`Validity`](#FreeLoad.Validity "viktor.external.scia.object.FreeLoad.Validity")** = 0*[](#FreeLoad.Validity.ALL "Link to this definition")
- FROM\_TO*: [`Validity`](#FreeLoad.Validity "viktor.external.scia.object.FreeLoad.Validity")** = 3*[](#FreeLoad.Validity.FROM_TO "Link to this definition")
* NEG\_Z*: [`Validity`](#FreeLoad.Validity "viktor.external.scia.object.FreeLoad.Validity")** = 1*[](#FreeLoad.Validity.NEG_Z "Link to this definition")
- NEG\_Z\_INCL\_ZERO*: [`Validity`](#FreeLoad.Validity "viktor.external.scia.object.FreeLoad.Validity")** = 5*[](#FreeLoad.Validity.NEG_Z_INCL_ZERO "Link to this definition")
* POS\_Z*: [`Validity`](#FreeLoad.Validity "viktor.external.scia.object.FreeLoad.Validity")** = 2*[](#FreeLoad.Validity.POS_Z "Link to this definition")
- POS\_Z\_INCL\_ZERO*: [`Validity`](#FreeLoad.Validity "viktor.external.scia.object.FreeLoad.Validity")** = 6*[](#FreeLoad.Validity.POS_Z_INCL_ZERO "Link to this definition")
* ZERO\_Z*: [`Validity`](#FreeLoad.Validity "viktor.external.scia.object.FreeLoad.Validity")** = 4*[](#FreeLoad.Validity.ZERO_Z "Link to this definition")
- *property *load\_case*: [LoadCase](#LoadCase "viktor.external.scia.object.LoadCase")*[](#FreeLoad.load_case "Link to this definition")
## FreePointLoad[](https://docs.viktor.ai/sdk/api/external/scia/.md#_FreePointLoad "Direct link to FreePointLoad")
* *class *viktor.external.scia.object.FreePointLoad(*object\_id*, *name*, *load\_case*, *direction*, *magnitude*, *position*, *load\_type=Type.FORCE*, *validity=Validity.ALL*, *select=Select.AUTO*, *system=CSys.GLOBAL*)[](#FreePointLoad "Link to this definition")
Bases: [`FreeLoad`](#FreeLoad "viktor.external.scia.object.FreeLoad")
Do not use this \_\_init\_\_ directly, but create the object by [`create_free_point_load()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_free_point_load "viktor.external.scia.scia.Model.create_free_point_load")
## FreeSurfaceLoad[](https://docs.viktor.ai/sdk/api/external/scia/.md#_FreeSurfaceLoad "Direct link to FreeSurfaceLoad")
* *class *viktor.external.scia.object.FreeSurfaceLoad(*object\_id*, *name*, *load\_case*, *direction*, *q1*, *q2=None*, *q3=None*, *points=None*, *distribution=None*, *load\_type=None*, *validity=None*, *system=None*, *location=None*, *selection=None*)[](#FreeSurfaceLoad "Link to this definition")
Bases: [`FreeLoad`](#FreeLoad "viktor.external.scia.object.FreeLoad")
Do not use this \_\_init\_\_ directly, but create the object by [`create_free_surface_load()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_free_surface_load "viktor.external.scia.scia.Model.create_free_surface_load")
* *class *Distribution(*\*values*)[](#FreeSurfaceLoad.Distribution "Link to this definition")
Bases: `Enum`
* DIR\_X*: [`Distribution`](#FreeSurfaceLoad.Distribution "viktor.external.scia.object.FreeSurfaceLoad.Distribution")** = 1*[](#FreeSurfaceLoad.Distribution.DIR_X "Link to this definition")
- DIR\_Y*: [`Distribution`](#FreeSurfaceLoad.Distribution "viktor.external.scia.object.FreeSurfaceLoad.Distribution")** = 2*[](#FreeSurfaceLoad.Distribution.DIR_Y "Link to this definition")
* POINTS*: [`Distribution`](#FreeSurfaceLoad.Distribution "viktor.external.scia.object.FreeSurfaceLoad.Distribution")** = 3*[](#FreeSurfaceLoad.Distribution.POINTS "Link to this definition")
- UNIFORM*: [`Distribution`](#FreeSurfaceLoad.Distribution "viktor.external.scia.object.FreeSurfaceLoad.Distribution")** = 0*[](#FreeSurfaceLoad.Distribution.UNIFORM "Link to this definition")
- *property *distribution*: [Distribution](#FreeSurfaceLoad.Distribution "viktor.external.scia.object.FreeSurfaceLoad.Distribution")*[](#FreeSurfaceLoad.distribution "Link to this definition")
* *property *points*: List\[Tuple\[float, float]] | None*[](#FreeSurfaceLoad.points "Link to this definition")
- *property *q2*: float | None*[](#FreeSurfaceLoad.q2 "Link to this definition")
* *property *q3*: float | None*[](#FreeSurfaceLoad.q3 "Link to this definition")
- *property *selection*: List\[[Plane](#Plane "viktor.external.scia.object.Plane")] | None*[](#FreeSurfaceLoad.selection "Link to this definition")
## GeneralCrossSection[](https://docs.viktor.ai/sdk/api/external/scia/.md#_GeneralCrossSection "Direct link to GeneralCrossSection")
* *class *viktor.external.scia.object.GeneralCrossSection(*object\_id*, *name*, *material*, *elements*)[](#GeneralCrossSection "Link to this definition")
Bases: [`CrossSection`](#CrossSection "viktor.external.scia.object.CrossSection")
Do not use this \_\_init\_\_ directly, but create the object by [`create_general_cross_section()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_general_cross_section "viktor.external.scia.scia.Model.create_general_cross_section")
## GeneralCrossSectionElement[](https://docs.viktor.ai/sdk/api/external/scia/.md#_GeneralCrossSectionElement "Direct link to GeneralCrossSectionElement")
* *class *viktor.external.scia.object.GeneralCrossSectionElement(*name*, *element\_type*, *points*, *\**, *material=None*)[](#GeneralCrossSectionElement "Link to this definition")
Do not use this \_\_init\_\_ directly, but create the object by [`create_general_cross_section_element()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_general_cross_section_element "viktor.external.scia.scia.Model.create_general_cross_section_element")
* *class *Type(*\*values*)[](#GeneralCrossSectionElement.Type "Link to this definition")
Bases: `Enum`
* OPENING*: [`Type`](#GeneralCrossSectionElement.Type "viktor.external.scia.object.GeneralCrossSectionElement.Type")** = 1*[](#GeneralCrossSectionElement.Type.OPENING "Link to this definition")
- POLYGON*: [`Type`](#GeneralCrossSectionElement.Type "viktor.external.scia.object.GeneralCrossSectionElement.Type")** = 0*[](#GeneralCrossSectionElement.Type.POLYGON "Link to this definition")
## HingeOnBeam[](https://docs.viktor.ai/sdk/api/external/scia/.md#_HingeOnBeam "Direct link to HingeOnBeam")
* *class *viktor.external.scia.object.HingeOnBeam(*object\_id*, *name*, *beam*, *position*, *freedom\_ux=Freedom.FREE*, *freedom\_uy=Freedom.FREE*, *freedom\_uz=Freedom.FREE*, *freedom\_fix=Freedom.FREE*, *freedom\_fiy=Freedom.FREE*, *freedom\_fiz=Freedom.FREE*, *stiffness\_ux=0*, *stiffness\_uy=0*, *stiffness\_uz=0*, *stiffness\_fix=0*, *stiffness\_fiy=0*, *stiffness\_fiz=0*)[](#HingeOnBeam "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_hinge_on_beam()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_hinge_on_beam "viktor.external.scia.scia.Model.create_hinge_on_beam").
* *class *Freedom(*\*values*)[](#HingeOnBeam.Freedom "Link to this definition")
Bases: `Enum`
* **FREE** - The support is free in the specified direction. That is it imposes no constraint in the direction.
* **RIGID** - The support in fully rigid in the specified direction.
* **FLEXIBLE** - The support is flexible (elastic) in the specified direction. The user has to define the required stiffness of the support.
- FLEXIBLE*: [`Freedom`](#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom")** = 2*[](#HingeOnBeam.Freedom.FLEXIBLE "Link to this definition")
* FREE*: [`Freedom`](#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom")** = 0*[](#HingeOnBeam.Freedom.FREE "Link to this definition")
- RIGID*: [`Freedom`](#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom")** = 1*[](#HingeOnBeam.Freedom.RIGID "Link to this definition")
- *class *Position(*\*values*)[](#HingeOnBeam.Position "Link to this definition")
Bases: `Enum`
* BEGIN*: [`Position`](#HingeOnBeam.Position "viktor.external.scia.object.HingeOnBeam.Position")** = 0*[](#HingeOnBeam.Position.BEGIN "Link to this definition")
- BOTH*: [`Position`](#HingeOnBeam.Position "viktor.external.scia.object.HingeOnBeam.Position")** = 2*[](#HingeOnBeam.Position.BOTH "Link to this definition")
* END*: [`Position`](#HingeOnBeam.Position "viktor.external.scia.object.HingeOnBeam.Position")** = 1*[](#HingeOnBeam.Position.END "Link to this definition")
* *property *beam*: [Beam](#Beam "viktor.external.scia.object.Beam")*[](#HingeOnBeam.beam "Link to this definition")
- *property *freedom*: Tuple\[[Freedom](#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom"), [Freedom](#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom"), [Freedom](#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom"), [Freedom](#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom"), [Freedom](#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom"), [Freedom](#HingeOnBeam.Freedom "viktor.external.scia.object.HingeOnBeam.Freedom")]*[](#HingeOnBeam.freedom "Link to this definition")
ux, uy, uz, fix, fiy, fiz
* *property *stiffness*: Tuple\[float, float, float, float, float, float]*[](#HingeOnBeam.stiffness "Link to this definition")
ux, uy, uz, fix, fiy, fiz
## HingeOnPlane[](https://docs.viktor.ai/sdk/api/external/scia/.md#_HingeOnPlane "Direct link to HingeOnPlane")
* *class *viktor.external.scia.object.HingeOnPlane(*object\_id*, *name*, *edge*, *ux=None*, *stiffness\_ux=None*, *uy=None*, *stiffness\_uy=None*, *uz=None*, *stiffness\_uz=None*, *fix=None*, *stiffness\_fix=None*, *c\_def=None*, *position\_x1=None*, *position\_x2=None*, *origin=None*)[](#HingeOnPlane "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_hinge_on_plane()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_hinge_on_plane "viktor.external.scia.scia.Model.create_hinge_on_plane").
* *class *CDef(*\*values*)[](#HingeOnPlane.CDef "Link to this definition")
Bases: `Enum`
* **ABSOLUTE** - absolute, where the coordinate must lie between 0 and the length of the plane edge
* **RELATIVE** - relative, where the coordinate must lie between 0 and 1
- ABSOLUTE*: [`CDef`](#HingeOnPlane.CDef "viktor.external.scia.object.HingeOnPlane.CDef")** = 0*[](#HingeOnPlane.CDef.ABSOLUTE "Link to this definition")
* RELATIVE*: [`CDef`](#HingeOnPlane.CDef "viktor.external.scia.object.HingeOnPlane.CDef")** = 1*[](#HingeOnPlane.CDef.RELATIVE "Link to this definition")
- *class *Freedom(*\*values*)[](#HingeOnPlane.Freedom "Link to this definition")
Bases: `Enum`
* **FREE** - The support is free in the specified direction. That is it imposes no constraint in the direction.
* **RIGID** - The support in fully rigid in the specified direction.
* **FLEXIBLE** - The support is flexible (elastic) in the specified direction. The user has to define the required stiffness of the support.
- FLEXIBLE*: [`Freedom`](#HingeOnPlane.Freedom "viktor.external.scia.object.HingeOnPlane.Freedom")** = 2*[](#HingeOnPlane.Freedom.FLEXIBLE "Link to this definition")
* FREE*: [`Freedom`](#HingeOnPlane.Freedom "viktor.external.scia.object.HingeOnPlane.Freedom")** = 0*[](#HingeOnPlane.Freedom.FREE "Link to this definition")
- RIGID*: [`Freedom`](#HingeOnPlane.Freedom "viktor.external.scia.object.HingeOnPlane.Freedom")** = 1*[](#HingeOnPlane.Freedom.RIGID "Link to this definition")
* *class *Origin(*\*values*)[](#HingeOnPlane.Origin "Link to this definition")
Bases: `Enum`
* **FROM\_START** - position is measured from the beginning of the plane edge
* **FROM\_END** - position is measured from the end of the plane edge
- FROM\_END*: [`Origin`](#HingeOnPlane.Origin "viktor.external.scia.object.HingeOnPlane.Origin")** = 1*[](#HingeOnPlane.Origin.FROM_END "Link to this definition")
* FROM\_START*: [`Origin`](#HingeOnPlane.Origin "viktor.external.scia.object.HingeOnPlane.Origin")** = 0*[](#HingeOnPlane.Origin.FROM_START "Link to this definition")
- *property *plane*: [Plane](#Plane "viktor.external.scia.object.Plane")*[](#HingeOnPlane.plane "Link to this definition")
## IntegrationStrip[](https://docs.viktor.ai/sdk/api/external/scia/.md#_IntegrationStrip "Direct link to IntegrationStrip")
* *class *viktor.external.scia.object.IntegrationStrip(*object\_id*, *name*, *plane*, *point\_1*, *point\_2*, *width*, *effective\_width\_geometry=\_EffectiveWidthGeometry.CONSTANT\_SYMMETRIC*, *effective\_width\_definition=\_EffectiveWidthDefinition.WIDTH*)[](#IntegrationStrip "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_integration_strip()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_integration_strip "viktor.external.scia.scia.Model.create_integration_strip")
* *property *plane*: [Plane](#Plane "viktor.external.scia.object.Plane")*[](#IntegrationStrip.plane "Link to this definition")
## InternalEdge[](https://docs.viktor.ai/sdk/api/external/scia/.md#_InternalEdge "Direct link to InternalEdge")
* *class *viktor.external.scia.object.InternalEdge(*object\_id*, *name*, *plane*, *node\_1*, *node\_2*)[](#InternalEdge "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_internal_edge()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_internal_edge "viktor.external.scia.scia.Model.create_internal_edge")
* *property *node\_1*: [Node](#Node "viktor.external.scia.object.Node")*[](#InternalEdge.node_1 "Link to this definition")
- *property *node\_2*: [Node](#Node "viktor.external.scia.object.Node")*[](#InternalEdge.node_2 "Link to this definition")
* *property *plane*: [Plane](#Plane "viktor.external.scia.object.Plane")*[](#InternalEdge.plane "Link to this definition")
## Layer[](https://docs.viktor.ai/sdk/api/external/scia/.md#_Layer "Direct link to Layer")
* *class *viktor.external.scia.object.Layer(*object\_id*, *name*, *comment=None*, *structural\_model\_only=None*, *current\_used\_activity=None*)[](#Layer "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_layer()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_layer "viktor.external.scia.scia.Model.create_layer")
## LibraryCrossSection[](https://docs.viktor.ai/sdk/api/external/scia/.md#_LibraryCrossSection "Direct link to LibraryCrossSection")
* *class *viktor.external.scia.object.LibraryCrossSection(*object\_id*, *name*, *material*, *section*, *profile*)[](#LibraryCrossSection "Link to this definition")
Bases: [`CrossSection`](#CrossSection "viktor.external.scia.object.CrossSection")
Do not use this \_\_init\_\_ directly, but create the object by [`create_library_cross_section()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_library_cross_section "viktor.external.scia.scia.Model.create_library_cross_section")
* *class *Section(*\*values*)[](#LibraryCrossSection.Section "Link to this definition")
Bases: `Enum`
* ASYMMETRIC\_I*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 101*[](#LibraryCrossSection.Section.ASYMMETRIC_I "Link to this definition")
- CHANNEL*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 5*[](#LibraryCrossSection.Section.CHANNEL "Link to this definition")
* CIRCULAR\_HOLLOW*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 3*[](#LibraryCrossSection.Section.CIRCULAR_HOLLOW "Link to this definition")
- COLD\_FORMED\_2C*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 130*[](#LibraryCrossSection.Section.COLD_FORMED_2C "Link to this definition")
* COLD\_FORMED\_ANGLE*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 111*[](#LibraryCrossSection.Section.COLD_FORMED_ANGLE "Link to this definition")
- COLD\_FORMED\_C*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 114*[](#LibraryCrossSection.Section.COLD_FORMED_C "Link to this definition")
* COLD\_FORMED\_CHANNEL*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 112*[](#LibraryCrossSection.Section.COLD_FORMED_CHANNEL "Link to this definition")
- COLD\_FORMED\_C\_EAVES\_BEAM*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 116*[](#LibraryCrossSection.Section.COLD_FORMED_C_EAVES_BEAM "Link to this definition")
* COLD\_FORMED\_C\_PLUS*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 117*[](#LibraryCrossSection.Section.COLD_FORMED_C_PLUS "Link to this definition")
- COLD\_FORMED\_IS\_PLUS*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 128*[](#LibraryCrossSection.Section.COLD_FORMED_IS_PLUS "Link to this definition")
* COLD\_FORMED\_I\_PLUS*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 127*[](#LibraryCrossSection.Section.COLD_FORMED_I_PLUS "Link to this definition")
- COLD\_FORMED\_OMEGA*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 115*[](#LibraryCrossSection.Section.COLD_FORMED_OMEGA "Link to this definition")
* COLD\_FORMED\_SIGMA*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 121*[](#LibraryCrossSection.Section.COLD_FORMED_SIGMA "Link to this definition")
- COLD\_FORMED\_SIGMA\_ASYMMETRIC*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 129*[](#LibraryCrossSection.Section.COLD_FORMED_SIGMA_ASYMMETRIC "Link to this definition")
* COLD\_FORMED\_SIGMA\_EAVES\_BEAM*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 124*[](#LibraryCrossSection.Section.COLD_FORMED_SIGMA_EAVES_BEAM "Link to this definition")
- COLD\_FORMED\_SIGMA\_PLUS*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 123*[](#LibraryCrossSection.Section.COLD_FORMED_SIGMA_PLUS "Link to this definition")
* COLD\_FORMED\_SIGMA\_PLUS\_EAVES\_BEAM*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 125*[](#LibraryCrossSection.Section.COLD_FORMED_SIGMA_PLUS_EAVES_BEAM "Link to this definition")
- COLD\_FORMED\_SIGMA\_STIFFENED*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 122*[](#LibraryCrossSection.Section.COLD_FORMED_SIGMA_STIFFENED "Link to this definition")
* COLD\_FORMED\_Z*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 113*[](#LibraryCrossSection.Section.COLD_FORMED_Z "Link to this definition")
- COLD\_FORMED\_ZED*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 118*[](#LibraryCrossSection.Section.COLD_FORMED_ZED "Link to this definition")
* COLD\_FORMED\_ZED\_ASYMMETRIC\_LIPS*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 119*[](#LibraryCrossSection.Section.COLD_FORMED_ZED_ASYMMETRIC_LIPS "Link to this definition")
- COLD\_FORMED\_ZED\_BOTH\_LIPS\_INCLINED*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 126*[](#LibraryCrossSection.Section.COLD_FORMED_ZED_BOTH_LIPS_INCLINED "Link to this definition")
* COLD\_FORMED\_ZED\_INCLINED\_LIP*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 120*[](#LibraryCrossSection.Section.COLD_FORMED_ZED_INCLINED_LIP "Link to this definition")
- FULL\_CIRCULAR*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 11*[](#LibraryCrossSection.Section.FULL_CIRCULAR "Link to this definition")
* FULL\_RECTANGULAR*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 7*[](#LibraryCrossSection.Section.FULL_RECTANGULAR "Link to this definition")
- GENERAL\_COLD\_FORMED*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 110*[](#LibraryCrossSection.Section.GENERAL_COLD_FORMED "Link to this definition")
* I*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 1*[](#LibraryCrossSection.Section.I "Link to this definition")
- IFBA*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 154*[](#LibraryCrossSection.Section.IFBA "Link to this definition")
* IFBB*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 155*[](#LibraryCrossSection.Section.IFBB "Link to this definition")
- L*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 4*[](#LibraryCrossSection.Section.L "Link to this definition")
* MINUS\_L*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 1002*[](#LibraryCrossSection.Section.MINUS_L "Link to this definition")
- RAIL\_TYPE\_KA*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 150*[](#LibraryCrossSection.Section.RAIL_TYPE_KA "Link to this definition")
* RAIL\_TYPE\_KF*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 151*[](#LibraryCrossSection.Section.RAIL_TYPE_KF "Link to this definition")
- RAIL\_TYPE\_KG*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 152*[](#LibraryCrossSection.Section.RAIL_TYPE_KG "Link to this definition")
* RECTANGULAR\_HOLLOW*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 2*[](#LibraryCrossSection.Section.RECTANGULAR_HOLLOW "Link to this definition")
- ROLLED\_Z*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 102*[](#LibraryCrossSection.Section.ROLLED_Z "Link to this definition")
* SFB*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 153*[](#LibraryCrossSection.Section.SFB "Link to this definition")
- T*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 6*[](#LibraryCrossSection.Section.T "Link to this definition")
* THQ*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 156*[](#LibraryCrossSection.Section.THQ "Link to this definition")
- VIRTUAL\_JOIST*: [`Section`](#LibraryCrossSection.Section "viktor.external.scia.object.LibraryCrossSection.Section")** = 160*[](#LibraryCrossSection.Section.VIRTUAL_JOIST "Link to this definition")
## LineForceSurface[](https://docs.viktor.ai/sdk/api/external/scia/.md#_LineForceSurface "Direct link to LineForceSurface")
* *class *viktor.external.scia.object.LineForceSurface(*object\_id*, *name*, *edge*, *load\_case*, *p1*, *p2=None*, *direction=None*, *location=None*, *c\_sys=None*, *c\_def=None*, *position\_x1=None*, *position\_x2=None*, *origin=None*)[](#LineForceSurface "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_line_load_on_plane()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_line_load_on_plane "viktor.external.scia.scia.Model.create_line_load_on_plane")
* *class *CDef(*\*values*)[](#LineForceSurface.CDef "Link to this definition")
Bases: `Enum`
* **ABSOLUTE** - absolute, where the coordinate must lie between 0 and the length of the plane edge
* **RELATIVE** - relative, where the coordinate must lie between 0 and 1
- ABSOLUTE*: [`CDef`](#LineForceSurface.CDef "viktor.external.scia.object.LineForceSurface.CDef")** = 0*[](#LineForceSurface.CDef.ABSOLUTE "Link to this definition")
* RELATIVE*: [`CDef`](#LineForceSurface.CDef "viktor.external.scia.object.LineForceSurface.CDef")** = 1*[](#LineForceSurface.CDef.RELATIVE "Link to this definition")
- *class *CSys(*\*values*)[](#LineForceSurface.CSys "Link to this definition")
Bases: `Enum`
* GLOBAL*: [`CSys`](#LineForceSurface.CSys "viktor.external.scia.object.LineForceSurface.CSys")** = 0*[](#LineForceSurface.CSys.GLOBAL "Link to this definition")
- LOCAL*: [`CSys`](#LineForceSurface.CSys "viktor.external.scia.object.LineForceSurface.CSys")** = 1*[](#LineForceSurface.CSys.LOCAL "Link to this definition")
* *class *Direction(*\*values*)[](#LineForceSurface.Direction "Link to this definition")
Bases: `Enum`
* X*: [`Direction`](#LineForceSurface.Direction "viktor.external.scia.object.LineForceSurface.Direction")** = 0*[](#LineForceSurface.Direction.X "Link to this definition")
- Y*: [`Direction`](#LineForceSurface.Direction "viktor.external.scia.object.LineForceSurface.Direction")** = 1*[](#LineForceSurface.Direction.Y "Link to this definition")
* Z*: [`Direction`](#LineForceSurface.Direction "viktor.external.scia.object.LineForceSurface.Direction")** = 2*[](#LineForceSurface.Direction.Z "Link to this definition")
- *class *Distribution(*\*values*)[](#LineForceSurface.Distribution "Link to this definition")
Bases: `Enum`
* TRAPEZOIDAL*: [`Distribution`](#LineForceSurface.Distribution "viktor.external.scia.object.LineForceSurface.Distribution")** = 1*[](#LineForceSurface.Distribution.TRAPEZOIDAL "Link to this definition")
- UNIFORM*: [`Distribution`](#LineForceSurface.Distribution "viktor.external.scia.object.LineForceSurface.Distribution")** = 0*[](#LineForceSurface.Distribution.UNIFORM "Link to this definition")
* *class *Location(*\*values*)[](#LineForceSurface.Location "Link to this definition")
Bases: `Enum`
* LENGTH*: [`Location`](#LineForceSurface.Location "viktor.external.scia.object.LineForceSurface.Location")** = 0*[](#LineForceSurface.Location.LENGTH "Link to this definition")
- PROJECTION*: [`Location`](#LineForceSurface.Location "viktor.external.scia.object.LineForceSurface.Location")** = 1*[](#LineForceSurface.Location.PROJECTION "Link to this definition")
- *class *Origin(*\*values*)[](#LineForceSurface.Origin "Link to this definition")
Bases: `Enum`
* **FROM\_START** - position is measured from the beginning of the plane edge
* **FROM\_END** - position is measured from the end of the plane edge
- FROM\_END*: [`Origin`](#LineForceSurface.Origin "viktor.external.scia.object.LineForceSurface.Origin")** = 1*[](#LineForceSurface.Origin.FROM_END "Link to this definition")
* FROM\_START*: [`Origin`](#LineForceSurface.Origin "viktor.external.scia.object.LineForceSurface.Origin")** = 0*[](#LineForceSurface.Origin.FROM_START "Link to this definition")
* *property *c\_def*: [CDef](#LineForceSurface.CDef "viktor.external.scia.object.LineForceSurface.CDef")*[](#LineForceSurface.c_def "Link to this definition")
- *property *c\_sys*: [CSys](#LineForceSurface.CSys "viktor.external.scia.object.LineForceSurface.CSys")*[](#LineForceSurface.c_sys "Link to this definition")
* *property *distribution*: [Distribution](#LineForceSurface.Distribution "viktor.external.scia.object.LineForceSurface.Distribution")*[](#LineForceSurface.distribution "Link to this definition")
- *property *load\_case*: [LoadCase](#LoadCase "viktor.external.scia.object.LoadCase")*[](#LineForceSurface.load_case "Link to this definition")
* *property *location*: [Location](#LineForceSurface.Location "viktor.external.scia.object.LineForceSurface.Location")*[](#LineForceSurface.location "Link to this definition")
- *property *origin*: [Origin](#LineForceSurface.Origin "viktor.external.scia.object.LineForceSurface.Origin")*[](#LineForceSurface.origin "Link to this definition")
* *property *plane*: [Plane](#Plane "viktor.external.scia.object.Plane")*[](#LineForceSurface.plane "Link to this definition")
- *property *position\_x1*: float | None*[](#LineForceSurface.position_x1 "Link to this definition")
* *property *position\_x2*: float | None*[](#LineForceSurface.position_x2 "Link to this definition")
## LineLoad[](https://docs.viktor.ai/sdk/api/external/scia/.md#_LineLoad "Direct link to LineLoad")
* *class *viktor.external.scia.object.LineLoad(*object\_id*, *name*, *load\_case*, *beam*, *load\_type*, *distribution*, *load\_start*, *load\_end*, *direction*, *c\_sys*, *position\_start*, *position\_end*, *c\_def*, *origin*, *ey*, *ez*)[](#LineLoad "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_line_load()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_line_load "viktor.external.scia.scia.Model.create_line_load")
* *class *CDef(*\*values*)[](#LineLoad.CDef "Link to this definition")
Bases: `Enum`
* **ABSOLUTE** - absolute, where the coordinate must lie between 0 and the length of the beam
* **RELATIVE** - relative, where the coordinate must lie between 0 and 1
- ABSOLUTE*: [`CDef`](#LineLoad.CDef "viktor.external.scia.object.LineLoad.CDef")** = 0*[](#LineLoad.CDef.ABSOLUTE "Link to this definition")
* RELATIVE*: [`CDef`](#LineLoad.CDef "viktor.external.scia.object.LineLoad.CDef")** = 1*[](#LineLoad.CDef.RELATIVE "Link to this definition")
- *class *CSys(*\*values*)[](#LineLoad.CSys "Link to this definition")
Bases: `Enum`
* GLOBAL*: [`CSys`](#LineLoad.CSys "viktor.external.scia.object.LineLoad.CSys")** = 0*[](#LineLoad.CSys.GLOBAL "Link to this definition")
- LOCAL*: [`CSys`](#LineLoad.CSys "viktor.external.scia.object.LineLoad.CSys")** = 1*[](#LineLoad.CSys.LOCAL "Link to this definition")
* *class *Direction(*\*values*)[](#LineLoad.Direction "Link to this definition")
Bases: `Enum`
* X*: [`Direction`](#LineLoad.Direction "viktor.external.scia.object.LineLoad.Direction")** = 0*[](#LineLoad.Direction.X "Link to this definition")
- Y*: [`Direction`](#LineLoad.Direction "viktor.external.scia.object.LineLoad.Direction")** = 1*[](#LineLoad.Direction.Y "Link to this definition")
* Z*: [`Direction`](#LineLoad.Direction "viktor.external.scia.object.LineLoad.Direction")** = 2*[](#LineLoad.Direction.Z "Link to this definition")
- *class *Distribution(*\*values*)[](#LineLoad.Distribution "Link to this definition")
Bases: `Enum`
* TRAPEZOIDAL*: [`Distribution`](#LineLoad.Distribution "viktor.external.scia.object.LineLoad.Distribution")** = 1*[](#LineLoad.Distribution.TRAPEZOIDAL "Link to this definition")
- UNIFORM*: [`Distribution`](#LineLoad.Distribution "viktor.external.scia.object.LineLoad.Distribution")** = 0*[](#LineLoad.Distribution.UNIFORM "Link to this definition")
* *class *Origin(*\*values*)[](#LineLoad.Origin "Link to this definition")
Bases: `Enum`
* **FROM\_START** - position is measured from the beginning of the beam
* **FROM\_END** - position is measured from the end of the beam
- FROM\_END*: [`Origin`](#LineLoad.Origin "viktor.external.scia.object.LineLoad.Origin")** = 1*[](#LineLoad.Origin.FROM_END "Link to this definition")
* FROM\_START*: [`Origin`](#LineLoad.Origin "viktor.external.scia.object.LineLoad.Origin")** = 0*[](#LineLoad.Origin.FROM_START "Link to this definition")
- *class *Type(*\*values*)[](#LineLoad.Type "Link to this definition")
Bases: `Enum`
* FORCE*: [`Type`](#LineLoad.Type "viktor.external.scia.object.LineLoad.Type")** = 0*[](#LineLoad.Type.FORCE "Link to this definition")
- SELF\_WEIGHT*: [`Type`](#LineLoad.Type "viktor.external.scia.object.LineLoad.Type")** = 1*[](#LineLoad.Type.SELF_WEIGHT "Link to this definition")
* *property *beam*: [Beam](#Beam "viktor.external.scia.object.Beam")*[](#LineLoad.beam "Link to this definition")
- *property *load\_case*: [LoadCase](#LoadCase "viktor.external.scia.object.LoadCase")*[](#LineLoad.load_case "Link to this definition")
## LineMomentOnBeam[](https://docs.viktor.ai/sdk/api/external/scia/.md#_LineMomentOnBeam "Direct link to LineMomentOnBeam")
* *class *viktor.external.scia.object.LineMomentOnBeam(*object\_id*, *name*, *beam*, *load\_case*, *m1*, *m2=None*, *direction=None*, *c\_def=None*, *position\_x1=None*, *position\_x2=None*, *origin=None*)[](#LineMomentOnBeam "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_line_moment_on_beam()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_line_moment_on_beam "viktor.external.scia.scia.Model.create_line_moment_on_beam").
* *class *CDef(*\*values*)[](#LineMomentOnBeam.CDef "Link to this definition")
Bases: `Enum`
* **ABSOLUTE** - absolute, where the coordinate must lie between 0 and the length of the beam
* **RELATIVE** - relative, where the coordinate must lie between 0 and 1
- ABSOLUTE*: [`CDef`](#LineMomentOnBeam.CDef "viktor.external.scia.object.LineMomentOnBeam.CDef")** = 0*[](#LineMomentOnBeam.CDef.ABSOLUTE "Link to this definition")
* RELATIVE*: [`CDef`](#LineMomentOnBeam.CDef "viktor.external.scia.object.LineMomentOnBeam.CDef")** = 1*[](#LineMomentOnBeam.CDef.RELATIVE "Link to this definition")
- *class *Direction(*\*values*)[](#LineMomentOnBeam.Direction "Link to this definition")
Bases: `Enum`
* X*: [`Direction`](#LineMomentOnBeam.Direction "viktor.external.scia.object.LineMomentOnBeam.Direction")** = 0*[](#LineMomentOnBeam.Direction.X "Link to this definition")
- Y*: [`Direction`](#LineMomentOnBeam.Direction "viktor.external.scia.object.LineMomentOnBeam.Direction")** = 1*[](#LineMomentOnBeam.Direction.Y "Link to this definition")
* Z*: [`Direction`](#LineMomentOnBeam.Direction "viktor.external.scia.object.LineMomentOnBeam.Direction")** = 2*[](#LineMomentOnBeam.Direction.Z "Link to this definition")
* *class *Origin(*\*values*)[](#LineMomentOnBeam.Origin "Link to this definition")
Bases: `Enum`
* **FROM\_START** - position is measured from the beginning of the beam
* **FROM\_END** - position is measured from the end of the beam
- FROM\_END*: [`Origin`](#LineMomentOnBeam.Origin "viktor.external.scia.object.LineMomentOnBeam.Origin")** = 1*[](#LineMomentOnBeam.Origin.FROM_END "Link to this definition")
* FROM\_START*: [`Origin`](#LineMomentOnBeam.Origin "viktor.external.scia.object.LineMomentOnBeam.Origin")** = 0*[](#LineMomentOnBeam.Origin.FROM_START "Link to this definition")
## LineMomentOnPlane[](https://docs.viktor.ai/sdk/api/external/scia/.md#_LineMomentOnPlane "Direct link to LineMomentOnPlane")
* *class *viktor.external.scia.object.LineMomentOnPlane(*object\_id*, *name*, *edge*, *load\_case*, *m1*, *m2=None*, *direction=None*, *c\_def=None*, *position\_x1=None*, *position\_x2=None*, *origin=None*)[](#LineMomentOnPlane "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_line_moment_on_plane()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_line_moment_on_plane "viktor.external.scia.scia.Model.create_line_moment_on_plane").
* *class *CDef(*\*values*)[](#LineMomentOnPlane.CDef "Link to this definition")
Bases: `Enum`
* **ABSOLUTE** - absolute, where the coordinate must lie between 0 and the length of the plane edge
* **RELATIVE** - relative, where the coordinate must lie between 0 and 1
- ABSOLUTE*: [`CDef`](#LineMomentOnPlane.CDef "viktor.external.scia.object.LineMomentOnPlane.CDef")** = 0*[](#LineMomentOnPlane.CDef.ABSOLUTE "Link to this definition")
* RELATIVE*: [`CDef`](#LineMomentOnPlane.CDef "viktor.external.scia.object.LineMomentOnPlane.CDef")** = 1*[](#LineMomentOnPlane.CDef.RELATIVE "Link to this definition")
- *class *Direction(*\*values*)[](#LineMomentOnPlane.Direction "Link to this definition")
Bases: `Enum`
* X*: [`Direction`](#LineMomentOnPlane.Direction "viktor.external.scia.object.LineMomentOnPlane.Direction")** = 0*[](#LineMomentOnPlane.Direction.X "Link to this definition")
- Y*: [`Direction`](#LineMomentOnPlane.Direction "viktor.external.scia.object.LineMomentOnPlane.Direction")** = 1*[](#LineMomentOnPlane.Direction.Y "Link to this definition")
* Z*: [`Direction`](#LineMomentOnPlane.Direction "viktor.external.scia.object.LineMomentOnPlane.Direction")** = 2*[](#LineMomentOnPlane.Direction.Z "Link to this definition")
* *class *Origin(*\*values*)[](#LineMomentOnPlane.Origin "Link to this definition")
Bases: `Enum`
* **FROM\_START** - position is measured from the beginning of the plane edge
* **FROM\_END** - position is measured from the end of the plane edge
- FROM\_END*: [`Origin`](#LineMomentOnPlane.Origin "viktor.external.scia.object.LineMomentOnPlane.Origin")** = 1*[](#LineMomentOnPlane.Origin.FROM_END "Link to this definition")
* FROM\_START*: [`Origin`](#LineMomentOnPlane.Origin "viktor.external.scia.object.LineMomentOnPlane.Origin")** = 0*[](#LineMomentOnPlane.Origin.FROM_START "Link to this definition")
- *property *plane*: [Plane](#Plane "viktor.external.scia.object.Plane")*[](#LineMomentOnPlane.plane "Link to this definition")
## LineSupport[](https://docs.viktor.ai/sdk/api/external/scia/.md#_LineSupport "Direct link to LineSupport")
* *class *viktor.external.scia.object.LineSupport(*object\_id*, *name*, *x=None*, *stiffness\_x=None*, *function\_x=None*, *y=None*, *stiffness\_y=None*, *function\_y=None*, *z=None*, *stiffness\_z=None*, *function\_z=None*, *rx=None*, *stiffness\_rx=None*, *function\_rx=None*, *ry=None*, *stiffness\_ry=None*, *function\_ry=None*, *rz=None*, *stiffness\_rz=None*, *function\_rz=None*, *c\_sys=None*, *c\_def=None*, *position\_x1=None*, *position\_x2=None*, *origin=None*)[](#LineSupport "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Abstract base class of all line supports.
* *class *CDef(*\*values*)[](#LineSupport.CDef "Link to this definition")
Bases: `Enum`
* **ABSOLUTE** - absolute, where the coordinate must lie between 0 and the length of the beam
* **RELATIVE** - relative, where the coordinate must lie between 0 and 1
- ABSOLUTE*: [`CDef`](#LineSupport.CDef "viktor.external.scia.object.LineSupport.CDef")** = 0*[](#LineSupport.CDef.ABSOLUTE "Link to this definition")
* RELATIVE*: [`CDef`](#LineSupport.CDef "viktor.external.scia.object.LineSupport.CDef")** = 1*[](#LineSupport.CDef.RELATIVE "Link to this definition")
- *class *CSys(*\*values*)[](#LineSupport.CSys "Link to this definition")
Bases: `Enum`
* GLOBAL*: [`CSys`](#LineSupport.CSys "viktor.external.scia.object.LineSupport.CSys")** = 0*[](#LineSupport.CSys.GLOBAL "Link to this definition")
- LOCAL*: [`CSys`](#LineSupport.CSys "viktor.external.scia.object.LineSupport.CSys")** = 1*[](#LineSupport.CSys.LOCAL "Link to this definition")
* *class *Constraint(*\*values*)[](#LineSupport.Constraint "Link to this definition")
Bases: `Enum`
* CUSTOM*: [`Constraint`](#LineSupport.Constraint "viktor.external.scia.object.LineSupport.Constraint")** = 3*[](#LineSupport.Constraint.CUSTOM "Link to this definition")
- FIXED*: [`Constraint`](#LineSupport.Constraint "viktor.external.scia.object.LineSupport.Constraint")** = 0*[](#LineSupport.Constraint.FIXED "Link to this definition")
* HINGED*: [`Constraint`](#LineSupport.Constraint "viktor.external.scia.object.LineSupport.Constraint")** = 1*[](#LineSupport.Constraint.HINGED "Link to this definition")
- SLIDING*: [`Constraint`](#LineSupport.Constraint "viktor.external.scia.object.LineSupport.Constraint")** = 2*[](#LineSupport.Constraint.SLIDING "Link to this definition")
- *class *Extent(*\*values*)[](#LineSupport.Extent "Link to this definition")
Bases: `Enum`
* **FULL** - support across the full length
* **SPAN** - support across a span
- FULL*: [`Extent`](#LineSupport.Extent "viktor.external.scia.object.LineSupport.Extent")** = 0*[](#LineSupport.Extent.FULL "Link to this definition")
* SPAN*: [`Extent`](#LineSupport.Extent "viktor.external.scia.object.LineSupport.Extent")** = 1*[](#LineSupport.Extent.SPAN "Link to this definition")
* *class *Freedom(*\*values*)[](#LineSupport.Freedom "Link to this definition")
Bases: `Enum`
* FLEXIBLE*: [`Freedom`](#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")** = 2*[](#LineSupport.Freedom.FLEXIBLE "Link to this definition")
- FLEXIBLE\_PRESS\_ONLY*: [`Freedom`](#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")** = 5*[](#LineSupport.Freedom.FLEXIBLE_PRESS_ONLY "Link to this definition")
* FLEXIBLE\_TENSION\_ONLY*: [`Freedom`](#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")** = 6*[](#LineSupport.Freedom.FLEXIBLE_TENSION_ONLY "Link to this definition")
- FREE*: [`Freedom`](#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")** = 0*[](#LineSupport.Freedom.FREE "Link to this definition")
* NONLINEAR*: [`Freedom`](#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")** = 7*[](#LineSupport.Freedom.NONLINEAR "Link to this definition")
- RIGID*: [`Freedom`](#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")** = 1*[](#LineSupport.Freedom.RIGID "Link to this definition")
* RIGID\_PRESS\_ONLY*: [`Freedom`](#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")** = 3*[](#LineSupport.Freedom.RIGID_PRESS_ONLY "Link to this definition")
- RIGID\_TENSION\_ONLY*: [`Freedom`](#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")** = 4*[](#LineSupport.Freedom.RIGID_TENSION_ONLY "Link to this definition")
- *class *Origin(*\*values*)[](#LineSupport.Origin "Link to this definition")
Bases: `Enum`
* **FROM\_START** - position is measured from the beginning of the beam
* **FROM\_END** - position is measured from the end of the beam
- FROM\_END*: [`Origin`](#LineSupport.Origin "viktor.external.scia.object.LineSupport.Origin")** = 1*[](#LineSupport.Origin.FROM_END "Link to this definition")
* FROM\_START*: [`Origin`](#LineSupport.Origin "viktor.external.scia.object.LineSupport.Origin")** = 0*[](#LineSupport.Origin.FROM_START "Link to this definition")
* *class *Type(*\*values*)[](#LineSupport.Type "Link to this definition")
Bases: `Enum`
* FOUNDATION\_STRIP*: [`Type`](#LineSupport.Type "viktor.external.scia.object.LineSupport.Type")** = 1*[](#LineSupport.Type.FOUNDATION_STRIP "Link to this definition")
- LINE*: [`Type`](#LineSupport.Type "viktor.external.scia.object.LineSupport.Type")** = 0*[](#LineSupport.Type.LINE "Link to this definition")
* WALL*: [`Type`](#LineSupport.Type "viktor.external.scia.object.LineSupport.Type")** = 2*[](#LineSupport.Type.WALL "Link to this definition")
- *property *constraint*: [Constraint](#LineSupport.Constraint "viktor.external.scia.object.LineSupport.Constraint")*[](#LineSupport.constraint "Link to this definition")
* *property *freedom*: Tuple\[[Freedom](#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom"), [Freedom](#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom"), [Freedom](#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom"), [Freedom](#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom"), [Freedom](#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom"), [Freedom](#LineSupport.Freedom "viktor.external.scia.object.LineSupport.Freedom")]*[](#LineSupport.freedom "Link to this definition")
- *property *function\_rx*: [NonLinearFunction](#NonLinearFunction "viktor.external.scia.object.NonLinearFunction") | None*[](#LineSupport.function_rx "Link to this definition")
* *property *function\_ry*: [NonLinearFunction](#NonLinearFunction "viktor.external.scia.object.NonLinearFunction") | None*[](#LineSupport.function_ry "Link to this definition")
- *property *function\_rz*: [NonLinearFunction](#NonLinearFunction "viktor.external.scia.object.NonLinearFunction") | None*[](#LineSupport.function_rz "Link to this definition")
* *property *function\_x*: [NonLinearFunction](#NonLinearFunction "viktor.external.scia.object.NonLinearFunction") | None*[](#LineSupport.function_x "Link to this definition")
- *property *function\_y*: [NonLinearFunction](#NonLinearFunction "viktor.external.scia.object.NonLinearFunction") | None*[](#LineSupport.function_y "Link to this definition")
* *property *function\_z*: [NonLinearFunction](#NonLinearFunction "viktor.external.scia.object.NonLinearFunction") | None*[](#LineSupport.function_z "Link to this definition")
- *property *stiffness*: Tuple\[float | None, float | None, float | None, float | None, float | None, float | None]*[](#LineSupport.stiffness "Link to this definition")
## LineSupportLine[](https://docs.viktor.ai/sdk/api/external/scia/.md#_LineSupportLine "Direct link to LineSupportLine")
* *class *viktor.external.scia.object.LineSupportLine(*object\_id*, *name*, *beam*, *x=None*, *stiffness\_x=None*, *function\_x=None*, *y=None*, *stiffness\_y=None*, *function\_y=None*, *z=None*, *stiffness\_z=None*, *function\_z=None*, *rx=None*, *stiffness\_rx=None*, *function\_rx=None*, *ry=None*, *stiffness\_ry=None*, *function\_ry=None*, *rz=None*, *stiffness\_rz=None*, *function\_rz=None*, *c\_sys=None*, *extent=None*, *c\_def=None*, *position\_x1=None*, *position\_x2=None*, *origin=None*)[](#LineSupportLine "Link to this definition")
Bases: [`LineSupport`](#LineSupport "viktor.external.scia.object.LineSupport")
Do not use this \_\_init\_\_ directly, but create the object by [`create_line_support_on_beam()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_line_support_on_beam "viktor.external.scia.scia.Model.create_line_support_on_beam")
* *property *beam*: [Beam](#Beam "viktor.external.scia.object.Beam")*[](#LineSupportLine.beam "Link to this definition")
- *property *spring\_type*: [Type](#LineSupport.Type "viktor.external.scia.object.LineSupport.Type")*[](#LineSupportLine.spring_type "Link to this definition")
## LineSupportSurface[](https://docs.viktor.ai/sdk/api/external/scia/.md#_LineSupportSurface "Direct link to LineSupportSurface")
* *class *viktor.external.scia.object.LineSupportSurface(*object\_id*, *name*, *edge*, *x=None*, *stiffness\_x=None*, *y=None*, *stiffness\_y=None*, *z=None*, *stiffness\_z=None*, *rx=None*, *stiffness\_rx=None*, *ry=None*, *stiffness\_ry=None*, *rz=None*, *stiffness\_rz=None*, *c\_sys=None*, *c\_def=None*, *position\_x1=None*, *position\_x2=None*, *origin=None*)[](#LineSupportSurface "Link to this definition")
Bases: [`LineSupport`](#LineSupport "viktor.external.scia.object.LineSupport")
Do not use this \_\_init\_\_ directly, but create the object by [`create_line_support_on_plane()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_line_support_on_plane "viktor.external.scia.scia.Model.create_line_support_on_plane")
* *property *plane*: [Plane](#Plane "viktor.external.scia.object.Plane")*[](#LineSupportSurface.plane "Link to this definition")
## LoadCase[](https://docs.viktor.ai/sdk/api/external/scia/.md#_LoadCase "Direct link to LoadCase")
* *class *viktor.external.scia.object.LoadCase(*object\_id*, *name*, *description*, *action\_type*, *load\_group*)[](#LoadCase "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Abstract base class of all load cases.
* *class *ActionType(*\*values*)[](#LoadCase.ActionType "Link to this definition")
Bases: `Enum`
* PERMANENT*: [`ActionType`](#LoadCase.ActionType "viktor.external.scia.object.LoadCase.ActionType")** = 0*[](#LoadCase.ActionType.PERMANENT "Link to this definition")
- VARIABLE*: [`ActionType`](#LoadCase.ActionType "viktor.external.scia.object.LoadCase.ActionType")** = 1*[](#LoadCase.ActionType.VARIABLE "Link to this definition")
- *class *Direction(*\*values*)[](#LoadCase.Direction "Link to this definition")
Bases: `Enum`
* **NEG\_Z** - -Z
* **POS\_Z** - +Z
* **NEG\_Y** - -Y
* **POS\_Y** - +Y
* **NEG\_X** - -X
* **POS\_X** - +X
- NEG\_X*: [`Direction`](#LoadCase.Direction "viktor.external.scia.object.LoadCase.Direction")** = 4*[](#LoadCase.Direction.NEG_X "Link to this definition")
* NEG\_Y*: [`Direction`](#LoadCase.Direction "viktor.external.scia.object.LoadCase.Direction")** = 2*[](#LoadCase.Direction.NEG_Y "Link to this definition")
- NEG\_Z*: [`Direction`](#LoadCase.Direction "viktor.external.scia.object.LoadCase.Direction")** = 0*[](#LoadCase.Direction.NEG_Z "Link to this definition")
* POS\_X*: [`Direction`](#LoadCase.Direction "viktor.external.scia.object.LoadCase.Direction")** = 5*[](#LoadCase.Direction.POS_X "Link to this definition")
- POS\_Y*: [`Direction`](#LoadCase.Direction "viktor.external.scia.object.LoadCase.Direction")** = 3*[](#LoadCase.Direction.POS_Y "Link to this definition")
* POS\_Z*: [`Direction`](#LoadCase.Direction "viktor.external.scia.object.LoadCase.Direction")** = 1*[](#LoadCase.Direction.POS_Z "Link to this definition")
* *class *Duration(*\*values*)[](#LoadCase.Duration "Link to this definition")
Bases: `Enum`
* INSTANTANEOUS*: [`Duration`](#LoadCase.Duration "viktor.external.scia.object.LoadCase.Duration")** = 3*[](#LoadCase.Duration.INSTANTANEOUS "Link to this definition")
- LONG*: [`Duration`](#LoadCase.Duration "viktor.external.scia.object.LoadCase.Duration")** = 0*[](#LoadCase.Duration.LONG "Link to this definition")
* MEDIUM*: [`Duration`](#LoadCase.Duration "viktor.external.scia.object.LoadCase.Duration")** = 1*[](#LoadCase.Duration.MEDIUM "Link to this definition")
- SHORT*: [`Duration`](#LoadCase.Duration "viktor.external.scia.object.LoadCase.Duration")** = 2*[](#LoadCase.Duration.SHORT "Link to this definition")
- *class *PermanentLoadType(*\*values*)[](#LoadCase.PermanentLoadType "Link to this definition")
Bases: `Enum`
* PRIMARY\_EFFECT*: [`PermanentLoadType`](#LoadCase.PermanentLoadType "viktor.external.scia.object.LoadCase.PermanentLoadType")** = 2*[](#LoadCase.PermanentLoadType.PRIMARY_EFFECT "Link to this definition")
- SELF\_WEIGHT*: [`PermanentLoadType`](#LoadCase.PermanentLoadType "viktor.external.scia.object.LoadCase.PermanentLoadType")** = 0*[](#LoadCase.PermanentLoadType.SELF_WEIGHT "Link to this definition")
* STANDARD*: [`PermanentLoadType`](#LoadCase.PermanentLoadType "viktor.external.scia.object.LoadCase.PermanentLoadType")** = 1*[](#LoadCase.PermanentLoadType.STANDARD "Link to this definition")
* *class *Specification(*\*values*)[](#LoadCase.Specification "Link to this definition")
Bases: `Enum`
* EARTHQUAKE*: [`Specification`](#LoadCase.Specification "viktor.external.scia.object.LoadCase.Specification")** = 103*[](#LoadCase.Specification.EARTHQUAKE "Link to this definition")
- SNOW*: [`Specification`](#LoadCase.Specification "viktor.external.scia.object.LoadCase.Specification")** = 104*[](#LoadCase.Specification.SNOW "Link to this definition")
* STANDARD*: [`Specification`](#LoadCase.Specification "viktor.external.scia.object.LoadCase.Specification")** = 100*[](#LoadCase.Specification.STANDARD "Link to this definition")
- STATIC\_WIND*: [`Specification`](#LoadCase.Specification "viktor.external.scia.object.LoadCase.Specification")** = 102*[](#LoadCase.Specification.STATIC_WIND "Link to this definition")
* TEMPERATURE*: [`Specification`](#LoadCase.Specification "viktor.external.scia.object.LoadCase.Specification")** = 101*[](#LoadCase.Specification.TEMPERATURE "Link to this definition")
- *class *VariableLoadType(*\*values*)[](#LoadCase.VariableLoadType "Link to this definition")
Bases: `Enum`
* PRIMARY\_EFFECT*: [`VariableLoadType`](#LoadCase.VariableLoadType "viktor.external.scia.object.LoadCase.VariableLoadType")** = 1*[](#LoadCase.VariableLoadType.PRIMARY_EFFECT "Link to this definition")
- STATIC*: [`VariableLoadType`](#LoadCase.VariableLoadType "viktor.external.scia.object.LoadCase.VariableLoadType")** = 0*[](#LoadCase.VariableLoadType.STATIC "Link to this definition")
* *abstract property *direction*: [Direction](#LoadCase.Direction "viktor.external.scia.object.LoadCase.Direction") | None*[](#LoadCase.direction "Link to this definition")
- *abstract property *duration*: [Duration](#LoadCase.Duration "viktor.external.scia.object.LoadCase.Duration") | None*[](#LoadCase.duration "Link to this definition")
* *property *load\_group*: [LoadGroup](#LoadGroup "viktor.external.scia.object.LoadGroup")*[](#LoadCase.load_group "Link to this definition")
- *abstract property *load\_type*: [PermanentLoadType](#LoadCase.PermanentLoadType "viktor.external.scia.object.LoadCase.PermanentLoadType") | [VariableLoadType](#LoadCase.VariableLoadType "viktor.external.scia.object.LoadCase.VariableLoadType")*[](#LoadCase.load_type "Link to this definition")
* *abstract property *master*: str | None*[](#LoadCase.master "Link to this definition")
- *abstract property *primary\_effect*: [LoadCase](#LoadCase "viktor.external.scia.object.LoadCase") | None*[](#LoadCase.primary_effect "Link to this definition")
* *abstract property *specification*: [Specification](#LoadCase.Specification "viktor.external.scia.object.LoadCase.Specification") | None*[](#LoadCase.specification "Link to this definition")
## LoadCombination[](https://docs.viktor.ai/sdk/api/external/scia/.md#_LoadCombination "Direct link to LoadCombination")
* *class *viktor.external.scia.object.LoadCombination(*object\_id*, *name*, *combination\_type*, *load\_cases*, *\**, *description=None*)[](#LoadCombination "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_load_combination()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_load_combination "viktor.external.scia.scia.Model.create_load_combination")
* *class *Type(*\*values*)[](#LoadCombination.Type "Link to this definition")
Bases: `Enum`
* **ENVELOPE\_ULTIMATE** - Envelope - ultimate
* **ENVELOPE\_SERVICEABILITY** - Envelope - serviceability
* **LINEAR\_ULTIMATE** - Linear - ultimate
* **LINEAR\_SERVICEABILITY** - Linear - serviceability
* **EN\_ULS\_SET\_B** - EN-ULS (STR/GEO) Set B
* **EN\_ACC\_ONE** - EN-Accidental 1
* **EN\_ACC\_TWO** - EN-Accidental 2
* **EN\_SEISMIC** - EN-Seismic
* **EN\_SLS\_CHAR** - EN-SLS Characteristic
* **EN\_SLS\_FREQ** - EN-SLS Frequent
* **EN\_SLS\_QUASI** - EN-SLS Quasi-permanent
* **EN\_ULS\_SET\_C** - EN-ULS (STR/GEO) Set C
- ENVELOPE\_SERVICEABILITY*: [`Type`](#LoadCombination.Type "viktor.external.scia.object.LoadCombination.Type")** = 1*[](#LoadCombination.Type.ENVELOPE_SERVICEABILITY "Link to this definition")
* ENVELOPE\_ULTIMATE*: [`Type`](#LoadCombination.Type "viktor.external.scia.object.LoadCombination.Type")** = 0*[](#LoadCombination.Type.ENVELOPE_ULTIMATE "Link to this definition")
- EN\_ACC\_ONE*: [`Type`](#LoadCombination.Type "viktor.external.scia.object.LoadCombination.Type")** = 5*[](#LoadCombination.Type.EN_ACC_ONE "Link to this definition")
* EN\_ACC\_TWO*: [`Type`](#LoadCombination.Type "viktor.external.scia.object.LoadCombination.Type")** = 6*[](#LoadCombination.Type.EN_ACC_TWO "Link to this definition")
- EN\_SEISMIC*: [`Type`](#LoadCombination.Type "viktor.external.scia.object.LoadCombination.Type")** = 7*[](#LoadCombination.Type.EN_SEISMIC "Link to this definition")
* EN\_SLS\_CHAR*: [`Type`](#LoadCombination.Type "viktor.external.scia.object.LoadCombination.Type")** = 8*[](#LoadCombination.Type.EN_SLS_CHAR "Link to this definition")
- EN\_SLS\_FREQ*: [`Type`](#LoadCombination.Type "viktor.external.scia.object.LoadCombination.Type")** = 9*[](#LoadCombination.Type.EN_SLS_FREQ "Link to this definition")
* EN\_SLS\_QUASI*: [`Type`](#LoadCombination.Type "viktor.external.scia.object.LoadCombination.Type")** = 10*[](#LoadCombination.Type.EN_SLS_QUASI "Link to this definition")
- EN\_ULS\_SET\_B*: [`Type`](#LoadCombination.Type "viktor.external.scia.object.LoadCombination.Type")** = 4*[](#LoadCombination.Type.EN_ULS_SET_B "Link to this definition")
* EN\_ULS\_SET\_C*: [`Type`](#LoadCombination.Type "viktor.external.scia.object.LoadCombination.Type")** = 11*[](#LoadCombination.Type.EN_ULS_SET_C "Link to this definition")
- LINEAR\_SERVICEABILITY*: [`Type`](#LoadCombination.Type "viktor.external.scia.object.LoadCombination.Type")** = 3*[](#LoadCombination.Type.LINEAR_SERVICEABILITY "Link to this definition")
* LINEAR\_ULTIMATE*: [`Type`](#LoadCombination.Type "viktor.external.scia.object.LoadCombination.Type")** = 2*[](#LoadCombination.Type.LINEAR_ULTIMATE "Link to this definition")
- *property *load\_cases*: Dict\[[LoadCase](#LoadCase "viktor.external.scia.object.LoadCase"), float]*[](#LoadCombination.load_cases "Link to this definition")
## LoadGroup[](https://docs.viktor.ai/sdk/api/external/scia/.md#_LoadGroup "Direct link to LoadGroup")
* *class *viktor.external.scia.object.LoadGroup(*object\_id*, *name*, *load\_option*, *relation=None*, *load\_type=None*)[](#LoadGroup "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_load_group()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_load_group "viktor.external.scia.scia.Model.create_load_group")
* *class *LoadOption(*\*values*)[](#LoadGroup.LoadOption "Link to this definition")
Bases: `Enum`
* ACCIDENTAL*: [`LoadOption`](#LoadGroup.LoadOption "viktor.external.scia.object.LoadGroup.LoadOption")** = 2*[](#LoadGroup.LoadOption.ACCIDENTAL "Link to this definition")
- PERMANENT*: [`LoadOption`](#LoadGroup.LoadOption "viktor.external.scia.object.LoadGroup.LoadOption")** = 0*[](#LoadGroup.LoadOption.PERMANENT "Link to this definition")
* SEISMIC*: [`LoadOption`](#LoadGroup.LoadOption "viktor.external.scia.object.LoadGroup.LoadOption")** = 3*[](#LoadGroup.LoadOption.SEISMIC "Link to this definition")
- VARIABLE*: [`LoadOption`](#LoadGroup.LoadOption "viktor.external.scia.object.LoadGroup.LoadOption")** = 1*[](#LoadGroup.LoadOption.VARIABLE "Link to this definition")
- *class *LoadTypeOption(*\*values*)[](#LoadGroup.LoadTypeOption "Link to this definition")
Bases: `Enum`
* **CAT\_A** - Domestic
* **CAT\_B** - Offices
* **CAT\_C** - Congregation
* **CAT\_D** - Shopping
* **CAT\_E** - Storage
* **CAT\_F** - Vehicle <30kN
* **CAT\_G** - Vehicle >30kN
* **CAT\_H** - Roofs
* **SNOW** - Snow
* **WIND** - Wind
* **TEMPERATURE** - Temperature
* **RAIN\_WATER** - Rain water
* **CONSTRUCTION\_LOADS** - Construction loads
- CAT\_A*: [`LoadTypeOption`](#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption")** = 0*[](#LoadGroup.LoadTypeOption.CAT_A "Link to this definition")
* CAT\_B*: [`LoadTypeOption`](#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption")** = 1*[](#LoadGroup.LoadTypeOption.CAT_B "Link to this definition")
- CAT\_C*: [`LoadTypeOption`](#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption")** = 2*[](#LoadGroup.LoadTypeOption.CAT_C "Link to this definition")
* CAT\_D*: [`LoadTypeOption`](#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption")** = 3*[](#LoadGroup.LoadTypeOption.CAT_D "Link to this definition")
- CAT\_E*: [`LoadTypeOption`](#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption")** = 4*[](#LoadGroup.LoadTypeOption.CAT_E "Link to this definition")
* CAT\_F*: [`LoadTypeOption`](#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption")** = 5*[](#LoadGroup.LoadTypeOption.CAT_F "Link to this definition")
- CAT\_G*: [`LoadTypeOption`](#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption")** = 6*[](#LoadGroup.LoadTypeOption.CAT_G "Link to this definition")
* CAT\_H*: [`LoadTypeOption`](#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption")** = 7*[](#LoadGroup.LoadTypeOption.CAT_H "Link to this definition")
- CONSTRUCTION\_LOADS*: [`LoadTypeOption`](#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption")** = 21*[](#LoadGroup.LoadTypeOption.CONSTRUCTION_LOADS "Link to this definition")
* RAIN\_WATER*: [`LoadTypeOption`](#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption")** = 20*[](#LoadGroup.LoadTypeOption.RAIN_WATER "Link to this definition")
- SNOW*: [`LoadTypeOption`](#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption")** = 8*[](#LoadGroup.LoadTypeOption.SNOW "Link to this definition")
* TEMPERATURE*: [`LoadTypeOption`](#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption")** = 12*[](#LoadGroup.LoadTypeOption.TEMPERATURE "Link to this definition")
- WIND*: [`LoadTypeOption`](#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption")** = 11*[](#LoadGroup.LoadTypeOption.WIND "Link to this definition")
* *class *RelationOption(*\*values*)[](#LoadGroup.RelationOption "Link to this definition")
Bases: `Enum`
* EXCLUSIVE*: [`RelationOption`](#LoadGroup.RelationOption "viktor.external.scia.object.LoadGroup.RelationOption")** = 1*[](#LoadGroup.RelationOption.EXCLUSIVE "Link to this definition")
- STANDARD*: [`RelationOption`](#LoadGroup.RelationOption "viktor.external.scia.object.LoadGroup.RelationOption")** = 0*[](#LoadGroup.RelationOption.STANDARD "Link to this definition")
* TOGETHER*: [`RelationOption`](#LoadGroup.RelationOption "viktor.external.scia.object.LoadGroup.RelationOption")** = 2*[](#LoadGroup.RelationOption.TOGETHER "Link to this definition")
- *property *load\_type*: [LoadTypeOption](#LoadGroup.LoadTypeOption "viktor.external.scia.object.LoadGroup.LoadTypeOption") | None*[](#LoadGroup.load_type "Link to this definition")
* *property *relation*: [RelationOption](#LoadGroup.RelationOption "viktor.external.scia.object.LoadGroup.RelationOption") | None*[](#LoadGroup.relation "Link to this definition")
## Material[](https://docs.viktor.ai/sdk/api/external/scia/.md#_Material "Direct link to Material")
* *class *viktor.external.scia.object.Material(*object\_id*, *name*)[](#Material "Link to this definition")
Reference to an existing material in the .esa template file in which the xml input file will be loaded.
* Parameters:
* **object\_id** (`int`) – ID of the existing material.
* **name** (`str`) – name of the existing material.
## MeshSetup[](https://docs.viktor.ai/sdk/api/external/scia/.md#_MeshSetup "Direct link to MeshSetup")
* *class *viktor.external.scia.object.MeshSetup(*\**, *average\_1d=1.0*, *average\_2d=1.0*, *division\_2d\_1d=50*)[](#MeshSetup "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Mesh settings parameters.
* Parameters:
* **average\_1d** (`float`) – Average size of cables, tendons, elements on subsoil, nonlinear soil spring \[m] (default: 1.0).
* **average\_2d** (`float`) – Average size of 2d element/curved element \[m] (default: 1.0).
* **division\_2d\_1d** (`int`) – Division for 2D-1D upgrade (default: 50).
## Node[](https://docs.viktor.ai/sdk/api/external/scia/.md#_Node "Direct link to Node")
* *class *viktor.external.scia.object.Node(*object\_id*, *name*, *x*, *y*, *z*)[](#Node "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_node()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_node "viktor.external.scia.scia.Model.create_node")
## NonLinearFunction[](https://docs.viktor.ai/sdk/api/external/scia/.md#_NonLinearFunction "Direct link to NonLinearFunction")
* *class *viktor.external.scia.object.NonLinearFunction(*object\_id*, *name*, *function\_type*, *positive\_end*, *negative\_end*, *impulse*)[](#NonLinearFunction "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_nonlinear_function()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_nonlinear_function "viktor.external.scia.scia.Model.create_nonlinear_function")
* *class *Support(*\*values*)[](#NonLinearFunction.Support "Link to this definition")
Bases: `Enum`
* FLEXIBLE*: [`Support`](#NonLinearFunction.Support "viktor.external.scia.object.NonLinearFunction.Support")** = 2*[](#NonLinearFunction.Support.FLEXIBLE "Link to this definition")
- FREE*: [`Support`](#NonLinearFunction.Support "viktor.external.scia.object.NonLinearFunction.Support")** = 1*[](#NonLinearFunction.Support.FREE "Link to this definition")
* RIGID*: [`Support`](#NonLinearFunction.Support "viktor.external.scia.object.NonLinearFunction.Support")** = 0*[](#NonLinearFunction.Support.RIGID "Link to this definition")
- *class *Type(*\*values*)[](#NonLinearFunction.Type "Link to this definition")
Bases: `Enum`
* NONLINEAR\_SUBSOIL*: [`Type`](#NonLinearFunction.Type "viktor.external.scia.object.NonLinearFunction.Type")** = 2*[](#NonLinearFunction.Type.NONLINEAR_SUBSOIL "Link to this definition")
- ROTATION*: [`Type`](#NonLinearFunction.Type "viktor.external.scia.object.NonLinearFunction.Type")** = 1*[](#NonLinearFunction.Type.ROTATION "Link to this definition")
* TRANSLATION*: [`Type`](#NonLinearFunction.Type "viktor.external.scia.object.NonLinearFunction.Type")** = 0*[](#NonLinearFunction.Type.TRANSLATION "Link to this definition")
* *property *impulse*: List\[Tuple\[float, float]]*[](#NonLinearFunction.impulse "Link to this definition")
## NonLinearLoadCombination[](https://docs.viktor.ai/sdk/api/external/scia/.md#_NonLinearLoadCombination "Direct link to NonLinearLoadCombination")
* *class *viktor.external.scia.object.NonLinearLoadCombination(*object\_id*, *name*, *combination\_type*, *load\_cases*, *\**, *description=None*)[](#NonLinearLoadCombination "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
* Do not use this \_\_init\_\_ directly, but create the object by
[`create_nonlinear_load_combination()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_nonlinear_load_combination "viktor.external.scia.scia.Model.create_nonlinear_load_combination")
- *class *Type(*\*values*)[](#NonLinearLoadCombination.Type "Link to this definition")
Bases: `Enum`
* SERVICEABILITY*: [`Type`](#NonLinearLoadCombination.Type "viktor.external.scia.object.NonLinearLoadCombination.Type")** = 1*[](#NonLinearLoadCombination.Type.SERVICEABILITY "Link to this definition")
- ULTIMATE*: [`Type`](#NonLinearLoadCombination.Type "viktor.external.scia.object.NonLinearLoadCombination.Type")** = 0*[](#NonLinearLoadCombination.Type.ULTIMATE "Link to this definition")
* *property *load\_cases*: Dict\[[LoadCase](#LoadCase "viktor.external.scia.object.LoadCase"), float]*[](#NonLinearLoadCombination.load_cases "Link to this definition")
## NumericalCrossSection[](https://docs.viktor.ai/sdk/api/external/scia/.md#_NumericalCrossSection "Direct link to NumericalCrossSection")
* *class *viktor.external.scia.object.NumericalCrossSection(*object\_id*, *name*, *material*, *\**, *A=None*, *Ay=None*, *Az=None*, *AL=None*, *AD=None*, *cYUCS=None*, *cZUCS=None*, *alpha=None*, *Iy=None*, *Iz=None*, *Wely=None*, *Welz=None*, *Wply=None*, *Wplz=None*, *Mply\_plus=None*, *Mply\_min=None*, *Mplz\_plus=None*, *Mplz\_min=None*, *dy=None*, *dz=None*, *It=None*, *Iw=None*, *beta\_y=None*, *beta\_z=None*)[](#NumericalCrossSection "Link to this definition")
Bases: [`CrossSection`](#CrossSection "viktor.external.scia.object.CrossSection")
Do not use this \_\_init\_\_ directly, but create the object by [`create_numerical_cross_section()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_numerical_cross_section "viktor.external.scia.scia.Model.create_numerical_cross_section")
## OpenSlab[](https://docs.viktor.ai/sdk/api/external/scia/.md#_OpenSlab "Direct link to OpenSlab")
* *class *viktor.external.scia.object.OpenSlab(*object\_id*, *name*, *plane*, *corner\_nodes*)[](#OpenSlab "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_open_slab()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_open_slab "viktor.external.scia.scia.Model.create_open_slab")
* *property *corner\_nodes*: List\[[Node](#Node "viktor.external.scia.object.Node")]*[](#OpenSlab.corner_nodes "Link to this definition")
- *property *plane*: [Plane](#Plane "viktor.external.scia.object.Plane")*[](#OpenSlab.plane "Link to this definition")
## Orthotropy[](https://docs.viktor.ai/sdk/api/external/scia/.md#_Orthotropy "Direct link to Orthotropy")
* *class *viktor.external.scia.object.Orthotropy(*object\_id*, *name*, *material*, *thickness*, *D11=None*, *D22=None*, *D12=None*, *D33=None*, *D44=None*, *D55=None*, *d11=None*, *d22=None*, *d12=None*, *d33=None*, *kxy=None*, *kyx=None*)[](#Orthotropy "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_orthotropy()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_orthotropy "viktor.external.scia.scia.Model.create_orthotropy")
## PermanentLoadCase[](https://docs.viktor.ai/sdk/api/external/scia/.md#_PermanentLoadCase "Direct link to PermanentLoadCase")
* *class *viktor.external.scia.object.PermanentLoadCase(*object\_id*, *name*, *description*, *load\_group*, *load\_type*, *direction=None*, *primary\_effect=None*)[](#PermanentLoadCase "Link to this definition")
Bases: [`LoadCase`](#LoadCase "viktor.external.scia.object.LoadCase")
Do not use this \_\_init\_\_ directly, but create the object by [`create_permanent_load_case()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_permanent_load_case "viktor.external.scia.scia.Model.create_permanent_load_case")
* *property *direction*: [Direction](#LoadCase.Direction "viktor.external.scia.object.LoadCase.Direction") | None*[](#PermanentLoadCase.direction "Link to this definition")
- *property *duration*: None*[](#PermanentLoadCase.duration "Link to this definition")
* *property *load\_type*: [PermanentLoadType](#LoadCase.PermanentLoadType "viktor.external.scia.object.LoadCase.PermanentLoadType")*[](#PermanentLoadCase.load_type "Link to this definition")
- *property *master*: None*[](#PermanentLoadCase.master "Link to this definition")
* *property *primary\_effect*: [LoadCase](#LoadCase "viktor.external.scia.object.LoadCase") | None*[](#PermanentLoadCase.primary_effect "Link to this definition")
- *property *specification*: None*[](#PermanentLoadCase.specification "Link to this definition")
## Plane[](https://docs.viktor.ai/sdk/api/external/scia/.md#_Plane "Direct link to Plane")
* *class *viktor.external.scia.object.Plane(*object\_id*, *name*, *thickness*, *material*, *\**, *plane\_type=None*, *layer=None*, *corner\_nodes=None*, *internal\_nodes=None*, *swap\_orientation=None*, *lcs\_rotation=None*, *fem\_model=None*, *orthotropy=None*, *center\_node=None*, *vertex\_node=None*, *axis=None*)[](#Plane "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_plane()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_plane "viktor.external.scia.scia.Model.create_plane") or [`create_circular_plane()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_circular_plane "viktor.external.scia.scia.Model.create_circular_plane")
* *class *FEMModel(*\*values*)[](#Plane.FEMModel "Link to this definition")
Bases: `Enum`
* ISOTROPIC*: [`FEMModel`](#Plane.FEMModel "viktor.external.scia.object.Plane.FEMModel")** = 0*[](#Plane.FEMModel.ISOTROPIC "Link to this definition")
- ORTHOTROPIC*: [`FEMModel`](#Plane.FEMModel "viktor.external.scia.object.Plane.FEMModel")** = 1*[](#Plane.FEMModel.ORTHOTROPIC "Link to this definition")
- *class *Type(*\*values*)[](#Plane.Type "Link to this definition")
Bases: `Enum`
* **PLATE** - A standard plate is a planar 2D member with an arbitrary number of edges that may be straight or curved.
* **WALL** - A wall is a vertical 2D member whose base is either straight or curved.
* **SHELL** - Shells are defined by border lines (i.e. border curves). The shape of the shell can be defined by four, three or two curves / straight lines.
- PLATE*: [`Type`](#Plane.Type "viktor.external.scia.object.Plane.Type")** = 0*[](#Plane.Type.PLATE "Link to this definition")
* SHELL*: [`Type`](#Plane.Type "viktor.external.scia.object.Plane.Type")** = 2*[](#Plane.Type.SHELL "Link to this definition")
- WALL*: [`Type`](#Plane.Type "viktor.external.scia.object.Plane.Type")** = 1*[](#Plane.Type.WALL "Link to this definition")
* *property *corner\_nodes*: List\[[Node](#Node "viktor.external.scia.object.Node")]*[](#Plane.corner_nodes "Link to this definition")
- *property *internal\_nodes*: List\[[Node](#Node "viktor.external.scia.object.Node")]*[](#Plane.internal_nodes "Link to this definition")
* *property *lcs\_rotation*: float*[](#Plane.lcs_rotation "Link to this definition")
- *property *swap\_orientation*: bool*[](#Plane.swap_orientation "Link to this definition")
## PointLoad[](https://docs.viktor.ai/sdk/api/external/scia/.md#_PointLoad "Direct link to PointLoad")
* *class *viktor.external.scia.object.PointLoad(*object\_id*, *name*, *load\_case*, *beam*, *direction*, *load\_type*, *load\_value*, *c\_sys=None*, *c\_def=None*, *position\_x=None*, *origin=None*, *repeat=None*, *ey=None*, *ez=None*, *\**, *angle=None*)[](#PointLoad "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_point_load()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_point_load "viktor.external.scia.scia.Model.create_point_load")
* *class *CDef(*\*values*)[](#PointLoad.CDef "Link to this definition")
Bases: `Enum`
* **ABSOLUTE** - absolute, where the coordinate must lie between 0 and the length of the beam
* **RELATIVE** - relative, where the coordinate must lie between 0 and 1
- ABSOLUTE*: [`CDef`](#PointLoad.CDef "viktor.external.scia.object.PointLoad.CDef")** = 0*[](#PointLoad.CDef.ABSOLUTE "Link to this definition")
* RELATIVE*: [`CDef`](#PointLoad.CDef "viktor.external.scia.object.PointLoad.CDef")** = 1*[](#PointLoad.CDef.RELATIVE "Link to this definition")
- *class *CSys(*\*values*)[](#PointLoad.CSys "Link to this definition")
Bases: `Enum`
* GLOBAL*: [`CSys`](#PointLoad.CSys "viktor.external.scia.object.PointLoad.CSys")** = 0*[](#PointLoad.CSys.GLOBAL "Link to this definition")
- LOCAL*: [`CSys`](#PointLoad.CSys "viktor.external.scia.object.PointLoad.CSys")** = 1*[](#PointLoad.CSys.LOCAL "Link to this definition")
* *class *Direction(*\*values*)[](#PointLoad.Direction "Link to this definition")
Bases: `Enum`
* X*: [`Direction`](#PointLoad.Direction "viktor.external.scia.object.PointLoad.Direction")** = 0*[](#PointLoad.Direction.X "Link to this definition")
- Y*: [`Direction`](#PointLoad.Direction "viktor.external.scia.object.PointLoad.Direction")** = 1*[](#PointLoad.Direction.Y "Link to this definition")
* Z*: [`Direction`](#PointLoad.Direction "viktor.external.scia.object.PointLoad.Direction")** = 2*[](#PointLoad.Direction.Z "Link to this definition")
- *class *Distribution(*\*values*)[](#PointLoad.Distribution "Link to this definition")
Bases: `Enum`
* TRAPEZOIDAL*: [`Distribution`](#PointLoad.Distribution "viktor.external.scia.object.PointLoad.Distribution")** = 1*[](#PointLoad.Distribution.TRAPEZOIDAL "Link to this definition")
- UNIFORM*: [`Distribution`](#PointLoad.Distribution "viktor.external.scia.object.PointLoad.Distribution")** = 0*[](#PointLoad.Distribution.UNIFORM "Link to this definition")
* *class *Origin(*\*values*)[](#PointLoad.Origin "Link to this definition")
Bases: `Enum`
* **FROM\_START** - position is measured from the beginning of the beam
* **FROM\_END** - position is measured from the end of the beam
- FROM\_END*: [`Origin`](#PointLoad.Origin "viktor.external.scia.object.PointLoad.Origin")** = 1*[](#PointLoad.Origin.FROM_END "Link to this definition")
* FROM\_START*: [`Origin`](#PointLoad.Origin "viktor.external.scia.object.PointLoad.Origin")** = 0*[](#PointLoad.Origin.FROM_START "Link to this definition")
- *class *Type(*\*values*)[](#PointLoad.Type "Link to this definition")
Bases: `Enum`
* FORCE*: [`Type`](#PointLoad.Type "viktor.external.scia.object.PointLoad.Type")** = 0*[](#PointLoad.Type.FORCE "Link to this definition")
* *property *beam*: [Beam](#Beam "viktor.external.scia.object.Beam")*[](#PointLoad.beam "Link to this definition")
- *property *load\_case*: [LoadCase](#LoadCase "viktor.external.scia.object.LoadCase")*[](#PointLoad.load_case "Link to this definition")
## PointLoadNode[](https://docs.viktor.ai/sdk/api/external/scia/.md#_PointLoadNode "Direct link to PointLoadNode")
* *class *viktor.external.scia.object.PointLoadNode(*object\_id*, *name*, *node*, *load\_case*, *load*, *direction=None*, *c\_sys=None*, *angle=None*)[](#PointLoadNode "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_point_load_node()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_point_load_node "viktor.external.scia.scia.Model.create_point_load_node")
* *class *CSys(*\*values*)[](#PointLoadNode.CSys "Link to this definition")
Bases: `Enum`
* GLOBAL*: [`CSys`](#PointLoadNode.CSys "viktor.external.scia.object.PointLoadNode.CSys")** = 0*[](#PointLoadNode.CSys.GLOBAL "Link to this definition")
- LOCAL*: [`CSys`](#PointLoadNode.CSys "viktor.external.scia.object.PointLoadNode.CSys")** = 1*[](#PointLoadNode.CSys.LOCAL "Link to this definition")
- *class *Direction(*\*values*)[](#PointLoadNode.Direction "Link to this definition")
Bases: `Enum`
* X*: [`Direction`](#PointLoadNode.Direction "viktor.external.scia.object.PointLoadNode.Direction")** = 0*[](#PointLoadNode.Direction.X "Link to this definition")
- Y*: [`Direction`](#PointLoadNode.Direction "viktor.external.scia.object.PointLoadNode.Direction")** = 1*[](#PointLoadNode.Direction.Y "Link to this definition")
* Z*: [`Direction`](#PointLoadNode.Direction "viktor.external.scia.object.PointLoadNode.Direction")** = 2*[](#PointLoadNode.Direction.Z "Link to this definition")
* *property *load\_case*: [LoadCase](#LoadCase "viktor.external.scia.object.LoadCase")*[](#PointLoadNode.load_case "Link to this definition")
- *property *node*: [Node](#Node "viktor.external.scia.object.Node")*[](#PointLoadNode.node "Link to this definition")
## PointMomentNode[](https://docs.viktor.ai/sdk/api/external/scia/.md#_PointMomentNode "Direct link to PointMomentNode")
* *class *viktor.external.scia.object.PointMomentNode(*object\_id*, *name*, *node*, *load\_case*, *load*, *direction*, *c\_sys*)[](#PointMomentNode "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_point_moment_node()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_point_moment_node "viktor.external.scia.scia.Model.create_point_moment_node").
* *class *CSys(*\*values*)[](#PointMomentNode.CSys "Link to this definition")
Bases: `Enum`
* GLOBAL*: [`CSys`](#PointMomentNode.CSys "viktor.external.scia.object.PointMomentNode.CSys")** = 0*[](#PointMomentNode.CSys.GLOBAL "Link to this definition")
- LOCAL*: [`CSys`](#PointMomentNode.CSys "viktor.external.scia.object.PointMomentNode.CSys")** = 1*[](#PointMomentNode.CSys.LOCAL "Link to this definition")
- *class *Direction(*\*values*)[](#PointMomentNode.Direction "Link to this definition")
Bases: `Enum`
* X*: [`Direction`](#PointMomentNode.Direction "viktor.external.scia.object.PointMomentNode.Direction")** = 0*[](#PointMomentNode.Direction.X "Link to this definition")
- Y*: [`Direction`](#PointMomentNode.Direction "viktor.external.scia.object.PointMomentNode.Direction")** = 1*[](#PointMomentNode.Direction.Y "Link to this definition")
* Z*: [`Direction`](#PointMomentNode.Direction "viktor.external.scia.object.PointMomentNode.Direction")** = 2*[](#PointMomentNode.Direction.Z "Link to this definition")
* *property *load\_case*: [LoadCase](#LoadCase "viktor.external.scia.object.LoadCase")*[](#PointMomentNode.load_case "Link to this definition")
- *property *node*: [Node](#Node "viktor.external.scia.object.Node")*[](#PointMomentNode.node "Link to this definition")
## PointSupport[](https://docs.viktor.ai/sdk/api/external/scia/.md#_PointSupport "Direct link to PointSupport")
* *class *viktor.external.scia.object.PointSupport(*object\_id*, *name*, *node*, *spring\_type*, *freedom*, *stiffness*, *c\_sys*, *default\_size=0.2*, *angle=None*)[](#PointSupport "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_point_support()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_point_support "viktor.external.scia.scia.Model.create_point_support")
* *class *CSys(*\*values*)[](#PointSupport.CSys "Link to this definition")
Bases: `Enum`
* GLOBAL*: [`CSys`](#PointSupport.CSys "viktor.external.scia.object.PointSupport.CSys")** = 0*[](#PointSupport.CSys.GLOBAL "Link to this definition")
- LOCAL*: [`CSys`](#PointSupport.CSys "viktor.external.scia.object.PointSupport.CSys")** = 1*[](#PointSupport.CSys.LOCAL "Link to this definition")
- *class *Constraint(*\*values*)[](#PointSupport.Constraint "Link to this definition")
Bases: `Enum`
* CUSTOM*: [`Constraint`](#PointSupport.Constraint "viktor.external.scia.object.PointSupport.Constraint")** = 3*[](#PointSupport.Constraint.CUSTOM "Link to this definition")
- FIXED*: [`Constraint`](#PointSupport.Constraint "viktor.external.scia.object.PointSupport.Constraint")** = 0*[](#PointSupport.Constraint.FIXED "Link to this definition")
* HINGED*: [`Constraint`](#PointSupport.Constraint "viktor.external.scia.object.PointSupport.Constraint")** = 1*[](#PointSupport.Constraint.HINGED "Link to this definition")
- SLIDING*: [`Constraint`](#PointSupport.Constraint "viktor.external.scia.object.PointSupport.Constraint")** = 2*[](#PointSupport.Constraint.SLIDING "Link to this definition")
* *class *Freedom(*\*values*)[](#PointSupport.Freedom "Link to this definition")
Bases: `Enum`
* **FREE** - The support is free in the specified direction. That is it imposes no constraint in the direction.
* **RIGID** - The support in fully rigid in the specified direction.
* **FLEXIBLE** - The support is flexible (elastic) in the specified direction. The user has to define the required stiffness of the support.
- FLEXIBLE*: [`Freedom`](#PointSupport.Freedom "viktor.external.scia.object.PointSupport.Freedom")** = 2*[](#PointSupport.Freedom.FLEXIBLE "Link to this definition")
* FREE*: [`Freedom`](#PointSupport.Freedom "viktor.external.scia.object.PointSupport.Freedom")** = 0*[](#PointSupport.Freedom.FREE "Link to this definition")
- RIGID*: [`Freedom`](#PointSupport.Freedom "viktor.external.scia.object.PointSupport.Freedom")** = 1*[](#PointSupport.Freedom.RIGID "Link to this definition")
- *class *Type(*\*values*)[](#PointSupport.Type "Link to this definition")
Bases: `Enum`
* COLUMN*: [`Type`](#PointSupport.Type "viktor.external.scia.object.PointSupport.Type")** = 2*[](#PointSupport.Type.COLUMN "Link to this definition")
- PAD\_FOUNDATION*: [`Type`](#PointSupport.Type "viktor.external.scia.object.PointSupport.Type")** = 1*[](#PointSupport.Type.PAD_FOUNDATION "Link to this definition")
* STANDARD*: [`Type`](#PointSupport.Type "viktor.external.scia.object.PointSupport.Type")** = 0*[](#PointSupport.Type.STANDARD "Link to this definition")
* *property *constraint*: [Constraint](#PointSupport.Constraint "viktor.external.scia.object.PointSupport.Constraint")*[](#PointSupport.constraint "Link to this definition")
- *property *node*: [Node](#Node "viktor.external.scia.object.Node")*[](#PointSupport.node "Link to this definition")
## PointSupportLine[](https://docs.viktor.ai/sdk/api/external/scia/.md#_PointSupportLine "Direct link to PointSupportLine")
* *class *viktor.external.scia.object.PointSupportLine(*object\_id*, *name*, *beam*, *x=None*, *stiffness\_x=None*, *y=None*, *stiffness\_y=None*, *z=None*, *stiffness\_z=None*, *rx=None*, *stiffness\_rx=None*, *ry=None*, *stiffness\_ry=None*, *rz=None*, *stiffness\_rz=None*, *default\_size=None*, *c\_sys=None*, *c\_def=None*, *position\_x=None*, *origin=None*, *repeat=None*, *delta\_x=None*)[](#PointSupportLine "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_point_support_on_beam()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_point_support_on_beam "viktor.external.scia.scia.Model.create_point_support_on_beam")
* *class *CDef(*\*values*)[](#PointSupportLine.CDef "Link to this definition")
Bases: `Enum`
* **ABSOLUTE** - absolute, where the coordinate must lie between 0 and the length of the beam
* **RELATIVE** - relative, where the coordinate must lie between 0 and 1
- ABSOLUTE*: [`CDef`](#PointSupportLine.CDef "viktor.external.scia.object.PointSupportLine.CDef")** = 0*[](#PointSupportLine.CDef.ABSOLUTE "Link to this definition")
* RELATIVE*: [`CDef`](#PointSupportLine.CDef "viktor.external.scia.object.PointSupportLine.CDef")** = 1*[](#PointSupportLine.CDef.RELATIVE "Link to this definition")
- *class *CSys(*\*values*)[](#PointSupportLine.CSys "Link to this definition")
Bases: `Enum`
* GLOBAL*: [`CSys`](#PointSupportLine.CSys "viktor.external.scia.object.PointSupportLine.CSys")** = 0*[](#PointSupportLine.CSys.GLOBAL "Link to this definition")
- LOCAL*: [`CSys`](#PointSupportLine.CSys "viktor.external.scia.object.PointSupportLine.CSys")** = 1*[](#PointSupportLine.CSys.LOCAL "Link to this definition")
* *class *Freedom(*\*values*)[](#PointSupportLine.Freedom "Link to this definition")
Bases: `Enum`
* **FREE** - The support is free in the specified direction. That is it imposes no constraint in the direction.
* **RIGID** - The support in fully rigid in the specified direction.
* **FLEXIBLE** - The support is flexible (elastic) in the specified direction. The user has to define the required stiffness of the support.
- FLEXIBLE*: [`Freedom`](#PointSupportLine.Freedom "viktor.external.scia.object.PointSupportLine.Freedom")** = 2*[](#PointSupportLine.Freedom.FLEXIBLE "Link to this definition")
* FREE*: [`Freedom`](#PointSupportLine.Freedom "viktor.external.scia.object.PointSupportLine.Freedom")** = 0*[](#PointSupportLine.Freedom.FREE "Link to this definition")
- RIGID*: [`Freedom`](#PointSupportLine.Freedom "viktor.external.scia.object.PointSupportLine.Freedom")** = 1*[](#PointSupportLine.Freedom.RIGID "Link to this definition")
- *class *Origin(*\*values*)[](#PointSupportLine.Origin "Link to this definition")
Bases: `Enum`
* **FROM\_START** - position is measured from the beginning of the beam
* **FROM\_END** - position is measured from the end of the beam
- FROM\_END*: [`Origin`](#PointSupportLine.Origin "viktor.external.scia.object.PointSupportLine.Origin")** = 1*[](#PointSupportLine.Origin.FROM_END "Link to this definition")
* FROM\_START*: [`Origin`](#PointSupportLine.Origin "viktor.external.scia.object.PointSupportLine.Origin")** = 0*[](#PointSupportLine.Origin.FROM_START "Link to this definition")
## ProjectData[](https://docs.viktor.ai/sdk/api/external/scia/.md#_ProjectData "Direct link to ProjectData")
* *class *viktor.external.scia.object.ProjectData(*\**, *name=None*, *part=None*, *description=None*, *author=None*, *date=None*)[](#ProjectData "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
New in v13.1.0
Basic project data.
* Parameters:
* **name** (`str`) – Project name (default: as defined in ESA model)
* **part** (`str`) – Project part name (default: as defined in ESA model)
* **description** (`str`) – Project description (default: as defined in ESA model)
* **author** (`str`) – Name of the author (default: as defined in ESA model)
* **date** (`str`) – Date of the last modification (default: as defined in ESA model)
## RectangularCrossSection[](https://docs.viktor.ai/sdk/api/external/scia/.md#_RectangularCrossSection "Direct link to RectangularCrossSection")
* *class *viktor.external.scia.object.RectangularCrossSection(*object\_id*, *name*, *material*, *width*, *height*)[](#RectangularCrossSection "Link to this definition")
Bases: [`CrossSection`](#CrossSection "viktor.external.scia.object.CrossSection")
Do not use this \_\_init\_\_ directly, but create the object by [`create_rectangular_cross_section()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_rectangular_cross_section "viktor.external.scia.scia.Model.create_rectangular_cross_section")
## ResultClass[](https://docs.viktor.ai/sdk/api/external/scia/.md#_ResultClass "Direct link to ResultClass")
* *class *viktor.external.scia.object.ResultClass(*object\_id*, *name*, *combinations*, *nonlinear\_combinations*)[](#ResultClass "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_result_class()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_result_class "viktor.external.scia.scia.Model.create_result_class")
* *property *combinations*: List\[[LoadCombination](#LoadCombination "viktor.external.scia.object.LoadCombination")]*[](#ResultClass.combinations "Link to this definition")
- *property *nonlinear\_combinations*: List\[[NonLinearLoadCombination](#NonLinearLoadCombination "viktor.external.scia.object.NonLinearLoadCombination")]*[](#ResultClass.nonlinear_combinations "Link to this definition")
## RigidArm[](https://docs.viktor.ai/sdk/api/external/scia/.md#_RigidArm "Direct link to RigidArm")
* *class *viktor.external.scia.object.RigidArm(*object\_id*, *name*, *master\_node*, *slave\_node*, *hinge\_on\_master*, *hinge\_on\_slave*)[](#RigidArm "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_rigid_arm()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_rigid_arm "viktor.external.scia.scia.Model.create_rigid_arm")
* *property *master\_node*: [Node](#Node "viktor.external.scia.object.Node")*[](#RigidArm.master_node "Link to this definition")
- *property *slave\_node*: [Node](#Node "viktor.external.scia.object.Node")*[](#RigidArm.slave_node "Link to this definition")
## SciaObject[](https://docs.viktor.ai/sdk/api/external/scia/.md#_SciaObject "Direct link to SciaObject")
* *class *viktor.external.scia.object.SciaObject(*object\_id*, *name*)[](#SciaObject "Link to this definition")
Bases: `ABC`
* *property *name*: str*[](#SciaObject.name "Link to this definition")
Name of the object in SCIA.
- *property *object\_id*: int*[](#SciaObject.object_id "Link to this definition")
ID of the object in SCIA.
## SectionOnBeam[](https://docs.viktor.ai/sdk/api/external/scia/.md#_SectionOnBeam "Direct link to SectionOnBeam")
* *class *viktor.external.scia.object.SectionOnBeam(*object\_id*, *name*, *beam*, *c\_def*, *position\_x*, *origin*, *repeat*, *delta\_x*)[](#SectionOnBeam "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_section_on_beam()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_section_on_beam "viktor.external.scia.scia.Model.create_section_on_beam")
* *class *CDef(*\*values*)[](#SectionOnBeam.CDef "Link to this definition")
Bases: `Enum`
* **ABSOLUTE** - absolute, where the coordinate must lie between 0 and the length of the beam
* **RELATIVE** - relative, where the coordinate must lie between 0 and 1
- ABSOLUTE*: [`CDef`](#SectionOnBeam.CDef "viktor.external.scia.object.SectionOnBeam.CDef")** = 0*[](#SectionOnBeam.CDef.ABSOLUTE "Link to this definition")
* RELATIVE*: [`CDef`](#SectionOnBeam.CDef "viktor.external.scia.object.SectionOnBeam.CDef")** = 1*[](#SectionOnBeam.CDef.RELATIVE "Link to this definition")
- *class *Origin(*\*values*)[](#SectionOnBeam.Origin "Link to this definition")
Bases: `Enum`
* **FROM\_START** - position is measured from the beginning of the beam
* **FROM\_END** - position is measured from the end of the beam
- FROM\_END*: [`Origin`](#SectionOnBeam.Origin "viktor.external.scia.object.SectionOnBeam.Origin")** = 1*[](#SectionOnBeam.Origin.FROM_END "Link to this definition")
* FROM\_START*: [`Origin`](#SectionOnBeam.Origin "viktor.external.scia.object.SectionOnBeam.Origin")** = 0*[](#SectionOnBeam.Origin.FROM_START "Link to this definition")
* *property *beam*: [Beam](#Beam "viktor.external.scia.object.Beam")*[](#SectionOnBeam.beam "Link to this definition")
## SectionOnPlane[](https://docs.viktor.ai/sdk/api/external/scia/.md#_SectionOnPlane "Direct link to SectionOnPlane")
* *class *viktor.external.scia.object.SectionOnPlane(*object\_id*, *name*, *point\_1*, *point\_2*, *draw=None*, *direction\_of\_cut=None*)[](#SectionOnPlane "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_section_on_plane()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_section_on_plane "viktor.external.scia.scia.Model.create_section_on_plane")
* *class *Draw(*\*values*)[](#SectionOnPlane.Draw "Link to this definition")
Bases: `Enum`
* ELEMENT\_PLANE*: [`Draw`](#SectionOnPlane.Draw "viktor.external.scia.object.SectionOnPlane.Draw")** = 1*[](#SectionOnPlane.Draw.ELEMENT_PLANE "Link to this definition")
- UPRIGHT\_TO\_ELEMENT*: [`Draw`](#SectionOnPlane.Draw "viktor.external.scia.object.SectionOnPlane.Draw")** = 0*[](#SectionOnPlane.Draw.UPRIGHT_TO_ELEMENT "Link to this definition")
* X\_DIRECTION*: [`Draw`](#SectionOnPlane.Draw "viktor.external.scia.object.SectionOnPlane.Draw")** = 2*[](#SectionOnPlane.Draw.X_DIRECTION "Link to this definition")
- Y\_DIRECTION*: [`Draw`](#SectionOnPlane.Draw "viktor.external.scia.object.SectionOnPlane.Draw")** = 3*[](#SectionOnPlane.Draw.Y_DIRECTION "Link to this definition")
* Z\_DIRECTION*: [`Draw`](#SectionOnPlane.Draw "viktor.external.scia.object.SectionOnPlane.Draw")** = 4*[](#SectionOnPlane.Draw.Z_DIRECTION "Link to this definition")
## Selection[](https://docs.viktor.ai/sdk/api/external/scia/.md#_Selection "Direct link to Selection")
* *class *viktor.external.scia.object.Selection(*object\_id*, *name*, *objects*)[](#Selection "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_selection()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_selection "viktor.external.scia.scia.Model.create_selection")
## SolverSetup[](https://docs.viktor.ai/sdk/api/external/scia/.md#_SolverSetup "Direct link to SolverSetup")
* *class *viktor.external.scia.object.SolverSetup(*\**, *neglect\_shear\_force\_deformation=None*, *bending\_theory=None*, *solver\_type=None*, *number\_of\_sections=None*, *reinforcement\_coefficient=None*)[](#SolverSetup "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
New in v13.1.0
Solver setup.
* Parameters:
* **neglect\_shear\_force\_deformation** (`bool`) – Neglect shear force deformation (default: as defined in ESA model)
* **bending\_theory** (`str`) – Bending theory of plate/shell analysis (‘mindlin’ | ‘kirchhoff’) (default: as defined in ESA model)
* **solver\_type** (`str`) – Type of solver (‘direct’ | ‘iterative’) (default: as defined in ESA model)
* **number\_of\_sections** (`float`) – Number of sections on average member (default: as defined in ESA model)
* **reinforcement\_coefficient** (`float`) – Coefficient for reinforcement (default: as defined in ESA model)
## Subsoil[](https://docs.viktor.ai/sdk/api/external/scia/.md#_Subsoil "Direct link to Subsoil")
* *class *viktor.external.scia.object.Subsoil(*object\_id*, *name*, *stiffness*, *c1x=None*, *c1y=None*, *c1z=None*, *nonlinear\_function=None*, *c2x=None*, *c2y=None*, *is\_drained=None*, *water\_air\_in\_clay\_subgrade=None*, *specific\_weight=None*, *fi=None*, *sigma\_oc=None*, *c=None*, *cu=None*)[](#Subsoil "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_subsoil()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_subsoil "viktor.external.scia.scia.Model.create_subsoil")
* *class *C1z(*\*values*)[](#Subsoil.C1z "Link to this definition")
Bases: `Enum`
* FLEXIBLE*: [`C1z`](#Subsoil.C1z "viktor.external.scia.object.Subsoil.C1z")** = 0*[](#Subsoil.C1z.FLEXIBLE "Link to this definition")
- NONLINEAR\_FUNCTION*: [`C1z`](#Subsoil.C1z "viktor.external.scia.object.Subsoil.C1z")** = 1*[](#Subsoil.C1z.NONLINEAR_FUNCTION "Link to this definition")
- *property *nonlinear\_function*: [NonLinearFunction](#NonLinearFunction "viktor.external.scia.object.NonLinearFunction") | None*[](#Subsoil.nonlinear_function "Link to this definition")
## SurfaceLoad[](https://docs.viktor.ai/sdk/api/external/scia/.md#_SurfaceLoad "Direct link to SurfaceLoad")
* *class *viktor.external.scia.object.SurfaceLoad(*object\_id*, *name*, *load\_case*, *plane*, *direction*, *load\_type*, *load\_value*, *c\_sys*, *location*)[](#SurfaceLoad "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_surface_load()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_surface_load "viktor.external.scia.scia.Model.create_surface_load")
* *class *CSys(*\*values*)[](#SurfaceLoad.CSys "Link to this definition")
Bases: `Enum`
* GLOBAL*: [`CSys`](#SurfaceLoad.CSys "viktor.external.scia.object.SurfaceLoad.CSys")** = 0*[](#SurfaceLoad.CSys.GLOBAL "Link to this definition")
- LOCAL*: [`CSys`](#SurfaceLoad.CSys "viktor.external.scia.object.SurfaceLoad.CSys")** = 1*[](#SurfaceLoad.CSys.LOCAL "Link to this definition")
- *class *Direction(*\*values*)[](#SurfaceLoad.Direction "Link to this definition")
Bases: `Enum`
* X*: [`Direction`](#SurfaceLoad.Direction "viktor.external.scia.object.SurfaceLoad.Direction")** = 0*[](#SurfaceLoad.Direction.X "Link to this definition")
- Y*: [`Direction`](#SurfaceLoad.Direction "viktor.external.scia.object.SurfaceLoad.Direction")** = 1*[](#SurfaceLoad.Direction.Y "Link to this definition")
* Z*: [`Direction`](#SurfaceLoad.Direction "viktor.external.scia.object.SurfaceLoad.Direction")** = 2*[](#SurfaceLoad.Direction.Z "Link to this definition")
* *class *Location(*\*values*)[](#SurfaceLoad.Location "Link to this definition")
Bases: `Enum`
* LENGTH*: [`Location`](#SurfaceLoad.Location "viktor.external.scia.object.SurfaceLoad.Location")** = 0*[](#SurfaceLoad.Location.LENGTH "Link to this definition")
- PROJECTION*: [`Location`](#SurfaceLoad.Location "viktor.external.scia.object.SurfaceLoad.Location")** = 1*[](#SurfaceLoad.Location.PROJECTION "Link to this definition")
- *class *Type(*\*values*)[](#SurfaceLoad.Type "Link to this definition")
Bases: `Enum`
* FORCE*: [`Type`](#SurfaceLoad.Type "viktor.external.scia.object.SurfaceLoad.Type")** = 0*[](#SurfaceLoad.Type.FORCE "Link to this definition")
- SELF\_WEIGHT*: [`Type`](#SurfaceLoad.Type "viktor.external.scia.object.SurfaceLoad.Type")** = 1*[](#SurfaceLoad.Type.SELF_WEIGHT "Link to this definition")
* *property *load\_case*: [LoadCase](#LoadCase "viktor.external.scia.object.LoadCase")*[](#SurfaceLoad.load_case "Link to this definition")
- *property *plane*: [Plane](#Plane "viktor.external.scia.object.Plane")*[](#SurfaceLoad.plane "Link to this definition")
## SurfaceSupportSurface[](https://docs.viktor.ai/sdk/api/external/scia/.md#_SurfaceSupportSurface "Direct link to SurfaceSupportSurface")
* *class *viktor.external.scia.object.SurfaceSupportSurface(*object\_id*, *name*, *plane*, *subsoil*)[](#SurfaceSupportSurface "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_surface_support()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_surface_support "viktor.external.scia.scia.Model.create_surface_support")
* *property *plane*: [Plane](#Plane "viktor.external.scia.object.Plane")*[](#SurfaceSupportSurface.plane "Link to this definition")
- *property *subsoil*: [Subsoil](#Subsoil "viktor.external.scia.object.Subsoil")*[](#SurfaceSupportSurface.subsoil "Link to this definition")
## ThermalLoad[](https://docs.viktor.ai/sdk/api/external/scia/.md#_ThermalLoad "Direct link to ThermalLoad")
* *class *viktor.external.scia.object.ThermalLoad(*object\_id*, *name*, *load\_case*, *beam*, *distribution*, *delta*, *left\_delta*, *right\_delta*, *top\_delta*, *bottom\_delta*, *position\_start*, *position\_end*, *c\_def*, *origin*)[](#ThermalLoad "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_thermal_load()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_thermal_load "viktor.external.scia.scia.Model.create_thermal_load")
* *class *CDef(*\*values*)[](#ThermalLoad.CDef "Link to this definition")
Bases: `Enum`
* **ABSOLUTE** - absolute, where the coordinate must lie between 0 and the length of the beam
* **RELATIVE** - relative, where the coordinate must lie between 0 and 1
- ABSOLUTE*: [`CDef`](#ThermalLoad.CDef "viktor.external.scia.object.ThermalLoad.CDef")** = 0*[](#ThermalLoad.CDef.ABSOLUTE "Link to this definition")
* RELATIVE*: [`CDef`](#ThermalLoad.CDef "viktor.external.scia.object.ThermalLoad.CDef")** = 1*[](#ThermalLoad.CDef.RELATIVE "Link to this definition")
- *class *Distribution(*\*values*)[](#ThermalLoad.Distribution "Link to this definition")
Bases: `Enum`
* CONSTANT*: [`Distribution`](#ThermalLoad.Distribution "viktor.external.scia.object.ThermalLoad.Distribution")** = 0*[](#ThermalLoad.Distribution.CONSTANT "Link to this definition")
- LINEAR*: [`Distribution`](#ThermalLoad.Distribution "viktor.external.scia.object.ThermalLoad.Distribution")** = 1*[](#ThermalLoad.Distribution.LINEAR "Link to this definition")
* *class *Origin(*\*values*)[](#ThermalLoad.Origin "Link to this definition")
Bases: `Enum`
* **FROM\_START** - position is measured from the beginning of the beam
* **FROM\_END** - position is measured from the end of the beam
- FROM\_END*: [`Origin`](#ThermalLoad.Origin "viktor.external.scia.object.ThermalLoad.Origin")** = 1*[](#ThermalLoad.Origin.FROM_END "Link to this definition")
* FROM\_START*: [`Origin`](#ThermalLoad.Origin "viktor.external.scia.object.ThermalLoad.Origin")** = 0*[](#ThermalLoad.Origin.FROM_START "Link to this definition")
- *property *beam*: [Beam](#Beam "viktor.external.scia.object.Beam")*[](#ThermalLoad.beam "Link to this definition")
* *property *load\_case*: [LoadCase](#LoadCase "viktor.external.scia.object.LoadCase")*[](#ThermalLoad.load_case "Link to this definition")
## ThermalSurfaceLoad[](https://docs.viktor.ai/sdk/api/external/scia/.md#_ThermalSurfaceLoad "Direct link to ThermalSurfaceLoad")
* *class *viktor.external.scia.object.ThermalSurfaceLoad(*object\_id*, *name*, *load\_case*, *plane*, *delta=None*, *top\_delta=None*, *bottom\_delta=None*)[](#ThermalSurfaceLoad "Link to this definition")
Bases: [`SciaObject`](#SciaObject "viktor.external.scia.object.SciaObject")
Do not use this \_\_init\_\_ directly, but create the object by [`create_thermal_surface_load()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_thermal_surface_load "viktor.external.scia.scia.Model.create_thermal_surface_load")
* *class *Distribution(*\*values*)[](#ThermalSurfaceLoad.Distribution "Link to this definition")
Bases: `Enum`
* CONSTANT*: [`Distribution`](#ThermalSurfaceLoad.Distribution "viktor.external.scia.object.ThermalSurfaceLoad.Distribution")** = 0*[](#ThermalSurfaceLoad.Distribution.CONSTANT "Link to this definition")
- LINEAR*: [`Distribution`](#ThermalSurfaceLoad.Distribution "viktor.external.scia.object.ThermalSurfaceLoad.Distribution")** = 1*[](#ThermalSurfaceLoad.Distribution.LINEAR "Link to this definition")
## VariableLoadCase[](https://docs.viktor.ai/sdk/api/external/scia/.md#_VariableLoadCase "Direct link to VariableLoadCase")
* *class *viktor.external.scia.object.VariableLoadCase(*object\_id*, *name*, *description*, *load\_group*, *load\_type*, *specification=None*, *duration=None*, *primary\_effect=None*, *master=None*)[](#VariableLoadCase "Link to this definition")
Bases: [`LoadCase`](#LoadCase "viktor.external.scia.object.LoadCase")
Do not use this \_\_init\_\_ directly, but create the object by [`create_variable_load_case()`](https://docs.viktor.ai/sdk/api/external/scia/.md#Model.create_variable_load_case "viktor.external.scia.scia.Model.create_variable_load_case")
* *property *direction*: None*[](#VariableLoadCase.direction "Link to this definition")
- *property *duration*: [Duration](#LoadCase.Duration "viktor.external.scia.object.LoadCase.Duration") | None*[](#VariableLoadCase.duration "Link to this definition")
* *property *load\_type*: [VariableLoadType](#LoadCase.VariableLoadType "viktor.external.scia.object.LoadCase.VariableLoadType")*[](#VariableLoadCase.load_type "Link to this definition")
- *property *master*: str | None*[](#VariableLoadCase.master "Link to this definition")
* *property *primary\_effect*: [LoadCase](#LoadCase "viktor.external.scia.object.LoadCase") | None*[](#VariableLoadCase.primary_effect "Link to this definition")
- *property *specification*: [Specification](#LoadCase.Specification "viktor.external.scia.object.LoadCase.Specification") | None*[](#VariableLoadCase.specification "Link to this definition")
---
# viktor.external.spreadsheet
## DirectInputCell[](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#_DirectInputCell "Direct link to DirectInputCell")
* *class *viktor.external.spreadsheet.DirectInputCell(*sheet\_name*, *column*, *row*, *value*)[](#DirectInputCell "Link to this definition")
Bases: `_DirectCellBaseClass`
Class for defining a direct cell in which a value must be inserted
If a rectangular block of data has to be inserted, use [`InputCellRange`](#InputCellRange "viktor.external.spreadsheet.InputCellRange") for more efficiency.
* Parameters:
* **sheet\_name** (`str`) – name of the sheet in which the cell is present.
* **column** (`str`) – target column.
* **row** (`int`) – target row.
* **value** (`bool` | `int` | `str` | `float`) – value to be placed in the cell.
- serialize(*convert\_value\_to\_str=False*)[](#DirectInputCell.serialize "Link to this definition")
* Parameters:
**convert\_value\_to\_str** (`bool`) – convert value to str. Necessary when DirectInputCell is used in coupled Excel program (only old workers).
* Return type:
`dict`
## DirectOutputCell[](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#_DirectOutputCell "Direct link to DirectOutputCell")
* *class *viktor.external.spreadsheet.DirectOutputCell(*sheet\_name*, *column*, *row*)[](#DirectOutputCell "Link to this definition")
Bases: `_DirectCellBaseClass`
Class for defining a direct cell of which an output is desired.
Example usage:
```
direct_cell = DirectOutputCell('sheet_name', 'G', 3)
excel = Excel(template, direct_output_cells=[direct_cell])
excel.execute()
my_desired_value = direct_cell.result
```
* equals(*direct\_cell\_result*)[](#DirectOutputCell.equals "Link to this definition")
* Return type:
`bool`
- *property *result*: Any*[](#DirectOutputCell.result "Link to this definition")
* serialize()[](#DirectOutputCell.serialize "Link to this definition")
* Return type:
`dict`
## InputCellRange[](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#_InputCellRange "Direct link to InputCellRange")
* *class *viktor.external.spreadsheet.InputCellRange(*sheet\_name*, *left\_column*, *top\_row*, *data*)[](#InputCellRange "Link to this definition")
Convenience object to define a range of cells in row- and/or column direction.
For single cells, use [`DirectInputCell`](#DirectInputCell "viktor.external.spreadsheet.DirectInputCell")
Example:
```
data = [
[1, 2, 3],
[4, 5, 6],
['a', 'b', 'c'],
]
cell_range = InputCellRange('Sheet1', left_column='B', top_row=3, data=data)
```
This produces the following sheet:
> | | | | | | |
> | - | - | - | - | - | - |
> | | A | B | C | D | E |
> | 1 | | | | | |
> | 2 | | | | | |
> | 3 | | 1 | 2 | 3 | |
> | 4 | | 4 | 5 | 6 | |
> | 5 | | a | b | c | |
> | 6 | | | | | |
* Parameters:
* **sheet\_name** (`str`) – name of the sheet in which the data is inserted
* **left\_column** (`str`) – column letter of the top left target of the data
* **top\_row** (`int`) – row number of the top left target of the data
* **data** (`List`\[`List`\[`float` | `str`]]) – content which is filled in the cell range. the nested list structure should be rectangular (each list should have the same length) and not empty.
- serialize()[](#InputCellRange.serialize "Link to this definition")
* Return type:
`dict`
## NamedInputCell[](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#_NamedInputCell "Direct link to NamedInputCell")
* *class *viktor.external.spreadsheet.NamedInputCell(*name*, *value*)[](#NamedInputCell "Link to this definition")
Bases: `_NamedCellBaseClass`
Class for defining a named cell in which a value must be inserted.
* Parameters:
* **name** (`str`) – name of the cell.
* **value** (`bool` | `int` | `str` | `float`) – value to be placed in the cell.
- serialize(*convert\_value\_to\_str=False*)[](#NamedInputCell.serialize "Link to this definition")
* Parameters:
**convert\_value\_to\_str** (`bool`) – convert value to str. Necessary when NamedInputCell is used in coupled Excel program (only old workers).
* Return type:
`dict`
* serialize\_for\_fill\_spreadsheet()[](#NamedInputCell.serialize_for_fill_spreadsheet "Link to this definition")
* Return type:
`dict`
## NamedOutputCell[](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#_NamedOutputCell "Direct link to NamedOutputCell")
* *class *viktor.external.spreadsheet.NamedOutputCell(*name*)[](#NamedOutputCell "Link to this definition")
Bases: `_NamedCellBaseClass`
Class for defining named cells of which the output is desired. Example usage:
```
named_cell = NamedOutputCell('my_name')
excel = Excel(template, named_output_cells=[named_cell])
excel.execute()
my_desired_value = named_cell.result
```
* equals(*named\_cell\_result*)[](#NamedOutputCell.equals "Link to this definition")
* Return type:
`bool`
- *property *result*: Any*[](#NamedOutputCell.result "Link to this definition")
Property that returns the result of this cell. May be called after Excel has been executed.
* Returns:
the result of this cell after excel execution
* serialize()[](#NamedOutputCell.serialize "Link to this definition")
* Return type:
`dict`
## SpreadsheetCalculation[](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#_SpreadsheetCalculation "Direct link to SpreadsheetCalculation")
* *class *viktor.external.spreadsheet.SpreadsheetCalculation(*file*, *inputs*)[](#SpreadsheetCalculation "Link to this definition")
Using a spreadsheet for calculations, inserting inputs and reading outputs. This spreadsheet should not contain macros. See the excel module for spreadsheet calculations with macros.
Example usage:
```
inputs = [
SpreadsheetCalculationInput('x', 1),
SpreadsheetCalculationInput('y', 2),
]
spreadsheet = SpreadsheetCalculation(spreadsheet, inputs)
result = spreadsheet.evaluate(include_filled_file=False)
values = result.values
```
* Parameters:
**file** (`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – spreadsheet file
- evaluate(*include\_filled\_file=False*)[](#SpreadsheetCalculation.evaluate "Link to this definition")
This function enters the values provided into the input tab of the sheet. The sheet evaluates the input and returns a dictionary containing key value pairs of the result parameters
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
**include\_filled\_file** (`bool`) – when True, the SpreadsheetResult will contain the filled in spreadsheet.
* Return type:
[`SpreadsheetResult`](#SpreadsheetResult "viktor.external.spreadsheet.SpreadsheetResult")
* *property *file*: [File](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")*[](#SpreadsheetCalculation.file "Link to this definition")
New in v14.14.0
Returns a File object of the to-be-calculated spreadsheet.
- *classmethod *from\_path(*file\_path*, *inputs*)[](#SpreadsheetCalculation.from_path "Link to this definition")
* Parameters:
* **file\_path** (`str` | `bytes` | `PathLike`) – Complete path including extension
* **inputs** (`List`\[[`SpreadsheetCalculationInput`](#SpreadsheetCalculationInput "viktor.external.spreadsheet.SpreadsheetCalculationInput")])
* Return type:
[`SpreadsheetCalculation`](#SpreadsheetCalculation "viktor.external.spreadsheet.SpreadsheetCalculation")
* *property *result*: [SpreadsheetResult](#SpreadsheetResult "viktor.external.spreadsheet.SpreadsheetResult")*[](#SpreadsheetCalculation.result "Link to this definition")
## SpreadsheetCalculationInput[](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#_SpreadsheetCalculationInput "Direct link to SpreadsheetCalculationInput")
* *class *viktor.external.spreadsheet.SpreadsheetCalculationInput(*name*, *value*)[](#SpreadsheetCalculationInput "Link to this definition")
Bases: [`NamedInputCell`](#NamedInputCell "viktor.external.spreadsheet.NamedInputCell")
This class is subclassed from NamedInputCell because the same functionality is needed.
* Parameters:
* **name** (`str`) – name of the cell.
* **value** (`bool` | `int` | `str` | `float`) – value to be placed in the cell.
## SpreadsheetResult[](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#_SpreadsheetResult "Direct link to SpreadsheetResult")
* *class *viktor.external.spreadsheet.SpreadsheetResult(*\**, *values=None*, *file=None*)[](#SpreadsheetResult "Link to this definition")
Wrapper around results obtained from spreadsheet services.
Warning
Do not instantiate this class directly, it is created by the spreadsheet service.
* *property *file*: [File](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")*[](#SpreadsheetResult.file "Link to this definition")
New in v14.14.0
Returns a File object of the resulting filled-in spreadsheet.
- *property *file\_content*: bytes*[](#SpreadsheetResult.file_content "Link to this definition")
* get\_value(*name*)[](#SpreadsheetResult.get_value "Link to this definition")
* Return type:
`Any`
- *property *values*: dict*[](#SpreadsheetResult.values "Link to this definition")
## SpreadsheetTemplate[](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#_SpreadsheetTemplate "Direct link to SpreadsheetTemplate")
* *class *viktor.external.spreadsheet.SpreadsheetTemplate(*file*, *input\_cells*)[](#SpreadsheetTemplate "Link to this definition")
Note
Prefer to use the function [`render_spreadsheet()`](#render_spreadsheet "viktor.external.spreadsheet.render_spreadsheet") instead.
Fill spreadsheet with values/text. This can be done both with direct cells (e.g. A2), or named cells.
Example usage:
```
cells = [
DirectInputCell('sheet1', 'A', 1, 5),
NamedInputCell('named_cell_1', 'text_to_be_placed'),
]
template = SpreadsheetTemplate(template, cells)
result = template.render()
filled_template = result.file_content
```
* Parameters:
* **file** (`BytesIO`) – BytesIO object of the spreadsheet
* **input\_cells** (`List`\[[`DirectInputCell`](#DirectInputCell "viktor.external.spreadsheet.DirectInputCell") | [`NamedInputCell`](#NamedInputCell "viktor.external.spreadsheet.NamedInputCell") | [`InputCellRange`](#InputCellRange "viktor.external.spreadsheet.InputCellRange")]) – The cells to fill the file with.
- *classmethod *from\_path(*file\_path*, *input\_cells*)[](#SpreadsheetTemplate.from_path "Link to this definition")
* Parameters:
* **file\_path** (`str` | `bytes` | `PathLike`) – Complete path including extension
* **input\_cells** (`List`\[[`DirectInputCell`](#DirectInputCell "viktor.external.spreadsheet.DirectInputCell") | [`NamedInputCell`](#NamedInputCell "viktor.external.spreadsheet.NamedInputCell") | [`InputCellRange`](#InputCellRange "viktor.external.spreadsheet.InputCellRange")]) – The cells to fill the file with
* Return type:
[`SpreadsheetTemplate`](#SpreadsheetTemplate "viktor.external.spreadsheet.SpreadsheetTemplate")
* render()[](#SpreadsheetTemplate.render "Link to this definition")
This function renders the SpreadsheetTemplate with cells. It returns a SpreadsheetResult object of the filled template.
* Return type:
[`SpreadsheetResult`](#SpreadsheetResult "viktor.external.spreadsheet.SpreadsheetResult")
* Returns:
a SpreadsheetResult object containing the filled template
- *property *result*: [SpreadsheetResult](#SpreadsheetResult "viktor.external.spreadsheet.SpreadsheetResult")*[](#SpreadsheetTemplate.result "Link to this definition")
## render\_spreadsheet[](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#_render_spreadsheet "Direct link to render_spreadsheet")
* viktor.external.spreadsheet.render\_spreadsheet(*template*, *cells*)[](#render_spreadsheet "Link to this definition")
Fill spreadsheet with values/text. This can be done both with direct cells (e.g. A2), or named cells.
Example usage:
```
cells = [
DirectInputCell('sheet1', 'A', 1, 5),
NamedInputCell('named_cell_1', 'text_to_be_placed'),
]
template_path = Path(__file__).parent / 'my' / 'relative' / 'path' / 'template.xlsx'
with open(template_path, 'rb') as template:
filled_spreadsheet = render_spreadsheet(template, cells)
```
* Parameters:
* **template** (`BinaryIO`) – spreadsheet template file
* **cells** (`List`\[[`DirectInputCell`](#DirectInputCell "viktor.external.spreadsheet.DirectInputCell") | [`NamedInputCell`](#NamedInputCell "viktor.external.spreadsheet.NamedInputCell") | [`InputCellRange`](#InputCellRange "viktor.external.spreadsheet.InputCellRange")]) – cells to fill the template with
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* Returns:
File object containing the rendered spreadsheet
## stringify\_value[](https://docs.viktor.ai/sdk/api/external/spreadsheet/.md#_stringify_value "Direct link to stringify_value")
* viktor.external.spreadsheet.stringify\_value(*value*)[](#stringify_value "Link to this definition")
Function that will create the correct string representation of python data types, in order for ‘value’ to be inserted in Excel correctly.
* Parameters:
**value** (`bool` | `int` | `str` | `float`) – the value to be stringified.
* Return type:
`str`
* Returns:
a string representation of value.
---
# viktor.external.tekla
## TeklaAnalysis[](https://docs.viktor.ai/sdk/api/external/tekla/.md#_TeklaAnalysis "Direct link to TeklaAnalysis")
* *class *viktor.external.tekla.TeklaAnalysis(*script=None*, *script\_key=''*, *files=None*, *output\_filenames=None*)[](#TeklaAnalysis "Link to this definition")
Bases: [`PythonAnalysis`](https://docs.viktor.ai/sdk/api/external/python/.md#PythonAnalysis "viktor.external.python.PythonAnalysis")
New in 14.17.0
TeklaAnalysis can be used to evaluate a tekla-python script on third-party infrastructure. The script is expected to be blocking, i.e. if the script is invoked from command prompt, it should wait until the executable is finished. The default behaviour, is that the python script is defined within the app and send to the worker to be executed on third-party infrastructure. If desired (due to security considerations) the worker can be configured to only run local scripts. These scripts must be defined the in worker configuration file and can be selected through the script\_key.
Usage:
```
script = vkt.File.from_path(Path(__file__).parent / "run_tekla.py")
files = [
('input1.txt', file1),
]
analysis = TeklaAnalysis(script=script, files=files, output_filenames=["output.txt"])
analysis.execute(timeout=60)
output_file = analysis.get_output_file("output.txt")
```
Exceptions which can be raised during calculation:
> * [`viktor.errors.LicenseError`](https://docs.viktor.ai/sdk/api/errors/.md#LicenseError "viktor.errors.LicenseError"): no license available
>
> * [`viktor.errors.ExecutionError`](https://docs.viktor.ai/sdk/api/errors/.md#ExecutionError "viktor.errors.ExecutionError"): generic error. Error message provides more information
* Parameters:
* **script** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Script file that is transferred to the working directory on the server.
* **script\_key** (`str`) – The key of the script that needs to be run. Only use this when the worker is configured to run local scripts. This key should be present in the configuration file of the worker.
* **files** (`List`\[`Tuple`\[`str`, `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]]) – Additional files that are transferred to the working directory on the server. Each file is a tuple containing the content and the filename which is used to save on the infrastructure.
* **output\_filenames** (`List`\[`str`]) – A list of filenames (including extension) that are to be transferred back to the app. This filename is relative to the working directory.
Either one of ‘script’ or ‘script\_key’ should be defined.
* Raises:
**ValueError** – when neither ‘script’ or ‘script\_key’ is included OR when both are included.
---
# viktor.external.word
## WordFileComponent[](https://docs.viktor.ai/sdk/api/external/word/.md#_WordFileComponent "Direct link to WordFileComponent")
* *class *viktor.external.word.WordFileComponent(*identifier*)[](#WordFileComponent "Link to this definition")
Bases: `ABC`
Abstract base class for specific word file components, such as tags, images…
## WordFileImage[](https://docs.viktor.ai/sdk/api/external/word/.md#_WordFileImage "Direct link to WordFileImage")
* *class *viktor.external.word.WordFileImage(*file*, *identifier*, *width=None*, *height=None*)[](#WordFileImage "Link to this definition")
Bases: [`WordFileComponent`](#WordFileComponent "viktor.external.word.WordFileComponent")
Add an image in a Word file template. When neither width or height is provided, the original size is used. When only one is provided, the other is scaled. When both are provided, both are used and the original aspect ratio might be changed.
* Parameters:
* **file** (`BinaryIO`) – image to be placed at the tag location
* **identifier** (`str`) – used to find the location in the template
* **width** (`int`) – optional parameter for sizing. in Pt
* **height** (`int`) – optional parameter for sizing. in Pt
- *classmethod *from\_path(*file\_path*, *identifier*, *width=None*, *height=None*)[](#WordFileImage.from_path "Link to this definition")
Create a WordFileImage from an image defined by its file path.
* Return type:
[`WordFileImage`](#WordFileImage "viktor.external.word.WordFileImage")
## WordFileResult[](https://docs.viktor.ai/sdk/api/external/word/.md#_WordFileResult "Direct link to WordFileResult")
* *class *viktor.external.word.WordFileResult(*\**, *file\_content=None*)[](#WordFileResult "Link to this definition")
* *property *file\_content*: bytes*[](#WordFileResult.file_content "Link to this definition")
## WordFileTag[](https://docs.viktor.ai/sdk/api/external/word/.md#_WordFileTag "Direct link to WordFileTag")
* *class *viktor.external.word.WordFileTag(*identifier*, *value*)[](#WordFileTag "Link to this definition")
Bases: [`WordFileComponent`](#WordFileComponent "viktor.external.word.WordFileComponent")
Add a value in a Word file template by tag.
* Parameters:
* **identifier** (`str`) – used to find the location in the template
* **value** (`str` | `int` | `float` | `bool` | `None` | `list` | `dict`) – what needs to be placed at the tag location. A scalar (str, int, float, bool, None) fills a single value; a list or dict (optionally nested) is iterated over, e.g. to fill repeating table rows.
## WordFileTemplate[](https://docs.viktor.ai/sdk/api/external/word/.md#_WordFileTemplate "Direct link to WordFileTemplate")
* *class *viktor.external.word.WordFileTemplate(*file*, *components*)[](#WordFileTemplate "Link to this definition")
Note
Prefer to use the function [`render_word_file()`](#render_word_file "viktor.external.word.render_word_file") instead.
Fill wordfile template with components (e.g. text, image).
Note that the template file should be a BytesIO object of a .docx file (not .doc).
Example usage:
```
>>> file = BytesIO(b'file')
>>> image = BytesIO(b'image')
>>>
>>> tags = [
>>> WordFileTag('x', 1),
>>> WordFileTag('y', 2),
>>> WordFileImage(image, 'fig_tag', width=300),
>>> ]
>>> word_file_template = WordFileTemplate(file, tags)
>>> result = word_file_template.render()
>>> word_file = result.file_content
```
* Parameters:
* **file** (`BytesIO`) – BytesIO object of the Word template
* **components** (`List`\[[`WordFileComponent`](#WordFileComponent "viktor.external.word.WordFileComponent")]) – items that need to be inserted in the template
- *classmethod *from\_path(*file\_path*, *components*)[](#WordFileTemplate.from_path "Link to this definition")
* Parameters:
* **file\_path** (`str` | `bytes` | `PathLike`) – Complete path including extension
* **components** (`List`\[[`WordFileComponent`](#WordFileComponent "viktor.external.word.WordFileComponent")]) – items that need to be inserted in the template
* Return type:
[`WordFileTemplate`](#WordFileTemplate "viktor.external.word.WordFileTemplate")
* render()[](#WordFileTemplate.render "Link to this definition")
This function renders the docx template and returns the resulting file.
Note
This method needs to be mocked in (automated) unit and integration tests.
* Return type:
[`WordFileResult`](#WordFileResult "viktor.external.word.WordFileResult")
- *property *result*: [WordFileResult](#WordFileResult "viktor.external.word.WordFileResult")*[](#WordFileTemplate.result "Link to this definition")
## render\_word\_file[](https://docs.viktor.ai/sdk/api/external/word/.md#_render_word_file "Direct link to render_word_file")
* viktor.external.word.render\_word\_file(*template*, *components*)[](#render_word_file "Link to this definition")
Fill Word file with components (e.g. text, image).
Example usage:
```
components = [
WordFileTag('x', 1),
WordFileImage(image, 'fig_tag', width=300),
]
template_path = Path(__file__).parent / 'my' / 'relative' / 'path' / 'template.docx'
with open(template_path, 'rb') as template:
word_file = render_word_file(template, components)
```
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
* **template** (`BinaryIO`) – Word file template of type .docx (not .doc)
* **components** (`List`\[[`WordFileComponent`](#WordFileComponent "viktor.external.word.WordFileComponent")]) – components to fill the template with
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* Returns:
File object containing the rendered Word file
* Raises:
[`viktor.errors.WordFileError`](https://docs.viktor.ai/sdk/api/errors/.md#WordFileError "viktor.errors.WordFileError") when rendering fails
---
# viktor.geo
## GEFData[](https://docs.viktor.ai/sdk/api/geo/.md#_GEFData "Direct link to GEFData")
* *class *viktor.geo.GEFData(*gef\_dict*)[](#GEFData "Link to this definition")
Initialize GEFData object to simplify working with GEF data. Every GEF has different header fields, and therefore only a limited amount of fields is compulsory. All other header fields are also added as attribute. Compulsory header fields are:
> * name
>
> * ground\_level\_wrt\_reference
Other header fields might be compulsory for methods on the object (e.g. get\_cone\_visualization). See docstring of the specific method for needed headers.
The following measurement\_data fields are also compulsory and are implicitly parsed from the file (do NOT need to be specified explicitly):
> * elevation
>
> * qc
>
> * Rf
Examples of optional attributes from header are:
> * height\_system
>
> * project\_name
>
> * project\_id
>
> * gef\_file\_date
>
> * gef\_version\_number
>
> * x\_y\_coordinates
>
> * coordinate\_system
>
> * excavation\_depth
>
> * measurement\_standard
>
> * surface\_area\_quotient\_tip
>
> * water\_level
>
> * cone\_tip\_area
>
> * cone\_type
Measurement\_data fields that are optional are:
> * u2
>
> * fs
>
> * penetration\_length
>
> * corrected\_depth
>
> * inclination
>
> * inclination\_n\_s
>
> * inclination\_e\_w
Example implementation to create GEFData object:
```
import viktor as vkt
class GEFFileController(vkt.Controller):
...
@vkt.ParamsFromFile(file_types=['.gef'])
def process_file(self, file, **kwargs) -> dict:
file_content = file.getvalue(encoding="ISO-8859-1")
gef_file = vkt.geo.GEFFile(file_content)
gef_data_object = gef_file.parse(additional_columns=['elevation', 'qc', 'Rf', 'fs', 'u2'],
return_gef_data_obj=True)
gef_dict = gef_data_object.serialize()
return {'gef_dict': gef_dict}
def get_gef_content_from_database(self) -> vkt.geo.GEFData:
# API call to right entity
return vkt.geo.GEFData(gef_file_entity.last_saved_params['gef_dict'])
```
* Parameters:
**gef\_dict** (`dict` | `Munch`) – dictionary with \[‘headers’] and \[‘measurement\_data’] keys
- classify(*method*, *return\_soil\_layout\_obj=True*)[](#GEFData.classify "Link to this definition")
Create SoilLayout object or dictionary by classifying the GEF measurement data, using either the Robertson method or a qualification table method.
**RobertsonMethod**
This method requires the GEFData object to at least contain the measurement data ‘corrected\_depth’. See [`GEFData`](#GEFData "viktor.geo.GEFData") for all possible measurement data columns.
```
from viktor.geo import RobertsonMethod
soil_properties = [
{'name': 'Robertson zone unknown', 'extra_property1': 1, 'extra_property2': 2},
{'name': 'Robertson zone 1', 'extra_property1': 3, 'extra_property2': 4},
]
classification_method = RobertsonMethod(soil_properties)
soil_layout_dict = gef_data.classify(method=classification_method, return_soil_layout_obj=False)
```
**TableMethod**
For this method a qualification table has to be provided by the user, for example through a VIKTOR editor. Please refer to the docstring of [`TableMethod`](#TableMethod "viktor.geo.TableMethod") for the structure of this table.
This table is usually controlled on a project-wide level, so in a parent entity. On the controller of the GEF file, you can use the API to retrieve the table content and pass it to the TableMethod:
```
import viktor as vkt
api = vkt.api_v1.API()
parent_entity = api.get_entity(entity_id).parent()
parent_params = parent.last_saved_params
qualification_table = parent_params['material_properties']
ground_water_level = parent_params['ground_water_level']
classification_method = vkt.geo.TableMethod(qualification_table, ground_water_level)
soil_layout_obj = gef_data.classify(method=classification_method, return_soil_layout_obj=False)
```
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
* **method** (`_ClassificationMethod`) – Specifies which method should be used for qualification: TableMethod | RobertsonMethod | NormalizedSoilBehaviourTypeIndexMethod.
* **return\_soil\_layout\_obj** (`bool`) – Flag to return SoilLayout object or dictionary
* Return type:
`dict` | [`SoilLayout`](#SoilLayout "viktor.geo.SoilLayout")
* Returns:
SoilLayout object or dictionary (=SoilLayout.serialize())
* get\_cone\_visualization(*axes*)[](#GEFData.get_cone_visualization "Link to this definition")
Modify (clean/empty) ‘axes’ input argument to plot cone resistance (with pore pressure if present in GEF data).
* Parameters:
**axes** (`Axes`) – Axes object that will be modified.
* Return type:
`None`
The following header fields are compulsory and need to be specified when the GEFData object is created:
> * max\_measurement\_depth\_wrt\_reference
>
> * ground\_level\_wrt\_reference
>
> * height\_system
Example usage:
```
import matplotlib.pyplot as plt
# Create main figure
fig = plt.figure(figsize=(8.27, 11.69))
# Define contour (rectangle) for cone visualization, and create Axes object that can be modified by
# functions
rect_cone = [0.1, 0.1, 0.4, 0.9] # [left, bottom, width, height]
cone_axes = plt.axes(rect_cone)
# Modify created Axes objects
self.gef_data.get_cone_visualization(cone_axes)
# Convert to SVG for visualization
svg_data = StringIO()
fig.savefig(svg_data, format='svg', bbox_inches='tight', pad_inches=0.8)
plt.close()
gef_visualisation_data = svg_data.getvalue()
```
- get\_plotted\_denotation\_large\_qc\_values(*axes*, *x\_loc\_text*)[](#GEFData.get_plotted_denotation_large_qc_values "Link to this definition")
Can be used to add text labels with the maximum qc value of a layer that exceeds the maximum value of the x-axis.
* Parameters:
* **axes** (`Axes`) – Axes object that will be modified.
* **x\_loc\_text** (`float`) – Maximum qc value.
* Return type:
`None`
The following header fields are compulsory and need to be specified when the GEFData object is created:
> * max\_measurement\_depth\_wrt\_reference
An example is shown below where the figure is capped at a maximum qc of 30 MPa (hence x\_loc\_text=30).
[](https://docs.viktor.ai/_images/gefdata_plot_large_qc.svg)
* get\_resistance\_visualization(*axes*)[](#GEFData.get_resistance_visualization "Link to this definition")
Modify (clean/empty) ‘axes’ input argument to plot resistance number.
* Parameters:
**axes** (`Axes`) – Axes object that will be modified.
* Return type:
`None`
The following header fields are compulsory and need to be specified when the GEFData object is created:
> * max\_measurement\_depth\_wrt\_reference
>
> * ground\_level\_wrt\_reference
Example usage:
```
import matplotlib.pyplot as plt
# Create main figure
fig = plt.figure(figsize=(8.27, 11.69))
# Define contour (rectangle) for resistance number visualization, and create Axes object that can be
# modified by functions
rect_resistance = [0.1, 0.1, 0.4, 0.9] # [left, bottom, width, height]
resistance_axes = plt.axes(rect_resistance)
# Modify created Axes objects
self.gef_data.get_resistance_visualization(resistance_axes)
# Convert to SVG for visualization
svg_data = StringIO()
fig.savefig(svg_data, format='svg', bbox_inches='tight', pad_inches=0.8)
plt.close()
gef_visualisation_data = svg_data.getvalue()
```
- serialize()[](#GEFData.serialize "Link to this definition")
* Return type:
`dict` | `Munch`
## GEFFile[](https://docs.viktor.ai/sdk/api/geo/.md#_GEFFile "Direct link to GEFFile")
* *class *viktor.geo.GEFFile(*file\_content*)[](#GEFFile "Link to this definition")
* *classmethod *from\_file(*file\_path*, *encoding='ISO-8859-1'*)[](#GEFFile.from_file "Link to this definition")
* Return type:
[`GEFFile`](#GEFFile "viktor.geo.GEFFile")
- parse(*additional\_columns=None*, *verbose=True*, *return\_gef\_data\_obj=True*)[](#GEFFile.parse "Link to this definition")
Parse GEFFile, and return information from GEF in dict with \[‘headers’] and \[‘measurement data’] sub-dicts or a GEFData object.
Example implementation:
```
import viktor as vkt
class GEFFileController(vkt.Controller):
...
@vkt.ParamsFromFile(file_types=['.gef'])
def process_file(self, file, **kwargs) -> dict:
file_content = file.getvalue(encoding="ISO-8859-1")
gef_file = vkt.geo.GEFFile(file_content)
gef_data_obj = gef_file.parse(additional_columns=['fs', 'u2'], return_gef_data_obj=True)
soil_properties = [
{'name': Robertson zone unknown, 'extra_property1': 1, 'extra_property2': 2},
{'name': Robertson zone 1, 'extra_property1': 3, 'extra_property2': 4},
]
soil_layout_dict = gef_data_obj.classify(method=vkt.geo.RobertsonMethod(soil_properties), return_soil_layout_obj=False)
parsed_dict = gef_data_obj.serialize()
parsed_dict['soils'] = soil_layout_dict
return parsed_dict
```
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
* **additional\_columns** (`List`\[`str`]) –
In order for a GEF file to be of use in VIKTOR, three columns are required:
* elevation (corrected depth with respect to a specified datum)
* qc (tip pressure as measured)
* Rf (friction number, either measured or computed using qc and fs)
These three columns will always be parsed and returned, additional columns can be parsed as well. Possible columns to request are:
* ”penetration\_length”
* ”corrected\_depth”
* ”fs”
* ”u2” (for more accuracy when qualifying layers using Robertson method)
* ”inclination”
* ”inclination\_n\_s”
* ”inclination\_e\_w”
* **verbose** (`bool`) – Boolean specifying if parsing should output warnings or work in silence
* **return\_gef\_data\_obj** (`bool`) – Boolean to return GEFData or dictionary
* Return type:
`dict` | [`GEFData`](#GEFData "viktor.geo.GEFData")
* Returns:
dictionary with GEF parameters or GEFData object with GEF parameters as attributes
## NormalizedSoilBehaviourTypeIndexMethod[](https://docs.viktor.ai/sdk/api/geo/.md#_NormalizedSoilBehaviourTypeIndexMethod "Direct link to NormalizedSoilBehaviourTypeIndexMethod")
* *class *viktor.geo.NormalizedSoilBehaviourTypeIndexMethod(*ic\_table*, *ground\_water\_level*, *specific\_weight\_soil*, *resolution=None*)[](#NormalizedSoilBehaviourTypeIndexMethod "Link to this definition")
Bases: `_ClassificationMethod`
Class to classify soil based on the normalized soil behaviour type index
Example:
```
ic_table = [
{'name': 'Zand', 'color': '0, 50, 255', 'ic_min': 0, 'ic_max': 3.5},
{'name': 'Klei', 'color': '80, 70, 25', 'ic_min': 3.5, 'cone_factor': 20},
]
ground_water_level = 0
specific_weight_soil = 17
method = NormalizedSoilBehaviourTypeIndexMethod(ic_table, ground_water_level, specific_weight_soil)
```
This method uses the assumption that the specific weight of all the soil layers is the same, this is a simplification. It is possible to calculate the specific weight from qc values.
* Parameters:
* **ic\_table** (`List`\[`dict`]) – Table with soil types that correspond to Ic values. Keys: name, ic\_min, ic\_max, color, cone\_factor
* **ground\_water\_level** (`float`) – Ground water level used to compute qc\_norm
* **specific\_weight\_soil** (`float`) – Specific weight of soil in kN/m^3 used to calculate sigma’
* **resolution** (`float`) – Resolution of the classification in m; if None classify each line of data
- get\_method\_params()[](#NormalizedSoilBehaviourTypeIndexMethod.get_method_params "Link to this definition")
* Return type:
`dict`
## PiezoLine[](https://docs.viktor.ai/sdk/api/geo/.md#_PiezoLine "Direct link to PiezoLine")
* *class *viktor.geo.PiezoLine(*points*, *phreatic=False*)[](#PiezoLine "Link to this definition")
Bases: [`Polyline`](https://docs.viktor.ai/sdk/api/geometry/.md#Polyline "viktor.geometry.Polyline")
Class to represent a Piezo line.
Essentially, this is a polyline with a flag added to mark the phreatic polyline.
* Parameters:
* **points** (`List`\[[`Point`](https://docs.viktor.ai/sdk/api/geometry/.md#Point "viktor.geometry.Point")]) – points of the polyline
* **phreatic** (`bool`) – mark the phreatic waterline
- *classmethod *from\_dict(*piezo\_line\_dict*)[](#PiezoLine.from_dict "Link to this definition")
* Return type:
[`PiezoLine`](#PiezoLine "viktor.geo.PiezoLine")
* *classmethod *from\_lines(*lines*, *phreatic=False*)[](#PiezoLine.from_lines "Link to this definition")
create a polyline object from a list of lines the end of one line must always coincide with the start of the next
* Parameters:
* **lines** (`List`\[[`Line`](https://docs.viktor.ai/sdk/api/geometry/.md#Line "viktor.geometry.Line") | [`Polyline`](https://docs.viktor.ai/sdk/api/geometry/.md#Polyline "viktor.geometry.Polyline")])
* **phreatic** (`bool`)
* Return type:
[`PiezoLine`](#PiezoLine "viktor.geo.PiezoLine")
- serialize()[](#PiezoLine.serialize "Link to this definition")
Return a json serializable dict of form:
```
[
{'x': point_1.x, 'y': point_1.y},
{'x': point_2.x, 'y': point_2.y}
]
```
* Return type:
`dict`
## PositionalSoilLayout[](https://docs.viktor.ai/sdk/api/geo/.md#_PositionalSoilLayout "Direct link to PositionalSoilLayout")
* *class *viktor.geo.PositionalSoilLayout(*x*, *soil\_layers*)[](#PositionalSoilLayout "Link to this definition")
Bases: [`SoilLayout`](#SoilLayout "viktor.geo.SoilLayout")
A subclass of SoilLayout that adds an x location. This can be useful to generate a Soil Layout 2D
Generate a positional soil layout from an x location and a list of soil layers
* Parameters:
* **x** (`float`)
* **soil\_layers** (`List`\[[`SoilLayer`](#SoilLayer "viktor.geo.SoilLayer")])
- *classmethod *from\_dict(*positional\_soil\_layout\_dict*)[](#PositionalSoilLayout.from_dict "Link to this definition")
Instantiates a PositionalSoilLayout from the provided soil layout data.
* Parameters:
**positional\_soil\_layout\_dict** (`dict` | `Munch`) – Soil layout data.
* Return type:
[`PositionalSoilLayout`](#PositionalSoilLayout "viktor.geo.PositionalSoilLayout")
* serialize()[](#PositionalSoilLayout.serialize "Link to this definition")
Generate a JSON serializable dict from this positional soil layout.
* Return type:
`dict`
## RobertsonMethod[](https://docs.viktor.ai/sdk/api/geo/.md#_RobertsonMethod "Direct link to RobertsonMethod")
* *class *viktor.geo.RobertsonMethod(*soil\_properties*)[](#RobertsonMethod "Link to this definition")
Bases: `_ClassificationMethod`
Class to pass Robertson specific properties such as soil\_properties. Every list element at least requires a ‘name’ key that specifies the RobertsonZone. It is important that ‘name’ key matches with hardcoded RobertsonZone.name property. There are 9 Robertson zones and 1 Robertson zone unknown that can be specified
By default, the colors as defined in (red, green, blue) for each zone are as shown in this figure:
[](https://docs.viktor.ai/_images/robertson_colors.png)
Example:
```
soil_properties = [
{'name': 'Robertson zone unknown', 'extra_property1': 1, 'extra_property2': 2},
{'name': 'Robertson zone 1', 'extra_property1': 3, 'extra_property2': 4},
]
method = RobertsonMethod(soil_properties)
```
* Parameters:
**soil\_properties** (`List`\[`dict`]) – dictionary with soil properties
- get\_method\_params()[](#RobertsonMethod.get_method_params "Link to this definition")
* Return type:
`dict`
## Soil[](https://docs.viktor.ai/sdk/api/geo/.md#_Soil "Direct link to Soil")
* *class *viktor.geo.Soil(*name*, *color*, *properties=None*)[](#Soil "Link to this definition")
Set name and color of Soil material. Extra properties can be added with dictionary, and keys are added as attribute via ‘munchify’. They are accessible as self.properties.{extra\_property\_name}
* Parameters:
* **name** (`str`)
* **color** ([`Color`](https://docs.viktor.ai/sdk/api/core/.md#Color "viktor.core.Color")) – color of soil used in plots
* **properties** (`dict` | `Munch`) – dict with optional extra parameters to be added to Soil
- *property *color*: [Color](https://docs.viktor.ai/sdk/api/core/.md#Color "viktor.core.Color")*[](#Soil.color "Link to this definition")
* *classmethod *from\_dict(*d*)[](#Soil.from_dict "Link to this definition")
* Return type:
[`Soil`](#Soil "viktor.geo.Soil")
- serialize()[](#Soil.serialize "Link to this definition")
Serialize Soil in following dictionary structure:
```
{
'name',
'color',
'properties': {
(..extra_properties..)
},
}
```
* Return type:
`dict`
* Returns:
dictionary with all properties of Soil
* update\_properties(*properties*)[](#Soil.update_properties "Link to this definition")
Replace the current properties dict with the provided new one.
For backwards compatibility, this function is kept with this functionality. In order to be able to update the existing properties dict, the properties property is public and mutable.
* Parameters:
**properties** (`dict` | `Munch`) – dictionary with all SoilLayer properties
* Return type:
`None`
## SoilLayer[](https://docs.viktor.ai/sdk/api/geo/.md#_SoilLayer "Direct link to SoilLayer")
* *class *viktor.geo.SoilLayer(*soil*, *top\_of\_layer*, *bottom\_of\_layer*, *properties=None*)[](#SoilLayer "Link to this definition")
Create a SoilLayer to be used in SoilLayout
* Parameters:
* **soil** ([`Soil`](#Soil "viktor.geo.Soil")) – Type of soil
* **top\_of\_layer** (`float`) – Top of layer
* **bottom\_of\_layer** (`float`) – Bottom of layer
* **properties** (`dict` | `Munch`) – dict with optional extra parameters to be added to SoilLayer
- *classmethod *from\_dict(*soil\_layer\_dict*)[](#SoilLayer.from_dict "Link to this definition")
* Return type:
[`SoilLayer`](#SoilLayer "viktor.geo.SoilLayer")
* serialize()[](#SoilLayer.serialize "Link to this definition")
Serialize SoilLayer in following dictionary structure:
```
{
'soil',
'top_of_layer',
'bottom_of_layer',
}
```
* Return type:
`dict`
* Returns:
dictionary with properties of SoilLayer
- *property *thickness*: float*[](#SoilLayer.thickness "Link to this definition")
* update\_properties(*properties*)[](#SoilLayer.update_properties "Link to this definition")
Replace the current properties dict with the provided new one.
For backwards compatibility, this function is kept with this functionality. In order to be able to update the existing properties dict, the properties property is public and mutable.
* Parameters:
**properties** (`dict` | `Munch`) – dictionary with all SoilLayer properties
* Return type:
`None`
- update\_soil\_properties(*properties*)[](#SoilLayer.update_soil_properties "Link to this definition")
* Return type:
`None`
## SoilLayer2D[](https://docs.viktor.ai/sdk/api/geo/.md#_SoilLayer2D "Direct link to SoilLayer2D")
* *class *viktor.geo.SoilLayer2D(*soil*, *top\_profile*, *bottom\_profile*, *properties=None*, *piezo\_line\_top=None*, *piezo\_line\_bottom=None*)[](#SoilLayer2D "Link to this definition")
A 2D representation of a soil layer
A Soil layer 2d always consists of a soil and a top and bottom profile Optionally, properties and top and bottom pl lines can be added
Top and bottom profiles need to be monotonic ascending in x-direction Top and bottom profiles need to have identical start x and end x coordinates. These will become the left and right boundaries
Top and bottom profiles can overlap, but not intersect. The layer can have one or multiple ranges with zero thickness, but the top profile may never lie below the bottom profile
* Parameters:
* **soil** ([`Soil`](#Soil "viktor.geo.Soil"))
* **top\_profile** ([`Polyline`](https://docs.viktor.ai/sdk/api/geometry/.md#Polyline "viktor.geometry.Polyline"))
* **bottom\_profile** ([`Polyline`](https://docs.viktor.ai/sdk/api/geometry/.md#Polyline "viktor.geometry.Polyline"))
* **properties** (`dict` | `Munch`)
* **piezo\_line\_top** ([`PiezoLine`](#PiezoLine "viktor.geo.PiezoLine"))
* **piezo\_line\_bottom** ([`PiezoLine`](#PiezoLine "viktor.geo.PiezoLine"))
- bottom\_y\_coordinate(*x*)[](#SoilLayer2D.bottom_y_coordinate "Link to this definition")
Determine the y-coordinate along the bottom boundary, belonging to the x value used as input
If a profile has a vertical section on the given x-location, this method will return the first touching point of the polyline with the vertical line
* Parameters:
**x** (`float`) – The x-coordinate where the height is requested.
* Return type:
`float`
* Returns:
The y-coordinate of the top at the x-coordinate location.
* *classmethod *from\_dict(*soil\_layer\_dict*)[](#SoilLayer2D.from_dict "Link to this definition")
Instantiates a SoilLayer2D from the provided soil layer data.
dict structure:
```
{
'soil': serialized Soil
'top_profile': serialized Polyline
'bottom_profile': serialized Polyline
'piezo_line_top': serialized PiezoLine
'piezo_line_bottom': serialized PiezoLine
'properties': Dict
}
```
* Parameters:
**soil\_layer\_dict** (`dict` | `Munch`) – Soil layer data.
* Return type:
[`SoilLayer2D`](#SoilLayer2D "viktor.geo.SoilLayer2D")
- height\_at\_x(*x*)[](#SoilLayer2D.height_at_x "Link to this definition")
Returns the height at a specific x location.
If a profile has a vertical section on the given x-location, this method will return the first touching point of the polyline with the vertical line
* Parameters:
**x** (`float`) – The x-coordinate where the height is requested.
* Return type:
`float`
* Returns:
The height at the x-coordinate location.
* *property *left\_boundary*: float*[](#SoilLayer2D.left_boundary "Link to this definition")
- polygons()[](#SoilLayer2D.polygons "Link to this definition")
Generate a list of polygons representing this soil layer.
For every region of this soil layout that has a non-zero thickness, a polygon is generated.
* Return type:
`List`\[[`Polygon`](https://docs.viktor.ai/sdk/api/geometry/.md#Polygon "viktor.geometry.Polygon")]
* *property *right\_boundary*: float*[](#SoilLayer2D.right_boundary "Link to this definition")
- serialize()[](#SoilLayer2D.serialize "Link to this definition")
Serialize SoilLayer in following dictionary structure:
```
{
'soil': Soil
'top_profile': Polyline
'bottom_profile': Polyline
'piezo_line_top': serialized PiezoLine
'piezo_line_bottom': serialized PiezoLine
'properties': Dict
}
```
* Return type:
`dict`
* Returns:
dictionary with properties of SoilLayer
* top\_y\_coordinate(*x*)[](#SoilLayer2D.top_y_coordinate "Link to this definition")
Determine the y-coordinate along the top boundary, belonging to the x value used as input
If a profile has a vertical section on the given x-location, this method will return the first touching point of the polyline with the vertical line
* Parameters:
**x** (`float`) – The x-coordinate where the height is requested.
* Return type:
`float`
* Returns:
The y-coordinate of the top at the x-coordinate location.
- update\_properties(*properties*)[](#SoilLayer2D.update_properties "Link to this definition")
Replace the current properties dict with the provided new one.
For backwards compatibility, this function is kept with this functionality. In order to be able to update the existing properties dict, the properties property is public and mutable.
* Parameters:
**properties** (`dict` | `Munch`) – dictionary with all SoilLayer properties
* Return type:
`None`
* Returns:
* update\_soil\_properties(*properties*)[](#SoilLayer2D.update_soil_properties "Link to this definition")
Replace the current soil properties dict with a new one
* Parameters:
**properties** (`dict` | `Munch`)
* Return type:
`None`
* Returns:
- visualize\_geometry(*visualize\_border=False*, *opacity=1*, *material=None*)[](#SoilLayer2D.visualize_geometry "Link to this definition")
Returns the visualization elements (group, labels) of the SoilLayer2D which can be used in a GeometryView.
* Parameters:
* **visualize\_border** (`bool`) – visualize the border surrounding this soil layout with an extra line.
* **opacity** (`float`) – float between 0 (transparent) - 1 (opaque)
* **material** ([`Material`](https://docs.viktor.ai/sdk/api/geometry/.md#Material "viktor.geometry.Material")) – optional material to be applied on the geometry.
* Return type:
`Tuple`\[[`Group`](https://docs.viktor.ai/sdk/api/geometry/.md#Group "viktor.geometry.Group"), `List`\[[`Label`](https://docs.viktor.ai/sdk/api/views/.md#Label "viktor.views.Label")]]
## SoilLayout[](https://docs.viktor.ai/sdk/api/geo/.md#_SoilLayout "Direct link to SoilLayout")
* *class *viktor.geo.SoilLayout(*soil\_layers*)[](#SoilLayout "Link to this definition")
Aggregation object of SoilLayer
* Parameters:
**soil\_layers** (`List`\[[`SoilLayer`](#SoilLayer "viktor.geo.SoilLayer")]) – list of SoilLayer objects
- append(*layer*)[](#SoilLayout.append "Link to this definition")
Add a layer to the bottom of the classification
* Parameters:
**layer** ([`SoilLayer`](#SoilLayer "viktor.geo.SoilLayer")) – SoilLayer instance
* Return type:
`None`
* *property *bottom*: float*[](#SoilLayout.bottom "Link to this definition")
Height level of the bottom of the layout.
- filter\_layers\_on\_thickness(*min\_layer\_thickness*, *merge\_adjacent\_same\_soil\_layers=False*)[](#SoilLayout.filter_layers_on_thickness "Link to this definition")
Collects layers that are thinner than min\_layer\_thickness in groups, and replaces them by one of two things:
> * If the group is thinner than min\_layer\_thickness, it is removed from the soil layout and the layer above it is elongated to fill the gap. See explanation figure, situation A.
>
> * If the group is equal to or thicker than min\_layer\_thickness, a new layer with Soil and properties of the most dominant (based cumulative thickness) soiltype occurring within this block of layers that was replaced by the new layer. See explanation figure, situation B.
After all replacements have been made, if merge\_adjacent\_same\_soil\_layers is specified as True (default is False), `_merge_adjacent_same_soil_layers()` is called, which merges adjacent soil layers that have the same soiltype and have the same set of parameters. Note that this merging results in a new layer that has the average value for all soil layer properties present in the layers that were merged. See the docstring of `_merge_adjacent_same_soil_layers()` for more detailed information about how this is done.
* Parameters:
* **min\_layer\_thickness** (`float`) – Minimum thickness
* **merge\_adjacent\_same\_soil\_layers** (`bool`) – Try to merge adjacent layers that have the same soil type
* Return type:
[`SoilLayout`](#SoilLayout "viktor.geo.SoilLayout")
Note: this method alters the instance!
[](https://docs.viktor.ai/_images/soil_layout_filtering_explanation.svg)
* filter\_unique\_soils()[](#SoilLayout.filter_unique_soils "Link to this definition")
* Return type:
`List`\[[`Soil`](#Soil "viktor.geo.Soil")]
- *classmethod *from\_dict(*soil\_layout\_dict*)[](#SoilLayout.from_dict "Link to this definition")
Create SoilLayout with dictionary from SoilLayout.serialize(). Useful when SoilLayout needs to be created from dictionary from the database.
Example usage:
```
class Controller(vkt.Controller):
...
def get_soil_layout_from_database(self) -> vkt.geo.SoilLayout:
# API call to entity that stores complete SoilLayout
layout_dict = entity.last_saved_params['layout_dict']
soil_layout = vkt.geo.SoilLayout.from_dict(layout_dict)
return soil_layout
```
* Parameters:
**soil\_layout\_dict** (`Dict`\[`str`, `List`] | `Munch`) – dictionary with same structure as SoilLayout.serialize()
* Return type:
[`SoilLayout`](#SoilLayout "viktor.geo.SoilLayout")
* get\_visualization(*axes*)[](#SoilLayout.get_visualization "Link to this definition")
Modify (clean/empty) ‘axes’ input argument to plot SoilLayout structure. Layers must be sorted from top to bottom.
* Parameters:
**axes** (`Axes`) – Axes object that will be modified
* Return type:
`None`
- *property *number\_of\_layers*: int*[](#SoilLayout.number_of_layers "Link to this definition")
Number of layers
* serialize()[](#SoilLayout.serialize "Link to this definition")
Serialize SoilLayout to dict (e.g. to store in database). The structure of dict is:
```
{
'layers': [...]
}
```
* Return type:
`dict`
- *property *top*: float*[](#SoilLayout.top "Link to this definition")
Height level of the top of the layout.
* update\_layers()[](#SoilLayout.update_layers "Link to this definition")
Merges adjacent layers that have the same soil type. The merged layer is assigned the average value of each SoilLayer’s individual properties. This average is calculated in ratio to the thickness of the layers. After merging layer depths are corrected by going from top to bottom and setting each bottom\_of\_layer equal to top\_of\_layer of next SoilLayer
* Return type:
`None`
Example
layer 1 has thickness 10 and for property A a value of 5 layer 2 has thickness 40 and for property A a value of 2 Resulting layer will have thickness 50, and property A = (10 \* 5 + 40 \* 2) / (10 + 40) = 2.6
- update\_soil\_properties(*df*)[](#SoilLayout.update_soil_properties "Link to this definition")
Update SoilLayout with Soil properties
* Parameters:
**df** (`DataFrame`) – dataframe with soil properties by name (must at least have column ‘name’).
* Return type:
`None`
* Returns:
## SoilLayout2D[](https://docs.viktor.ai/sdk/api/geo/.md#_SoilLayout2D "Direct link to SoilLayout2D")
* *class *viktor.geo.SoilLayout2D(*soil\_layers*, *piezo\_lines=None*)[](#SoilLayout2D "Link to this definition")
A 2D representation of a soil body build up from layers.
A Soil Layout 2D basically consists of the following elements:
* A list of soil layers: objects of the class SoilLayer2D
* A list of piezo lines
* A left and right boundary
* A top and bottom profile
Left and right boundaries, as well as top and bottom profiles, are automatically taken from the given soil layers
The following requirements are to be met:
* Each soil layer has to stretch all the way from the left boundary to the right boundary
* The layers have to be stacked starting from bottom to top
* There can be no holes in the soil layout 2d, meaning that the top profile of a previous layer always has to be identical to the bottom profile of the next layer
* A layer can have zero thickness over (part of) the width of the soil layout 2d
* All soil layers and piezo lines have to exactly identical ranges in x direction, meaning that they all range exactly from left boundary to right boundary
A SoilLayout2D will have roughly the following shape, with each layer containing it’s own soil and soil properties:
```
| xxxxxxxxxx |
|xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
| |
| |
| xxxxxxxx |
|xxxxxxxxxxxxxx xxxxxxxxxxxxx xxxxxxxxxxxxxxxx|
| xxx xxxxxx |
| xxx |
| |
| |
|xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxx|
| xxxxxxxxxxxxxxxxxx |
| |
| xxxxxxxxxxxxxxx |
|xxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
```
The SoilLayout2D class is immutable. Any methods that alter or change properties of the class will return a new instance.
* Parameters:
* **soil\_layers** (`List`\[[`SoilLayer2D`](#SoilLayer2D "viktor.geo.SoilLayer2D")]) – an ordered dict of 2D soil layers. Starting from the bottom layer
* **piezo\_lines** (`List`\[[`PiezoLine`](#PiezoLine "viktor.geo.PiezoLine")]) – list of piezo lines
- *property *bottom\_profile*: [Polyline](https://docs.viktor.ai/sdk/api/geometry/.md#Polyline "viktor.geometry.Polyline")*[](#SoilLayout2D.bottom_profile "Link to this definition")
bottom profile of the soil layout: Polyline
* Type:
return
* *classmethod *combine\_soil\_layouts\_2d(*\*soil\_layouts\_2d*)[](#SoilLayout2D.combine_soil_layouts_2d "Link to this definition")
Combine multiple SoilLayout2D’s in into one big SoilLayout2D
All given soil layouts need to connect seemlessly, so that the resulting SoilLayout2D fullfills the requirement that it has got no holes and the top and bottom profile are monotonic ascending in x direction
All layers will be continued (with zero thickness) to the new right and left boundaries
* Parameters:
**soil\_layouts\_2d** ([`SoilLayout2D`](#SoilLayout2D "viktor.geo.SoilLayout2D"))
* Return type:
[`SoilLayout2D`](#SoilLayout2D "viktor.geo.SoilLayout2D")
* Returns:
POSSIBLE COMBINATIONS:
combining a left and a right soil layout 2d
```
_____________________
| |_______________________
| | |
|-------------------|----------------------|
| | |
|___________________|----------------------|
| |
|______________________|
```
combining a top and bottom soil layout 2d
```
_____________________
| |
|-------------------|
| |
|___________________|______________
| |
|--------------------------|
|__________________________|
```
combining n soil layouts, as long as there are no holes in the resulting soil layout, and it is possible to keep all layer profiles monotonic ascending in x-directions
```
_____________________
| |_______________________
| | |
|-------------------|----------------------|
| | |
|___________________|______________________|
| |
|-------------------|
|___________________|
```
IMPOSSIBLE COMBINATIONS:
soillayouts without seem
```
_____________________
| | ________________________
| | | |
|-------------------| |----------------------|
| | | |
|___________________| |----------------------|
| |
|______________________|
```
overlapping soil layouts
```
_____________________
| ________|_______________
| | | |
|-----------|-------| |
| |-------|--------------|
|___________|_______| |
| |
|______________________|
```
the resulting soil layout does contain layers with profiles that are not monotonic ascending in x-direction
```
_____________________
| |_______________________
| | |
|-------------------| |
| |----------------------|
|___________________| |
| |
________|______________________|
| |
|-------------------|
|___________________|
```
- *classmethod *from\_dict(*soil\_layout\_2d\_dict*)[](#SoilLayout2D.from_dict "Link to this definition")
Create SoilLayout2D with dictionary from SoilLayout2D.serialize(). Useful when SoilLayout2D needs to be created from dictionary from the database.
Example usage:
```
class Controller(vkt.Controller):
...
def get_interpolated_soil_layout_from_database(self) -> vkt.geo.SoilLayout2D:
# API call to entity that stores complete SoilLayout2D
layout_dict = entity.last_saved_params['layout_dict']
interpolated_soil_layout = vkt.geo.SoilLayout2D.from_dict(layout_dict)
return interpolated_soil_layout
```
* Parameters:
**soil\_layout\_2d\_dict** (`dict` | `Munch`) – dictionary with same structure as SoilLayout2D.serialize()
* Return type:
[`SoilLayout2D`](#SoilLayout2D "viktor.geo.SoilLayout2D")
* *classmethod *from\_positional\_soil\_layouts(*positional\_soil\_layouts*, *top\_profile*, *piezo\_lines=None*)[](#SoilLayout2D.from_positional_soil_layouts "Link to this definition")
Instantiate a soil layout 2d from multiple 1d soil layouts combined with x locations and a ground profile
all 1d soil layouts should have the same layers in the same order. Variation in height and thickness are possible
the top profile has to be monotonic ascending in x direction
* Parameters:
* **positional\_soil\_layouts** (`List`\[[`PositionalSoilLayout`](#PositionalSoilLayout "viktor.geo.PositionalSoilLayout")]) – 1d soil layouts with x locations
* **top\_profile** ([`Polyline`](https://docs.viktor.ai/sdk/api/geometry/.md#Polyline "viktor.geometry.Polyline")) – a polyline representing the ground level
* **piezo\_lines** (`List`\[[`PiezoLine`](#PiezoLine "viktor.geo.PiezoLine")]) – list of piezo lines
* Return type:
[`SoilLayout2D`](#SoilLayout2D "viktor.geo.SoilLayout2D")
- *classmethod *from\_single\_soil\_layout(*soil\_layout*, *left\_boundary*, *right\_boundary*, *top\_profile*, *piezo\_lines=None*)[](#SoilLayout2D.from_single_soil_layout "Link to this definition")
A special case when a 1D soil layout is stretched in the 2D plane.
This class method will create a 2D layout with horizontal layers and a top\_profile.
* Parameters:
* **soil\_layout** ([`SoilLayout`](#SoilLayout "viktor.geo.SoilLayout"))
* **top\_profile** ([`Polyline`](https://docs.viktor.ai/sdk/api/geometry/.md#Polyline "viktor.geometry.Polyline"))
* **left\_boundary** (`float`)
* **right\_boundary** (`float`)
* **piezo\_lines** (`List`\[[`PiezoLine`](#PiezoLine "viktor.geo.PiezoLine")])
* Return type:
[`SoilLayout2D`](#SoilLayout2D "viktor.geo.SoilLayout2D")
* get\_left\_boundary\_polyline()[](#SoilLayout2D.get_left_boundary_polyline "Link to this definition")
Get the polyline describing the left boundary This will always be a straight boundary This will contain a point on every boundary between layers
* Return type:
[`Polyline`](https://docs.viktor.ai/sdk/api/geometry/.md#Polyline "viktor.geometry.Polyline")
* Returns:
Polyline
- get\_right\_boundary\_polyline()[](#SoilLayout2D.get_right_boundary_polyline "Link to this definition")
Get the polyline describing the right boundary This will always be a straight boundary This will contain a point on every boundary between layers
* Return type:
[`Polyline`](https://docs.viktor.ai/sdk/api/geometry/.md#Polyline "viktor.geometry.Polyline")
* Returns:
Polyline
* serialize()[](#SoilLayout2D.serialize "Link to this definition")
Serialize to dict (e.g. to store in database). The structure of dict is:
```
{'layers': [layer.serialize} for layer in self.layers,
'piezo_lines': [line.serialize() for line in self.piezo_lines]}
```
* Return type:
`dict`
* Returns:
dictionary with structure above
- split(*\*split\_lines*)[](#SoilLayout2D.split "Link to this definition")
Split the soil layout by given polylines.
Each split line has to:
> * have a start and end point that lies outside of this soil layout
>
> * intersect the soil layout in at least one region
>
> * be monotonic ascending in x-direction
Split lines are allowed to cross each other one or multiple times.
Examples:
Single split line
```
___________ ___________ ___________ ____________
| / | | / / |
| / | ==> | / / |
|-------/-------------| |-------/ /-------------|
|______/______________| |______/ /______________|
```
Single split line with multiple intersections
```
/\
___________/__\________ _______________________
| / \ | | / \ |
| / \ | ==> | / \ |
|-------/--------\----| |-------/ ____ \----|
|______/__________\___| |______/ / \ \___|
/ \ / \
/--------\
/__________\
```
Two crossing split lines
```
____
______ ____ ___________ _______ \ / ____________
| \ / | | \ \/ / |
| \/ | ==> | \ / |
|-------/\------------| |-------/ \------------|
|______/__\___________| |______/ /\ \___________|
/__\
```
* Parameters:
**split\_lines** ([`Polyline`](https://docs.viktor.ai/sdk/api/geometry/.md#Polyline "viktor.geometry.Polyline")) – a list of polylines
* Return type:
`List`\[[`SoilLayout2D`](#SoilLayout2D "viktor.geo.SoilLayout2D")]
* *property *top\_profile*: [Polyline](https://docs.viktor.ai/sdk/api/geometry/.md#Polyline "viktor.geometry.Polyline")*[](#SoilLayout2D.top_profile "Link to this definition")
top profile of the soil layout: Polyline
* Type:
return
- visualize\_geometry(*visualize\_border=False*, *opacity=1*)[](#SoilLayout2D.visualize_geometry "Link to this definition")
Returns the visualization elements (group, labels) of the SoilLayout2D which can be used in a GeometryView.
* Parameters:
* **visualize\_border** (`bool`) – visualize the border surrounding this soil layout with an extra line.
* **opacity** (`float`) – float between 0 (transparent) - 1 (opaque)
* Return type:
`Tuple`\[[`Group`](https://docs.viktor.ai/sdk/api/geometry/.md#Group "viktor.geometry.Group"), `List`\[[`Label`](https://docs.viktor.ai/sdk/api/views/.md#Label "viktor.views.Label")]]
## TableMethod[](https://docs.viktor.ai/sdk/api/geo/.md#_TableMethod "Direct link to TableMethod")
* *class *viktor.geo.TableMethod(*qualification\_table*, *ground\_water\_level*)[](#TableMethod "Link to this definition")
Bases: `_ClassificationMethod`
Class to pass TableMethod specific properties, such as a qualification\_table and ground\_water\_level. The qualification\_table is a list of dictionaries, containing for each user-specified soil type the accompanying qualification parameters (and possibly additional material properties). The required fields for each row are:
> * name
>
> * color in r, g, b
Also required fields, but can also be (partly) empty:
> * qc\_min
>
> * qc\_max
>
> * qc\_norm\_min
>
> * qc\_norm\_max
>
> * rf\_min
>
> * rf\_max
>
> * gamma\_dry\_min
>
> * gamma\_dry\_max
>
> * gamma\_wet\_min
>
> * gamma\_wet\_max
For more information about qc\_norm (qc\_normalized), see table 2.b in in NEN 9997-1+C1:2012, point g specifically. Besides the qualification table, a ground\_water\_level has to be provided as well, which is used to determine if gamma\_dry or gamma\_wet should be used to calculate qc\_norm for each entry in the GEF file.
Example:
```
qualification_table = [
{'name': 'Peat', 'color': '166,42,42', 'qc_min': 0, 'qc_max': '', 'qc_norm_min': '',
'qc_norm_max': '', 'rf_min': 8, 'rf_max': '', 'gamma_dry_min': 10, 'gamma_wet_min': 10, },
{'name': 'Clay', 'color': '125,180,116', 'qc_min': '', 'qc_max': 2, 'qc_norm_min': '',
'qc_norm_max': '', 'rf_min': 1, 'rf_max': 8, 'gamma_dry_min': 20, 'gamma_wet_min': 22, },
{'name': 'Loam', 'color': '125,150,116', 'qc_min': 2, 'qc_max': '', 'qc_norm_min': '',
'qc_norm_max': '', 'rf_min': 1, 'rf_max': 8, 'gamma_dry_min': 20, 'gamma_wet_min': 22, },
{'name': 'Sand', 'color': '239,255,12', 'qc_min': '', 'qc_max': '', 'qc_norm_min': 22,
'qc_norm_max': '', 'rf_min': 0, 'rf_max': 1, 'gamma_dry_min': 24, 'gamma_wet_min': 26, },
{'name': 'Gravel', 'color': '255,255,128', 'qc_min': '', 'qc_max': '', 'qc_norm_min': '',
'qc_norm_max': 22, 'rf_min': 0, 'rf_max': 1, 'gamma_dry_min': 24, 'gamma_wet_min': 26, }
]
ground_water_level = -4.63
method = TableMethod(qualification_table, ground_water_level)
```
* Parameters:
* **ground\_water\_level** (`float`) – Ground water level is used to compute qc\_norm using either gamma\_dry or gamma\_wet
* **qualification\_table** (`List`\[`dict`]) – List containing rows defining a soil
- get\_method\_params()[](#TableMethod.get_method_params "Link to this definition")
* Return type:
`dict`
* get\_qualification\_table\_plot(*fileformat*)[](#TableMethod.get_qualification_table_plot "Link to this definition")
Use this method to obtain a plot of the qualification table. On the x axis the Rf values are plotted, on the y axis Qc values are shown. Each line, representing a soil, is shown as an area in this plot. This allows for easy inspection of the qualification rules, showing areas of the plot that might still be empty, or soil areas that overlap (in which case the area on top will be chosen). Use the fileformat argument to specify if the result should be a BytesIO containing pdf or png bytes or a StringIO containing svg data
* Parameters:
**fileformat** (`str`) – specify if required fileformat is pdf, png or svg
* Return type:
`BytesIO` | `StringIO`
* Returns:
qualification table plot as either BytesIO (‘pdf’ or ‘png’) or StringIO (‘svg’) object
## UndefinedSoil[](https://docs.viktor.ai/sdk/api/geo/.md#_UndefinedSoil "Direct link to UndefinedSoil")
* *class *viktor.geo.UndefinedSoil[](#UndefinedSoil "Link to this definition")
Bases: [`Soil`](#Soil "viktor.geo.Soil")
Set name and color of Soil material. Extra properties can be added with dictionary, and keys are added as attribute via ‘munchify’. They are accessible as self.properties.{extra\_property\_name}
* Parameters:
* **name**
* **color** – color of soil used in plots
* **properties** – dict with optional extra parameters to be added to Soil
## gef\_visualization[](https://docs.viktor.ai/sdk/api/geo/.md#_gef_visualization "Direct link to gef_visualization")
* viktor.geo.gef\_visualization(*gef\_data*, *soil\_layout\_original*, *soil\_layout\_user*, *\**, *as\_file=False*)[](#gef_visualization "Link to this definition")
Standard visualization for GEF File.
Example usage:
```
class Controller(vkt.Controller):
...
@vkt.ImageView("GEF plot", duration_guess=2)
def visualize(self, params, **kwargs):
gef_data = ...
soil_layout_original = ...
soil_layout_user = ...
svg_image = vkt.geo.gef_visualization(gef_data, soil_layout_original, soil_layout_user)
return vkt.ImageResult(svg_image)
```
* Parameters:
* **gef\_data** ([`GEFData`](#GEFData "viktor.geo.GEFData")) – GEFData object to be visualized
* **soil\_layout\_original** ([`SoilLayout`](#SoilLayout "viktor.geo.SoilLayout")) – SoilLayout from GEFData. Layers must be sorted from top to bottom.
* **soil\_layout\_user** ([`SoilLayout`](#SoilLayout "viktor.geo.SoilLayout")) – SoilLayout that is filtered/modified by user. Layers must be sorted from top to bottom.
* **as\_file** (`bool`) – return as str (default) or File
New in v13.5.0
* Return type:
`str` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* Returns:
SVG image file
---
# viktor.geometry
## Arc[](https://docs.viktor.ai/sdk/api/geometry/.md#_Arc "Direct link to Arc")
* *class *viktor.geometry.Arc(*centre\_point*, *start\_point*, *end\_point*, *short\_arc=True*, *\**, *n\_segments=30*, *color=(0, 0, 0)*, *identifier=None*)[](#Arc "Link to this definition")
Bases: [`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")
Creates a constant radius arc in the xy plane. Clockwise rotation creates an outward surface.
* Parameters:
* **centre\_point** ([`Point`](#Point "viktor.geometry.Point") | `Tuple`\[`float`, `float`, `float`]) – Point in xy plane.
* **start\_point** ([`Point`](#Point "viktor.geometry.Point") | `Tuple`\[`float`, `float`, `float`]) – Point in xy plane. Should have the same distance to centre\_point as end\_point.
* **end\_point** ([`Point`](#Point "viktor.geometry.Point") | `Tuple`\[`float`, `float`, `float`]) – Point in xy plane. Should have the same distance to centre\_point as start\_point.
* **short\_arc** (`bool`) – Angle of arc smaller than pi if True, larger than pi if False.
* **n\_segments** (`int`) – Number of discrete segments of the arc (default: 30)
New in v13.5.0
.
* **color** ([`Color`](https://docs.viktor.ai/sdk/api/core/.md#Color "viktor.core.Color")) – Visualization color
New in v13.5.0
.
* **identifier** (`str`) – object identifier (new in v14.10.0)
- *property *angle*: float*[](#Arc.angle "Link to this definition")
Absolute angle of the arc in radians, which is the difference between theta1 and theta2.
* *property *centre\_point*: [Point](#Point "viktor.geometry.Point")*[](#Arc.centre_point "Link to this definition")
- discretize(*num=2*)[](#Arc.discretize "Link to this definition")
Returns a discrete representation of the arc, as a list of Point objects. The amount of points can be specified using ‘num’, which should be larger than 1.
* Return type:
`List`\[[`Point`](#Point "viktor.geometry.Point")]
* *property *end\_point*: [Point](#Point "viktor.geometry.Point")*[](#Arc.end_point "Link to this definition")
- *property *length*: float*[](#Arc.length "Link to this definition")
Arc length.
* *property *n\_segments*: int*[](#Arc.n_segments "Link to this definition")
- *property *radius*: float*[](#Arc.radius "Link to this definition")
* revolve(*\**, *rotation\_angle=None*, *material=None*, *identifier=None*, *\*\*kwargs*)[](#Arc.revolve "Link to this definition")
Returns an ArcRevolve object, revolved around the global y-axis.
* Parameters:
* **rotation\_angle** (`float`) – Angle of the revolved object according to the right-hand-rule, with the start of the rotation in positive z-direction. Angle in radians. If not specified, 2 pi will be used.
* **material** ([`Material`](#Material "viktor.geometry.Material")) – optional material
* **identifier** (`str`) – object identifier (new in v14.10.0)
* Return type:
[`ArcRevolve`](#ArcRevolve "viktor.geometry.ArcRevolve")
- *property *short\_arc*: bool*[](#Arc.short_arc "Link to this definition")
* *property *start\_point*: [Point](#Point "viktor.geometry.Point")*[](#Arc.start_point "Link to this definition")
- *property *theta1*: float*[](#Arc.theta1 "Link to this definition")
Angle of the end point with respect to the x-axis in radians.
* *property *theta1\_theta2*: Tuple\[float, float]*[](#Arc.theta1_theta2 "Link to this definition")
Angles of the end (theta1) and start (theta2) points with respect to the x-axis in radians.
- *property *theta2*: float*[](#Arc.theta2 "Link to this definition")
Angle of the start point with respect to the x-axis in radians.
## ArcExtrusion[](https://docs.viktor.ai/sdk/api/geometry/.md#_ArcExtrusion "Direct link to ArcExtrusion")
* *class *viktor.geometry.ArcExtrusion(*profile*, *arc*, *profile\_rotation=0*, *n\_segments=50*, *\**, *material=None*, *identifier=None*)[](#ArcExtrusion "Link to this definition")
Bases: [`Group`](#Group "viktor.geometry.Group")
Given an Arc and a cross-section of the extrusion, a discretized Extrusion object is returned.
The coordinates of the profile are defined with respect to the Arc and have a LOCAL coordinate system:
> * z-axis is in direction of the arc from start to end.
>
> * x-axis is in positive global z-axis.
>
> * y-axis follows from the right-hand-rule.
Rotation of the profile is about the axis according to the right-hand-rule with LOCAL z-axis (see definition above).
Example:
```
profile = [
Point(1, 1),
Point(1, 2),
Point(3, 2),
Point(3, 1),
Point(1, 1),
]
arc = Arc(Point(1, 1, 0), Point(3, 1, 0), Point(1, 3, 0))
arc_ext = ArcExtrusion(profile, arc, profile_rotation=10, n_segments=10)
```
This will result in the following visualization, where the Arc itself is also shown in the xy plane:
[](https://docs.viktor.ai/_images/arc-extrusion.png)
* Parameters:
* **profile** (`List`\[[`Point`](#Point "viktor.geometry.Point")]) – Coordinates of cross-section.
* **arc** ([`Arc`](#Arc "viktor.geometry.Arc")) – An Arc object is used to define the direction of the extrusion.
* **profile\_rotation** (`float`) – Rotation of the profile around its local Z-axis in degrees.
* **n\_segments** (`int`) – Number of discrete segments of the arc, which is 50 by default.
* **material** ([`Material`](#Material "viktor.geometry.Material")) – optional material
* **identifier** (`str`) – object identifier (new in v14.10.0)
## ArcRevolve[](https://docs.viktor.ai/sdk/api/geometry/.md#_ArcRevolve "Direct link to ArcRevolve")
* *class *viktor.geometry.ArcRevolve(*arc*, *\*args*, *rotation\_angle=None*, *material=None*, *identifier=None*, *\*\*kwargs*)[](#ArcRevolve "Link to this definition")
Bases: [`Revolve`](#Revolve "viktor.geometry.Revolve")
Returns a revolved object of an arc around the global y-axis.
In the example below, rotation\_angle is equal to pi / 3:
[](https://docs.viktor.ai/_images/arc-revolve.png)
* Parameters:
* **arc** ([`Arc`](#Arc "viktor.geometry.Arc")) – Arc object.
* **rotation\_angle** (`float`) – Angle of the revolved object according to the right-hand-rule, with the start of the rotation in positive z-direction. Angle in radians. If not specified, 2 pi will be used.
* **material** ([`Material`](#Material "viktor.geometry.Material")) – optional material
* **identifier** (`str`) – object identifier (new in v14.10.0)
- *property *arc*: [Arc](#Arc "viktor.geometry.Arc")*[](#ArcRevolve.arc "Link to this definition")
[`Arc`](#Arc "viktor.geometry.Arc")
* *property *height*: float*[](#ArcRevolve.height "Link to this definition")
Height of the object.
- *property *inner\_volume*: float*[](#ArcRevolve.inner_volume "Link to this definition")
Returns the inner volume of the revolved object.
This method will only return a value if the defined Arc meets the following conditions:
> * it should be short, i.e. short\_arc=True
>
> * the start- and end-point are located on the same side w\.r.t. the y-axis of the center-point of the Arc
>
> * it is defined in clockwise direction
* *property *surface\_area*: float*[](#ArcRevolve.surface_area "Link to this definition")
Total exterior area of the object.
- *property *uuid*: str*[](#ArcRevolve.uuid "Link to this definition")
## BidirectionalPattern[](https://docs.viktor.ai/sdk/api/geometry/.md#_BidirectionalPattern "Direct link to BidirectionalPattern")
* *class *viktor.geometry.BidirectionalPattern(*base\_object*, *direction\_1*, *direction\_2*, *number\_of\_elements\_1*, *number\_of\_elements\_2*, *spacing\_1*, *spacing\_2*, *\**, *identifier=None*)[](#BidirectionalPattern "Link to this definition")
Bases: [`Pattern`](#Pattern "viktor.geometry.Pattern")
Instantiates a two-dimensional pattern, evenly spaced in two separate directions. If identifier has been set on the base-object, the identifiers of the objects within the pattern are suffixed with ‘-i’ (i = 1, 2, 3, …).
* Parameters:
* **base\_object** ([`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")) – the object to be duplicated
* **direction\_1** (`List`\[`float`]) – a unit vector specifying the first direction
* **direction\_2** (`List`\[`float`]) – a unit vector specifying the second direction
* **number\_of\_elements\_1** (`int`) – total amount of elements along direction 1
* **number\_of\_elements\_2** (`int`) – total amount of elements along direction 2
* **spacing\_1** (`float`) – the applied spacing in direction 1
* **spacing\_2** (`float`) – the applied spacing in direction 2
* **identifier** (`str`) – object identifier (new in v14.10.0)
## CartesianAxes[](https://docs.viktor.ai/sdk/api/geometry/.md#_CartesianAxes "Direct link to CartesianAxes")
* *class *viktor.geometry.CartesianAxes(*origin=Point(0.000e+00, 0.000e+00, 0.000e+00)*, *axis\_length=1*, *axis\_diameter=0.05*)[](#CartesianAxes "Link to this definition")
Bases: [`Group`](#Group "viktor.geometry.Group")
Helper visualisation object to show positive x (red), y (green) and z (blue) axes.
[](https://docs.viktor.ai/_images/cartesian-axes.png)
* Parameters:
* **origin** ([`Point`](#Point "viktor.geometry.Point")) – Coordinates of the origin.
* **axis\_length** (`float`) – Length of the axes.
* **axis\_diameter** (`float`) – Diameter of the axes.
## CircularExtrusion[](https://docs.viktor.ai/sdk/api/geometry/.md#_CircularExtrusion "Direct link to CircularExtrusion")
* *class *viktor.geometry.CircularExtrusion(*diameter*, *line*, *\**, *shell\_thickness=None*, *material=None*, *identifier=None*)[](#CircularExtrusion "Link to this definition")
Bases: [`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")
This class is used to construct an extrusion which has a circular base, e.g. a circular foundation pile.
* Parameters:
* **diameter** (`float`) – Outer diameter of the cross-section.
* **line** ([`Line`](#Line "viktor.geometry.Line")) – Line object along which the circular cross-section is extruded.
* **shell\_thickness** (`float`) – Optional shell thickness. None for solid (default: None)
New in v13.6.0
.
* **material** ([`Material`](#Material "viktor.geometry.Material")) – Optional material.
* **identifier** (`str`) – object identifier (new in v14.10.0)
- *property *cross\_sectional\_area*: float*[](#CircularExtrusion.cross_sectional_area "Link to this definition")
* *property *diameter*: float*[](#CircularExtrusion.diameter "Link to this definition")
- *property *length*: float*[](#CircularExtrusion.length "Link to this definition")
* *property *line*: [Line](#Line "viktor.geometry.Line")*[](#CircularExtrusion.line "Link to this definition")
- *property *radius*: float*[](#CircularExtrusion.radius "Link to this definition")
* *property *shell\_thickness*: float | None*[](#CircularExtrusion.shell_thickness "Link to this definition")
## Cone[](https://docs.viktor.ai/sdk/api/geometry/.md#_Cone "Direct link to Cone")
* *class *viktor.geometry.Cone(*diameter*, *height*, *\**, *origin=None*, *orientation=None*, *material=None*, *identifier=None*)[](#Cone "Link to this definition")
Bases: [`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")
Creates a cone object.
* Parameters:
* **diameter** (`float`) – Diameter of the circular base surface.
* **height** (`float`) – Height from base to tip.
* **origin** ([`Point`](#Point "viktor.geometry.Point")) – Optional location of the centroid of the base surface (default: Point(0, 0, 0)).
* **orientation** ([`Vector`](#Vector "viktor.geometry.Vector")) – Optional orientation from origin to the tip (default: Vector(0, 0, 1)).
* **material** ([`Material`](#Material "viktor.geometry.Material")) – Optional material.
* **identifier** (`str`) – object identifier (new in v14.10.0)
- *classmethod *from\_line(*diameter*, *line*, *\**, *material=None*, *identifier=None*)[](#Cone.from_line "Link to this definition")
Create a Cone object by a given base diameter and line.
* Parameters:
* **diameter** (`float`) – Diameter of the circular base surface.
* **line** ([`Line`](#Line "viktor.geometry.Line")) – Line from base to top of the cone. The start point of the line represents the location of the center of the base, and the end point represents the tip of the cone.
* **material** ([`Material`](#Material "viktor.geometry.Material")) – Optional material.
* **identifier** (`str`) – object identifier (new in v14.10.0)
* Return type:
[`Cone`](#Cone "viktor.geometry.Cone")
## Extrusion[](https://docs.viktor.ai/sdk/api/geometry/.md#_Extrusion "Direct link to Extrusion")
* *class *viktor.geometry.Extrusion(*profile*, *line*, *profile\_rotation=0*, *\**, *material=None*, *identifier=None*)[](#Extrusion "Link to this definition")
Bases: [`Group`](#Group "viktor.geometry.Group")
Extruded object from a given set of points, which is called the profile. This profile should meet the following requirements:
> * start point should be added at the end for closed profile
>
> * points should be defined in z=0 plane
>
> * circumference should be defined clockwise
Note that the profile is defined with respect to the start point of the Line object, i.e. the profile is defined in the local coordinate system. An example is given below of two extrusions with the same dimensions. Their corresponding Line objects are also visualized. The extrusion have the following profile:
```
# black box
profile_b = [
Point(1, 1),
Point(1, 2),
Point(2, 2),
Point(2, 1),
Point(1, 1),
]
box_b = Extrusion(profile_b, Line(Point(4, 1, 0), Point(4, 1, 1)))
# yellow box
profile_y = [
Point(-0.5, -0.5),
Point(-0.5, 0.5),
Point(0.5, 0.5),
Point(0.5, -0.5),
Point(-0.5, -0.5),
]
box_y = Extrusion(profile_y, Line(Point(2, 2, 0), Point(2, 2, 1)))
```
[](https://docs.viktor.ai/_images/extrusion-profile.png)
* Parameters:
* **profile** (`List`\[[`Point`](#Point "viktor.geometry.Point")]) – Coordinates of cross-section.
* **line** ([`Line`](#Line "viktor.geometry.Line")) – A line object is used to define the length (thickness) of the extrusion.
* **profile\_rotation** (`float`) – Rotation of the profile around the Z-axis in degrees.
* **material** ([`Material`](#Material "viktor.geometry.Material")) – optional material
* **identifier** (`str`) – object identifier (new in v14.10.0)
- *property *length*: float*[](#Extrusion.length "Link to this definition")
* *property *line*: [Line](#Line "viktor.geometry.Line")*[](#Extrusion.line "Link to this definition")
- *property *material*: [Material](#Material "viktor.geometry.Material")*[](#Extrusion.material "Link to this definition")
* *property *profile*: List\[[Point](#Point "viktor.geometry.Point")]*[](#Extrusion.profile "Link to this definition")
## GeoPoint[](https://docs.viktor.ai/sdk/api/geometry/.md#_GeoPoint "Direct link to GeoPoint")
* *class *viktor.geometry.GeoPoint(*lat*, *lon*)[](#GeoPoint "Link to this definition")
Geographical point on the Earth’s surface described by a latitude / longitude coordinate pair.
This object can be created directly, or will be returned in the params when using a [`GeoPointField`](https://docs.viktor.ai/sdk/api/parametrization/.md#GeoPointField "viktor.parametrization.GeoPointField").
* Parameters:
* **lat** (`float`) – Latitude, between -90 and 90 degrees.
* **lon** (`float`) – Longitude, between -180 and 180 degrees.
- *classmethod *from\_rd(*coords*)[](#GeoPoint.from_rd "Link to this definition")
Instantiates a GeoPoint from the provided RD coordinates.
* Parameters:
**coords** (`Tuple`\[`float`, `float`]) – RD coordinates (x, y).
* Return type:
[`GeoPoint`](#GeoPoint "viktor.geometry.GeoPoint")
* *property *latitude*: float*[](#GeoPoint.latitude "Link to this definition")
New in v14.22.0
- *property *longitude*: float*[](#GeoPoint.longitude "Link to this definition")
New in v14.22.0
* *property *rd*: Tuple\[float, float]*[](#GeoPoint.rd "Link to this definition")
RD representation (x, y) of the GeoPoint.
## GeoPolygon[](https://docs.viktor.ai/sdk/api/geometry/.md#_GeoPolygon "Direct link to GeoPolygon")
* *class *viktor.geometry.GeoPolygon(*\*points*)[](#GeoPolygon "Link to this definition")
Geographical polygon on the Earth’s surface described by a list of [`GeoPoints`](#GeoPoint "viktor.geometry.GeoPoint").
This object can be created directly, or will be returned in the params when using a [`GeoPolygonField`](https://docs.viktor.ai/sdk/api/parametrization/.md#GeoPolygonField "viktor.parametrization.GeoPolygonField").
* Parameters:
**points** ([`GeoPoint`](#GeoPoint "viktor.geometry.GeoPoint")) – Geo points (minimum 3). The profile is automatically closed, so it is not necessary to add the start point at the end.
- *property *points*: List\[[GeoPoint](#GeoPoint "viktor.geometry.GeoPoint")]*[](#GeoPolygon.points "Link to this definition")
## GeoPolyline[](https://docs.viktor.ai/sdk/api/geometry/.md#_GeoPolyline "Direct link to GeoPolyline")
* *class *viktor.geometry.GeoPolyline(*\*points*)[](#GeoPolyline "Link to this definition")
Geographical polyline on the Earth’s surface described by a list of [`GeoPoints`](#GeoPoint "viktor.geometry.GeoPoint").
This object can be created directly, or will be returned in the params when using a [`GeoPolylineField`](https://docs.viktor.ai/sdk/api/parametrization/.md#GeoPolylineField "viktor.parametrization.GeoPolylineField").
* Parameters:
**points** ([`GeoPoint`](#GeoPoint "viktor.geometry.GeoPoint")) – Geo points (minimum 2).
- *property *points*: List\[[GeoPoint](#GeoPoint "viktor.geometry.GeoPoint")]*[](#GeoPolyline.points "Link to this definition")
## Group[](https://docs.viktor.ai/sdk/api/geometry/.md#_Group "Direct link to Group")
* *class *viktor.geometry.Group(*objects*, *\**, *identifier=None*)[](#Group "Link to this definition")
Bases: [`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")
* Parameters:
* **objects** (`Sequence`\[[`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")]) – Objects that are part of the group.
* **identifier** (`str`) – object identifier (new in v14.10.0)
- add(*objects*)[](#Group.add "Link to this definition")
* Return type:
`None`
* *property *children*: List\[[TransformableObject](#TransformableObject "viktor.geometry.TransformableObject")]*[](#Group.children "Link to this definition")
- duplicate()[](#Group.duplicate "Link to this definition")
* Return type:
[`Group`](#Group "viktor.geometry.Group")
## Line[](https://docs.viktor.ai/sdk/api/geometry/.md#_Line "Direct link to Line")
* *class *viktor.geometry.Line(*start\_point*, *end\_point*, *\**, *color=(0, 0, 0)*, *identifier=None*)[](#Line "Link to this definition")
Bases: [`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")
* Parameters:
* **start\_point** ([`Point`](#Point "viktor.geometry.Point") | `Tuple`\[`float`, `float`, `float`]) – Start point of the line (cannot coincide with end\_point).
* **end\_point** ([`Point`](#Point "viktor.geometry.Point") | `Tuple`\[`float`, `float`, `float`]) – End point of the line (cannot coincide with start\_point).
* **color** ([`Color`](https://docs.viktor.ai/sdk/api/core/.md#Color "viktor.core.Color")) – Visualization color
New in v13.5.0
.
* **identifier** (`str`) – object identifier (new in v14.10.0)
- collinear(*point*)[](#Line.collinear "Link to this definition")
True if point is collinear (in line) with Line, else False.
* Return type:
`bool`
* direction(*normalize=True*)[](#Line.direction "Link to this definition")
Direction vector between start and end point.
* Return type:
[`Vector`](#Vector "viktor.geometry.Vector")
- distance\_to\_point(*point*)[](#Line.distance_to_point "Link to this definition")
Calculate the (minimal) distance from the given point to the (unbounded) line.
* Return type:
`float`
* *property *end\_point*: [Point](#Point "viktor.geometry.Point")*[](#Line.end_point "Link to this definition")
- find\_overlap(*other*, *inclusive=False*)[](#Line.find_overlap "Link to this definition")
Find the overlapping part of this line with another line.
The returned value depends on the situation:
* None, if no overlap is found or the two lines are not parallel
* Point, if an overlap is found with length equal to 0
* Line, if an overlap is found with length larger than 0
- Parameters:
* **other** ([`Line`](#Line "viktor.geometry.Line")) – Other Line object
* **inclusive** (`bool`) – True to treat overlapping points as overlap
- Return type:
[`Point`](#Point "viktor.geometry.Point") | [`Line`](#Line "viktor.geometry.Line") | `None`
* get\_line\_function\_parameters()[](#Line.get_line_function_parameters "Link to this definition")
Get parameters for y=ax+b definition of a line.
* Return type:
`Tuple`\[`float`, `float`]
* Returns:
(a, b) or (nan, nan) if line is vertical
- *property *horizontal*: bool*[](#Line.horizontal "Link to this definition")
* *property *length*: float*[](#Line.length "Link to this definition")
- *property *length\_vector*: numpy.ndarray*[](#Line.length_vector "Link to this definition")
* project\_point(*point*)[](#Line.project_point "Link to this definition")
Project the point on the (unbounded) line.
* Return type:
[`Point`](#Point "viktor.geometry.Point")
- revolve(*\**, *material=None*, *identifier=None*, *\*\*kwargs*)[](#Line.revolve "Link to this definition")
Revolve line around y-axis, only possible for lines in x-y plane.
* Parameters:
* **material** ([`Material`](#Material "viktor.geometry.Material")) – optional material
* **identifier** (`str`) – object identifier (new in v14.10.0)
* Raises:
**NotImplementedError** – when line is not in x-y plane
* Return type:
[`LineRevolve`](#LineRevolve "viktor.geometry.LineRevolve")
* *property *start\_point*: [Point](#Point "viktor.geometry.Point")*[](#Line.start_point "Link to this definition")
- *property *unit\_vector*: numpy.ndarray*[](#Line.unit_vector "Link to this definition")
* *property *vertical*: bool*[](#Line.vertical "Link to this definition")
## LineRevolve[](https://docs.viktor.ai/sdk/api/geometry/.md#_LineRevolve "Direct link to LineRevolve")
* *class *viktor.geometry.LineRevolve(*line*, *\*args*, *material=None*, *identifier=None*, *\*\*kwargs*)[](#LineRevolve "Link to this definition")
Bases: [`Revolve`](#Revolve "viktor.geometry.Revolve")
Returns a revolved object of a Line around the global y-axis.
An example revolve of a line between the point (1, 1, 0) and (3, 2, 0) is shown below, with the line object shown in black.
```
line = Line(Point(1, 1, 0), Point(3, 2, 0))
line_rev = LineRevolve(line)
```
[](https://docs.viktor.ai/_images/line-revolve.png)
* Parameters:
* **line** ([`Line`](#Line "viktor.geometry.Line")) – Line object which is to be revolved.
* **material** ([`Material`](#Material "viktor.geometry.Material")) – optional material
* **identifier** (`str`) – object identifier (new in v14.10.0)
- *property *height*: float*[](#LineRevolve.height "Link to this definition")
* *property *inner\_volume*: float*[](#LineRevolve.inner_volume "Link to this definition")
Returns the inner volume of the revolved object.
This method will only return a value if the defined Line meets the following conditions:
> * it should NOT be horizontal, i.e. y\_start != y\_end
>
> * it should be defined in positive y-direction, i.e. y\_start < y\_end
- *property *line*: [Line](#Line "viktor.geometry.Line")*[](#LineRevolve.line "Link to this definition")
* *property *surface\_area*: float*[](#LineRevolve.surface_area "Link to this definition")
Returns the total exterior area of the revolved object.
- *property *uuid*: UUID*[](#LineRevolve.uuid "Link to this definition")
## LinearPattern[](https://docs.viktor.ai/sdk/api/geometry/.md#_LinearPattern "Direct link to LinearPattern")
* *class *viktor.geometry.LinearPattern(*base\_object*, *direction*, *number\_of\_elements*, *spacing*, *\**, *identifier=None*)[](#LinearPattern "Link to this definition")
Bases: [`Pattern`](#Pattern "viktor.geometry.Pattern")
Instantiates a linear, evenly spaced, pattern along a single direction. If identifier has been set on the base-object, the identifiers of the objects within the pattern are suffixed with ‘-i’ (i = 1, 2, 3, …).
* Parameters:
* **base\_object** ([`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")) – the object to be duplicated
* **direction** (`List`\[`float`]) – a unit vector specifying in which direction the pattern propagates
* **number\_of\_elements** (`int`) – total amount of elements in the pattern, including the base object
* **spacing** (`float`) – the applied spacing
* **identifier** (`str`) – object identifier (new in v14.10.0)
## Material[](https://docs.viktor.ai/sdk/api/geometry/.md#_Material "Direct link to Material")
* *class *viktor.geometry.Material(*name=None*, *density=None*, *price=None*, *\**, *threejs\_type='MeshStandardMaterial'*, *roughness=1.0*, *metalness=0.5*, *opacity=1.0*, *color=(221, 221, 221)*)[](#Material "Link to this definition")
Note
The following properties were renamed since v14.5.0. If you are using a lower version, please use the old naming.
* threejs\_roughness -> roughness
* threejs\_metalness -> metalness
* threejs\_opacity -> opacity
**(new in v14.22.0)** Provide a hex value or tuple (r, g, b) as ‘color’.
* Parameters:
* **name** (`str`) – Optional name.
* **density** (`float`) – Optional density.
* **price** (`float`) – Optional price.
* **threejs\_type** (`str`) – deprecated
* **roughness** (`float`) – Between 0 - 1 where closer to 1 gives the material a rough texture.
* **metalness** (`float`) – Between 0 - 1 where closer to 1 gives the material a shiny metal look.
* **opacity** (`float`) – Between 0 - 1 where closer to 0 makes the material less visible.
* **color** (`str` | `tuple`\[`int`, `int`, `int`] | [`Color`](https://docs.viktor.ai/sdk/api/core/.md#Color "viktor.core.Color")) – Color of the material.
## Pattern[](https://docs.viktor.ai/sdk/api/geometry/.md#_Pattern "Direct link to Pattern")
* *class *viktor.geometry.Pattern(*base\_object*, *duplicate\_translation\_list*, *\**, *identifier=None*)[](#Pattern "Link to this definition")
Bases: [`Group`](#Group "viktor.geometry.Group")
Instantiates a pattern based on a base object and several duplicates, each translated by an input vector. If identifier has been set on the base-object, the identifiers of the objects within the pattern are suffixed with ‘-i’ (i = 1, 2, 3, …).
* Parameters:
* **base\_object** ([`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")) – the object to be duplicated
* **duplicate\_translation\_list** (`List`\[`List`\[`float`]]) – a list of translation vectors, each of which generates a duplicate
* **identifier** (`str`) – object identifier (new in v14.10.0)
## Point[](https://docs.viktor.ai/sdk/api/geometry/.md#_Point "Direct link to Point")
* *class *viktor.geometry.Point(*x*, *y*, *z=0*)[](#Point "Link to this definition")
This class represents a point object, which is instantiated by means of 3-dimensional coordinates X, Y, and Z. It forms a basis of many structural 2D and 3D objects.
Example usage:
```
p1 = Point(1, 2) # create a 2D point
p1.z # 0
p2 = Point(1, 2, 3) # create a 3D point
p1.z # 3
```
* Parameters:
* **x** (`float`) – X-coordinate.
* **y** (`float`) – Y-coordinate.
* **z** (`float`) – (optional) Z-coordinate, defaults to 0.
* Raises:
**TypeError** – if the point is instantiated with a None value.
- coincides\_with(*other*)[](#Point.coincides_with "Link to this definition")
Given another Point object, this method determines whether the two points coincide.
* Return type:
`bool`
* *property *coordinates*: numpy.ndarray*[](#Point.coordinates "Link to this definition")
Coordinates of the Point as array (X, Y, Z).
- copy()[](#Point.copy "Link to this definition")
Returns a deep copy of the object.
* Return type:
[`Point`](#Point "viktor.geometry.Point")
* get\_local\_coordinates(*local\_origin*, *spherical=False*)[](#Point.get_local_coordinates "Link to this definition")
Method to determine the local coordinates of the current Point with respect to a ‘local origin’.
* Return type:
`ndarray`
- vector\_to(*point*)[](#Point.vector_to "Link to this definition")
Vector pointing from self to point.
Example usage:
```
p1 = Point(1, 2, 3)
p2 = Point(0, 0, 0) # origin
v = p1.vector_to(p2) # vector from p1 to the origin
v = p1.vector_to((0, 0, 0)) # short notation
```
* Return type:
[`Vector`](#Vector "viktor.geometry.Vector")
* *property *x*: float*[](#Point.x "Link to this definition")
X-coordinate.
- *property *y*: float*[](#Point.y "Link to this definition")
Y-coordinate.
* *property *z*: float*[](#Point.z "Link to this definition")
Z-coordinate.
## Polygon[](https://docs.viktor.ai/sdk/api/geometry/.md#_Polygon "Direct link to Polygon")
* *class *viktor.geometry.Polygon(*points*, *\**, *surface\_orientation=False*, *material=None*, *skip\_duplicate\_vertices\_check=False*, *identifier=None*)[](#Polygon "Link to this definition")
Bases: [`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")
2D closed polygon without holes in x-y plane.
* Parameters:
* **points** (`list`\[[`Point`](#Point "viktor.geometry.Point")]) – profile is automatically closed, do not add start point at the end. only the x and y coordinates are considered. left hand rule around circumference determines surface direction
* **surface\_orientation** (`bool`) –
* if True, the left hand rule around circumference determines surface direction
* if False, surface always in +z direction
* **material** ([`Material`](#Material "viktor.geometry.Material")) – optional material
* **skip\_duplicate\_vertices\_check** (`bool`) – if True, duplicate vertices are not filtered on serialization of the triangles. This may boost performance (default: False).
* **identifier** (`str`) – object identifier (new in v14.10.0)
* Raises:
**ValueError** –
* if less than 3 points are provided.
* if points contains duplicates.
* if points form a polygon with self-intersecting lines.
* if points are all collinear.
- *property *centroid*: tuple\[float, float]*[](#Polygon.centroid "Link to this definition")
Returns the centroid (X, Y) of the polygon.
* *property *cross\_sectional\_area*: float*[](#Polygon.cross_sectional_area "Link to this definition")
- extrude(*line*, *\**, *profile\_rotation=0*, *material=None*, *identifier=None*)[](#Polygon.extrude "Link to this definition")
Extrude the Polygon in the direction of the given line.
* Parameters:
* **line** ([`Line`](#Line "viktor.geometry.Line")) – A line object is used to define the length (thickness) of the extrusion.
* **profile\_rotation** (`float`) – Rotation of the profile around the Z-axis in degrees.
* **material** ([`Material`](#Material "viktor.geometry.Material")) – optional material
* **identifier** (`str`) – object identifier (new in v14.10.0)
* Return type:
[`Extrusion`](#Extrusion "viktor.geometry.Extrusion")
* has\_clockwise\_circumference()[](#Polygon.has_clockwise_circumference "Link to this definition")
* Return type:
`bool`
- Method determines the direction of the input points, and returns:
* True if the circumference is clockwise
* False if the circumference is counter-clockwise
- *property *moment\_of\_inertia*: tuple\[float, float]*[](#Polygon.moment_of_inertia "Link to this definition")
Returns the moment of inertia (Ix, Iy) in xy-plane.
## Polyline[](https://docs.viktor.ai/sdk/api/geometry/.md#_Polyline "Direct link to Polyline")
* *class *viktor.geometry.Polyline(*points*, *\**, *color=(0, 0, 0)*, *identifier=None*)[](#Polyline "Link to this definition")
Bases: [`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")
Representation of a polyline made up of multiple straight line segments.
This class is immutable, meaning that all functions that perform changes on a polyline will return a mutated copy of the original polyline.
* Parameters:
* **points** (`List`\[[`Point`](#Point "viktor.geometry.Point")]) – List of points, which may contain duplicate points. Note that when calling the individual lines of the polyline, duplicate points are filtered (i.e. zero-length lines are omitted).
* **color** ([`Color`](https://docs.viktor.ai/sdk/api/core/.md#Color "viktor.core.Color")) – Visualization color
New in v13.5.0
.
* **identifier** (`str`) – object identifier (new in v14.10.0)
- combine\_with(*other*)[](#Polyline.combine_with "Link to this definition")
Given two polylines that have at least one point in common and together form one line without any side branches, combine those two polylines. The combined line will contain all points of both polylines.
* Parameters:
**other** ([`Polyline`](#Polyline "viktor.geometry.Polyline"))
* Return type:
[`Polyline`](#Polyline "viktor.geometry.Polyline")
* *property *end\_point*: [Point](#Point "viktor.geometry.Point")*[](#Polyline.end_point "Link to this definition")
Last point in polyline.points
- filter\_duplicate\_points()[](#Polyline.filter_duplicate_points "Link to this definition")
Returns a new Polyline object. If two consecutive points in this polyline coincide, the second point will be omitted
* Return type:
[`Polyline`](#Polyline "viktor.geometry.Polyline")
* find\_overlaps(*other*)[](#Polyline.find_overlaps "Link to this definition")
Find all overlapping regions of this polyline with another polyline. The returned overlapping regions will all point in the direction of this line. The overlap polylines will contain all points of both polylines, even if they only occur in one of the lines.
If no overlaps are found, an empty list will be returned.
* Parameters:
**other** ([`Polyline`](#Polyline "viktor.geometry.Polyline"))
* Return type:
`List`\[[`Polyline`](#Polyline "viktor.geometry.Polyline")]
- *classmethod *from\_lines(*lines*)[](#Polyline.from_lines "Link to this definition")
Create a polyline object from a list of lines.
The end of one line must always coincide with the start of the next line.
* Parameters:
**lines** (`Sequence`\[[`Line`](#Line "viktor.geometry.Line")]) – Sequence of lines
* Return type:
[`Polyline`](#Polyline "viktor.geometry.Polyline")
* *classmethod *get\_lowest\_or\_highest\_profile\_x(*profile\_1*, *profile\_2*, *lowest*)[](#Polyline.get_lowest_or_highest_profile_x "Link to this definition")
Given two polylines with n intersections, return a third polyline that will always follow the lowest (or highest) of the two lines the x locations of the points of the two polylines should be not descending (lines from left to right or vertical) the returned polyline will only cover the overlapping range in x coordinates.
If one of the profiles is an empty polyline, an empty polyline will be returned.
examples:
```
/----------------|
/ /-------|--------------------
profile_1: ----------------\ / / |
\ / / |_____________________________
profile_2: -------------\-/ /
\_________/
get_lowest_or_highest_profile_x(cls, profile_1, profile_2, lowest=True) will return:
/-------|
/ |
/ |____________________
result: -------------\ /
\_________/
```
Note that only the overlapping region of the two profiles is returned!
* Parameters:
* **profile\_1** ([`Polyline`](#Polyline "viktor.geometry.Polyline"))
* **profile\_2** ([`Polyline`](#Polyline "viktor.geometry.Polyline"))
* **lowest** (`bool`) – switch to decide whether to return highest or lowest profile
* Return type:
[`Polyline`](#Polyline "viktor.geometry.Polyline")
Currently, this implementation is exclusive. Meaning that vertical line parts that lie on the start or end of the overlap region in x are not taken into account.
- get\_polyline\_between(*start\_point*, *end\_point*, *inclusive=False*)[](#Polyline.get_polyline_between "Link to this definition")
Given two points that both lie on a polyline, return the polyline that lies between those two points start\_point has to lie before end\_point on this polyline.
If the given start point lies after the given end point on this polyline, an empty polyline will be returned. If the two given points are identical, it depends on the inclusive flag whether a polyline containing that point once, or an empty polyline will be returned.
* Parameters:
* **start\_point** ([`Point`](#Point "viktor.geometry.Point"))
* **end\_point** ([`Point`](#Point "viktor.geometry.Point"))
* **inclusive** (`bool`) – if true, the start and the end points will be added to the returned list
* Raises:
**ValueError** – when one of the two given points does not lie on this polyline
* Return type:
[`Polyline`](#Polyline "viktor.geometry.Polyline")
* get\_reversed\_polyline()[](#Polyline.get_reversed_polyline "Link to this definition")
Returns a polyline that is the reverse of this one.
* Return type:
[`Polyline`](#Polyline "viktor.geometry.Polyline")
- intersections\_with\_polyline(*other\_polyline*)[](#Polyline.intersections_with_polyline "Link to this definition")
Find all intersections with another polyline and return them ordered according to the direction of this polyline
If the polylines are partly parallel, the start and end points of the parallel section will be returned as intersections. If one of the polylines is a subset of the other, or the two lines are completely parallel, no intersections will be found.
* Parameters:
**other\_polyline** ([`Polyline`](#Polyline "viktor.geometry.Polyline"))
* Return type:
`List`\[[`Point`](#Point "viktor.geometry.Point")]
* intersections\_with\_x\_location(*x*)[](#Polyline.intersections_with_x_location "Link to this definition")
Find all intersections of this polyline with a given x location. Ordered from start to end of this polyline.
If this line is partly vertical, the start and end points of the vertical section will be returned as an intersection. If this line is completely vertical, no intersections will be found.
* Parameters:
**x** (`float`)
* Return type:
`List`\[[`Point`](#Point "viktor.geometry.Point")]
- is\_equal\_to(*other*)[](#Polyline.is_equal_to "Link to this definition")
Check if all points in this polyline coincide with all points of another polyline
* Parameters:
**other** ([`Polyline`](#Polyline "viktor.geometry.Polyline")) – Other polyline
* Return type:
`bool`
* is\_monotonic\_ascending\_x(*strict=True*)[](#Polyline.is_monotonic_ascending_x "Link to this definition")
Check if the x coordinates of the points of this polyline are ascending.
* Parameters:
**strict** (`bool`) – when set to false, equal x coordinates are accepted between points
* Return type:
`bool`
- is\_monotonic\_ascending\_y(*strict=True*)[](#Polyline.is_monotonic_ascending_y "Link to this definition")
Check if the y coordinates of the points of this polyline are ascending
* Parameters:
**strict** (`bool`) – when set to false, equal y coordinates are accepted between points
* Return type:
`bool`
* *property *lines*: List\[[Line](#Line "viktor.geometry.Line")]*[](#Polyline.lines "Link to this definition")
A list of lines connecting all polyline points. Lines between coincident points are skipped.
- point\_is\_on\_polyline(*point*)[](#Polyline.point_is_on_polyline "Link to this definition")
Check if a given point lies on this polyline
* Parameters:
**point** ([`Point`](#Point "viktor.geometry.Point"))
* Return type:
`bool`
* *property *points*: List\[[Point](#Point "viktor.geometry.Point")]*[](#Polyline.points "Link to this definition")
- serialize()[](#Polyline.serialize "Link to this definition")
Return a json serializable dict of form:
```
[
{'x': point_1.x, 'y': point_1.y},
{'x': point_2.x, 'y': point_2.y}
]
```
* Return type:
`List`\[`dict`]
* split(*point*)[](#Polyline.split "Link to this definition")
return the two separate parts of this polyline before and after the given point.
* Parameters:
**point** ([`Point`](#Point "viktor.geometry.Point"))
* Raises:
**ValueError** – if the provided point does not lie on this polyline.
* Return type:
`Tuple`\[[`Polyline`](#Polyline "viktor.geometry.Polyline"), [`Polyline`](#Polyline "viktor.geometry.Polyline")]
- *property *start\_point*: [Point](#Point "viktor.geometry.Point")*[](#Polyline.start_point "Link to this definition")
First point in polyline.points
* *property *x\_max*: float | None*[](#Polyline.x_max "Link to this definition")
The highest x-coordinate present within this polyline.
- *property *x\_min*: float | None*[](#Polyline.x_min "Link to this definition")
The lowest x-coordinate present within this polyline.
* *property *y\_max*: float | None*[](#Polyline.y_max "Link to this definition")
The highest y-coordinate present within this polyline.
- *property *y\_min*: float | None*[](#Polyline.y_min "Link to this definition")
The lowest y-coordinate present within this polyline.
* *property *z\_max*: float | None*[](#Polyline.z_max "Link to this definition")
The highest z-coordinate present within this polyline.
- *property *z\_min*: float | None*[](#Polyline.z_min "Link to this definition")
The lowest z-coordinate present within this polyline.
## RDWGSConverter[](https://docs.viktor.ai/sdk/api/geometry/.md#_RDWGSConverter "Direct link to RDWGSConverter")
* *class *viktor.geometry.RDWGSConverter[](#RDWGSConverter "Link to this definition")
Class that provides functions to translate latitude and longitude coordinates between the WGS system and RD system.
The RD coordinate system is a cartesian coordinate system that is frequently used for in civil engineering to describe locations in the Netherlands. The origin is located in france, so that for all of the Netherlands, both x (m) and y (m) values are positive and y is always larger then x. The domain in which the RD coordinate system is valid is:
* x: \[-7000, 300000]
* y: \[289000, 629000]
About the RD coordinate system:
* X0* = 155000*[](#RDWGSConverter.X0 "Link to this definition")
- Y0* = 463000*[](#RDWGSConverter.Y0 "Link to this definition")
* *static *from\_rd\_to\_wgs(*coords*)[](#RDWGSConverter.from_rd_to_wgs "Link to this definition")
Convert RD coordinates (x, y) to WGS coordinates \[latitude, longitude].
```
lat, lon = RDWGSConverter.from_rd_to_wgs((100000, 400000))
```
* Parameters:
**coords** (`Tuple`\[`float`, `float`]) – RD coordinates (x, y)
* Return type:
`List`\[`float`]
- *static *from\_wgs\_to\_rd(*coords*)[](#RDWGSConverter.from_wgs_to_rd "Link to this definition")
Convert WGS coordinates (latitude, longitude) to RD coordinates \[x, y].
```
x, y = RDWGSConverter.from_wgs_to_rd((51.58622, 4.59360))
```
* Parameters:
**coords** (`Tuple`\[`float`, `float`]) – WGS coordinates (latitude, longitude)
* Return type:
`List`\[`float`]
* lam0* = 5.38720621*[](#RDWGSConverter.lam0 "Link to this definition")
- phi0* = 52.1551744*[](#RDWGSConverter.phi0 "Link to this definition")
## RectangularExtrusion[](https://docs.viktor.ai/sdk/api/geometry/.md#_RectangularExtrusion "Direct link to RectangularExtrusion")
* *class *viktor.geometry.RectangularExtrusion(*width*, *height*, *line*, *profile\_rotation=0*, *\**, *material=None*, *identifier=None*)[](#RectangularExtrusion "Link to this definition")
Bases: [`Extrusion`](#Extrusion "viktor.geometry.Extrusion")
Extruded object from a given set of points, which is called the profile. This profile should meet the following requirements:
> * start point should be added at the end for closed profile
>
> * points should be defined in z=0 plane
>
> * circumference should be defined clockwise
Note that the profile is defined with respect to the start point of the Line object, i.e. the profile is defined in the local coordinate system. An example is given below of two extrusions with the same dimensions. Their corresponding Line objects are also visualized. The extrusion have the following profile:
```
# black box
profile_b = [
Point(1, 1),
Point(1, 2),
Point(2, 2),
Point(2, 1),
Point(1, 1),
]
box_b = Extrusion(profile_b, Line(Point(4, 1, 0), Point(4, 1, 1)))
# yellow box
profile_y = [
Point(-0.5, -0.5),
Point(-0.5, 0.5),
Point(0.5, 0.5),
Point(0.5, -0.5),
Point(-0.5, -0.5),
]
box_y = Extrusion(profile_y, Line(Point(2, 2, 0), Point(2, 2, 1)))
```
[](https://docs.viktor.ai/_images/extrusion-profile.png)
* Parameters:
* **profile** – Coordinates of cross-section.
* **line** ([`Line`](#Line "viktor.geometry.Line")) – A line object is used to define the length (thickness) of the extrusion.
* **profile\_rotation** (`float`) – Rotation of the profile around the Z-axis in degrees.
* **material** ([`Material`](#Material "viktor.geometry.Material")) – optional material
* **identifier** (`str`) – object identifier (new in v14.10.0)
- *property *cross\_sectional\_area*: float*[](#RectangularExtrusion.cross_sectional_area "Link to this definition")
Returns the area of the cross-section (width x height).
* *property *height*: float*[](#RectangularExtrusion.height "Link to this definition")
Height of the extrusion.
- *property *inner\_volume*: float*[](#RectangularExtrusion.inner_volume "Link to this definition")
Returns the inner volume of the extruded object.
* *property *width*: float*[](#RectangularExtrusion.width "Link to this definition")
Width of the extrusion.
## Revolve[](https://docs.viktor.ai/sdk/api/geometry/.md#_Revolve "Direct link to Revolve")
* *class *viktor.geometry.Revolve(*\*args*, *rotation\_angle=None*, *material=None*, *identifier=None*, *\*\*kwargs*)[](#Revolve "Link to this definition")
Bases: [`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject"), `ABC`
Abstract base class of a revolved object.
* *abstract property *inner\_volume*: float*[](#Revolve.inner_volume "Link to this definition")
- *property *mass*: float*[](#Revolve.mass "Link to this definition")
Calculates the mass of the object as rho \* area \* thickness, with rho the density of the Material.
* *abstract property *surface\_area*: float*[](#Revolve.surface_area "Link to this definition")
- *property *thickness*: float*[](#Revolve.thickness "Link to this definition")
## Sphere[](https://docs.viktor.ai/sdk/api/geometry/.md#_Sphere "Direct link to Sphere")
* *class *viktor.geometry.Sphere(*centre\_point*, *radius*, *width\_segments=30*, *height\_segments=30*, *material=None*, *\**, *identifier=None*)[](#Sphere "Link to this definition")
Bases: [`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")
This class can be used to construct a spherical object around the specified coordinate.
The smoothness of the edges can be altered by setting width\_segments and height\_segments. In the example below both the default smoothness of 30 (left) and a rough sphere with 5 segments (right) is shown:
[](https://docs.viktor.ai/_images/sphere.png)
* Parameters:
* **centre\_point** ([`Point`](#Point "viktor.geometry.Point")) – Center point of the sphere.
* **radius** (`float`) – Radius of the sphere.
* **width\_segments** (`float`) – Sets the smoothness in xz-plane.
* **height\_segments** (`float`) – Sets the smoothness in yz-plane.
* **material** ([`Material`](#Material "viktor.geometry.Material")) – Optionally a custom material can be set.
* **identifier** (`str`) – object identifier (new in v14.10.0)
- circumference()[](#Sphere.circumference "Link to this definition")
* Return type:
`float`
* diameter()[](#Sphere.diameter "Link to this definition")
* Return type:
`float`
- surface\_area()[](#Sphere.surface_area "Link to this definition")
* Return type:
`float`
* volume()[](#Sphere.volume "Link to this definition")
* Return type:
`float`
## SquareBeam[](https://docs.viktor.ai/sdk/api/geometry/.md#_SquareBeam "Direct link to SquareBeam")
* *class *viktor.geometry.SquareBeam(*length\_x*, *length\_y*, *length\_z*, *\**, *material=None*, *identifier=None*)[](#SquareBeam "Link to this definition")
Bases: [`RectangularExtrusion`](#RectangularExtrusion "viktor.geometry.RectangularExtrusion")
High level object to create a rectangular beam object around the origin. The centroid of the beam is located at the origin (0, 0, 0).
* Parameters:
* **length\_x** (`float`) – Width of the extrusion in x-direction.
* **length\_y** (`float`) – Length of the extrusion in y-direction.
* **length\_z** (`float`) – Height of the extrusion in z-direction.
* **material** ([`Material`](#Material "viktor.geometry.Material")) – optional material
* **identifier** (`str`) – object identifier (new in v14.10.0)
## Torus[](https://docs.viktor.ai/sdk/api/geometry/.md#_Torus "Direct link to Torus")
* *class *viktor.geometry.Torus(*radius\_cross\_section*, *radius\_rotation\_axis*, *rotation\_angle=6.283185307179586*, *\**, *material=None*, *identifier=None*)[](#Torus "Link to this definition")
Bases: [`Group`](#Group "viktor.geometry.Group")
Create a torus object
* Parameters:
* **radius\_cross\_section** (`float`)
* **radius\_rotation\_axis** (`float`) – measured from central axis to centre of cross-section.
* **rotation\_angle** (`float`) – optional argument to control how large of a torus section you want. 2pi for complete torus
* **material** ([`Material`](#Material "viktor.geometry.Material")) – optional material
* **identifier** (`str`) – object identifier (new in v14.10.0)
- *property *inner\_volume*: float*[](#Torus.inner_volume "Link to this definition")
* *property *material*: [Material](#Material "viktor.geometry.Material")*[](#Torus.material "Link to this definition")
## TransformableObject[](https://docs.viktor.ai/sdk/api/geometry/.md#_TransformableObject "Direct link to TransformableObject")
* *class *viktor.geometry.TransformableObject(*\**, *identifier=None*)[](#TransformableObject "Link to this definition")
Bases: `ABC`
* mirror(*point*, *normal*)[](#TransformableObject.mirror "Link to this definition")
Mirror an object on a plane defined by a point and normal vector.
* Parameters:
* **point** ([`Point`](#Point "viktor.geometry.Point") | `Tuple`\[`float`, `float`, `float`]) – Point within the mirror plane.
* **normal** ([`Vector`](#Vector "viktor.geometry.Vector") | `Tuple`\[`float`, `float`, `float`]) – Normal vector of the mirror plane.
* Return type:
[`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")
- rotate(*angle*, *direction*, *point=None*)[](#TransformableObject.rotate "Link to this definition")
Rotate an object along an axis (direction) by an angle. Direction will follow right hand rule.
* Parameters:
* **angle** (`float`) – Angle of desired rotation in radians.
* **direction** ([`Vector`](#Vector "viktor.geometry.Vector") | `Tuple`\[`float`, `float`, `float`]) – Vector along which rotation is to be performed.
* **point** ([`Point`](#Point "viktor.geometry.Point") | `Tuple`\[`float`, `float`, `float`]) – Point through which the rotation vector runs.
* Return type:
[`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")
* scale(*scaling\_vector*)[](#TransformableObject.scale "Link to this definition")
Scale an object along a scaling vector.
* Parameters:
**scaling\_vector** ([`Vector`](#Vector "viktor.geometry.Vector") | `Tuple`\[`float`, `float`, `float`]) – Vector along which scaling is to be performed.
* Return type:
[`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")
- translate(*translation\_vector*)[](#TransformableObject.translate "Link to this definition")
Translate an object along a translation vector.
* Parameters:
**translation\_vector** ([`Vector`](#Vector "viktor.geometry.Vector") | `Tuple`\[`float`, `float`, `float`]) – Vector along which translation is to be performed.
* Return type:
[`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")
## Triangle[](https://docs.viktor.ai/sdk/api/geometry/.md#_Triangle "Direct link to Triangle")
* *class *viktor.geometry.Triangle(*point1*, *point2*, *point3*)[](#Triangle "Link to this definition")
Creates a Triangle object from 3D vertices.
* Parameters:
* **point1** ([`Point`](#Point "viktor.geometry.Point")) – First vertex.
* **point2** ([`Point`](#Point "viktor.geometry.Point")) – Second vertex.
* **point3** ([`Point`](#Point "viktor.geometry.Point")) – Third vertex.
- area()[](#Triangle.area "Link to this definition")
Returns the area of the triangle.
* Return type:
`float`
* *property *centroid*: Tuple\[float, float, float]*[](#Triangle.centroid "Link to this definition")
Returns the centroid (X, Y, Z) of the triangle.
- *property *moment\_of\_inertia*: Tuple\[float, float]*[](#Triangle.moment_of_inertia "Link to this definition")
Returns the moment of inertia (Ix, Iy) (only in x-y plane).
## TriangleAssembly[](https://docs.viktor.ai/sdk/api/geometry/.md#_TriangleAssembly "Direct link to TriangleAssembly")
* *class *viktor.geometry.TriangleAssembly(*triangles*, *\**, *material=None*, *skip\_duplicate\_vertices\_check=False*, *identifier=None*)[](#TriangleAssembly "Link to this definition")
Bases: [`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")
Fundamental visualisation geometry, built up from triangles. Right hand rule on triangle circumference determines the surface direction.
* Parameters:
* **triangles** (`List`\[[`Triangle`](#Triangle "viktor.geometry.Triangle")]) – Triangles of the assembly.
* **material** ([`Material`](#Material "viktor.geometry.Material")) – optional material.
* **skip\_duplicate\_vertices\_check** (`bool`) – if True, duplicate vertices are not filtered on serialization of the triangles. This may boost performance (default: False).
* **identifier** (`str`) – object identifier (new in v14.10.0)
## Vector[](https://docs.viktor.ai/sdk/api/geometry/.md#_Vector "Direct link to Vector")
* *class *viktor.geometry.Vector(*x*, *y*, *z=0*)[](#Vector "Link to this definition")
A 3-dimensional vector in space.
The following operations are supported:
* Negation
> ```
> v1 = Vector(1, 2, 3)
> v2 = -v1 # results in Vector(-1, -2, -3)
> ```
* Addition
> ```
> v1 = Vector(1, 2, 3)
> v2 = Vector(1, 2, 3)
> v3 = v1 + v2 # results in Vector(2, 4, 6)
> ```
* Subtraction
> ```
> v1 = Vector(1, 2, 3)
> v2 = Vector(1, 2, 3)
> v3 = v1 - v2 # results in Vector(0, 0, 0)
> ```
* (reverse) Multiplication
> ```
> v1 = Vector(1, 2, 3)
> v2 = v1 * 3 # results in Vector(3, 6, 9)
> v3 = 3 * v1 # results in Vector(3, 6, 9)
> ```
* Dot product
> ```
> v1 = Vector(1, 2, 3)
> v2 = Vector(1, 2, 3)
> res = v1.dot(v2) # results in 14
> ```
* Cross product
> ```
> v1 = Vector(1, 0, 0)
> v2 = Vector(0, 1, 0)
> v3 = v1.cross(v2) # results in Vector(0, 0, 1)
> ```
- Parameters:
* **x** (`float`) – X-coordinate.
* **y** (`float`) – Y-coordinate.
* **z** (`float`) – Z-coordinate (default: 0).
* *property *coordinates*: Tuple\[float, float, float]*[](#Vector.coordinates "Link to this definition")
Coordinates of the Vector as tuple (X, Y, Z).
- cross(*other*)[](#Vector.cross "Link to this definition")
Vector product of two vectors.
* Parameters:
**other** ([`Vector`](#Vector "viktor.geometry.Vector")) – Second Vector
* Return type:
[`Vector`](#Vector "viktor.geometry.Vector")
* dot(*other*)[](#Vector.dot "Link to this definition")
Scalar product of two vectors.
* Parameters:
**other** ([`Vector`](#Vector "viktor.geometry.Vector")) – Second Vector
* Return type:
`float`
- *property *magnitude*: float*[](#Vector.magnitude "Link to this definition")
Magnitude of the Vector.
* normalize()[](#Vector.normalize "Link to this definition")
Return the normalized vector (with unit-length).
* Raises:
**ValueError** – if vector is a null-vector.
* Return type:
[`Vector`](#Vector "viktor.geometry.Vector")
- *property *squared\_magnitude*: float*[](#Vector.squared_magnitude "Link to this definition")
Vector magnitude without square root; faster than magnitude.
## add\_point[](https://docs.viktor.ai/sdk/api/geometry/.md#_add_point "Direct link to add_point")
* viktor.geometry.add\_point(*unique\_points*, *point*)[](#add_point "Link to this definition")
Adds a Point object to a unique list of Point objects. The point is only added when not already present in the list.
* Parameters:
* **unique\_points** (`List`\[[`Point`](#Point "viktor.geometry.Point")]) – List of point objects.
* **point** ([`Point`](#Point "viktor.geometry.Point")) – Point object which has to be added.
* Return type:
`Tuple`\[`List`\[[`Point`](#Point "viktor.geometry.Point")], `int`]
## calculate\_distance\_vector[](https://docs.viktor.ai/sdk/api/geometry/.md#_calculate_distance_vector "Direct link to calculate_distance_vector")
* viktor.geometry.calculate\_distance\_vector(*start\_point*, *end\_point*)[](#calculate_distance_vector "Link to this definition")
Calculates the distance between start and end point in the direction start -> end.
* Parameters:
* **start\_point** ([`Point`](#Point "viktor.geometry.Point")) – Start position of the distance vector.
* **end\_point** ([`Point`](#Point "viktor.geometry.Point")) – End position of the distance vector.
* Return type:
`ndarray`
## calculate\_intersection\_bounded\_line\_extended\_line[](https://docs.viktor.ai/sdk/api/geometry/.md#_calculate_intersection_bounded_line_extended_line "Direct link to calculate_intersection_bounded_line_extended_line")
* viktor.geometry.calculate\_intersection\_bounded\_line\_extended\_line(*bounded\_line*, *extended\_line*, *inclusive=True*)[](#calculate_intersection_bounded_line_extended_line "Link to this definition")
Calculate intersection between line with fixed endpoints and line which is indefinitely extended.
* Parameters:
* **bounded\_line** ([`Line`](#Line "viktor.geometry.Line")) – Bounded Line object.
* **extended\_line** ([`Line`](#Line "viktor.geometry.Line")) – Extended Line object.
* **inclusive** (`bool`) – If set to True, this method will also check for end points that are located on one of the line ends.
* Return type:
[`Point`](#Point "viktor.geometry.Point") | `None`
## calculate\_intersection\_bounded\_line\_with\_y[](https://docs.viktor.ai/sdk/api/geometry/.md#_calculate_intersection_bounded_line_with_y "Direct link to calculate_intersection_bounded_line_with_y")
* viktor.geometry.calculate\_intersection\_bounded\_line\_with\_y(*line*, *y\_intersection*)[](#calculate_intersection_bounded_line_with_y "Link to this definition")
Calculate x intersection between two points and y value. Return None if no intersection is found.
```
Returns x: Returns None:
o
/
y-----/--- y---------
/: o
/ : /
o x o
```
* Parameters:
* **line** ([`Line`](#Line "viktor.geometry.Line")) – Line object.
* **y\_intersection** (`float`) – y-value of the intersection line.
* Return type:
`float` | `None`
## calculate\_intersection\_bounded\_lines[](https://docs.viktor.ai/sdk/api/geometry/.md#_calculate_intersection_bounded_lines "Direct link to calculate_intersection_bounded_lines")
* viktor.geometry.calculate\_intersection\_bounded\_lines(*bounded\_line1*, *bounded\_line2*, *inclusive=True*)[](#calculate_intersection_bounded_lines "Link to this definition")
Calculate intersection between two lines with fixed endpoints (2D only, Z-coordinate is ignored!).
* Parameters:
* **bounded\_line1** ([`Line`](#Line "viktor.geometry.Line")) – First bounded Line object.
* **bounded\_line2** ([`Line`](#Line "viktor.geometry.Line")) – Second bounded Line object.
* **inclusive** (`bool`) – If set to True, intersections on the endpoint will also be taken into account.
* Return type:
[`Point`](#Point "viktor.geometry.Point") | `None`
## calculate\_intersection\_extended\_line\_with\_x[](https://docs.viktor.ai/sdk/api/geometry/.md#_calculate_intersection_extended_line_with_x "Direct link to calculate_intersection_extended_line_with_x")
* viktor.geometry.calculate\_intersection\_extended\_line\_with\_x(*line*, *x*)[](#calculate_intersection_extended_line_with_x "Link to this definition")
Returns the point at which a given line intersects a vertical axis at position x.
```
Returns P(x, y): Returns P(x, y):
o
/
y-----P--- y-----P----
/: o:
/ : / :
o x o x
```
* Parameters:
* **line** ([`Line`](#Line "viktor.geometry.Line")) – Line to be evaluated.
* **x** (`float`) – x-value of the intersection line.
* Return type:
[`Point`](#Point "viktor.geometry.Point")
## calculate\_intersection\_extended\_line\_with\_y[](https://docs.viktor.ai/sdk/api/geometry/.md#_calculate_intersection_extended_line_with_y "Direct link to calculate_intersection_extended_line_with_y")
* viktor.geometry.calculate\_intersection\_extended\_line\_with\_y(*line*, *y\_intersection*)[](#calculate_intersection_extended_line_with_y "Link to this definition")
Calculates the intersection x value of a line at a given y value.
```
Returns x: Returns x:
o
/
y-----/--- y----------
/: o:
/ : / :
o x o x
```
* Parameters:
* **line** ([`Line`](#Line "viktor.geometry.Line")) – Line object.
* **y\_intersection** (`float`) – y-value of the intersection line.
* Return type:
`float`
## calculate\_intersection\_extended\_lines[](https://docs.viktor.ai/sdk/api/geometry/.md#_calculate_intersection_extended_lines "Direct link to calculate_intersection_extended_lines")
* viktor.geometry.calculate\_intersection\_extended\_lines(*extended\_line1*, *extended\_line2*)[](#calculate_intersection_extended_lines "Link to this definition")
Calculate intersection between two lines defined by start/end points. The lines are assumed to extend infinitely: bounds are not taken account. Returns None if lines are parallel (i.e. no intersection exists).
```
Returns P(x, y): Returns P(x, y): Returns None:
o
/
o-----P---o o--o P o-----o
/ o
/ / o--o
o o
```
* Parameters:
* **extended\_line1** ([`Line`](#Line "viktor.geometry.Line")) – First Line object.
* **extended\_line2** ([`Line`](#Line "viktor.geometry.Line")) – Second Line object.
* Return type:
[`Point`](#Point "viktor.geometry.Point") | `None`
## cartesian\_to\_cylindrical[](https://docs.viktor.ai/sdk/api/geometry/.md#_cartesian_to_cylindrical "Direct link to cartesian_to_cylindrical")
* viktor.geometry.cartesian\_to\_cylindrical(*cartesian\_coordinates*)[](#cartesian_to_cylindrical "Link to this definition")
Using ISO convention:
Reference plane is former Cartesian xy-plane and cylindrical axis is the Cartesian z-axis.
* Parameters:
**cartesian\_coordinates** (`Tuple`\[`float`, `float`, `float`]) – Cartesian coordinates (x, y, z).
* Return type:
`ndarray`
* Returns:
Cylindrical coordinates (rho, phi, z) with phi between -pi and +pi.
## cartesian\_to\_spherical[](https://docs.viktor.ai/sdk/api/geometry/.md#_cartesian_to_spherical "Direct link to cartesian_to_spherical")
* viktor.geometry.cartesian\_to\_spherical(*cartesian\_coordinates*)[](#cartesian_to_spherical "Link to this definition")
Using ISO/physical convention:
* Parameters:
**cartesian\_coordinates** (`Tuple`\[`float`, `float`, `float`]) – Cartesian coordinates (x, y, z).
* Return type:
`ndarray`
* Returns:
Spherical coordinates (r, theta, phi).
## circumference\_is\_clockwise[](https://docs.viktor.ai/sdk/api/geometry/.md#_circumference_is_clockwise "Direct link to circumference_is_clockwise")
* viktor.geometry.circumference\_is\_clockwise(*circumference*)[](#circumference_is_clockwise "Link to this definition")
* Method determines the direction of a set of points, and returns:
* True if the circumference is clockwise
* False if the circumference is counter-clockwise
- Parameters:
**circumference** (`List`\[[`Point`](#Point "viktor.geometry.Point")]) – Circumference in x,y-plane.
- Return type:
`bool`
## convert\_points\_for\_lathe[](https://docs.viktor.ai/sdk/api/geometry/.md#_convert_points_for_lathe "Direct link to convert_points_for_lathe")
* viktor.geometry.convert\_points\_for\_lathe(*points*)[](#convert_points_for_lathe "Link to this definition")
Method can be used to convert Point objects to lists of dictionaries in the format: {‘x’: point.x, ‘y’: point.y}
* Parameters:
**points** (`Sequence`\[[`Point`](#Point "viktor.geometry.Point")]) – Point objects.
* Return type:
`List`\[`dict`]
## cylindrical\_to\_cartesian[](https://docs.viktor.ai/sdk/api/geometry/.md#_cylindrical_to_cartesian "Direct link to cylindrical_to_cartesian")
* viktor.geometry.cylindrical\_to\_cartesian(*cylindrical\_coordinates*)[](#cylindrical_to_cartesian "Link to this definition")
Using ISO convention:
Reference plane is former Cartesian xy-plane and cylindrical axis is the Cartesian z-axis.
* Parameters:
**cylindrical\_coordinates** (`Tuple`\[`float`, `float`, `float`]) – Cylindrical coordinates (rho, phi, z).
* Return type:
`ndarray`
* Returns:
Cartesian coordinates (x, y, z).
## find\_overlap[](https://docs.viktor.ai/sdk/api/geometry/.md#_find_overlap "Direct link to find_overlap")
* viktor.geometry.find\_overlap(*region\_a*, *region\_b*, *inclusive=False*)[](#find_overlap "Link to this definition")
Given to regions with upper and lower boundary, check if there is overlap and if so return a tuple with the overlap found
The direction of the given regions does not matter: (1, 2) will be handled exactly the same as (2, 1) The returned Tuple will always be in ascending order
Example usage:
```
find_overlap((2, 4), (3, 5)) -> (3, 4)
find_overlap((4, 2), (5, 3)) -> (3, 4)
find_overlap((2, 3), (3, 4)) -> None
find_overlap((2, 3), (3, 4), inclusive=True) -> (3, 3)
```
* Parameters:
* **region\_a** (`Tuple`\[`float`, `float`]) – Tuple of values of the first region.
* **region\_b** (`Tuple`\[`float`, `float`]) – Tuple of values of the second region.
* **inclusive** (`bool`) – A flag to decide whether a point overlap is counted as overlap or not.
* Return type:
`None` | `Tuple`\[`float`, `float`]
* Returns:
A tuple with upper and lower bounds of the overlapping region, or None.
## get\_line\_function\_parameters[](https://docs.viktor.ai/sdk/api/geometry/.md#_get_line_function_parameters "Direct link to get_line_function_parameters")
* viktor.geometry.get\_line\_function\_parameters(*line*)[](#get_line_function_parameters "Link to this definition")
Returns the line function parameters (a, b) of a line (y = ax + b).
* Return type:
`Tuple`\[`float`, `float`]
## get\_vertices\_faces[](https://docs.viktor.ai/sdk/api/geometry/.md#_get_vertices_faces "Direct link to get_vertices_faces")
* viktor.geometry.get\_vertices\_faces(*triangles*)[](#get_vertices_faces "Link to this definition")
Returns the vertices and faces of a list of Triangle objects.
* Parameters:
**triangles** (`List`\[[`Triangle`](#Triangle "viktor.geometry.Triangle")]) – List of triangle objects.
* Return type:
`Tuple`\[`list`, `list`]
## line\_is\_horizontal[](https://docs.viktor.ai/sdk/api/geometry/.md#_line_is_horizontal "Direct link to line_is_horizontal")
* viktor.geometry.line\_is\_horizontal(*line*)[](#line_is_horizontal "Link to this definition")
Returns True if line is horizontal.
* Return type:
`bool`
## line\_is\_vertical[](https://docs.viktor.ai/sdk/api/geometry/.md#_line_is_vertical "Direct link to line_is_vertical")
* viktor.geometry.line\_is\_vertical(*line*)[](#line_is_vertical "Link to this definition")
Returns True if line is vertical.
* Return type:
`bool`
## lines\_in\_same\_plane[](https://docs.viktor.ai/sdk/api/geometry/.md#_lines_in_same_plane "Direct link to lines_in_same_plane")
* viktor.geometry.lines\_in\_same\_plane(*line1*, *line2*)[](#lines_in_same_plane "Link to this definition")
Method to determine whether two Line objects are located in a shared plane and hence are coplanar.
* Parameters:
* **line1** ([`Line`](#Line "viktor.geometry.Line")) – First line object.
* **line2** ([`Line`](#Line "viktor.geometry.Line")) – Second line object.
* Return type:
`bool`
## mirror\_object[](https://docs.viktor.ai/sdk/api/geometry/.md#_mirror_object "Direct link to mirror_object")
* viktor.geometry.mirror\_object(*obj*, *point*, *normal*)[](#mirror_object "Link to this definition")
Function that mirrors an object through a plane. The plane is defined by a point and a normal vector. The return is a copy of the original object, mirrored over the specified plane.
* Parameters:
* **obj** ([`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")) – Object that is to be mirrored
* **point** ([`Point`](#Point "viktor.geometry.Point")) – Point object on the desired mirror plane
* **normal** ([`Vector`](#Vector "viktor.geometry.Vector") | `Tuple`\[`float`, `float`, `float`]) – Vector that denotes a normal vector of the desired mirror plane.
* Return type:
[`TransformableObject`](#TransformableObject "viktor.geometry.TransformableObject")
## point\_is\_on\_bounded\_line[](https://docs.viktor.ai/sdk/api/geometry/.md#_point_is_on_bounded_line "Direct link to point_is_on_bounded_line")
* viktor.geometry.point\_is\_on\_bounded\_line(*point*, *line*, *inclusive=True*)[](#point_is_on_bounded_line "Link to this definition")
Check whether a given Point object is within the ends of a Line.
* Parameters:
* **point** ([`Point`](#Point "viktor.geometry.Point") | `Tuple`\[`float`, `float`, `float`]) – Point to be evaluated.
* **line** ([`Line`](#Line "viktor.geometry.Line") | `Tuple`\[`Tuple`\[`float`, `float`, `float`], `Tuple`\[`float`, `float`, `float`]]) – Line object.
* **inclusive** (`bool`) – If True, this method will also return True when the point is located on one of the line ends.
* Return type:
`bool`
## points\_are\_coplanar[](https://docs.viktor.ai/sdk/api/geometry/.md#_points_are_coplanar "Direct link to points_are_coplanar")
* viktor.geometry.points\_are\_coplanar(*points*)[](#points_are_coplanar "Link to this definition")
Determine whether all given points are coplanar (are on a two-dimensional plane).
* Parameters:
**points** (`Sequence`\[[`Point`](#Point "viktor.geometry.Point") | `Tuple`\[`float`, `float`, `float`]]) – points to be evaluated (min. 3).
* Return type:
`bool`
Example usage:
```
points = [[Point(0, 3, 1), Point(0, 5, 1), Point(2, 3, 4), Point(2, 5, 4)]]
coplanar = points_are_coplanar(points)
coplanar = points_are_coplanar([(0, 3, 1), (0, 5, 1), (2, 3, 4), (2, 5, 4)])
```
## reflection\_matrix[](https://docs.viktor.ai/sdk/api/geometry/.md#_reflection_matrix "Direct link to reflection_matrix")
* viktor.geometry.reflection\_matrix(*point*, *normal*)[](#reflection_matrix "Link to this definition")
Returns the reflection matrix to mirror at a plane defined by a point and a normal vector.
* Parameters:
* **point** ([`Point`](#Point "viktor.geometry.Point") | `Tuple`\[`float`, `float`, `float`]) – Point object.
* **normal** ([`Vector`](#Vector "viktor.geometry.Vector") | `Tuple`\[`float`, `float`, `float`]) – Normal vector of the mirror plane.
* Return type:
`ndarray`
## rotation\_matrix[](https://docs.viktor.ai/sdk/api/geometry/.md#_rotation_matrix "Direct link to rotation_matrix")
* viktor.geometry.rotation\_matrix(*angle*, *direction*, *point=None*)[](#rotation_matrix "Link to this definition")
Returns the rotation matrix that corresponds to a rotation about an axis defined by a point and direction. Angle in radians, direction in accordance to right-hand rule.
Example:
```
R = rotation_matrix(pi/2, [0, 0, 1], [1, 0, 0])
np.allclose(np.dot(R, [0, 0, 0, 1]), [1, -1, 0, 1]) # True
```
* Return type:
`ndarray`
## scaling\_matrix[](https://docs.viktor.ai/sdk/api/geometry/.md#_scaling_matrix "Direct link to scaling_matrix")
* viktor.geometry.scaling\_matrix(*scaling\_vector*)[](#scaling_matrix "Link to this definition")
Returns the scaling matrix that corresponds to a given scaling vector (3D).
* Parameters:
**scaling\_vector** ([`Vector`](#Vector "viktor.geometry.Vector") | `Tuple`\[`float`, `float`, `float`]) – Three-dimensional scaling vector.
* Return type:
`ndarray`
## spherical\_to\_cartesian[](https://docs.viktor.ai/sdk/api/geometry/.md#_spherical_to_cartesian "Direct link to spherical_to_cartesian")
* viktor.geometry.spherical\_to\_cartesian(*spherical\_coordinates*)[](#spherical_to_cartesian "Link to this definition")
Using ISO/physical convention:
* Parameters:
**spherical\_coordinates** (`Tuple`\[`float`, `float`, `float`]) – Spherical coordinates (r, theta, phi).
* Return type:
`ndarray`
* Returns:
Cartesian coordinates (x, y, z).
## surface\_area\_dome[](https://docs.viktor.ai/sdk/api/geometry/.md#_surface_area_dome "Direct link to surface_area_dome")
* viktor.geometry.surface\_area\_dome(*theta1*, *theta2*, *r*, *R*)[](#surface_area_dome "Link to this definition")
Computes the surface area of a dome (arc-revolve).
* Parameters:
* **theta1** (`float`) – Starting angle of arc in radians.
* **theta2** (`float`) – Ending angle of arc in radians.
* **r** (`float`) – Radius of arc.
* **R** (`float`) – Distance from centre of arc to rotation line.
* Return type:
`float`
* Returns:
surface area of arc-revolve.
## surface\_cone\_without\_base[](https://docs.viktor.ai/sdk/api/geometry/.md#_surface_cone_without_base "Direct link to surface_cone_without_base")
* viktor.geometry.surface\_cone\_without\_base(*r*, *h*)[](#surface_cone_without_base "Link to this definition")
Calculates the exterior surface of the cone, excluding the area of the circular base.
* Parameters:
* **r** (`float`) – Radius of the base.
* **h** (`float`) – Height of the cone.
* Return type:
`float`
## translation\_matrix[](https://docs.viktor.ai/sdk/api/geometry/.md#_translation_matrix "Direct link to translation_matrix")
* viktor.geometry.translation\_matrix(*direction*)[](#translation_matrix "Link to this definition")
Returns the translation matrix that corresponds to a give direction vector (3D).
* Parameters:
**direction** ([`Vector`](#Vector "viktor.geometry.Vector") | `Tuple`\[`float`, `float`, `float`]) – Direction vector of the translation.
* Return type:
`ndarray`
## unit\_vector[](https://docs.viktor.ai/sdk/api/geometry/.md#_unit_vector "Direct link to unit_vector")
* viktor.geometry.unit\_vector(*data*, *axis=None*, *out=None*)[](#unit_vector "Link to this definition")
Returns the unit vector of a given vector.
* Return type:
`ndarray` | `None`
## volume\_cone[](https://docs.viktor.ai/sdk/api/geometry/.md#_volume_cone "Direct link to volume_cone")
* viktor.geometry.volume\_cone(*r*, *h*)[](#volume_cone "Link to this definition")
Calculates the volume of a cone.
* Parameters:
* **r** (`float`) – Radius of the base.
* **h** (`float`) – Height of the cone.
* Return type:
`float`
## x\_between\_bounds[](https://docs.viktor.ai/sdk/api/geometry/.md#_x_between_bounds "Direct link to x_between_bounds")
* viktor.geometry.x\_between\_bounds(*x*, *x1*, *x2*, *inclusive=True*)[](#x_between_bounds "Link to this definition")
Method checks whether the x value is between the bounds x1 and x2.
* Parameters:
* **x** (`float`) – x-value to be evaluated.
* **x1** (`float`) – Lower bound.
* **x2** (`float`) – Upper bound.
* **inclusive** (`bool`) – If set to True, this method will also return True when the x value is equal to either x1 or x2.
* Return type:
`bool`
## y\_between\_bounds[](https://docs.viktor.ai/sdk/api/geometry/.md#_y_between_bounds "Direct link to y_between_bounds")
* viktor.geometry.y\_between\_bounds(*y*, *y1*, *y2*, *inclusive=True*)[](#y_between_bounds "Link to this definition")
Method checks whether the y value is between the bounds y1 and y2.
* Parameters:
* **y** (`float`) – y-value to be evaluated.
* **y1** (`float`) – Lower bound.
* **y2** (`float`) – Upper bound.
* **inclusive** (`bool`) – If set to True, this method will also return True when the y value is equal to either y1 or y2.
* Return type:
`bool`
---
# viktor.llm
## ViktorOpenAI[](https://docs.viktor.ai/sdk/api/llm/.md#_ViktorOpenAI "Direct link to ViktorOpenAI")
* *class *viktor.llm.ViktorOpenAI[](#ViktorOpenAI "Link to this definition")
New in v14.29.0
Helper class for using the VIKTOR OpenAI service.
Example:
```
from openai import OpenAI
import viktor as vkt
client = OpenAI(
base_url=vkt.ViktorOpenAI.get_base_url(version='v1'),
api_key=vkt.ViktorOpenAI.get_api_key()
)
```
* *static *get\_api\_key()[](#ViktorOpenAI.get_api_key "Link to this definition")
Returns the API key that is required to access the VIKTOR OpenAI service.
* Return type:
`str`
- *static *get\_base\_url(*\**, *version*)[](#ViktorOpenAI.get_base_url "Link to this definition")
Returns the base URL to the VIKTOR OpenAI service.
* Parameters:
**version** (`str`) – version identifier that is appended to the base URL (e.g. “v1”)
* Return type:
`str`
---
# viktor.parametrization
## ActionButton[](https://docs.viktor.ai/sdk/api/parametrization/.md#_ActionButton "Direct link to ActionButton")
* *class *viktor.parametrization.ActionButton(*ui\_name*, *method*, *longpoll=True*, *\**, *visible=True*, *always\_available=False*, *flex=None*, *description=None*, *interaction=None*)[](#ActionButton "Link to this definition")
Bases: `_ActionButton`
Action button which can be pressed to perform a (heavy) calculation without returning a result.
Example usage:
```
# in parametrization:
calculation_btn = vkt.ActionButton("Analysis", "calculation", longpoll=True)
# in controller:
def calculation(self, params, **kwargs):
# perform calculation, no return necessary
```
* Parameters:
* **ui\_name** (`str`) – Name which is visible in the VIKTOR user interface.
* **method** (`str`) – Name of the download method that is defined in the controller
* **longpoll** (`bool`) – Set this option to True if the process that is invoked by the action button cannot be completed within the timeout limit.
* **visible** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | [`DynamicArrayConstraint`](#DynamicArrayConstraint "viktor.parametrization.DynamicArrayConstraint") | [`RowLookup`](#RowLookup "viktor.parametrization.RowLookup") | `Callable`) – Visibility of the button. A Constraint can be used when the visibility depends on other input fields.
* **always\_available** (`bool`) – deprecated
* **flex** (`int`) – The width of the field can be altered via this argument. value between 0 and 100 (default=33).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **interaction** ([`Interaction`](#Interaction "viktor.parametrization.Interaction")) – Enable view interaction through this button
New in v13.2.0
## AnalyseButton[](https://docs.viktor.ai/sdk/api/parametrization/.md#_AnalyseButton "Direct link to AnalyseButton")
* viktor.parametrization.AnalyseButton[](#AnalyseButton "Link to this definition")
alias of [`ActionButton`](#ActionButton "viktor.parametrization.ActionButton")
## And[](https://docs.viktor.ai/sdk/api/parametrization/.md#_And "Direct link to And")
* *class *viktor.parametrization.And(*\*operands*)[](#And "Link to this definition")
Bases: [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator")
Can be used to evaluate multiple operands to be True.
```
field_1 = vkt.NumberField('Field 1')
field_2 = vkt.BooleanField('Field 2')
field_3 = vkt.NumberField('Field 3', visible=vkt.And(vkt.IsEqual(vkt.Lookup('field_1'), 5), vkt.Lookup('field_2')))
```
* Parameters:
**operands** ([`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | `bool`) – Operands to be evaluated.
## AutocompleteField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_AutocompleteField "Direct link to AutocompleteField")
* *class *viktor.parametrization.AutocompleteField(*ui\_name*, *options*, *name=None*, *prefix=None*, *suffix=None*, *default=None*, *visible=True*, *flex=None*, *\**, *description=None*)[](#AutocompleteField "Link to this definition")
Bases: `_SelectField`
Similar to OptionField, except for two differences:
* user can type to search for option
* single option is not pre-selected
Example usage:
```
field = vkt.AutocompleteField('Available options', options=['Option 1', 'Option 2'], default='Option 1')
```
Or use an OptionListElement to obtain a value in the params which differs from the interface name:
```
_options = [vkt.OptionListElement('option_1', 'Option 1'), vkt.OptionListElement('option_2', 'Option 2')]
field = vkt.AutocompleteField('Available options', options=_options, default='option_1')
```
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
**options** (`list`\[`float` | `str` | [`OptionListElement`](#OptionListElement "viktor.parametrization.OptionListElement")] | `Callable`) – Options should be defined as a list of numbers, strings, or OptionListElement objects.
Data:
* type of selected option: integer, float or string
* None when nothing is selected
## AutodeskFileField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_AutodeskFileField "Direct link to AutodeskFileField")
* *class *viktor.parametrization.AutodeskFileField(*ui\_name*, *oauth2\_integration*, *\**, *file\_types=None*, *name=None*, *visible=True*, *flex=None*, *description=None*)[](#AutodeskFileField "Link to this definition")
Bases: [`Field`](#Field "viktor.parametrization.Field")
New in 14.25.0
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
* **oauth2\_integration** (`str`) – Name of the Autodesk OAuth2Integration this field is linked to.
* **file\_types** (`Sequence`\[`str`]) – Optional restriction on file type(s) (e.g. \[‘.rvt’]) (case-insensitive).
## BoolOperator[](https://docs.viktor.ai/sdk/api/parametrization/.md#_BoolOperator "Direct link to BoolOperator")
* *class *viktor.parametrization.BoolOperator[](#BoolOperator "Link to this definition")
Bases: `ABC`
Warning
Do not use this class directly in an application.
Base class for operators that can be used for field visibility and min/max. See the documentation of the subclasses for example implementations.
## BooleanField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_BooleanField "Direct link to BooleanField")
* *class *viktor.parametrization.BooleanField(*ui\_name*, *name=None*, *\**, *default=None*, *visible=True*, *flex=None*, *always\_available=False*, *description=None*)[](#BooleanField "Link to this definition")
Bases: [`Field`](#Field "viktor.parametrization.Field")
See [`Field`](#Field "viktor.parametrization.Field") for parameters
Additional parameters:
* Parameters:
**always\_available** (`bool`) – deprecated
Data:
* False or True
## Chat[](https://docs.viktor.ai/sdk/api/parametrization/.md#_Chat "Direct link to Chat")
* *class *viktor.parametrization.Chat(*ui\_name*, *method*, *\**, *first\_message=None*, *placeholder=None*, *flex=None*, *visible=True*)[](#Chat "Link to this definition")
Bases: `_ActionButton`
New in v14.21.0
**This field is currently in BETA**
Chat field, e.g. to enable an LLM conversation.
Example usage:
```
# in parametrization:
chat = vkt.Chat("Chatbot", method="call_llm", first_message="How can I help you?", placeholder="Ask anything")
# in controller:
def call_llm(self, params, **kwargs):
conversation = params.chat
text_stream = ... # dependent on full conversation obtained with conversation.get_messages()
return vkt.ChatResult(conversation, text_stream)
```
Data:
* [`ChatConversation`](https://docs.viktor.ai/sdk/api/api-v1/.md#ChatConversation "viktor.api_v1.ChatConversation")
- Parameters:
* **ui\_name** (`str`) – Name which is visible in the VIKTOR user interface.
* **method** (`str`) – Name of the download method that is defined in the controller
* **first\_message** (`str`) – First message that is shown in the chat (or None for default message)
* **placeholder** (`str`) – Placeholder message in the prompt (or None for default message)
* **flex** (`int`) – Width of the image as percentage of the parametrization component (value betweeb 0-100)
* **visible** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | [`DynamicArrayConstraint`](#DynamicArrayConstraint "viktor.parametrization.DynamicArrayConstraint") | [`RowLookup`](#RowLookup "viktor.parametrization.RowLookup") | `Callable`) – Visibility of the button. A Constraint can be used when the visibility depends on other input fields.
## ChildEntityManager[](https://docs.viktor.ai/sdk/api/parametrization/.md#_ChildEntityManager "Direct link to ChildEntityManager")
* *class *viktor.parametrization.ChildEntityManager(*entity\_type\_name*, *\**, *visible=True*)[](#ChildEntityManager "Link to this definition")
Bases: [`Field`](#Field "viktor.parametrization.Field")
New in v14.2.0
Manager in which a user can create, inspect, and delete child entities of a specific type.
* Parameters:
* **entity\_type\_name** (`str`) – User will only be able to manage entities of specified type.
* **visible** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | [`DynamicArrayConstraint`](#DynamicArrayConstraint "viktor.parametrization.DynamicArrayConstraint") | [`RowLookup`](#RowLookup "viktor.parametrization.RowLookup") | `Callable`) – Can be used when the visibility depends on other input fields.
## ChildEntityMultiSelectField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_ChildEntityMultiSelectField "Direct link to ChildEntityMultiSelectField")
* *class *viktor.parametrization.ChildEntityMultiSelectField(*ui\_name*, *name=None*, *visible=True*, *flex=None*, *\**, *entity\_type\_names=None*, *description=None*)[](#ChildEntityMultiSelectField "Link to this definition")
Bases: `_EntityMultiSelectField`
Field to select zero or more child entities of given type(s). Up to 5000 entities may be visualized in the dropdown in the interface.
Data:
* list\[[`Entity`](https://docs.viktor.ai/sdk/api/api-v1/.md#Entity "viktor.api_v1.Entity")]
* Empty list when nothing is selected
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
**entity\_type\_names** (`list`\[`str`]) – User will only be able to select entities of types within this list. None = all entities.
## ChildEntityOptionField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_ChildEntityOptionField "Direct link to ChildEntityOptionField")
* *class *viktor.parametrization.ChildEntityOptionField(*ui\_name*, *name=None*, *visible=True*, *flex=None*, *\**, *entity\_type\_names=None*, *description=None*)[](#ChildEntityOptionField "Link to this definition")
Bases: `_EntityOptionField`
Field to select a child entity of given type(s). Single option is not automatically pre-selected.
Data:
* [`Entity`](https://docs.viktor.ai/sdk/api/api-v1/.md#Entity "viktor.api_v1.Entity")
* None when nothing is selected
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
**entity\_type\_names** (`list`\[`str`]) – User will only be able to select entities of types within this list. None = all entities.
## ColorField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_ColorField "Direct link to ColorField")
* *class *viktor.parametrization.ColorField(*ui\_name*, *name=None*, *\**, *default=None*, *flex=None*, *visible=True*, *description=None*)[](#ColorField "Link to this definition")
Bases: [`Field`](#Field "viktor.parametrization.Field")
New in v14.0.0
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional params: -
Data:
> * [`Color`](https://docs.viktor.ai/sdk/api/core/.md#Color "viktor.core.Color")
>
> * None when empty
## DateField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_DateField "Direct link to DateField")
* *class *viktor.parametrization.DateField(*ui\_name*, *name=None*, *\**, *default=None*, *flex=None*, *visible=True*, *description=None*)[](#DateField "Link to this definition")
Bases: [`Field`](#Field "viktor.parametrization.Field")
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional params: -
Data:
* datetime.date object
* None, when empty
## DownloadButton[](https://docs.viktor.ai/sdk/api/parametrization/.md#_DownloadButton "Direct link to DownloadButton")
* *class *viktor.parametrization.DownloadButton(*ui\_name*, *method*, *longpoll=False*, *\**, *visible=True*, *always\_available=False*, *flex=None*, *description=None*, *interaction=None*)[](#DownloadButton "Link to this definition")
Bases: `_ActionButton`
Action button which can be pressed to download a result to a file.
Example usage:
```
# in parametrization:
download_btn = vkt.DownloadButton("Download file", "get_download_result", longpoll=True)
# in controller:
def get_download_result(self, params, **kwargs):
return vkt.DownloadResult(file_content='file_content', file_name='some_file.txt')
```
* Parameters:
* **ui\_name** (`str`) – Name which is visible in the VIKTOR user interface.
* **method** (`str`) – Name of the download method that is defined in the controller
* **longpoll** (`bool`) – Set this option to True if the process that is invoked by the action button cannot be completed within the timeout limit.
* **visible** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | [`DynamicArrayConstraint`](#DynamicArrayConstraint "viktor.parametrization.DynamicArrayConstraint") | [`RowLookup`](#RowLookup "viktor.parametrization.RowLookup") | `Callable`) – Visibility of the button. A Constraint can be used when the visibility depends on other input fields.
* **always\_available** (`bool`) – deprecated
* **flex** (`int`) – The width of the field can be altered via this argument. value between 0 and 100 (default=33).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **interaction** ([`Interaction`](#Interaction "viktor.parametrization.Interaction")) – Enable view interaction through this button
New in v13.2.0
## DynamicArray[](https://docs.viktor.ai/sdk/api/parametrization/.md#_DynamicArray "Direct link to DynamicArray")
* *class *viktor.parametrization.DynamicArray(*ui\_name*, *min=None*, *max=None*, *copylast=None*, *visible=True*, *default=None*, *\**, *name=None*, *description=None*, *row\_label=None*)[](#DynamicArray "Link to this definition")
Bases: `_AttrGroup`
Dynamic array input field with row definitions.
Warning
**Nesting Restrictions:**
* Cannot nest [`DynamicArray`](#DynamicArray "viktor.parametrization.DynamicArray") within [`DynamicArray`](#DynamicArray "viktor.parametrization.DynamicArray")
* Cannot nest [`DynamicArray`](#DynamicArray "viktor.parametrization.DynamicArray") within [`Table`](#Table "viktor.parametrization.Table")
**Unsupported Field Types:**
The following field types cannot be added to a dynamic array:
* [`ActionButton`](#ActionButton "viktor.parametrization.ActionButton")
* [`ChildEntityManager`](#ChildEntityManager "viktor.parametrization.ChildEntityManager")
* [`DownloadButton`](#DownloadButton "viktor.parametrization.DownloadButton")
* [`HiddenField`](#HiddenField "viktor.parametrization.HiddenField")
* [`Image`](#Image "viktor.parametrization.Image")
* [`OptimizationButton`](#OptimizationButton "viktor.parametrization.OptimizationButton")
* [`SetParamsButton`](#SetParamsButton "viktor.parametrization.SetParamsButton")
* [`Text`](#Text "viktor.parametrization.Text")
Example usage:
```
# Define dynamic array structure
layers = vkt.DynamicArray("Layers")
layers.depth = vkt.NumberField("Depth", suffix='m')
layers.material = vkt.TextField("Material")
```
A dynamic array can also be created with default content. Assume the fields as defined above:
```
_default_content = [
{'depth': 2.5, 'material': 'Sand'},
{'depth': 5.0, 'material': 'Clay'},
{'depth': 3.2, 'material': 'Gravel'},
]
layers = vkt.DynamicArray("Layers", default=_default_content)
...
```
* Parameters:
* **ui\_name** (`str`) – This string is visible in the VIKTOR user interface.
* **min** (`int` | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | `Callable`) – Minimum number of rows in the array.
* **max** (`int` | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | `Callable`) – Maximum number of rows in the array.
* **copylast** (`bool`) – Copy the last row when clicking the + button. Takes precedence over field defaults.
* **visible** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | `Callable`) – Can be used when the visibility depends on other input fields.
* **default** (`list`\[`dict`]) – Default values of complete array. Filled before user interaction.
* **name** (`str`) – The position of the parameter in the database can be specified in this argument.
New in v14.18.0
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **row\_label** (`str`) – Label to be shown at each row. The row number is appended to the label (max. 30 characters).
The default values of the DynamicArray are filled when the editor is entered for the first time (just like the other fields). The fields underneath the dynamic array can also have default values. These are filled when the user adds a new row. If copylast is True, the last values are copied, and the Field defaults are ignored.
```
array = vkt.DynamicArray('Dyn Array', default=[{'a': 1, 'b': 'hello'}, {'a': 2, 'b': 'there'}])
array.a = vkt.NumberField('A', default=99)
array.b = vkt.TextField('B', default='foo')
```
When first entering the editor:
| A | B |
| - | ----- |
| 1 | hello |
| 2 | there |
When adding a new row:
| A | B |
| -- | ----- |
| 1 | hello |
| 2 | there |
| 99 | foo |
When using copylast:
```
array = vkt.DynamicArray('Dyn Array', copylast=True, default=[{'a': 1, 'b': 'hello'}])
array.a = vkt.NumberField('A', default=99)
array.b = vkt.TextField('B', default='foo')
```
When first entering the editor:
| A | B |
| - | ----- |
| 1 | hello |
When adding a new row:
| A | B |
| - | ----- |
| 1 | hello |
| 1 | hello |
Data:
* list of dictionaries: e.g. \[{‘a’: 1, ‘b’: ‘1’}, {‘a’: 2, ‘b’: ‘2’}]
* empty list if there are no ‘rows’
* when fields are empty, the corresponding empty values are used (see documentation of specific field)
## DynamicArrayConstraint[](https://docs.viktor.ai/sdk/api/parametrization/.md#_DynamicArrayConstraint "Direct link to DynamicArrayConstraint")
* *class *viktor.parametrization.DynamicArrayConstraint(*dynamic\_array\_name*, *operand*)[](#DynamicArrayConstraint "Link to this definition")
This constraint facilitates usage of other constraints within a dynamic array row.
Warning
The DynamicArrayConstraint can currently only be used for the **visibility** of DynamicArray components.
Example usage:
```
_show_y = vkt.DynamicArrayConstraint('array_name', vkt.IsTrue(vkt.Lookup('$row.param_x')))
array = vkt.DynamicArray('My array')
array.param_x = vkt.BooleanField('X')
array.param_y = vkt.NumberField('Y', visible=_show_y)
```
* Parameters:
* **dynamic\_array\_name** (`str`) – name of the dynamic array on which the constraint should be applied.
* **operand** ([`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup")) – The inputs of the operand have to be altered to access the correct row within the dynamic array. The input for a target field becomes ‘$row.{field\_name}’.
## EntityMultiSelectField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_EntityMultiSelectField "Direct link to EntityMultiSelectField")
* *class *viktor.parametrization.EntityMultiSelectField(*ui\_name*, *entity\_type\_names*, *\**, *name=None*, *visible=True*, *flex=None*, *description=None*)[](#EntityMultiSelectField "Link to this definition")
Bases: `_EntityMultiField`
Field to select zero or more entities of given type(s).
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
**entity\_type\_names** (`list`\[`str`]) – User will only be able to select entities of types within this list.
Data:
> * list\[[`Entity`](https://docs.viktor.ai/sdk/api/api-v1/.md#Entity "viktor.api_v1.Entity")]
>
> * Empty list when nothing is selected
## EntityOptionField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_EntityOptionField "Direct link to EntityOptionField")
* *class *viktor.parametrization.EntityOptionField(*ui\_name*, *entity\_type\_names*, *\**, *name=None*, *visible=True*, *flex=None*, *description=None*)[](#EntityOptionField "Link to this definition")
Bases: `_EntitySelectField`
Field to select any entity of given type(s).
Single option is not automatically pre-selected.
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
**entity\_type\_names** (`list`\[`str`]) – User will only be able to select entities of type(s) within this list.
Data:
> * [`Entity`](https://docs.viktor.ai/sdk/api/api-v1/.md#Entity "viktor.api_v1.Entity")
>
> * None when nothing is selected
## Field[](https://docs.viktor.ai/sdk/api/parametrization/.md#_Field "Direct link to Field")
* *class *viktor.parametrization.Field(*\**, *ui\_name*, *name=None*, *prefix=None*, *suffix=None*, *default=None*, *flex=None*, *visible=True*, *description=None*)[](#Field "Link to this definition")
Bases: `_Field`
* Parameters:
* **ui\_name** (`str`) – This string is visible in the VIKTOR user interface.
* **name** (`str`) –
The position of the parameter in the database can be specified in this argument.
Warning
**Reserved Names:** The following names are reserved and cannot be used:
* `'name'` (reserved for internal use)
* `'filename'` (reserved for file handling)
Using a reserved name will cause an error. Choose a different name for your field.
* **prefix** (`str`) – A prefix will be put in front of the ui\_name to provide info such as a dollar sign. Note that this function does not yet work for input fields.
* **suffix** (`str`) – A suffix will be put behind the ui\_name to provide additional information such as units.
* **default** (`Any`) – The value or string that is specified here is filled in as a default input.
* **flex** (`int`) – The width of the field can be altered via this argument. value between 0 and 100 (default=33).
* **visible** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | [`DynamicArrayConstraint`](#DynamicArrayConstraint "viktor.parametrization.DynamicArrayConstraint") | [`RowLookup`](#RowLookup "viktor.parametrization.RowLookup") | `Callable`) – Can be used when the visibility depends on other input fields.
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
## FileField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_FileField "Direct link to FileField")
* *class *viktor.parametrization.FileField(*ui\_name*, *file\_types=None*, *\**, *max\_size=None*, *name=None*, *visible=True*, *flex=None*, *description=None*)[](#FileField "Link to this definition")
Bases: `_FileField`
FileField can be used to let the user upload a file.
Data:
* [`FileResource`](https://docs.viktor.ai/sdk/api/api-v1/.md#FileResource "viktor.api_v1.FileResource")
* None when nothing is uploaded
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
* **file\_types** (`Sequence`\[`str`]) – Optional restriction on file type(s) (e.g. \[‘.png’, ‘.jpg’, ‘.jpeg’]) (case-insensitive).
* **max\_size** (`int`) – Optional restriction on file size in bytes (e.g. 10\_000\_000 = 10 MB).
## FunctionLookup[](https://docs.viktor.ai/sdk/api/parametrization/.md#_FunctionLookup "Direct link to FunctionLookup")
* *class *viktor.parametrization.FunctionLookup(*func*, *\*func\_args*, *\*\*kwargs*)[](#FunctionLookup "Link to this definition")
Defines a lookup constraint where the output value is any function of several input fields.
Example usages:
```
def multiply(a, b=10):
return a * b
field_1 = vkt.NumberField('Field 1')
field_2 = vkt.NumberField('Field 2')
```
Standard usage with two field arguments:
```
field_3 = vkt.NumberField('Field 3', min=FunctionLookup(multiply, Lookup('field_1'), Lookup('field_2')))
```
Using the default value of argument b:
```
field_4 = vkt.NumberField('Field 4', min=FunctionLookup(multiply, Lookup('field_1')))
```
Using a constant instead of a field for argument a:
```
field_5 = vkt.NumberField('Field 5', min=FunctionLookup(multiply, 8, Lookup('field_2')))
```
* Parameters:
* **func** (`Callable`) – Python function or lambda expression. The function can have arguments with default values.
* **func\_args** (`Any`) – Arguments that are provided to the function. Arguments of type Lookup / BoolOperator are evaluated first (e.g. to refer to the value of a Field in the editor, a Lookup can be used).
## GeoPointField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_GeoPointField "Direct link to GeoPointField")
* *class *viktor.parametrization.GeoPointField(*ui\_name*, *\**, *name=None*, *default=None*, *visible=True*, *description=None*)[](#GeoPointField "Link to this definition")
Bases: `_GeoField`
GeoPointField can be used for the selection of a geographical location on a MapView/GeoJSONView.
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Data:
> * [`GeoPoint`](https://docs.viktor.ai/sdk/api/geometry/.md#GeoPoint "viktor.geometry.GeoPoint")
**Data Access:** Multiple patterns are supported:
```
# ✓ Property access (recommended)
lat = params.my_location.lat # or .latitude
lon = params.my_location.lon # or .longitude
# ✓ Subscript access
lat = params.my_location['lat'] # or ['latitude']
lon = params.my_location['lon'] # or ['longitude']
```
## GeoPolygonField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_GeoPolygonField "Direct link to GeoPolygonField")
* *class *viktor.parametrization.GeoPolygonField(*ui\_name*, *\**, *name=None*, *default=None*, *visible=True*, *description=None*)[](#GeoPolygonField "Link to this definition")
Bases: `_GeoField`
GeoPolygonField can be used for the selection of a geographical polygon on a MapView/GeoJSONView.
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Data:
> * [`GeoPolygon`](https://docs.viktor.ai/sdk/api/geometry/.md#GeoPolygon "viktor.geometry.GeoPolygon")
**Data Access:** Multiple patterns are supported:
```
# ✓ Direct iteration (recommended)
for point in params.my_polygon:
lat, lon = point.lat, point.lon
# ✓ Access points via .points property
for point in params.my_polygon.points:
lat, lon = point.lat, point.lon
```
## GeoPolylineField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_GeoPolylineField "Direct link to GeoPolylineField")
* *class *viktor.parametrization.GeoPolylineField(*ui\_name*, *\**, *name=None*, *default=None*, *visible=True*, *description=None*)[](#GeoPolylineField "Link to this definition")
Bases: `_GeoField`
GeoPolylineField can be used for the selection of a geographical (poly)line on a MapView/GeoJSONView.
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Data:
> * [`GeoPolyline`](https://docs.viktor.ai/sdk/api/geometry/.md#GeoPolyline "viktor.geometry.GeoPolyline")
**Data Access:** Multiple patterns are supported:
```
# ✓ Direct iteration (recommended)
for point in params.my_polyline:
lat, lon = point.lat, point.lon
# ✓ Access points via .points property
for point in params.my_polyline.points:
lat, lon = point.lat, point.lon
```
## GeometryMultiSelectField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_GeometryMultiSelectField "Direct link to GeometryMultiSelectField")
* *class *viktor.parametrization.GeometryMultiSelectField(*ui\_name*, *\**, *name=None*, *default=None*, *visible=True*, *flex=None*, *description=None*, *view=None*, *min\_select=1*, *max\_select=None*)[](#GeometryMultiSelectField "Link to this definition")
Bases: `_GeometryField`
New in v14.10.0
GeometryMultiSelectField can be used to let the user select multiple geometry objects from a View.
Data:
* list\[str]
* Empty list when nothing is selected
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
* **view** (`str`) – View method to which the field is connected (default: first GeometryView / IFCView).
* **min\_select** (`int`) – Minimum amount of objects the user needs to select.
* **max\_select** (`int`) – Maximum amount of objects the user is allowed to select.
## GeometrySelectField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_GeometrySelectField "Direct link to GeometrySelectField")
* *class *viktor.parametrization.GeometrySelectField(*ui\_name*, *\**, *name=None*, *default=None*, *visible=True*, *flex=None*, *description=None*, *view=None*)[](#GeometrySelectField "Link to this definition")
Bases: `_GeometryField`
New in v14.10.0
GeometrySelectField can be used to let the user select a geometry object from a View.
Data:
* str
* None when nothing is selected
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
**view** (`str`) – View method to which the field is connected (default: first GeometryView / IFCView).
## HiddenField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_HiddenField "Direct link to HiddenField")
* *class *viktor.parametrization.HiddenField(*ui\_name*, *name=None*)[](#HiddenField "Link to this definition")
The purpose of a HiddenField is to store data in the parametrization, without the necessity to show this information in the editor.
Warning
Do NOT store tremendous amounts of data when it is not necessary, as this will make your application slow and perhaps unstable!
* Parameters:
* **ui\_name** (`str`) – User-defined name of the field.
* **name** (`str`) – The position of the parameter in the database can be specified in this argument.
## Image[](https://docs.viktor.ai/sdk/api/parametrization/.md#_Image "Direct link to Image")
* *class *viktor.parametrization.Image(*path*, *\**, *align='center'*, *caption=None*, *flex=100*, *max\_width=None*, *visible=True*)[](#Image "Link to this definition")
Bases: [`Field`](#Field "viktor.parametrization.Field")
New in v14.3.0
Field that can be used to display a static image.
* Parameters:
* **path** (`str`) – Path to the image relative to the assets directory, note that path traversal is not allowed.
* **align** (`Literal`\[`'left'`, `'center'`, `'right'`]) – Image alignment (“left” | “center” | “right”).
* **caption** (`str`) – Image caption (max. 200 characters).
* **flex** (`int`) – Width of the image as percentage of the parametrization component.
* **max\_width** (`int`) – A maximum width (pixels) can be set to ensure an image does not end up pixelated.
* **visible** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | [`DynamicArrayConstraint`](#DynamicArrayConstraint "viktor.parametrization.DynamicArrayConstraint") | [`RowLookup`](#RowLookup "viktor.parametrization.RowLookup") | `Callable`) – Can be used when the visibility depends on other input fields.
## IntegerField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_IntegerField "Direct link to IntegerField")
* *class *viktor.parametrization.IntegerField(*ui\_name*, *name=None*, *prefix=None*, *\**, *suffix=None*, *default=None*, *step=None*, *min=None*, *max=None*, *visible=True*, *flex=None*, *description=None*)[](#IntegerField "Link to this definition")
Bases: [`NumberField`](#NumberField "viktor.parametrization.NumberField")
See [`NumberField`](#NumberField "viktor.parametrization.NumberField") for parameters
Additional parameters: -
Data:
* integer, when filled
* None, when empty
## Interaction[](https://docs.viktor.ai/sdk/api/parametrization/.md#_Interaction "Direct link to Interaction")
* *class *viktor.parametrization.Interaction(*view*, *selection=None*)[](#Interaction "Link to this definition")
Bases: `ABC`
* Parameters:
* **view** (`str`) – method name of the view to be interacted with.
* **selection** (`Sequence`\[`str`]) – only features/objects within selected interaction groups can be interacted with. Interaction groups can be created on the view result (e.g. `MapResult`) using ‘interaction\_groups’. None, to enable interaction with all features/objects with ‘identifier’ assigned, ignoring interaction groups (default: None).
## IsEqual[](https://docs.viktor.ai/sdk/api/parametrization/.md#_IsEqual "Direct link to IsEqual")
* *class *viktor.parametrization.IsEqual(*operand1*, *operand2*)[](#IsEqual "Link to this definition")
Bases: [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator")
Can be used to evaluate two operands to be equal.
```
field_1 = vkt.NumberField('Field 1')
field_2 = vkt.NumberField('Field 2', visible=vkt.IsEqual(vkt.Lookup('field_1'), 5))
```
* Parameters:
* **operand1** ([`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | `Any`) – First operand to be evaluated.
* **operand2** ([`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | `Any`) – Second operand to be evaluated.
## IsFalse[](https://docs.viktor.ai/sdk/api/parametrization/.md#_IsFalse "Direct link to IsFalse")
* *class *viktor.parametrization.IsFalse(*operand*)[](#IsFalse "Link to this definition")
Bases: [`IsEqual`](#IsEqual "viktor.parametrization.IsEqual")
Can be used to evaluate an operand to be False.
```
field_1 = vkt.NumberField('Field 1')
field_2 = vkt.NumberField('Field 2', visible=vkt.IsFalse(vkt.Lookup('field_1')))
```
* Parameters:
**operand** ([`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | `Any`) – Operand to be evaluated.
## IsNotEqual[](https://docs.viktor.ai/sdk/api/parametrization/.md#_IsNotEqual "Direct link to IsNotEqual")
* *class *viktor.parametrization.IsNotEqual(*operand1*, *operand2*)[](#IsNotEqual "Link to this definition")
Bases: [`IsEqual`](#IsEqual "viktor.parametrization.IsEqual")
Can be used to evaluate two operands to be NOT equal.
```
field_1 = vkt.NumberField('Field 1')
field_2 = vkt.NumberField('Field 2', visible=vkt.IsNotEqual(vkt.Lookup('field_1'), 5))
```
* Parameters:
* **operand1** ([`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | `Any`) – First operand to be evaluated.
* **operand2** ([`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | `Any`) – Second operand to be evaluated.
## IsNotNone[](https://docs.viktor.ai/sdk/api/parametrization/.md#_IsNotNone "Direct link to IsNotNone")
* *class *viktor.parametrization.IsNotNone(*operand*)[](#IsNotNone "Link to this definition")
Bases: [`IsNotEqual`](#IsNotEqual "viktor.parametrization.IsNotEqual")
Can be used to evaluate an operand to be NOT None.
```
field_1 = vkt.NumberField('Field 1')
field_2 = vkt.NumberField('Field 2', visible=vkt.IsNotNone(vkt.Lookup('field_1')))
```
* Parameters:
**operand** ([`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | `Any`) – Operand to be evaluated.
## IsTrue[](https://docs.viktor.ai/sdk/api/parametrization/.md#_IsTrue "Direct link to IsTrue")
* *class *viktor.parametrization.IsTrue(*operand*)[](#IsTrue "Link to this definition")
Bases: [`IsEqual`](#IsEqual "viktor.parametrization.IsEqual")
Can be used to evaluate an operand to be True.
```
field_1 = vkt.NumberField('Field 1')
field_2 = vkt.NumberField('Field 2', visible=vkt.IsTrue(vkt.Lookup('field_1')))
```
* Parameters:
**operand** ([`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | `Any`) – Operand to be evaluated.
## LineBreak[](https://docs.viktor.ai/sdk/api/parametrization/.md#_LineBreak "Direct link to LineBreak")
* *class *viktor.parametrization.LineBreak(*\**, *visible=True*)[](#LineBreak "Link to this definition")
Linebreaks can be used to force input fields to be placed in the next row to obtain a cleaner looking editor.
Example usage:
```
field_1 = vkt.NumberField()
new_line = vkt.LineBreak()
field_2 = vkt.NumberField()
```
* Parameters:
**visible** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | [`DynamicArrayConstraint`](#DynamicArrayConstraint "viktor.parametrization.DynamicArrayConstraint") | [`RowLookup`](#RowLookup "viktor.parametrization.RowLookup") | `Callable`) – Can be used when the visibility depends on other input fields.
New in v14.37.0
## Lookup[](https://docs.viktor.ai/sdk/api/parametrization/.md#_Lookup "Direct link to Lookup")
* *class *viktor.parametrization.Lookup(*target*)[](#Lookup "Link to this definition")
Can be used to lookup the value of an input field. This can be used to set visibility of a field and to set a minimum and / or maximum boundary on a number field.
Example usage on visibility:
```
field_1 = vkt.BooleanField('Field 1')
field_2 = vkt.NumberField('Field 2', visible=Lookup('field_1'))
```
Example usage on min / max:
```
field_1 = vkt.NumberField('Field 1')
field_2 = vkt.NumberField('Field 2', min=Lookup('field_1'))
```
* Parameters:
**target** (`str`) – Name of input field.
## MapSelectInteraction[](https://docs.viktor.ai/sdk/api/parametrization/.md#_MapSelectInteraction "Direct link to MapSelectInteraction")
* *class *viktor.parametrization.MapSelectInteraction(*view*, *\**, *selection=None*, *min\_select=1*, *max\_select=None*)[](#MapSelectInteraction "Link to this definition")
Bases: [`Interaction`](#Interaction "viktor.parametrization.Interaction")
New in v13.2.0
Interaction for the selection of feature(s) in a map view.
See [`Interaction`](#Interaction "viktor.parametrization.Interaction") for parameters.
Additional parameters:
* Parameters:
* **min\_select** (`int`) – minimum number of features a user must select (>=1).
* **max\_select** (`int`) – maximum number of features a user may select. None for no limit (default: None).
Example:
```
button = vkt.ActionButton(..., interaction=vkt.MapSelectInteraction('my_map_view', selection=['points']))
```
## MultiFileField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_MultiFileField "Direct link to MultiFileField")
* *class *viktor.parametrization.MultiFileField(*ui\_name*, *file\_types=None*, *\**, *max\_size=None*, *name=None*, *visible=True*, *flex=None*, *description=None*)[](#MultiFileField "Link to this definition")
Bases: `_FileField`
MultiFileField can be used to let the user upload multiple files.
Data:
* list\[[`FileResource`](https://docs.viktor.ai/sdk/api/api-v1/.md#FileResource "viktor.api_v1.FileResource")]
* Empty list when nothing is uploaded
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
* **file\_types** (`Sequence`\[`str`]) – Optional restriction on file type(s) (e.g. \[‘.png’, ‘.jpg’, ‘.jpeg’]) (case-insensitive).
* **max\_size** (`int`) – Optional restriction on file size in bytes (e.g. 10\_000\_000 = 10 MB).
## MultiSelectField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_MultiSelectField "Direct link to MultiSelectField")
* *class *viktor.parametrization.MultiSelectField(*ui\_name*, *options*, *name=None*, *prefix=None*, *suffix=None*, *default=None*, *visible=True*, *flex=None*, *\**, *description=None*)[](#MultiSelectField "Link to this definition")
Bases: `_SelectField`
Present dropdown list with options for user, in which multiple options can be selected.
If there is only one option, this option will not be automatically selected.
Example usage:
```
field = vkt.MultiSelectField('Available options', options=['Option 1', 'Option 2'], default=['Option 1', 'Option 2'])
```
Or use an OptionListElement to obtain a value in the params which differs from the interface name:
```
_options = [vkt.OptionListElement('option_1', 'Option 1'), OptionListElement('option_2', 'Option 2')]
field = vkt.MultiSelectField('Available options', options=_options, default=['option_1', 'option_2'])
```
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
**options** (`list`\[`float` | `str` | [`OptionListElement`](#OptionListElement "viktor.parametrization.OptionListElement")] | `Callable`) – Options should be defined as a list of numbers, strings, or OptionListElement objects.
Data:
* empty list if no options are selected
* list with values of [`OptionListElements`](#OptionListElement "viktor.parametrization.OptionListElement"): integer, float or string
## MultipleSelectField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_MultipleSelectField "Direct link to MultipleSelectField")
* viktor.parametrization.MultipleSelectField[](#MultipleSelectField "Link to this definition")
alias of [`MultiSelectField`](#MultiSelectField "viktor.parametrization.MultiSelectField")
## Not[](https://docs.viktor.ai/sdk/api/parametrization/.md#_Not "Direct link to Not")
* *class *viktor.parametrization.Not(*operand*)[](#Not "Link to this definition")
Bases: [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator")
Can be used to evaluate an operand to be False.
```
field_1 = vkt.NumberField('Field 1')
field_2 = vkt.NumberField('Field 2', visible=vkt.Not(vkt.IsEqual(vkt.Lookup('field_1'), 5)))
```
Note, above construction is the same as:
```
field_1 = vkt.NumberField('Field 1')
field_2 = vkt.NumberField('Field 2', visible=vkt.IsNotEqual(vkt.Lookup('field_1'), 5))
```
* Parameters:
**operand** ([`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | `bool`) – Operand to be evaluated.
## NumberField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_NumberField "Direct link to NumberField")
* *class *viktor.parametrization.NumberField(*ui\_name*, *name=None*, *prefix=None*, *\**, *suffix=None*, *default=None*, *step=None*, *min=None*, *max=None*, *num\_decimals=None*, *visible=True*, *flex=None*, *variant='standard'*, *description=None*)[](#NumberField "Link to this definition")
Bases: [`Field`](#Field "viktor.parametrization.Field")
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
* **step** (`float`) – Stepping interval when clicking up and down spinner buttons. When min, max, and step are all specified, max must be reachable from min in a whole number of steps.
* **min** (`float` | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | [`RowLookup`](#RowLookup "viktor.parametrization.RowLookup") | `Callable`) – Specifies a minimum value constraint.
* **max** (`float` | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | [`RowLookup`](#RowLookup "viktor.parametrization.RowLookup") | `Callable`) – Specifies a maximum value constraint.
* **num\_decimals** (`int`) – Specifies the number of decimals.
* **variant** (`str`) –
Visually alter the input field. Possible options:
* ’standard’: default
[](https://docs.viktor.ai/_images/variant_NumberField_standard.png)
* ’slider’: slider (ignored in Table)
[](https://docs.viktor.ai/_images/variant_NumberField_slider.png)
Data:
* integer or float
* None, when empty
## OptimiseButton[](https://docs.viktor.ai/sdk/api/parametrization/.md#_OptimiseButton "Direct link to OptimiseButton")
* viktor.parametrization.OptimiseButton[](#OptimiseButton "Link to this definition")
alias of [`OptimizationButton`](#OptimizationButton "viktor.parametrization.OptimizationButton")
## OptimizationButton[](https://docs.viktor.ai/sdk/api/parametrization/.md#_OptimizationButton "Direct link to OptimizationButton")
* *class *viktor.parametrization.OptimizationButton(*ui\_name*, *method*, *longpoll=True*, *\**, *visible=True*, *always\_available=False*, *flex=None*, *description=None*, *interaction=None*)[](#OptimizationButton "Link to this definition")
Bases: `_ActionButton`
Action button which can be pressed to perform an optimization routine.
Example usage:
```
# in parametrization:
optimize_btn = vkt.OptimizationButton("Optimization", "get_optimal_result", longpoll=True)
# in controller:
def get_optimal_result(self, params, **kwargs):
# specific optimization routine
...
return vkt.OptimizationResult(results)
```
* Parameters:
* **ui\_name** (`str`) – Name which is visible in the VIKTOR user interface.
* **method** (`str`) – Name of the download method that is defined in the controller
* **longpoll** (`bool`) – Set this option to True if the process that is invoked by the action button cannot be completed within the timeout limit.
* **visible** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | [`DynamicArrayConstraint`](#DynamicArrayConstraint "viktor.parametrization.DynamicArrayConstraint") | [`RowLookup`](#RowLookup "viktor.parametrization.RowLookup") | `Callable`) – Visibility of the button. A Constraint can be used when the visibility depends on other input fields.
* **always\_available** (`bool`) – deprecated
* **flex** (`int`) – The width of the field can be altered via this argument. value between 0 and 100 (default=33).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **interaction** ([`Interaction`](#Interaction "viktor.parametrization.Interaction")) – Enable view interaction through this button
New in v13.2.0
## OptionField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_OptionField "Direct link to OptionField")
* *class *viktor.parametrization.OptionField(*ui\_name*, *options*, *name=None*, *prefix=None*, *suffix=None*, *default=None*, *visible=True*, *flex=None*, *\**, *description=None*, *variant='standard'*, *autoselect\_single\_option=False*)[](#OptionField "Link to this definition")
Bases: `_SelectField`
Present dropdown list with options for user. If there is only one option, this option is automatically selected.
If you want to enable multiple options to be select, use a MultiSelectField.
Example usage:
```
field = vkt.OptionField('Available options', options=['Option 1', 'Option 2'], default='Option 1')
```
Or use an OptionListElement to obtain a value in the params which differs from the interface name:
```
_options = [vkt.OptionListElement('option_1', 'Option 1'), vkt.OptionListElement('option_2', 'Option 2')]
field = vkt.OptionField('Available options', options=_options, default='option_1')
```
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
* **options** (`list`\[`float` | `str` | [`OptionListElement`](#OptionListElement "viktor.parametrization.OptionListElement")] | `Callable`) – Options should be defined as a list of numbers, strings, or OptionListElement objects.
* **variant** (`str`) –
Visually alter the input field. Possible options:
* ’standard’: default

* ’radio’: radio buttons, vertically positioned (ignored in Table)

* ’radio-inline’: radio buttons, horizontally positioned (ignored in Table)

* **autoselect\_single\_option** (`bool`) – True to always automatically select when a single option is provided. This holds for static options as well as dynamic options (see examples below).
When autoselect\_single\_option=False (default), expect the following behavior:
| Action | Options |
| ----------------------------------------------------------------------------- | --------------------------------------- |
| enter the editor | ⚪ A, ⚪ B, ⚪ C |
| options dynamically change to single option A | ⚪ A |
| options dynamically change to multiple options | ⚪ A, ⚪ B, ⚪ C |
| user selects option B | ⚪ A, ⚫ B, ⚪ C |
| options dynamically change to multiple options, excluding the selected option | ⚪ A, ❌ B, ⚪ C (warning in interface) |
When autoselect\_single\_option=True, expect the following behavior:
Warning
Keep in mind that in case of dynamic options and the possibility of having a single option, the (automatically) selected option might be changed without the user being aware of this!
| Action | Options |
| ----------------------------------------------------------------------------- | --------------------------------------- |
| enter the editor | ⚪ A, ⚪ B, ⚪ C |
| options dynamically change to single option A | ⚫ A |
| options dynamically change to multiple options | ⚫ A, ⚪ B, ⚪ C |
| options dynamically change to single option B (user might not be aware!) | ⚫ B |
| options dynamically change to multiple options, excluding the selected option | ⚪ A, ❌ B, ⚪ C (warning in interface) |
Data:
* type of selected option: integer, float or string
* None when nothing is selected
## OptionListElement[](https://docs.viktor.ai/sdk/api/parametrization/.md#_OptionListElement "Direct link to OptionListElement")
* *class *viktor.parametrization.OptionListElement(*value*, *label=None*, *visible=True*)[](#OptionListElement "Link to this definition")
Create an option which can be used inside an OptionField.
Example: value only with type str
```
>>> option = OptionListElement('apple')
>>> option.value
'apple'
>>> option.label
'apple'
```
Example: value only with type int
```
>>> option = OptionListElement(33)
>>> option.value
33
>>> option.label
'33'
```
Example: value and label
```
>>> option = OptionListElement('apple', 'Delicious apple')
>>> option.value
'apple'
>>> option.label
'Delicious apple'
```
* Parameters:
* **value** (`float` | `str`) – The identifier which is used to store and retrieve chosen option.
* **label** (`str`) – The identifier which is shown to the user. If no label is specified, the value identifier is used, cast to a string.
* **visible** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup")) – Determines whether option is visible. Will mostly be used with Constraint.
- *property *label*: str*[](#OptionListElement.label "Link to this definition")
* *property *value*: float | str*[](#OptionListElement.value "Link to this definition")
## Or[](https://docs.viktor.ai/sdk/api/parametrization/.md#_Or "Direct link to Or")
* *class *viktor.parametrization.Or(*\*operands*)[](#Or "Link to this definition")
Bases: [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator")
Can be used to evaluate if at least one operand is True.
```
field_1 = vkt.NumberField('Field 1')
field_2 = vkt.BooleanField('Field 2')
field_3 = vkt.NumberField('Field 3', visible=vkt.Or(vkt.IsEqual(vkt.Lookup('field_1'), 5), vkt.Lookup('field_2')))
```
* Parameters:
**operands** ([`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | `bool`) – Operands to be evaluated.
## OutputField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_OutputField "Direct link to OutputField")
* *class *viktor.parametrization.OutputField(*ui\_name*, *\**, *value=None*, *prefix=None*, *suffix=None*, *visible=True*, *flex=None*, *description=None*)[](#OutputField "Link to this definition")
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
**value** (`float` | `str` | `bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | [`RowLookup`](#RowLookup "viktor.parametrization.RowLookup") | `Callable`) – Value to be presented in the interface (can be hard-coded or calculated).
Example: Point to another parameter
```
field_1 = vkt.NumberField()
field_2 = vkt.OutputField(ui_name, value=vkt.Lookup("field_1"))
```
Example: Compute output value using callback function
```
def get_value(params, entity_id, **kwargs):
# app specific logic
value = ...
return value
field = vkt.OutputField(ui_name, value=get_value)
```
Data:
* OutputFields are not present in the params
## Page[](https://docs.viktor.ai/sdk/api/parametrization/.md#_Page "Direct link to Page")
* *class *viktor.parametrization.Page(*title*, *\**, *views=None*, *description=None*, *visible=True*, *width=None*)[](#Page "Link to this definition")
Bases: `_Group`
A Page can be used to group certain inputs (e.g. fields) with certain outputs (views).
For example:
```
class Parametrization(vkt.Parametrization):
page_1 = vkt.Page('Page 1') # no views
page_1.field_1 = vkt.NumberField(...)
...
page_2 = vkt.Page('Page 2', views='view_data') # single view
page_2.field_1 = vkt.NumberField(...)
...
page_3 = vkt.Page('Page 3', views=['view_map', 'view_data']) # multiple views
page_3.field_1 = vkt.NumberField(...)
...
class Controller(vkt.Controller):
...
@vkt.DataView(...) # visible on "Page 2" and "Page 3"
def view_data(self, params, **kwargs):
...
@vkt.MapView(...) # only visible on "Page 3"
def view_map(self, params, **kwargs):
...
```
**(new in v14.7.0)** Adjust the width of a specific page:
```
class Parametrization(vkt.Parametrization):
page_1 = vkt.Page('Page 1', width=30)
...
page_2 = vkt.Page('Page 2', width=70)
...
```
* Parameters:
* **title** (`str`) – Title which is shown in the interface.
* **views** (`str` | `Sequence`\[`str`]) – View method(s) that should be visible in this page, e.g. ‘my\_view’ for a single view, or \[‘my\_data\_view’, ‘my\_geometry\_view’, …] for multiple views (default: None).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **visible** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | `Callable`) – Can be used when the visibility depends on other input fields.
New in v14.7.0
* **width** (`int`) – Sets the width of the parametrization side of this page as percentage of the complete width of the editor (input + output). The value should be an integer between 20 and 80. If a width is defined both on the Parametrization and the Page, the Page takes precedence.
New in v14.7.0
## Parametrization[](https://docs.viktor.ai/sdk/api/parametrization/.md#_Parametrization "Direct link to Parametrization")
* *class *viktor.parametrization.Parametrization(*\**, *width=None*)[](#Parametrization "Link to this definition")
The Parametrization class functions as the basis of the parameter set of an entity.
A simple parametrization looks as follows:
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
input_1 = vkt.TextField('This is a text field')
input_2 = vkt.NumberField('This is a number field')
```
In the VIKTOR user interface, this will be visualized as:
[](https://docs.viktor.ai/_images/editor-single-layered.png)
In some cases, the parametrization becomes quite big which requires a more structured layout. This can be achieved by making use of a [`Tab`](#Tab "viktor.parametrization.Tab") and [`Section`](#Section "viktor.parametrization.Section") object, which represent a tab and collapsible section in the interface respectively.
A 2-layered structure using Tab objects looks like this:
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
tab_1 = vkt.Tab('Tab 1')
tab_1.input_1 = vkt.TextField('This is a text field')
tab_1.input_2 = vkt.NumberField('This is a number field')
tab_2 = vkt.Tab('Tab 2')
tab_2.input_1 = vkt.TextField('Text field in Tab 2')
tab_2.input_2 = vkt.NumberField('Number field in Tab 2')
```
[](https://docs.viktor.ai/_images/editor-two-layered-tabs.png)
Using Section objects results in the following:
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
section_1 = vkt.Section('Section 1')
section_1.input_1 = vkt.TextField('This is a text field')
section_1.input_2 = vkt.NumberField('This is a number field')
section_2 = vkt.Section('Section 2')
section_2.input_1 = vkt.TextField('Text field in Section 2')
section_2.input_2 = vkt.NumberField('Number field in Section 2')
```
[](https://docs.viktor.ai/_images/editor-two-layered-sections.png)
A parametrization with a maximum depth of 3 layers consists of Tab, Section, and Field objects:
```
import viktor as vkt
class Parametrization(vkt.Parametrization):
tab_1 = vkt.Tab('Tab 1')
tab_1.section_1 = vkt.Section('Section 1')
tab_1.section_1.input_1 = vkt.TextField('This is a text field')
tab_1.section_1.input_2 = vkt.NumberField('This is a number field')
tab_1.section_2 = vkt.Section('Section 2')
...
tab_2 = vkt.Tab('Tab 2')
...
```
[](https://docs.viktor.ai/_images/editor-three-layered.png)
Every class attribute is treated as a tab, section, or field. If you want to use a variable inside a field, you can either define it outside of the class or as class attribute starting with an underscore:
```
OPTIONS = ['Option 1', 'Option 2']
class Parametrization(vkt.Parametrization):
_options = ['Option 3', 'Option 4']
field_1 = vkt.OptionField('Choose option', options=OPTIONS)
field_2 = vkt.OptionField('Choose option', options=_options)
```
**Callback Functions:** When using callback functions for `visible`, `min`, or `max` parameters, define them before the Parametrization class:
```
import viktor as vkt
def my_visibility(params, **kwargs):
return params.field_1 > 5
class Parametrization(vkt.Parametrization):
field_1 = vkt.NumberField('Field 1')
field_2 = vkt.NumberField('Field 2', visible=my_visibility)
```
**Adjusting Width:** The parametrization width defaults to 40% of the editor. Use the `width` parameter (range: 20-80%) to adjust this ratio:
```
class Parametrization(vkt.Parametrization):
number = vkt.NumberField('Number', flex=100)
class Controller(vkt.Controller):
parametrization = Parametrization(width=60)
```
Individual fields can use `flex` (0-100) to adjust their width relative to the parametrization side. The `width` and `flex` parameters multiply: `width=30` with `flex=100` results in a field taking 30% of the total editor width.
* Parameters:
**width** (`int`) – Sets the width of the parametrization side as percentage of the complete width of the editor (input + output). The value should be an integer between 20 and 80 (default: 40). If a width is defined both on the Parametrization and a Page / Step, the Page / Step takes precedence.
## RowLookup[](https://docs.viktor.ai/sdk/api/parametrization/.md#_RowLookup "Direct link to RowLookup")
* *class *viktor.parametrization.RowLookup(*target*)[](#RowLookup "Link to this definition")
Can be used to lookup the value of an input field within the same row of the dynamic array. This can be used to set the visibility of a field and a minimum and / or maximum boundary on a number field.
Example usage:
```
array = vkt.DynamicArray('Array')
array.field_1 = vkt.NumberField('Field 1')
array.field_2 = vkt.NumberField('Field 2', min=vkt.RowLookup('field_1'))
```
For more complex constructions, it is advised to use a callback function.
* Parameters:
**target** (`str`) – Name of input field within the dynamic array.
## Section[](https://docs.viktor.ai/sdk/api/parametrization/.md#_Section "Direct link to Section")
* *class *viktor.parametrization.Section(*title*, *\**, *description=None*, *initially\_expanded=None*, *visible=True*)[](#Section "Link to this definition")
Bases: `_Group`
* Parameters:
* **title** (`str`) – Title which is shown in the interface.
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **initially\_expanded** (`bool` | `None`) – Whether the section should be expanded on editor entry
New in v14.21.0
* **visible** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | `Callable`) – Can be used when the visibility depends on other input fields.
New in v14.7.0
## SetParamsButton[](https://docs.viktor.ai/sdk/api/parametrization/.md#_SetParamsButton "Direct link to SetParamsButton")
* *class *viktor.parametrization.SetParamsButton(*ui\_name*, *method*, *longpoll=True*, *\**, *visible=True*, *always\_available=False*, *flex=None*, *description=None*, *interaction=None*)[](#SetParamsButton "Link to this definition")
Bases: `_ActionButton`
Action button which can be pressed to perform an analysis and override current input fields.
Example usage:
```
# in parametrization:
set_params_btn = vkt.SetParamsButton("Set params", "set_param_a", longpoll=True)
# in controller:
def set_param_a(self, params, **kwargs):
# get updated input parameters
...
return vkt.SetParamsResult(updated_parameter_set)
```
* Parameters:
* **ui\_name** (`str`) – Name which is visible in the VIKTOR user interface.
* **method** (`str`) – Name of the download method that is defined in the controller
* **longpoll** (`bool`) – Set this option to True if the process that is invoked by the action button cannot be completed within the timeout limit.
* **visible** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | [`DynamicArrayConstraint`](#DynamicArrayConstraint "viktor.parametrization.DynamicArrayConstraint") | [`RowLookup`](#RowLookup "viktor.parametrization.RowLookup") | `Callable`) – Visibility of the button. A Constraint can be used when the visibility depends on other input fields.
* **always\_available** (`bool`) – deprecated
* **flex** (`int`) – The width of the field can be altered via this argument. value between 0 and 100 (default=33).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **interaction** ([`Interaction`](#Interaction "viktor.parametrization.Interaction")) – Enable view interaction through this button
New in v13.2.0
## SiblingEntityMultiSelectField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_SiblingEntityMultiSelectField "Direct link to SiblingEntityMultiSelectField")
* *class *viktor.parametrization.SiblingEntityMultiSelectField(*ui\_name*, *name=None*, *visible=True*, *flex=None*, *\**, *entity\_type\_names=None*, *description=None*)[](#SiblingEntityMultiSelectField "Link to this definition")
Bases: `_EntityMultiSelectField`
Field to select zero or more sibling entities of given type(s). Up to 5000 entities may be visualized in the dropdown in the interface.
Data:
* list\[[`Entity`](https://docs.viktor.ai/sdk/api/api-v1/.md#Entity "viktor.api_v1.Entity")]
* Empty list when nothing is selected
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
**entity\_type\_names** (`list`\[`str`]) – User will only be able to select entities of types within this list. None = all entities.
## SiblingEntityOptionField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_SiblingEntityOptionField "Direct link to SiblingEntityOptionField")
* *class *viktor.parametrization.SiblingEntityOptionField(*ui\_name*, *name=None*, *visible=True*, *flex=None*, *\**, *entity\_type\_names=None*, *description=None*)[](#SiblingEntityOptionField "Link to this definition")
Bases: `_EntityOptionField`
Field to select a sibling entity of given type(s). Single option is not automatically pre-selected.
Data:
* [`Entity`](https://docs.viktor.ai/sdk/api/api-v1/.md#Entity "viktor.api_v1.Entity")
* None when nothing is selected
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
**entity\_type\_names** (`list`\[`str`]) – User will only be able to select entities of types within this list. None = all entities.
## Step[](https://docs.viktor.ai/sdk/api/parametrization/.md#_Step "Direct link to Step")
* *class *viktor.parametrization.Step(*title*, *\**, *views=None*, *description=None*, *enabled=True*, *previous\_label=None*, *next\_label=None*, *on\_next=None*, *width=None*)[](#Step "Link to this definition")
Bases: [`Page`](#Page "viktor.parametrization.Page")
A Step can be used to group certain inputs (e.g. fields) with certain outputs (views) within a predefined order, browsable through a previous and next button.
For example:
```
class Parametrization(vkt.Parametrization):
step_1 = vkt.Step('Step 1') # no views
step_1.field_1 = vkt.NumberField(...)
...
step_2 = vkt.Step('Step 2', views='view_data') # single view
step_2.field_1 = vkt.NumberField(...)
...
step_3 = vkt.Step('Step 3', views=['view_map', 'view_data']) # multiple views
step_3.field_1 = vkt.NumberField(...)
...
class Controller(vkt.Controller):
...
@vkt.DataView(...) # visible on "Step 2" and "Step 3"
def view_data(self, params, **kwargs):
...
@vkt.MapView(...) # only visible on "Step 3"
def view_map(self, params, **kwargs):
...
```
**(new in v13.7.0)** When implementing the on\_next argument, the corresponding function is called when a user clicks the ‘next’ button to move to the next step. This can be used to, for example, validate the input of the current active step:
```
def validate_step_1(params, **kwargs):
if params.step_1.field_z <= params.step_1.field_x + params.step_1.field_y:
raise vkt.UserError(...)
class Parametrization(vkt.Parametrization):
step_1 = vkt.Step('Step 1', on_next=validate_step_1)
...
```
**(new in v14.7.0)** Adjust the width of a specific step:
```
class Parametrization(vkt.Parametrization):
step_1 = vkt.Step('Step 1', width=30)
...
step_2 = vkt.Step('Step 2', width=70)
...
```
**(new in v14.11.0)** Disable steps:
Disabled steps are skipped, you will go straight from Step 1 to Step 3 if Step 2 is disabled.
```
def is_step_enabled(params, **kwargs):
return params.step_1.field_z <= params.step_1.field_x + params.step_1.field_y
class Parametrization(vkt.Parametrization):
step_1 = vkt.Step('Step 1', enabled=True)
...
step_2 = vkt.Step('Step 2', enabled=is_step_enabled)
...
step_3 = vkt.Step('Step 3') # enabled=True by default
...
```
* Parameters:
* **title** (`str`) – Title which is shown in the interface.
* **views** (`str` | `Sequence`\[`str`]) – View method(s) that should be visible in this step, e.g. ‘my\_view’ for a single view, or \[‘my\_data\_view’, ‘my\_geometry\_view’, …] for multiple views (default: None).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **enabled** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | `Callable`) – Can be used to disable (skip) steps, may depend on other input fields.
New in v14.11.0
* **previous\_label** (`str`) – Text to be shown on the previous button (ignored for first step, max. 30 characters).
* **next\_label** (`str`) – Text to be shown on the next button (ignored for last step, max. 30 characters).
* **on\_next** (`Callable`) – Callback function which is triggered when the user moves to the next step.
New in v13.7.0
* **width** (`int`) – Sets the width of the parametrization side of this step as percentage of the complete width of the editor (input + output). The value should be an integer between 20 and 80. If a width is defined both on the Parametrization and the Step, the Step takes precedence.
New in v14.7.0
## Tab[](https://docs.viktor.ai/sdk/api/parametrization/.md#_Tab "Direct link to Tab")
* *class *viktor.parametrization.Tab(*title*, *\**, *description=None*, *visible=True*)[](#Tab "Link to this definition")
Bases: `_Group`
* Parameters:
* **title** (`str`) – Title which is shown in the interface.
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **visible** (`bool` | [`BoolOperator`](#BoolOperator "viktor.parametrization.BoolOperator") | [`Lookup`](#Lookup "viktor.parametrization.Lookup") | [`FunctionLookup`](#FunctionLookup "viktor.parametrization.FunctionLookup") | `Callable`) – Can be used when the visibility depends on other input fields.
New in v14.7.0
## Table[](https://docs.viktor.ai/sdk/api/parametrization/.md#_Table "Direct link to Table")
* *class *viktor.parametrization.Table(*ui\_name*, *name=None*, *\**, *default=None*, *visible=True*, *description=None*)[](#Table "Link to this definition")
Bases: [`Field`](#Field "viktor.parametrization.Field"), `_AttrGroup`
Table input field with column definitions.
Warning
**Nesting Restrictions:**
* Specifying a `default` on a field within a table is not supported
* Specifying constraints on a field within a table is not supported
* Cannot nest [`Table`](#Table "viktor.parametrization.Table") within [`Table`](#Table "viktor.parametrization.Table")
* Cannot nest [`DynamicArray`](#DynamicArray "viktor.parametrization.DynamicArray") within [`Table`](#Table "viktor.parametrization.Table")
* Tables can **only** contain the field types listed below
**Supported Column Types:**
> * [`TextField`](#TextField "viktor.parametrization.TextField")
>
> * [`NumberField`](#NumberField "viktor.parametrization.NumberField") (without min/max constraints)
>
> * [`IntegerField`](#IntegerField "viktor.parametrization.IntegerField")
>
> * [`BooleanField`](#BooleanField "viktor.parametrization.BooleanField")
>
> * [`OptionField`](#OptionField "viktor.parametrization.OptionField") (options argument required)
>
> * [`AutocompleteField`](#AutocompleteField "viktor.parametrization.AutocompleteField")
Example usage:
```
# Define table structure
table = vkt.Table('Input table')
table.name = vkt.TextField('Planet')
table.period = vkt.NumberField('Orbital period', suffix='years')
table.eccentricity = vkt.NumberField('Orbital eccentricity', num_decimals=3)
# ❌ INCORRECT: min/max not allowed in tables
# table.invalid = vkt.NumberField('Value', min=0, max=100) # Will be ignored
```
A table can also be created with default content. Assume the columns as defined above:
```
_default_content = [
{'name': 'Earth', 'period': 1, 'eccentricity': 0.017},
{'name': 'Mars', 'period': 1.88, 'eccentricity': 0.093},
{'name': 'Saturn', 'period': 29.42, 'eccentricity': 0.054},
]
table = vkt.Table('Input table', default=_default_content)
...
```
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Data:
* list of dictionaries
* empty list if there are no rows
* when fields are empty, the corresponding empty values are used (see documentation of specific field)
## TableInput[](https://docs.viktor.ai/sdk/api/parametrization/.md#_TableInput "Direct link to TableInput")
* viktor.parametrization.TableInput[](#TableInput "Link to this definition")
alias of [`Table`](#Table "viktor.parametrization.Table")
## Text[](https://docs.viktor.ai/sdk/api/parametrization/.md#_Text "Direct link to Text")
* *class *viktor.parametrization.Text(*value*, *\**, *visible=True*, *flex=100*)[](#Text "Link to this definition")
Bases: [`Field`](#Field "viktor.parametrization.Field")
Field that can be used to display a static text (max. 1800 characters). It is not included in the params.
Changed in v13.3.0: character limit has been increased from 500 to 1800.
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters:
* Parameters:
**value** (`str`) – Text to be shown
## TextAreaField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_TextAreaField "Direct link to TextAreaField")
* *class *viktor.parametrization.TextAreaField(*ui\_name*, *name=None*, *default=None*, *visible=True*, *flex=100*, *\**, *description=None*)[](#TextAreaField "Link to this definition")
Bases: [`Field`](#Field "viktor.parametrization.Field")
Multiple lines textual input. For one line use TextField.
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Data:
* string
* empty string, when empty
## TextAreaInput[](https://docs.viktor.ai/sdk/api/parametrization/.md#_TextAreaInput "Direct link to TextAreaInput")
* viktor.parametrization.TextAreaInput[](#TextAreaInput "Link to this definition")
alias of [`TextAreaField`](#TextAreaField "viktor.parametrization.TextAreaField")
## TextField[](https://docs.viktor.ai/sdk/api/parametrization/.md#_TextField "Direct link to TextField")
* *class *viktor.parametrization.TextField(*ui\_name*, *name=None*, *prefix=None*, *\**, *suffix=None*, *default=None*, *visible=True*, *flex=None*, *description=None*)[](#TextField "Link to this definition")
Bases: [`Field`](#Field "viktor.parametrization.Field")
See [`Field`](#Field "viktor.parametrization.Field") for parameters.
Additional parameters: -
Data:
* string
* empty string, when empty
## ToggleButton[](https://docs.viktor.ai/sdk/api/parametrization/.md#_ToggleButton "Direct link to ToggleButton")
* viktor.parametrization.ToggleButton[](#ToggleButton "Link to this definition")
alias of [`BooleanField`](#BooleanField "viktor.parametrization.BooleanField")
## ViktorParametrization[](https://docs.viktor.ai/sdk/api/parametrization/.md#_ViktorParametrization "Direct link to ViktorParametrization")
* viktor.parametrization.ViktorParametrization[](#ViktorParametrization "Link to this definition")
alias of [`Parametrization`](#Parametrization "viktor.parametrization.Parametrization")
---
# viktor.result
## ChatResult[](https://docs.viktor.ai/sdk/api/result/.md#_ChatResult "Direct link to ChatResult")
* *class *viktor.result.ChatResult(*conversation*, *response*)[](#ChatResult "Link to this definition")
Bases: `_ButtonResult`
Container for the output of a [`Chat`](https://docs.viktor.ai/sdk/api/parametrization/.md#Chat "viktor.parametrization.Chat").
```
vkt.ChatResult(conversation=my_conversation, response="The LLM response")
```
* Parameters:
* **conversation** ([`ChatConversation`](https://docs.viktor.ai/sdk/api/api-v1/.md#ChatConversation "viktor.api_v1.ChatConversation")) – The conversation that has to be updated.
* **response** (`str` | `Iterable`\[`str`]) – The response that the conversation has to be updated with.
## DownloadResult[](https://docs.viktor.ai/sdk/api/result/.md#_DownloadResult "Direct link to DownloadResult")
* *class *viktor.result.DownloadResult(*file\_content=None*, *file\_name=None*, *encoding='utf-8'*, *\**, *zipped\_files=None*)[](#DownloadResult "Link to this definition")
Bases: `_ButtonResult`
Container for the output of a [`DownloadButton`](https://docs.viktor.ai/sdk/api/parametrization/.md#DownloadButton "viktor.parametrization.DownloadButton").
Download of single file:
```
vkt.DownloadResult(file_content=my_file, file_name="my_file.txt")
```
Download of multiple files bundled in a zip-file:
```
vkt.DownloadResult(zipped_files={'my_file_1.txt': my_file_1, 'my_file_2.txt': my_file_2}, file_name="my_file.zip")
```
* Parameters:
* **file\_content** (`str` | `bytes` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `StringIO` | `BytesIO`) – if type str and encoding is not utf-8, specify in additional argument. Mutual exclusive with ‘zipped\_files’.
* **file\_name** (`str`) – name (including extension) to be used for download. In case of ‘zipped\_files’, this is the name of the zip-file. May only consist of alphanumeric characters, underscores and dots (any other characters are converted to an underscore).
* **encoding** (`str`) – optional argument to specify file encoding when file\_content is provided with type str
* **zipped\_files** (`dict`\[`str`, [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `StringIO` | `BytesIO`]) – a dict of {file name: content} to be bundled in a zip-file with file-name ‘file\_name’. Mutual exclusive with ‘file\_content’.
## OptimisationResult[](https://docs.viktor.ai/sdk/api/result/.md#_OptimisationResult "Direct link to OptimisationResult")
* viktor.result.OptimisationResult[](#OptimisationResult "Link to this definition")
alias of [`OptimizationResult`](#OptimizationResult "viktor.result.OptimizationResult")
## OptimisationResultElement[](https://docs.viktor.ai/sdk/api/result/.md#_OptimisationResultElement "Direct link to OptimisationResultElement")
* viktor.result.OptimisationResultElement[](#OptimisationResultElement "Link to this definition")
alias of [`OptimizationResultElement`](#OptimizationResultElement "viktor.result.OptimizationResultElement")
## OptimizationResult[](https://docs.viktor.ai/sdk/api/result/.md#_OptimizationResult "Direct link to OptimizationResult")
* *class *viktor.result.OptimizationResult(*results*, *result\_column\_names\_input=None*, *output\_headers=None*, *image=None*)[](#OptimizationResult "Link to this definition")
Bases: `_ButtonResult`
Container for the output of an [`OptimizationButton`](https://docs.viktor.ai/sdk/api/parametrization/.md#OptimizationButton "viktor.parametrization.OptimizationButton").
* Parameters:
* **results** (`list`\[[`OptimizationResultElement`](#OptimizationResultElement "viktor.result.OptimizationResultElement")]) – list of results, order is kept in user interface.
* **result\_column\_names\_input** (`list`\[`str`]) – specifies which input parameters should be shown the table. The parametrization class defined the label which is shown
* **output\_headers** (`dict`) – specifies which results should be shown in the results table. Key should match the key of the analysis\_result inside each result. Value is the corresponding label which the end user sees.
* **image** ([`ImageResult`](https://docs.viktor.ai/sdk/api/views/.md#ImageResult "viktor.views.ImageResult")) – image which is shown next to the results. Could be JPG, PNG or SVG.
Example:
```
params1 = {'tab': {'section': {'field1': 'a', 'field2': 5}}}
params2 = {'tab': {'section': {'field1': 'b', 'field2': 8}}}
analysis1 = {'result1': 10, 'result2': 20}
analysis2 = {'result1': 100, 'result2': 150}
results = [
vkt.OptimizationResultElement(params1, analysis1),
vkt.OptimizationResultElement(params2, analysis2),
]
vkt.OptimizationResult(
results, result_column_names_input=['tab.section.field1'], output_headers={'result1': 'Result 1'}
)
```
This renders as the following table for the end-user:
| # | Field 1 | Result 1 |
| - | ------- | -------- |
| 1 | a | 10 |
| 2 | b | 100 |
## OptimizationResultElement[](https://docs.viktor.ai/sdk/api/result/.md#_OptimizationResultElement "Direct link to OptimizationResultElement")
* *class *viktor.result.OptimizationResultElement(*params*, *analysis\_result=None*)[](#OptimizationResultElement "Link to this definition")
* Parameters:
* **params** (`dict` | `Munch`) – a complete parameter set
* **analysis\_result** (`dict`) – the accompanying results.
For an example, see [`OptimizationResult`](#OptimizationResult "viktor.result.OptimizationResult")
## SetParametersResult[](https://docs.viktor.ai/sdk/api/result/.md#_SetParametersResult "Direct link to SetParametersResult")
* viktor.result.SetParametersResult[](#SetParametersResult "Link to this definition")
alias of [`SetParamsResult`](#SetParamsResult "viktor.result.SetParamsResult")
## SetParamsResult[](https://docs.viktor.ai/sdk/api/result/.md#_SetParamsResult "Direct link to SetParamsResult")
* *class *viktor.result.SetParamsResult(*params*)[](#SetParamsResult "Link to this definition")
Bases: `_ButtonResult`
Container for the output of a [`SetParamsButton`](https://docs.viktor.ai/sdk/api/parametrization/.md#SetParamsButton "viktor.parametrization.SetParamsButton").
In order to set the content of the field Tab 1 > Section 1 > NumberField 1 to 1234 use the format:
```
vkt.SetParamsResult({
"tab_1": {
"section_1": {
"numberfield_1": 1234
}
}
})
```
To clear one or more fields one has to explicitly set the params to the empty state. Note that the empty value is different for each field and can be found in their docs:
```
vkt.SetParamsResult({
"tab_1": {
"section_1": {
"numberfield_1": None,
}
}
})
```
* Parameters:
**params** (`dict` | `Munch`) – the params you want to set. If a param is not specified, the value will be kept as is.
- get(*key*)[](#SetParamsResult.get "Link to this definition")
* Return type:
`Any`
## ViktorResult[](https://docs.viktor.ai/sdk/api/result/.md#_ViktorResult "Direct link to ViktorResult")
* *class *viktor.result.ViktorResult(*optimisation\_result=None*, *set\_parameters\_result=None*, *download\_result=None*, *\**, *optimization\_result=None*, *set\_params\_result=None*)[](#ViktorResult "Link to this definition")
Bases: `_SerializableObject`
Standard output object of a ViktorController method, which serialises and combines several individual results into the standard automation output. All inputs are optional to facilitate many combinations of results where needed in the future. Currently, the serialisation only accounts for the following (backward compatible) combinations:
* a single optimization result
* a single set\_params result
* a single download result
- Parameters:
* **optimisation\_result** ([`OptimizationResult`](#OptimizationResult "viktor.result.OptimizationResult")) – alias for optimization\_result
* **set\_parameters\_result** ([`SetParamsResult`](#SetParamsResult "viktor.result.SetParamsResult")) – alias for set\_params\_result
* **download\_result** ([`DownloadResult`](#DownloadResult "viktor.result.DownloadResult")) – DownloadResult object
* **optimization\_result** ([`OptimizationResult`](#OptimizationResult "viktor.result.OptimizationResult")) – OptimizationResult object
* **set\_params\_result** ([`SetParamsResult`](#SetParamsResult "viktor.result.SetParamsResult")) – SetParamsResult object
---
# viktor.testing
## MockedEntity[](https://docs.viktor.ai/sdk/api/testing/.md#_MockedEntity "Direct link to MockedEntity")
* *class *viktor.testing.MockedEntity(*\**, *entity\_id=1*, *name='Mocked Entity'*, *entity\_type=None*, *last\_saved\_params=None*, *last\_saved\_summary=None*, *get\_file=None*, *parent=None*, *children=None*, *siblings=None*, *revisions=None*, *invalid=False*, *workspace\_id=1*)[](#MockedEntity "Link to this definition")
New in v13.3.0
To mock an Entity. All arguments are optional: instantiating MockedEntity without parameters returns a default MockedEntity.
Example:
```
import viktor as vkt
mocked_entity = vkt.testing.MockedEntity(last_saved_params=params, revisions=[vkt.testing.MockedEntityRevision(params)])
```
last\_saved\_params can be passed from a JSON file by making use of [`mock_params()`](#mock_params "viktor.testing.mock_params"):
```
import viktor as vkt
from app.my_entity.controller import MyEntityController
json_file = vkt.File.from_path("path to JSON file")
params = vkt.testing.mock_params(json_file, MyEntityController.parametrization)
mocked_entity = vkt.testing.MockedEntity(last_saved_params=params, revisions=[vkt.testing.MockedEntityRevision(params)])
```
* Parameters:
* **entity\_id** (`int`) – Return value of Entity.id.
* **name** (`str`) – Return value of Entity.name.
* **entity\_type** ([`MockedEntityType`](#MockedEntityType "viktor.testing.MockedEntityType")) – Return value of Entity.entity\_type. None for default MockedEntityType.
* **last\_saved\_params** (`dict` | `Munch`) – Return value of Entity.last\_saved\_params(). Must be the deserialized params (see [`mock_params()`](#mock_params "viktor.testing.mock_params")). None to simulate an entity without params.
* **last\_saved\_summary** (`dict`) – Return value of Entity.last\_saved\_summary(). None to simulate an entity without summary.
* **get\_file** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Return value of Entity.get\_file. None to simulate an entity without file.
* **parent** ([`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")) – Return value of Entity.parent. None to simulate an entity without parent.
* **children** (`Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")]) – Return value of Entity.children. None to simulate an entity without children.
* **siblings** (`Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")]) – Return value of Entity.siblings. None to simulate an entity without siblings.
* **revisions** (`Sequence`\[[`MockedEntityRevision`](#MockedEntityRevision "viktor.testing.MockedEntityRevision")]) – Return value of Entity.revisions. None to simulate an entity without revisions.
* **invalid** (`bool`) – Set to True to simulate failing API calls on this Entity.
- children(*\*args*, *entity\_type\_names=None*, *\*\*kwargs*)[](#MockedEntity.children "Link to this definition")
* Return type:
[`MockedEntityList`](#MockedEntityList "viktor.testing.MockedEntityList")
* create\_child(*entity\_type\_name*, *name*, *\*args*, *params=None*, *\*\*kwargs*)[](#MockedEntity.create_child "Link to this definition")
* Return type:
[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")
- delete(*\*args*, *\*\*kwargs*)[](#MockedEntity.delete "Link to this definition")
* Return type:
`None`
* *property *entity\_type*: [MockedEntityType](#MockedEntityType "viktor.testing.MockedEntityType")*[](#MockedEntity.entity_type "Link to this definition")
- get\_file(*\*args*, *\*\*kwargs*)[](#MockedEntity.get_file "Link to this definition")
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* *property *id*: int*[](#MockedEntity.id "Link to this definition")
- *property *last\_saved\_params*: munch.Munch*[](#MockedEntity.last_saved_params "Link to this definition")
* *property *last\_saved\_summary*: munch.Munch*[](#MockedEntity.last_saved_summary "Link to this definition")
- *property *name*: str*[](#MockedEntity.name "Link to this definition")
* parent(*\*args*, *\*\*kwargs*)[](#MockedEntity.parent "Link to this definition")
* Return type:
[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")
- rename(*name*, *\*args*, *\*\*kwargs*)[](#MockedEntity.rename "Link to this definition")
* Return type:
[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")
* revisions(*\*args*, *\*\*kwargs*)[](#MockedEntity.revisions "Link to this definition")
* Return type:
`List`\[[`MockedEntityRevision`](#MockedEntityRevision "viktor.testing.MockedEntityRevision")]
- set\_params(*params*, *\*args*, *\*\*kwargs*)[](#MockedEntity.set_params "Link to this definition")
* Return type:
[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")
* siblings(*\*args*, *entity\_type\_names=None*, *\*\*kwargs*)[](#MockedEntity.siblings "Link to this definition")
* Return type:
[`MockedEntityList`](#MockedEntityList "viktor.testing.MockedEntityList")
## MockedEntityList[](https://docs.viktor.ai/sdk/api/testing/.md#_MockedEntityList "Direct link to MockedEntityList")
* *class *viktor.testing.MockedEntityList(*entities*, *\**, *error=None*)[](#MockedEntityList "Link to this definition")
## MockedEntityRevision[](https://docs.viktor.ai/sdk/api/testing/.md#_MockedEntityRevision "Direct link to MockedEntityRevision")
* *class *viktor.testing.MockedEntityRevision(*params=None*, *created\_date=None*, *entity\_revision\_id=1*)[](#MockedEntityRevision "Link to this definition")
Bases: [`EntityRevision`](https://docs.viktor.ai/sdk/api/api-v1/.md#EntityRevision "viktor.api_v1.EntityRevision")
New in v13.3.0
To mock an EntityRevision.
Example:
```
import viktor as vkt
params = {
'number': 1,
'entity': vkt.testing.MockedEntity(name="MyEntity"),
'file': vkt.testing.MockedFileResource(vkt.File.from_data("content"), "file.txt")
}
mocked_entity_revision = vkt.testing.MockedEntityRevision(params)
```
params can be passed from a JSON file by making use of [`mock_params()`](#mock_params "viktor.testing.mock_params"):
```
import viktor as vkt
from app.my_entity.controller import MyEntityController
json_file = vkt.File.from_path("path to JSON file")
params = vkt.mock_params(
json_file, MyEntityController.parametrization,
entities={1: vkt.testing.MockedEntity(name="MyEntity")},
file_resources={1: vkt.testing.MockedFileResource(vkt.File.from_data("content"), "file")}
)
mocked_entity_revision = vkt.testing.MockedEntityRevision(params)
```
* Parameters:
* **params** (`dict` | `Munch`) – Return value of EntityRevision.params. Must be the deserialized params (see [`mock_params()`](#mock_params "viktor.testing.mock_params")). None to set default (empty) params.
* **created\_date** (`datetime`) – Return value of EntityRevision.created\_date. None to set default date (2000, 1, 1).
* **entity\_revision\_id** (`int`) – Return value of EntityRevision.id.
## MockedEntityType[](https://docs.viktor.ai/sdk/api/testing/.md#_MockedEntityType "Direct link to MockedEntityType")
* *class *viktor.testing.MockedEntityType(*name='MockedEntityType'*, *entity\_type\_id=1*)[](#MockedEntityType "Link to this definition")
Bases: [`EntityType`](https://docs.viktor.ai/sdk/api/api-v1/.md#EntityType "viktor.api_v1.EntityType")
New in v13.3.0
To mock a EntityType.
## MockedFileResource[](https://docs.viktor.ai/sdk/api/testing/.md#_MockedFileResource "Direct link to MockedFileResource")
* *class *viktor.testing.MockedFileResource(*file=None*, *filename='mocked\_file.txt'*)[](#MockedFileResource "Link to this definition")
New in v13.3.0
To mock a FileResource.
* Parameters:
* **file** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Return value of FileResource.file. None to set default file with content = “mocked content”.
* **filename** (`str`) – Return value of FileResource.filename.
- open(*encoding=None*)[](#MockedFileResource.open "Link to this definition")
New in v14.28.0
Open the file in text mode directly.
```
with params.my_file.open() as f:
content = f.read()
```
* Parameters:
**encoding** (`str`) – Text encoding (default: system encoding)
* Return type:
`TextIO`
* Returns:
Text file-like object
* open\_binary()[](#MockedFileResource.open_binary "Link to this definition")
New in v14.28.0
Open the file in binary mode directly.
```
with params.my_file.open_binary() as f:
content = f.read()
```
* Return type:
`BinaryIO`
* Returns:
Binary file-like object
## MockedUser[](https://docs.viktor.ai/sdk/api/testing/.md#_MockedUser "Direct link to MockedUser")
* *class *viktor.testing.MockedUser(*\**, *first\_name='John'*, *last\_name='Doe'*, *email='john.doe\@email.com'*, *job\_title='Employee'*, *user\_id=1*)[](#MockedUser "Link to this definition")
Bases: [`User`](https://docs.viktor.ai/sdk/api/api-v1/.md#User "viktor.api_v1.User")
New in v13.3.0
To mock a User.
## mock\_API[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_API "Direct link to mock_API")
* viktor.testing.mock\_API(*\**, *get\_entity=None*, *create\_child\_entity=None*, *generate\_upload\_url=None*, *get\_current\_user=None*, *get\_entities\_by\_type=None*, *get\_entity\_children=None*, *get\_entity\_siblings=None*, *get\_root\_entities=None*, *get\_entity\_parent=None*, *get\_entity\_revisions=None*, *get\_entity\_file=None*, *rename\_entity=None*, *set\_entity\_params=None*)[](#mock_API "Link to this definition")
New in v13.3.0
Decorator that can be used to mock API() method calls, to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity.controller import MyEntityController
class TestMyEntityController(unittest.TestCase):
@vkt.testing.mock_API(
get_entity=[vkt.testing.MockedEntity(entity_id=98), vkt.testing.MockedEntity(entity_id=99)],
get_entity_file=vkt.File.from_data("fake content")
)
def test_api_calls(self):
MyEntityController().api_calls()
```
Note that last\_saved\_params can be passed to MockedEntity from a JSON file by making use of [`mock_params()`](#mock_params "viktor.testing.mock_params"):
```
import unittest
import viktor as vkt
from app.my_entity.controller import MyEntityController
class TestMyEntityController(unittest.TestCase):
json_file = vkt.File.from_path("path to JSON file")
params = vkt.testing.mock_params(
json_file, MyEntityController.parametrization,
entities={1: vkt.testing.MockedEntity(name="MyEntity")},
file_resources={1: vkt.testing.MockedFileResource(vkt.File.from_data("content"), "file")}
)
@vkt.testing.mock_API(
get_entity=vkt.testing.MockedEntity(last_saved_params=params, revisions=[vkt.testing.MockedEntityRevision(params)])
)
def test_api_calls(self):
MyEntityController().api_calls()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding API method call. When an API method is called on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding API method is called (endlessly).
* If None is provided (default), a default object is returned each time the corresponding API method is called (endlessly).
- Parameters:
* **get\_entity** (`Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")] | [`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")) – Return value of API.get\_entity.
* **create\_child\_entity** (`Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")] | [`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")) – Return value of API.create\_child\_entity.
* **generate\_upload\_url** (`Sequence`\[`dict`] | `dict`) – Return value of API.generate\_upload\_url.
* **get\_current\_user** (`Sequence`\[[`MockedUser`](#MockedUser "viktor.testing.MockedUser")] | [`MockedUser`](#MockedUser "viktor.testing.MockedUser")) – Return value of API.get\_current\_user.
* **get\_entities\_by\_type** (`Sequence`\[`Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")]] | `Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")]) – Return value of API.get\_entities\_by\_type.
* **get\_entity\_children** (`Sequence`\[`Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")]] | `Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")]) – Return value of API.get\_entity\_children.
* **get\_entity\_siblings** (`Sequence`\[`Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")]] | `Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")]) – Return value of API.get\_entity\_siblings.
* **get\_root\_entities** (`Sequence`\[`Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")]] | `Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")]) – Return value of API.get\_root\_entities.
* **get\_entity\_parent** (`Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")] | [`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")) – Return value of API.get\_entity\_parent.
* **get\_entity\_revisions** (`Sequence`\[`Sequence`\[[`MockedEntityRevision`](#MockedEntityRevision "viktor.testing.MockedEntityRevision")]] | `Sequence`\[[`MockedEntityRevision`](#MockedEntityRevision "viktor.testing.MockedEntityRevision")]) – Return value of API.get\_entity\_revisions.
* **get\_entity\_file** (`Sequence`\[[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Return value of API.get\_entity\_file.
* **rename\_entity** (`Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")] | [`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")) – Return value of API.rename\_entity.
* **set\_entity\_params** (`Sequence`\[[`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")] | [`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")) – Return value of API.set\_entity\_params.
- Return type:
`Callable`
## mock\_AutoCADConnection[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_AutoCADConnection "Direct link to mock_AutoCADConnection")
* viktor.testing.mock\_AutoCADConnection(*results=None*)[](#mock_AutoCADConnection "Link to this definition")
New in 14.35.0
Decorator to mock `viktor.external.autocad.connect()` and `viktor.external.autocad.attach()`, to facilitate easier testing.
Map each ActiveX path to the result it should return. A result of the form `{"__handle__": }` is decoded into an object handle exactly like production, so handle flows (using a returned object in later calls, writing its properties) are testable without a worker:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_AutoCADConnection(results={
'ActiveDocument.ModelSpace.AddLine': [{"__handle__": 1}],
'Length': [6.0],
})
def test_build_drawing(self):
MyEntityTypeController().build_drawing()
```
Paths not in the dict return `None`. For a result that depends on the call, pass a function of the ActiveX path and its arguments instead:
```
def mocked_autocad_results(path, args):
if path == 'ActiveDocument.ModelSpace.AddLine':
return [{"__handle__": 1}]
return [None]
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_AutoCADConnection(results=mocked_autocad_results)
def test_build_drawing(self):
...
```
The mock sends calls in chunks like the real connection. A `results` function runs when the mock sends the chunk, not at the call line, and gets plain values for results passed between calls. `batch()` works as in production, with one exception: a result of a `results` function cannot be unpacked inside the block, because the function only runs when the block ends. Unpack it after the block, or use a dict.
* Parameters:
**results** (`Dict`\[`str`, `list`] | `Callable`\[\[`str`, `list`], `list`]) – a dict mapping each ActiveX path to its result, or a `(path, args)` function returning one; `None` (default) returns `None` for every call.
* Return type:
`Callable`
## mock\_AxisVMAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_AxisVMAnalysis "Direct link to mock_AxisVMAnalysis")
* viktor.testing.mock\_AxisVMAnalysis(*get\_model\_file=None*, *get\_result\_file=None*, *get\_results=None*)[](#mock_AxisVMAnalysis "Link to this definition")
New in v13.5.0
Decorator that can be used to mock [`viktor.external.axisvm.AxisVMAnalysis`](https://docs.viktor.ai/sdk/api/external/axisvm/.md#AxisVMAnalysis "viktor.external.axisvm.AxisVMAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_AxisVMAnalysis(
get_model_file=vkt.File.from_path(Path(__file__).parent / 'test_model.axs'),
get_result_file=vkt.File.from_path(Path(__file__).parent / 'test_model.axe'),
get_results={'Forces': ...}
)
def test_axisvm_analysis(self):
MyEntityTypeController().axisvm_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File/BytesIO/dict object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
* **get\_model\_file** (`Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Return value of AxisVMAnalysis.get\_model\_file.
* **get\_result\_file** (`Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Return value of AxisVMAnalysis.get\_result\_file.
* **get\_results** (`Sequence`\[`dict`] | `dict`) – Return value of AxisVMAnalysis.get\_results.
- Return type:
`Callable`
## mock\_Civil3DConnection[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_Civil3DConnection "Direct link to mock_Civil3DConnection")
* viktor.testing.mock\_Civil3DConnection(*results=None*)[](#mock_Civil3DConnection "Link to this definition")
New in 14.36.0
Decorator to mock `viktor.external.civil3d.connect()` and `viktor.external.civil3d.attach()`, to facilitate easier testing.
Map each COM path to the result it should return. A result of the form `{"__handle__": }` is decoded into an object handle exactly like production, so handle flows (using a returned object in later calls, writing its properties) are testable without a worker:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_Civil3DConnection(results={
'ActiveDocument.Points.Add': [{"__handle__": 1}],
'Easting': [1000.0],
'ActiveDocument.PipeNetworks.Count': [2],
})
def test_build_model(self):
MyEntityTypeController().build_model()
```
Paths not in the dict return `None`. For a result that depends on the call, pass a function of the COM path and its arguments instead (see [`mock_AutoCADConnection()`](#mock_AutoCADConnection "viktor.testing.mock_AutoCADConnection") for the callable form).
Two mock-specific notes:
* the domain roots resolve without a fixture — `c3d.pipe` and `c3d.roadway` are transport, answered by the mock itself, so `results` maps app-visible COM paths only;
* results are keyed by path alone, without the root: `c3d.pipe.ActiveDocument.PipeNetworks.Count()` is keyed `'ActiveDocument.PipeNetworks.Count'`, and therefore collides with the same path reached from `c3d` itself. Key by the most specific path your test calls.
The mock sends calls in chunks like the real connection. A `results` function runs when the mock sends the chunk, not at the call line, and gets plain values for results passed between calls. `batch()` works as in production, with one exception: a result of a `results` function cannot be unpacked inside the block, because the function only runs when the block ends. Unpack it after the block, or use a dict.
* Parameters:
**results** (`Dict`\[`str`, `list`] | `Callable`\[\[`str`, `list`], `list`]) – a dict mapping each COM path to its result, or a `(path, args)` function returning one; `None` (default) returns `None` for every call.
* Return type:
`Callable`
## mock\_DFoundationsAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_DFoundationsAnalysis "Direct link to mock_DFoundationsAnalysis")
* viktor.testing.mock\_DFoundationsAnalysis(*get\_output\_file=None*)[](#mock_DFoundationsAnalysis "Link to this definition")
New in v13.5.0
Decorator that can be used to mock [`viktor.external.dfoundations.DFoundationsAnalysis`](https://docs.viktor.ai/sdk/api/external/dfoundations/.md#DFoundationsAnalysis "viktor.external.dfoundations.DFoundationsAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_DFoundationsAnalysis(get_output_file={
'.fod': vkt.File.from_path(Path(__file__).parent / 'test_output.fod'),
'.fos': vkt.File.from_path(Path(__file__).parent / 'test_output.fos')
})
def test_dfoundations_analysis(self):
MyEntityTypeController().dfoundations_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File/BytesIO object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
**get\_output\_file** (`Dict`\[`str`, `Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Return value of DFoundationsAnalysis.get\_output\_file.
- Return type:
`Callable`
## mock\_DGeoStabilityAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_DGeoStabilityAnalysis "Direct link to mock_DGeoStabilityAnalysis")
* viktor.testing.mock\_DGeoStabilityAnalysis(*get\_output\_file=None*)[](#mock_DGeoStabilityAnalysis "Link to this definition")
New in v13.5.0
Decorator that can be used to mock [`viktor.external.dgeostability.DGeoStabilityAnalysis`](https://docs.viktor.ai/sdk/api/external/dgeostability/.md#DGeoStabilityAnalysis "viktor.external.dgeostability.DGeoStabilityAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_DGeoStabilityAnalysis(get_output_file={
'.sto': vkt.File.from_path(Path(__file__).parent / 'test_output.sto')
})
def test_dgeostability_analysis(self):
MyEntityTypeController().dgeostability_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File/BytesIO object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
**get\_output\_file** (`Dict`\[`str`, `Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Return value of DGeoStabilityAnalysis.get\_output\_file.
- Return type:
`Callable`
## mock\_DSettlementAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_DSettlementAnalysis "Direct link to mock_DSettlementAnalysis")
* viktor.testing.mock\_DSettlementAnalysis(*get\_output\_file=None*, *get\_sld\_file=None*)[](#mock_DSettlementAnalysis "Link to this definition")
New in v13.5.0
Decorator that can be used to mock [`viktor.external.dsettlement.DSettlementAnalysis`](https://docs.viktor.ai/sdk/api/external/dsettlement/.md#DSettlementAnalysis "viktor.external.dsettlement.DSettlementAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_DSettlementAnalysis(get_output_file={
'.sld': vkt.File.from_path(Path(__file__).parent / 'test_output.sld'),
'.slo': vkt.File.from_path(Path(__file__).parent / 'test_output.slo')
})
def test_dsettlement_analysis(self):
MyEntityTypeController().dsettlement_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File or StringIO/BytesIO object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
* **get\_output\_file** (`Dict`\[`str`, `Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Return value of DSettlementAnalysis.get\_output\_file.
* **get\_sld\_file** (`Sequence`\[`StringIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `StringIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Return value of DSettlementAnalysis.get\_sld\_file.
- Return type:
`Callable`
## mock\_DSheetPilingAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_DSheetPilingAnalysis "Direct link to mock_DSheetPilingAnalysis")
* viktor.testing.mock\_DSheetPilingAnalysis(*get\_output\_file=None*)[](#mock_DSheetPilingAnalysis "Link to this definition")
New in v13.5.0
Decorator that can be used to mock [`viktor.external.dsheetpiling.DSheetPilingAnalysis`](https://docs.viktor.ai/sdk/api/external/dsheetpiling/.md#DSheetPilingAnalysis "viktor.external.dsheetpiling.DSheetPilingAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_DSheetPilingAnalysis(get_output_file={
'.shd': vkt.File.from_path(Path(__file__).parent / 'test_output.shd'),
'.shl': vkt.File.from_path(Path(__file__).parent / 'test_output.shl'),
'.shs': vkt.File.from_path(Path(__file__).parent / 'test_output.shs'),
'.sho': vkt.File.from_path(Path(__file__).parent / 'test_output.sho')
})
def test_dsheetpiling_analysis(self):
MyEntityTypeController().dsheetpiling_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File/BytesIO object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
**get\_output\_file** (`Dict`\[`str`, `Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Return value of DSheetPilingAnalysis.get\_output\_file.
- Return type:
`Callable`
## mock\_DStabilityAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_DStabilityAnalysis "Direct link to mock_DStabilityAnalysis")
* viktor.testing.mock\_DStabilityAnalysis(*get\_output\_file=None*)[](#mock_DStabilityAnalysis "Link to this definition")
New in v13.5.0
Decorator that can be used to mock [`viktor.external.dstability.DStabilityAnalysis`](https://docs.viktor.ai/sdk/api/external/dstability/.md#DStabilityAnalysis "viktor.external.dstability.DStabilityAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_DStabilityAnalysis(get_output_file={
'.stix': vkt.File.from_path(Path(__file__).parent / 'test_output.stix')
})
def test_dstability_analysis(self):
MyEntityTypeController().dstability_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
**get\_output\_file** (`Dict`\[`str`, `Sequence`\[[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Return value of DStabilityAnalysis.get\_output\_file.
- Return type:
`Callable`
## mock\_DynamoAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_DynamoAnalysis "Direct link to mock_DynamoAnalysis")
* viktor.testing.mock\_DynamoAnalysis(*get\_output\_file=None*)[](#mock_DynamoAnalysis "Link to this definition")
New in 14.17.0
Decorator that can be used to mock [`viktor.external.dynamo.DynamoAnalysis`](https://docs.viktor.ai/sdk/api/external/dynamo/.md#DynamoAnalysis "viktor.external.dynamo.DynamoAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_DynamoAnalysis(get_output_file={
'data.out': vkt.File.from_path(Path(__file__).parent / 'data.out'),
'info.log': vkt.File.from_path(Path(__file__).parent / 'info.log')
})
def test_dynamo_analysis(self):
MyEntityTypeController().dynamo_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File or BytesIO object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
**get\_output\_file** (`Dict`\[`str`, `Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Return value of DynamoAnalysis.get\_output\_file.
- Return type:
`Callable`
## mock\_ETABSAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_ETABSAnalysis "Direct link to mock_ETABSAnalysis")
* viktor.testing.mock\_ETABSAnalysis(*get\_output\_file=None*)[](#mock_ETABSAnalysis "Link to this definition")
New in 14.17.0
Decorator that can be used to mock `viktor.external.etabs.ETABSAnalysis`, to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_ETABSAnalysis(get_output_file={
'data.out': vkt.File.from_path(Path(__file__).parent / 'data.out'),
'info.log': vkt.File.from_path(Path(__file__).parent / 'info.log')
})
def test_etabs_analysis(self):
MyEntityTypeController().etabs_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
**get\_output\_file** (`Dict`\[`str`, `Sequence`\[[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Return value of ETABSAnalysis.get\_output\_file.
- Return type:
`Callable`
## mock\_ETABSConnection[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_ETABSConnection "Direct link to mock_ETABSConnection")
* viktor.testing.mock\_ETABSConnection(*results=None*)[](#mock_ETABSConnection "Link to this definition")
New in 14.31.0
Decorator to mock `viktor.external.etabs.connect()` and `viktor.external.etabs.attach()`, to facilitate easier testing.
Map each OAPI path to the result it should return:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_ETABSConnection(results={
'FrameObj.AddByCoord': ['B1', 0],
'FrameObj.GetPoints': ['P1', 'P2', 0],
})
def test_build_model(self):
MyEntityTypeController().build_model()
```
Paths not in the dict return `[0]`. For a result that depends on the call, pass a function of the OAPI path and its arguments instead:
```
def mocked_etabs_results(path, args):
if path == 'FrameObj.GetPoints':
return ['P1', 'P2', 0]
return [0]
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_ETABSConnection(results=mocked_etabs_results)
def test_build_model(self):
...
```
The mock sends calls in chunks like the real connection. A `results` function runs when the mock sends the chunk, not at the call line, and gets plain values for results passed between calls. `batch()` works as in production, with one exception: a result of a `results` function cannot be unpacked inside the block, because the function only runs when the block ends. Unpack it after the block, or use a dict.
* Parameters:
**results** (`Dict`\[`str`, `list`] | `Callable`\[\[`str`, `list`], `list`]) – a dict mapping each OAPI path to its result, or a `(path, args)` function returning one; `None` (default) returns `[0]` for every call.
* Return type:
`Callable`
## mock\_Excel[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_Excel "Direct link to mock_Excel")
* viktor.testing.mock\_Excel(*get\_named\_cell\_result=None*, *get\_direct\_cell\_result=None*, *get\_filled\_template=None*)[](#mock_Excel "Link to this definition")
New in v13.5.0
Decorator that can be used to mock [`viktor.external.excel.Excel`](https://docs.viktor.ai/sdk/api/external/excel/.md#Excel "viktor.external.excel.Excel"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_Excel(
get_filled_template=vkt.File.from_path(Path(__file__).parent / 'test_model.xlsx'),
get_named_cell_result={"cell name": 5.5},
get_direct_cell_result={
("Sheet1", "A", 5): "cell value",
("Sheet2", "B", 1): 1.4,
}
)
def test_excel_analysis(self):
MyEntityTypeController().excel_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File object (with empty content) is returned for the template, whereas None is returned for the cell values, each time the corresponding method is called (endlessly).
- Parameters:
* **get\_named\_cell\_result** (`Dict`\[`str`, `Sequence`\[`str` | `int` | `float` | `bool`] | `str` | `int` | `float` | `bool`]) – Return value of Excel.get\_named\_cell\_result.
* **get\_direct\_cell\_result** (`Dict`\[`Tuple`\[`str`, `str`, `int`], `Sequence`\[`str` | `int` | `float` | `bool`] | `str` | `int` | `float` | `bool`]) – Return value of Excel.get\_direct\_cell\_result.
* **get\_filled\_template** (`Sequence`\[[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Return value of Excel.get\_filled\_template.
- Return type:
`Callable`
## mock\_GRLWeapAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_GRLWeapAnalysis "Direct link to mock_GRLWeapAnalysis")
* viktor.testing.mock\_GRLWeapAnalysis(*get\_output\_file=None*)[](#mock_GRLWeapAnalysis "Link to this definition")
New in v13.5.0
Decorator that can be used to mock [`viktor.external.grlweap.GRLWeapAnalysis`](https://docs.viktor.ai/sdk/api/external/grlweap/.md#GRLWeapAnalysis "viktor.external.grlweap.GRLWeapAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_GRLWeapAnalysis(
get_output_file=vkt.File.from_path(Path(__file__).parent / 'test_output.GWO')
)
def test_grlweap_analysis(self):
MyEntityTypeController().grlweap_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File/BytesIO object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
**get\_output\_file** (`Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Return value of GRLWeapAnalysis.get\_output\_file.
- Return type:
`Callable`
## mock\_GenericAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_GenericAnalysis "Direct link to mock_GenericAnalysis")
* viktor.testing.mock\_GenericAnalysis(*get\_output\_file=None*)[](#mock_GenericAnalysis "Link to this definition")
New in v13.5.0
Decorator that can be used to mock [`viktor.external.generic.GenericAnalysis`](https://docs.viktor.ai/sdk/api/external/generic/.md#GenericAnalysis "viktor.external.generic.GenericAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_GenericAnalysis(get_output_file={
'data.out': vkt.File.from_path(Path(__file__).parent / 'data.out'),
'info.log': vkt.File.from_path(Path(__file__).parent / 'info.log')
})
def test_generic_analysis(self):
MyEntityTypeController().generic_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File or BytesIO object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
**get\_output\_file** (`Dict`\[`str`, `Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Return value of GenericAnalysis.get\_output\_file.
- Return type:
`Callable`
## mock\_IdeaRcsAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_IdeaRcsAnalysis "Direct link to mock_IdeaRcsAnalysis")
* viktor.testing.mock\_IdeaRcsAnalysis(*get\_output\_file=None*, *get\_idea\_rcs\_file=None*)[](#mock_IdeaRcsAnalysis "Link to this definition")
New in v13.5.0
Decorator that can be used to mock `viktor.external.idea_rcs.IdeaRcsAnalysis`, to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_IdeaRcsAnalysis(
get_output_file=vkt.File.from_path(Path(__file__).parent / 'test_output.xml'),
get_idea_rcs_file=vkt.File.from_path(Path(__file__).parent / 'test_rcs.ideaRcs')
)
def test_idea_rcs_analysis(self):
MyEntityTypeController().idea_rcs_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File/BytesIO object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
* **get\_output\_file** (`Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Return value of IdeaRcsAnalysis.get\_output\_file.
* **get\_idea\_rcs\_file** (`Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Return value of IdeaRcsAnalysis.get\_idea\_rcs\_file.
- Return type:
`Callable`
## mock\_MatlabAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_MatlabAnalysis "Direct link to mock_MatlabAnalysis")
* viktor.testing.mock\_MatlabAnalysis(*get\_output\_file=None*)[](#mock_MatlabAnalysis "Link to this definition")
New in 14.17.0
Decorator that can be used to mock [`viktor.external.matlab.MatlabAnalysis`](https://docs.viktor.ai/sdk/api/external/matlab/.md#MatlabAnalysis "viktor.external.matlab.MatlabAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_MatlabAnalysis(get_output_file={
'data.out': vkt.File.from_path(Path(__file__).parent / 'data.out'),
'info.log': vkt.File.from_path(Path(__file__).parent / 'info.log')
})
def test_matlab_analysis(self):
MyEntityTypeController().matlab_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File or BytesIO object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
**get\_output\_file** (`Dict`\[`str`, `Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Return value of MatlabAnalysis.get\_output\_file.
- Return type:
`Callable`
## mock\_ParamsFromFile[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_ParamsFromFile "Direct link to mock_ParamsFromFile")
* viktor.testing.mock\_ParamsFromFile(*controller*)[](#mock_ParamsFromFile "Link to this definition")
Decorator that can be used for testing methods decorated with [`viktor.core.ParamsFromFile`](https://docs.viktor.ai/sdk/api/core/.md#ParamsFromFile "viktor.core.ParamsFromFile").
Example:
```
import unittest
import viktor as vkt
from app.my_entity.controller import MyEntityController
class TestMyEntityController(unittest.TestCase):
@vkt.testing.mock_ParamsFromFile(MyEntityController)
def test_process_file(self):
file = vkt.File.from_data("abc")
returned_dict = MyEntityController().process_file(file)
self.assertDictEqual(returned_dict, {...})
```
* Parameters:
**controller** (`Type`\[[`Controller`](https://docs.viktor.ai/sdk/api/core/.md#Controller "viktor.core.Controller")]) – Controller class on which the ParamsFromFile should be mocked
* Return type:
`Callable`
## mock\_PlaxisAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_PlaxisAnalysis "Direct link to mock_PlaxisAnalysis")
* viktor.testing.mock\_PlaxisAnalysis(*get\_output\_file=None*)[](#mock_PlaxisAnalysis "Link to this definition")
New in 14.17.0
Decorator that can be used to mock [`viktor.external.plaxis.PlaxisAnalysis`](https://docs.viktor.ai/sdk/api/external/plaxis/.md#PlaxisAnalysis "viktor.external.plaxis.PlaxisAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_PlaxisAnalysis(get_output_file={
'data.out': vkt.File.from_path(Path(__file__).parent / 'data.out'),
'info.log': vkt.File.from_path(Path(__file__).parent / 'info.log')
})
def test_plaxis_analysis(self):
MyEntityTypeController().plaxis_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
**get\_output\_file** (`Dict`\[`str`, `Sequence`\[[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Return value of PlaxisAnalysis.get\_output\_file.
- Return type:
`Callable`
## mock\_PythonAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_PythonAnalysis "Direct link to mock_PythonAnalysis")
* viktor.testing.mock\_PythonAnalysis(*get\_output\_file=None*)[](#mock_PythonAnalysis "Link to this definition")
New in 14.17.0
Decorator that can be used to mock [`viktor.external.python.PythonAnalysis`](https://docs.viktor.ai/sdk/api/external/python/.md#PythonAnalysis "viktor.external.python.PythonAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_PythonAnalysis(get_output_file={
'data.out': vkt.File.from_path(Path(__file__).parent / 'data.out'),
'info.log': vkt.File.from_path(Path(__file__).parent / 'info.log')
})
def test_python_analysis(self):
MyEntityTypeController().python_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
**get\_output\_file** (`Dict`\[`str`, `Sequence`\[[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Return value of PythonAnalysis.get\_output\_file.
- Return type:
`Callable`
## mock\_RFEMAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_RFEMAnalysis "Direct link to mock_RFEMAnalysis")
* viktor.testing.mock\_RFEMAnalysis(*get\_model=None*, *get\_result=None*)[](#mock_RFEMAnalysis "Link to this definition")
New in v13.5.0
Decorator that can be used to mock [`viktor.external.rfem.RFEMAnalysis`](https://docs.viktor.ai/sdk/api/external/rfem/.md#RFEMAnalysis "viktor.external.rfem.RFEMAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_RFEMAnalysis(
get_model=vkt.File.from_path(Path(__file__).parent / 'test_model.rfx')
get_result={
3: vkt.File.from_path(Path(__file__).parent / 'load_case_3.json'),
5: vkt.File.from_path(Path(__file__).parent / 'load_case_5.json')
}
)
def test_rfem_analysis(self):
MyEntityTypeController().rfem_analysis()
})
def test_rfem_analysis(self):
MyEntityTypeController().rfem_analysis()
```
* For all parameters the following can be provided:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default BytesIO/File object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
* **get\_model** (`Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `BytesIO`) – Return value of RFEMAnalysis.get\_model.
* **get\_result** (`Dict`\[`int`, `Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `BytesIO`]) – Return value of RFEMAnalysis.get\_result.
- Return type:
`Callable`
## mock\_RevitAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_RevitAnalysis "Direct link to mock_RevitAnalysis")
* viktor.testing.mock\_RevitAnalysis(*get\_output\_file=None*)[](#mock_RevitAnalysis "Link to this definition")
New in 14.17.0
Decorator that can be used to mock [`viktor.external.revit.RevitAnalysis`](https://docs.viktor.ai/sdk/api/external/revit/.md#RevitAnalysis "viktor.external.revit.RevitAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_RevitAnalysis(get_output_file={
'data.out': vkt.File.from_path(Path(__file__).parent / 'data.out'),
'info.log': vkt.File.from_path(Path(__file__).parent / 'info.log')
})
def test_revit_analysis(self):
MyEntityTypeController().revit_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
**get\_output\_file** (`Dict`\[`str`, `Sequence`\[[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Return value of RevitAnalysis.get\_output\_file.
- Return type:
`Callable`
## mock\_RobotAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_RobotAnalysis "Direct link to mock_RobotAnalysis")
* viktor.testing.mock\_RobotAnalysis(*get\_model\_file=None*, *get\_results=None*)[](#mock_RobotAnalysis "Link to this definition")
New in v13.5.0
Decorator that can be used to mock [`viktor.external.robot.RobotAnalysis`](https://docs.viktor.ai/sdk/api/external/robot/.md#RobotAnalysis "viktor.external.robot.RobotAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_RobotAnalysis(
get_model_file=vkt.File.from_path(Path(__file__).parent / 'test_model.rtd'),
get_results={'bar_forces': {...}, ...}
)
def test_robot_analysis(self):
MyEntityTypeController().robot_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File/dict object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
* **get\_model\_file** (`Sequence`\[[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Return value of RobotAnalysis.get\_model\_file.
* **get\_results** (`Sequence`\[`dict`] | `dict`) – Return value of RobotAnalysis.get\_results.
- Return type:
`Callable`
## mock\_SAP2000Analysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_SAP2000Analysis "Direct link to mock_SAP2000Analysis")
* viktor.testing.mock\_SAP2000Analysis(*get\_output\_file=None*)[](#mock_SAP2000Analysis "Link to this definition")
New in 14.17.0
Decorator that can be used to mock `viktor.external.sap2000.SAP2000Analysis`, to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_SAP2000Analysis(get_output_file={
'data.out': vkt.File.from_path(Path(__file__).parent / 'data.out'),
'info.log': vkt.File.from_path(Path(__file__).parent / 'info.log')
})
def test_sap2000_analysis(self):
MyEntityTypeController().sap2000_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
**get\_output\_file** (`Dict`\[`str`, `Sequence`\[[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Return value of SAP2000Analysis.get\_output\_file.
- Return type:
`Callable`
## mock\_SAP2000Connection[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_SAP2000Connection "Direct link to mock_SAP2000Connection")
* viktor.testing.mock\_SAP2000Connection(*results=None*)[](#mock_SAP2000Connection "Link to this definition")
New in 14.32.0
Decorator to mock `viktor.external.sap2000.connect()` and `viktor.external.sap2000.attach()`, to facilitate easier testing.
Map each OAPI path to the result it should return:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_SAP2000Connection(results={
'FrameObj.AddByCoord': ['B1', 0],
'FrameObj.GetPoints': ['P1', 'P2', 0],
})
def test_build_model(self):
MyEntityTypeController().build_model()
```
Paths not in the dict return `[0]`. For a result that depends on the call, pass a function of the OAPI path and its arguments instead:
```
def mocked_sap2000_results(path, args):
if path == 'FrameObj.GetPoints':
return ['P1', 'P2', 0]
return [0]
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_SAP2000Connection(results=mocked_sap2000_results)
def test_build_model(self):
...
```
The mock sends calls in chunks like the real connection. A `results` function runs when the mock sends the chunk, not at the call line, and gets plain values for results passed between calls. `batch()` works as in production, with one exception: a result of a `results` function cannot be unpacked inside the block, because the function only runs when the block ends. Unpack it after the block, or use a dict.
* Parameters:
**results** (`Dict`\[`str`, `list`] | `Callable`\[\[`str`, `list`], `list`]) – a dict mapping each OAPI path to its result, or a `(path, args)` function returning one; `None` (default) returns `[0]` for every call.
* Return type:
`Callable`
## mock\_SciaAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_SciaAnalysis "Direct link to mock_SciaAnalysis")
* viktor.testing.mock\_SciaAnalysis(*get\_engineering\_report=None*, *get\_updated\_esa\_model=None*, *get\_xml\_output\_file=None*)[](#mock_SciaAnalysis "Link to this definition")
New in v13.3.0
Decorator that can be used to mock `viktor.external.scia.SciaAnalysis`, to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity.controller import MyEntityController
class TestMyEntityController(unittest.TestCase):
@vkt.testing.mock_SciaAnalysis(
get_engineering_report=vkt.File.from_path(Path(__file__).parent / 'test_file.pdf'),
get_updated_esa_model=vkt.File.from_path(Path(__file__).parent / 'test_file.esa'),
get_xml_output_file=vkt.File.from_path(Path(__file__).parent / 'test_output.xml')
)
def test_scia_analysis(self):
MyEntityController().scia_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File/BytesIO object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
* **get\_engineering\_report** (`Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Return value of SciaAnalysis.get\_engineering\_report.
* **get\_updated\_esa\_model** (`Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Return value of SciaAnalysis.get\_updated\_esa\_model.
* **get\_xml\_output\_file** (`Sequence`\[`BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Return value of SciaAnalysis.get\_xml\_output\_file.
- Return type:
`Callable`
## mock\_Storage[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_Storage "Direct link to mock_Storage")
* viktor.testing.mock\_Storage(*\**, *get=None*, *list=None*)[](#mock_Storage "Link to this definition")
Decorator that can be used for testing methods which invoke the [`viktor.core.Storage`](https://docs.viktor.ai/sdk/api/core/.md#Storage "viktor.core.Storage").
Use the get and list arguments to instruct which file(s) the respective Storage().get(…) and Storage().list(…) methods should return.
Example:
```
import unittest
import viktor as vkt
from app.my_entity.controller import MyEntityController
class TestMyEntityController(unittest.TestCase):
@vkt.testing.mock_Storage(
get=[vkt.File.from_data("abc"), vkt.File.from_data("def")],
list=[{'data_key_3': vkt.File.from_data("ghi")}]
)
def test_process_analysis_result(self):
# Storage().get(...) invoked twice, Storage().list(...) invoked once
result = MyEntityController().process_analysis_result()
...
```
* Parameters:
* **get** (`Sequence`\[[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Files to be returned by Storage().get(…). The files are returned in order of the input list.
* **list** (`Sequence`\[`Dict`\[`str`, [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]]) – File dicts to be returned by Storage().list(…). The dicts are returned in order of the input list.
* Return type:
`Callable`
## mock\_TeklaAnalysis[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_TeklaAnalysis "Direct link to mock_TeklaAnalysis")
* viktor.testing.mock\_TeklaAnalysis(*get\_output\_file=None*)[](#mock_TeklaAnalysis "Link to this definition")
New in 14.17.0
Decorator that can be used to mock [`viktor.external.tekla.TeklaAnalysis`](https://docs.viktor.ai/sdk/api/external/tekla/.md#TeklaAnalysis "viktor.external.tekla.TeklaAnalysis"), to facilitate easier testing.
Example:
```
import unittest
import viktor as vkt
from app.my_entity_type.controller import MyEntityTypeController
class TestMyEntityTypeController(unittest.TestCase):
@vkt.testing.mock_TeklaAnalysis(get_output_file={
'data.out': vkt.File.from_path(Path(__file__).parent / 'data.out'),
'info.log': vkt.File.from_path(Path(__file__).parent / 'info.log')
})
def test_tekla_analysis(self):
MyEntityTypeController().tekla_analysis()
```
* For all parameters the following holds:
* If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
* If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
* If None is provided (default), a default File object (with empty content) is returned each time the corresponding method is called (endlessly).
- Parameters:
**get\_output\_file** (`Dict`\[`str`, `Sequence`\[[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")] | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")]) – Return value of TeklaAnalysis.get\_output\_file.
- Return type:
`Callable`
## mock\_View[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_View "Direct link to mock_View")
* viktor.testing.mock\_View(*controller*)[](#mock_View "Link to this definition")
New in v13.3.0
Decorator that can be used to mock @View decorators (any subclass of [`viktor.views.View`](https://docs.viktor.ai/sdk/api/views/.md#View "viktor.views.View")), to facilitate easier testing of view methods.
Example:
```
import unittest
import viktor as vkt
from app.my_entity.controller import MyEntityController
class TestMyEntityController(unittest.TestCase):
@vkt.testing.mock_View(MyEntityController)
def test_geometry_view(self):
params = ...
geometry_result = MyEntityController().geometry_view(params=params)
self.assertIsInstance(geometry_result.geometry, vkt.TransformableObject)
self.assertEqual(geometry_result.labels, ...)
```
* Parameters:
**controller** (`Type`\[[`Controller`](https://docs.viktor.ai/sdk/api/core/.md#Controller "viktor.core.Controller")]) – Controller class on which the @View decorator should be mocked
* Return type:
`Callable`
## mock\_params[](https://docs.viktor.ai/sdk/api/testing/.md#_mock_params "Direct link to mock_params")
* viktor.testing.mock\_params(*params*, *parametrization*, *file\_resources=None*, *entities=None*)[](#mock_params "Link to this definition")
Convert a plain dict to the (deserialized) params, replacing FileResource and Entity objects with their mocked counterpart (MockedFileResource, MockedEntity). Can be used to test methods with params in their signature that are called by the VIKTOR platform (e.g. view methods, button methods).
Example:
```
import unittest
import viktor as vkt
from app.my_entity.controller import MyEntityController
class TestMyEntityController(unittest.TestCase):
def test_button_method(self):
// provide the params manually...
params_dict = {'number': 1, 'entity': 2, 'file': 3}
// or from a JSON file...
params_dict = vkt.File.from_path("path to my JSON file")
mocked_params = vkt.testing.mock_params(
params, MyEntityController.parametrization,
entities={2: vkt.testing.MockedEntity(entity_id=2, name="My Entity")}
file_resources={3: vkt.testing.MockedFileResource(vkt.File.from_data("content"), "file.txt")},
)
MyEntityController().button_method(mocked_params)
```
Deserialization only affects the raw values associated with the following fields:
> * DateField
>
> * EntityOptionField
>
> * ChildEntityOptionField
>
> * SiblingEntityOptionField
>
> * EntityMultiSelectField
>
> * ChildEntityMultiSelectField
>
> * SiblingEntityMultiSelectField
>
> * GeoPointField
>
> * GeoPolylineField
>
> * GeoPolygonField
>
> * FileField
>
> * MultiFileField
* Parameters:
* **params** (`dict` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – Plain dict or JSON file (with serialized params) to be converted to the (deserialized) params.
* **parametrization** ([`Parametrization`](https://docs.viktor.ai/sdk/api/parametrization/.md#Parametrization "viktor.parametrization.Parametrization") | `Type`\[[`Parametrization`](https://docs.viktor.ai/sdk/api/parametrization/.md#Parametrization "viktor.parametrization.Parametrization")]) – Parametrization corresponding to the params.
* **file\_resources** (`Dict`\[`int`, [`MockedFileResource`](#MockedFileResource "viktor.testing.MockedFileResource")]) – Maps FileResource source id in params to mocked file resource. If source id is not in file\_resources, a default MockedFileResource (with default filename and File) is returned.
* **entities** (`Dict`\[`int`, [`MockedEntity`](#MockedEntity "viktor.testing.MockedEntity")]) – Maps entity id in params to mocked entity. If entity id is not in entities, a default MockedEntity is returned.
* Return type:
`Munch`
---
# viktor.utils
## convert\_excel\_to\_pdf[](https://docs.viktor.ai/sdk/api/utils/.md#_convert_excel_to_pdf "Direct link to convert_excel_to_pdf")
* viktor.utils.convert\_excel\_to\_pdf(*file*)[](#convert_excel_to_pdf "Link to this definition")
Convert an Excel document to PDF.
Example usages:
```
import viktor as vkt
# using File object
file1 = vkt.File.from_path(Path(__file__).parent / "mydocument.xlsx")
with file1.open_binary() as f1:
pdf = convert_excel_to_pdf(f1)
# using built-in `open()`
with open(Path(__file__).parent / "mydocument.xlsx", "rb") as f1:
pdf = convert_excel_to_pdf(f1)
```
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
**file** (`BinaryIO`) – Document to be converted.
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* Returns:
File object containing converted document.
## convert\_svg\_to\_pdf[](https://docs.viktor.ai/sdk/api/utils/.md#_convert_svg_to_pdf "Direct link to convert_svg_to_pdf")
* viktor.utils.convert\_svg\_to\_pdf(*file*)[](#convert_svg_to_pdf "Link to this definition")
Convert a SVG document to PDF.
Example usages:
```
import viktor as vkt
# using File object
file1 = vkt.File.from_path(Path(__file__).parent / "mydocument.svg")
with file1.open_binary() as f1:
pdf = convert_svg_to_pdf(f1)
# using built-in `open()`
with open(Path(__file__).parent / "mydocument.svg", "rb") as f1:
pdf = convert_svg_to_pdf(f1)
```
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
**file** (`BinaryIO`) – Document to be converted.
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* Returns:
File object containing converted document.
## convert\_word\_to\_pdf[](https://docs.viktor.ai/sdk/api/utils/.md#_convert_word_to_pdf "Direct link to convert_word_to_pdf")
* viktor.utils.convert\_word\_to\_pdf(*file*)[](#convert_word_to_pdf "Link to this definition")
Convert a Word document to PDF.
Example usages:
```
import viktor as vkt
# using File object
file1 = vkt.File.from_path(Path(__file__).parent / "mydocument.docx")
with file1.open_binary() as f1:
pdf = convert_word_to_pdf(f1)
# using built-in `open()`
with open(Path(__file__).parent / "mydocument.docx", "rb") as f1:
pdf = convert_word_to_pdf(f1)
```
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
**file** (`BinaryIO`) – Document to be converted.
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* Returns:
File object containing converted document.
## memoize[](https://docs.viktor.ai/sdk/api/utils/.md#_memoize "Direct link to memoize")
* viktor.utils.memoize(*fun*)[](#memoize "Link to this definition")
Decorator that applies memoization to a function. This can increase performance when the function is called multiple times with identical input.
When using multiple decorators, this should be the last decorator.
Warning
memoized keys will differ depending on parameters being passed as args or kwargs, which can cause a (unexpected) cache miss! For example, f(1, y=2) and f(x=1, y=2) will be treated as two different entries. Prefer to use functions with kwargs only to prevent this.
Example:
```
# In this example, a DataView performs a long-running calculation when
# calling `func`. When the user changes input in the editor and updates
# the view again, `func` will only be evaluated again if either one of
# `param_a`, `param_b`, or `param_c` is changed in-between jobs.
import viktor as vkt
@vkt.memoize
def func(*, param_a, param_b, param_c):
# perform lengthy calculation
return result
class Controller(vkt.Controller):
...
@vkt.DataView("Results", duration_guess=30)
def get_data_view(self, params, **kwargs):
...
result = func(param_a=..., param_b=..., param_c=...)
...
return vkt.DataResult(...)
```
CAUTION: Only use this function when you are 100% sure of the following:
> * The function is a pure function (e.g. @staticmethod) meaning:
>
> > * It always returns the same result for a given input. [\[1\]](#id5)
> >
> > * It does not depend on other data and does not have side effects such as API calls or calls to others objects that persist state. [\[2\]](#id6)
>
> * If part of the returning data contains a modified input, it must not be a problem that the memory reference is lost and a new object is returned.
>
> * The input of the function is serializable. [\[3\]](#id7)
>
> * The output of the function is serializable. [\[3\]](#id7)
>
> * During memoization, tuples in the input are casted to lists before determining uniqueness.
>
> * During memoization, tuples in the output are casted to lists before returning.
>
> * In the design of your application you should take into account that the application should not fail in timeouts/unresponsiveness if the memoization does not work. It should be a bonus if it works.
>
> * The function name is unique within the Python file.
\[[1](#id1)]
Variables/objects/functions defined outside of the memoized function are not used in the memoized function.
\[[2](#id2)]
The function should only return results. Any other actions defined in the function are not performed if the function call is memoized.
\[3] ([1](#id3),[2](#id4))
‘Serializable’ in this context means the data is any of the following types: boolean, dictionary, float, int, list, none, string, tuple. Types as returned in the ‘params’ are also allowed (e.g. GeoPoint, FileResource, Color, datetime.date, etc.) with the exception of Entity. When data is nested, the nesting can only contain any of the aforementioned types.
Practical uses of this are, but not limited to, function calls with input and output that is relatively small compared to the amount of time required for the evaluation. Cached results are kept for a maximum of 24 hours.
Note
When using the memoization decorator on your development environment the cache is stored locally. The local storage is limited to 50 function calls. If the limit is exceeded, cached results are cleared based on a first in, first out approach. In production the storage is unlimited.
* Parameters:
**fun** (`Callable`) – original function
* Return type:
`Callable`
## merge\_pdf\_files[](https://docs.viktor.ai/sdk/api/utils/.md#_merge_pdf_files "Direct link to merge_pdf_files")
* viktor.utils.merge\_pdf\_files(*\*files*)[](#merge_pdf_files "Link to this definition")
This method can be used to merge several PDFs into one document. BinaryIO objects can be directly used as arguments in the method. The merged document is returned as a File object. The order of the input files is preserved in the resulting document.
Example usages:
```
import viktor as vkt
# using File object
file1 = vkt.File.from_path(Path(__file__).parent / "pdf1.pdf")
file2 = vkt.File.from_path(Path(__file__).parent / "pdf2.pdf")
with file1.open_binary() as f1, file2.open_binary() as f2:
merged_pdf = merge_pdf_files(f1, f2)
# using built-in `open()`
with open(Path(__file__).parent / "pdf1.pdf", "rb") as f1, open(Path(__file__).parent / "pdf2.pdf", "rb") as f2:
merged_pdf = merge_pdf_files(f1, f2)
```
Note
This method needs to be mocked in (automated) unit and integration tests.
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* Returns:
File object containing merged document.
## render\_jinja\_template[](https://docs.viktor.ai/sdk/api/utils/.md#_render_jinja_template "Direct link to render_jinja_template")
* viktor.utils.render\_jinja\_template(*template*, *variables*)[](#render_jinja_template "Link to this definition")
Render a template using Jinja.
Example usage:
```
with open("path/to/template.jinja", 'rb') as template:
result = render_jinja_template(template, {'name': 'John Doe'})
```
Note
This method needs to be mocked in (automated) unit and integration tests.
* Parameters:
* **template** (`BinaryIO`) – Jinja template file.
* **variables** (`dict`) – set of variables to fill the template with.
* Return type:
[`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")
* Returns:
File object containing the rendered template
---
# viktor.views
## AutodeskResult[](https://docs.viktor.ai/sdk/api/views/.md#_AutodeskResult "Direct link to AutodeskResult")
* *class *viktor.views.AutodeskResult(*autodesk\_file*, *\**, *access\_token*)[](#AutodeskResult "Link to this definition")
Bases: `_ViewResult`
New in v14.25.0
Container with the Autodesk cloud storage file that should be visualized in a AutodeskView.
* Parameters:
* **autodesk\_file** ([`AutodeskFile`](https://docs.viktor.ai/sdk/api/external/autodesk/.md#AutodeskFile "viktor.external.autodesk.AutodeskFile") | `str`) – Autodesk file to show. Can also pass the URN (unique resource name) of the versioned file on Autodesk cloud storage (of the form “”) directly.
* **access\_token** (`str`) – Autodesk cloud storage token to access the file.
## AutodeskView[](https://docs.viktor.ai/sdk/api/views/.md#_AutodeskView "Direct link to AutodeskView")
* *class *viktor.views.AutodeskView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#AutodeskView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
New in v14.25.0
A decorator class that configures a controller method to return an Autodesk-specific view, utilizing the Autodesk API for content display.
Example usage:
```
@vkt.AutodeskView("Autodesk View")
def get_autodesk_view(self, params, **kwargs):
integration = vkt.external.OAuth2Integration("autodesk-integration")
token = integration.get_access_token()
autodesk_file = params.autodesk_file # value of AutodeskFileField
if autodesk_file is None:
raise vkt.UserError("Please select an Autodesk file")
return vkt.AutodeskResult(autodesk_file, access_token=token)
```
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## DataGroup[](https://docs.viktor.ai/sdk/api/views/.md#_DataGroup "Direct link to DataGroup")
* *class *viktor.views.DataGroup(*\*args*, *\*\*kwargs*)[](#DataGroup "Link to this definition")
Bases: `dict`
Container for DataItems (max. 100).
DataItems can be added with or without a keyword argument. Keywords are required when you want to use a DataItem in the summary (for lookup).
Example:
```
DataGroup(
DataItem('a', 1),
DataItem('b', 2),
output_c=DataItem('c', 3), # 'output_c' can be used in the entity summary
output_d=DataItem('d', 4), # 'output_d' can be used in the entity summary
)
```
**(new in v14.22.0)** Append items to an existing data group using DataGroup.add():
```
d = DataGroup(
DataItem('a', 1),
)
d.add(DataItem('b', 2))
d.add(DataItem('c', 3), DataItem('d', 4))
```
* Parameters:
* **args** ([`DataItem`](#DataItem "viktor.views.DataItem")) – DataItem entries.
* **kwargs** ([`DataItem`](#DataItem "viktor.views.DataItem")) – Keyworded DataItem entries.
* Raises:
* AttributeError when more than 100 DataItems are used
- add(*\*items*)[](#DataGroup.add "Link to this definition")
New in v14.22.0
Add one or more DataItems to an existing DataGroup.
* Return type:
`None`
* *classmethod *from\_data\_groups(*groups*)[](#DataGroup.from_data_groups "Link to this definition")
Constructs a combined DataGroup object from a list of individual DataGroup entries.
Note that is not possible to have multiple DataGroups that share a specific key for a DataItem, e.g. the following will result in an error:
```
d1 = DataGroup(output_a=DataItem(...))
d2 = DataGroup(output_a=DataItem(...))
d3 = DataGroup.from_data_groups([d1, d2]) # raises KeyError
```
* Return type:
[`DataGroup`](#DataGroup "viktor.views.DataGroup")
## DataItem[](https://docs.viktor.ai/sdk/api/views/.md#_DataItem "Direct link to DataItem")
* *class *viktor.views.DataItem(*label*, *value=None*, *subgroup=None*, *\**, *prefix=''*, *suffix=''*, *number\_of\_decimals=None*, *status=DataStatus.INFO*, *status\_message=''*, *explanation\_label=''*)[](#DataItem "Link to this definition")
Constructs an entry that can be used as input of a DataGroup, to fill the data view with results.
The data view is dynamic, which means that a DataItem itself can consist of another DataGroup as subgroup. Both examples are demonstrated below.
Example single entry:
```
result = "I am a great result"
item = DataItem('output 1', result)
```
Example subgroup:
```
result = "I am a great result"
item = DataItem('output 1', result, subgroup=DataGroup(
output11=DataItem('output 1.1', "I can also be a numeric result"),
output12=DataItem('output 1.2', 123)
))
```
The prefix / suffix can potentially change with every call. However, when the result is used in the Summary, the prefix / suffix of the DataItem should be equal to the prefix / suffix of the SummaryItem to maintain a consistent database.
* Parameters:
* **label** (`str`) – Description of the value which is shown. e.g: ‘Uc bending’
* **value** (`str` | `float`) – Value of the data. e.g: 0.9
* **subgroup** ([`DataGroup`](#DataGroup "viktor.views.DataGroup")) – Optional DataItems grouped together in a DataGroup underneath this DataItem. Maximum depth = 3
* **prefix** (`str`) – E.g: €. Should be equal to the prefix of the SummaryItem if linked.
* **suffix** (`str`) – E.g: N. Should be equal to the suffix of the SummaryItem if linked.
* **number\_of\_decimals** (`int`) – Number of decimals with which the value is rounded for display.
* **status** ([`DataStatus`](#DataStatus "viktor.views.DataStatus")) –
Status of value. This controls the formatting of the status\_message:
* status=DataStatus.INFO: black text
* status=DataStatus.SUCCESS: green text
* status=DataStatus.WARNING: orange text
* status=DataStatus.ERROR: red text
* **status\_message** (`str`) – Message which will be shown underneath the value. Color can be formatted with status.
* **explanation\_label** (`str`) – Optional text which is placed between the label and the value. Could for instance be used for a calculation.
* Raises:
**TypeError** – if number\_of\_decimals is used on a non-numeric value.
- *property *subgroup*: [DataGroup](#DataGroup "viktor.views.DataGroup")*[](#DataItem.subgroup "Link to this definition")
## DataResult[](https://docs.viktor.ai/sdk/api/views/.md#_DataResult "Direct link to DataResult")
* *class *viktor.views.DataResult(*data*)[](#DataResult "Link to this definition")
Bases: `_ViewResult`
Container with the data that should be shown in a DataView. This data can be nested up to three levels deep.
* Parameters:
**data** ([`DataGroup`](#DataGroup "viktor.views.DataGroup")) – Result data.
## DataStatus[](https://docs.viktor.ai/sdk/api/views/.md#_DataStatus "Direct link to DataStatus")
* *class *viktor.views.DataStatus(*\*values*)[](#DataStatus "Link to this definition")
Bases: `Enum`
Enumeration of statuses to annotate a DataItem.
* ERROR*: [`DataStatus`](#DataStatus "viktor.views.DataStatus")** = 'error'*[](#DataStatus.ERROR "Link to this definition")
- INFO*: [`DataStatus`](#DataStatus "viktor.views.DataStatus")** = 'info'*[](#DataStatus.INFO "Link to this definition")
* SUCCESS*: [`DataStatus`](#DataStatus "viktor.views.DataStatus")** = 'success'*[](#DataStatus.SUCCESS "Link to this definition")
- WARNING*: [`DataStatus`](#DataStatus "viktor.views.DataStatus")** = 'warning'*[](#DataStatus.WARNING "Link to this definition")
## DataView[](https://docs.viktor.ai/sdk/api/views/.md#_DataView "Direct link to DataView")
* *class *viktor.views.DataView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#DataView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
Function decorator to instruct the controller method to return a data view that contains calculation result.
Example usage:
```
@DataView("Cost breakdown")
def get_data_view(self, params, **kwargs):
# calculate data
...
return DataResult(data_group)
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## GeoJSONAndDataResult[](https://docs.viktor.ai/sdk/api/views/.md#_GeoJSONAndDataResult "Direct link to GeoJSONAndDataResult")
* *class *viktor.views.GeoJSONAndDataResult(*geojson*, *data*, *labels=None*, *legend=None*, *\**, *interaction\_groups=None*, *attribution=None*)[](#GeoJSONAndDataResult "Link to this definition")
Bases: `_ViewResult`
Container with the GeoJSON data and result data that should be visualized in a GeoJSONAndDataView. Optionally a legend and map labels can be included, as well as an attribution text for the data shown on the map.
* Parameters:
* **geojson** (`dict`) – GeoJSON dictionary.
* **data** ([`DataGroup`](#DataGroup "viktor.views.DataGroup")) – Result data.
* **labels** (`List`\[[`MapLabel`](#MapLabel "viktor.views.MapLabel")]) – Labels that should be placed on the map.
* **legend** ([`MapLegend`](#MapLegend "viktor.views.MapLegend")) – Map legend.
* **interaction\_groups** (`Dict`\[`str`, `Sequence`\[`int` | `str` | [`MapFeature`](#MapFeature "viktor.views.MapFeature")]]) – create named groups that can be referred to in a map interaction
New in v13.2.0
* **attribution** (`str`) – text appended to the map’s attribution line (bottom-right), e.g. to credit a data source. Plain text (HTML is not interpreted), at most 200 characters. The base map provider attribution is always shown
New in v14.37.0
- *property *geojson*: dict*[](#GeoJSONAndDataResult.geojson "Link to this definition")
## GeoJSONAndDataView[](https://docs.viktor.ai/sdk/api/views/.md#_GeoJSONAndDataView "Direct link to GeoJSONAndDataView")
* *class *viktor.views.GeoJSONAndDataView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#GeoJSONAndDataView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
Function decorator to instruct the controller method to return a combined view consisting of a GeoJSON and data.
Example usage:
```
@vkt.GeoJSONAndDataView("Map / Data")
def get_geojson_data_view(self, params, **kwargs):
...
return vkt.GeoJSONAndDataResult(...)
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## GeoJSONResult[](https://docs.viktor.ai/sdk/api/views/.md#_GeoJSONResult "Direct link to GeoJSONResult")
* *class *viktor.views.GeoJSONResult(*geojson*, *labels=None*, *legend=None*, *\**, *interaction\_groups=None*, *attribution=None*)[](#GeoJSONResult "Link to this definition")
Bases: `_ViewResult`
Container with the GeoJSON data that should be visualized in a GeoJSONView. Optionally a legend and map labels can be included, as well as an attribution text for the data shown on the map.
The following geojson properties are supported that can be used for styling of the map elements:
> * icon (geometry type ‘Point’ only): icon to be shown (default: “pin”). For a complete list of all available markers, see [`MapPoint`](#MapPoint "viktor.views.MapPoint")
>
> * marker-color: the color of a marker [\[\*\]](#id2)
>
> * description: text to show when this item is clicked
>
> * stroke: the color of a line as part of a polygon, polyline, or multigeometry \*
>
> * fill: the color of the interior of a polygon \*
\[[\*](#id1)]
color rules: Colors can be in short form “#ace” or long form “#aaccee”, and should contain the # prefix. Colors are interpreted the same as in CSS, in #RRGGBB and #RGB order.
To enable interaction, the map feature identifiers can be defined within the geojson dict by adding an “id” attribute to a feature as follows:
```
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": ...,
"geometry": ...
"id": "my identifier",
...
```
* Parameters:
* **geojson** (`dict`) – GeoJSON dictionary.
* **labels** (`List`\[[`MapLabel`](#MapLabel "viktor.views.MapLabel")]) – Labels that should be placed on the map.
* **legend** ([`MapLegend`](#MapLegend "viktor.views.MapLegend")) – Map legend.
* **interaction\_groups** (`Dict`\[`str`, `Sequence`\[`int` | `str` | [`MapFeature`](#MapFeature "viktor.views.MapFeature")]]) – create named groups that can be referred to in a map interaction
New in v13.2.0
* **attribution** (`str`) – text appended to the map’s attribution line (bottom-right), e.g. to credit a data source. Plain text (HTML is not interpreted), at most 200 characters. The base map provider attribution is always shown
New in v14.37.0
- *property *geojson*: dict*[](#GeoJSONResult.geojson "Link to this definition")
## GeoJSONView[](https://docs.viktor.ai/sdk/api/views/.md#_GeoJSONView "Direct link to GeoJSONView")
* *class *viktor.views.GeoJSONView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#GeoJSONView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
Function decorator to instruct the controller method to return a GeoJSON (geographic data) view.
Example usage:
```
@GeoJSONView("Map")
def get_geojson_view(self, params, **kwargs):
...
return GeoJSONResult(...)
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## GeometryAndDataResult[](https://docs.viktor.ai/sdk/api/views/.md#_GeometryAndDataResult "Direct link to GeometryAndDataResult")
* *class *viktor.views.GeometryAndDataResult(*geometry*, *data*, *labels=None*, *\**, *geometry\_type='gltf'*)[](#GeometryAndDataResult "Link to this definition")
Bases: `_ViewResult`
Container with the results that should be visualized in a GeometryAndDataView. This consists of three-dimensional geometry object(s) with optional text labels and data.
Please have a look at GeometryResult for examples.
* Parameters:
* **geometry** ([`TransformableObject`](https://docs.viktor.ai/sdk/api/geometry/.md#TransformableObject "viktor.geometry.TransformableObject") | `Sequence`\[[`TransformableObject`](https://docs.viktor.ai/sdk/api/geometry/.md#TransformableObject "viktor.geometry.TransformableObject")] | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | [`FileResource`](https://docs.viktor.ai/sdk/api/api-v1/.md#FileResource "viktor.api_v1.FileResource")) – TransformableObject(s) that contain the geometric objects, or a geometry file such as glTF/GLB (v2.0) ().
* **geometry\_type** (`str`) – Type of loader that should be used to render the geometry (“gltf”, “3dm”)
New in v14.4.0
.
* **data** ([`DataGroup`](#DataGroup "viktor.views.DataGroup")) – Result data.
* **labels** (`List`\[[`Label`](#Label "viktor.views.Label")]) – Text labels that can be used to provide additional information.
## GeometryAndDataView[](https://docs.viktor.ai/sdk/api/views/.md#_GeometryAndDataView "Direct link to GeometryAndDataView")
* *class *viktor.views.GeometryAndDataView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *view\_mode='3D'*, *default\_shadow=False*, *up\_axis='Z'*, *x\_axis\_to\_right=None*, *visible=True*)[](#GeometryAndDataView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
Function decorator to instruct the controller method to return a combined view consisting of geometries and data.
Example usage:
```
@GeometryAndDataView("Model / Cost")
def get_geometry_data_view(self, params, **kwargs):
...
return GeometryAndDataResult(...)
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – See [`View`](#View "viktor.views.View").
* **duration\_guess** (`int`) – See [`View`](#View "viktor.views.View").
* **description** (`str`) – See [`View`](#View "viktor.views.View").
* **update\_label** (`str`) – See [`View`](#View "viktor.views.View").
* **view\_mode** (`Literal`\[`'2D'`, `'3D'`]) –
Sets the view mode:
* ’3D’: Camera is free to move and user can choose between orthographic and perspective view.
* ’2D’: Camera is fixed on the xy-plane and view is orthographic.
* **default\_shadow** (`bool`) – Show shadow when editor is opened. User can still switch it off.
* **up\_axis** (`Literal`\[`'Y'`, `'Z'`]) – (view\_mode=’3D’ only) Upwards pointing axis. Possible options: ‘Y’, ‘Z’ (default: ‘Z’)
* **x\_axis\_to\_right** (`bool`) – (view\_mode=’3D’ and up\_axis=’Y’ only) X-axis pointing to the right in the initial view
New in v14.8.0
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## GeometryResult[](https://docs.viktor.ai/sdk/api/views/.md#_GeometryResult "Direct link to GeometryResult")
* *class *viktor.views.GeometryResult(*geometry*, *labels=None*, *\**, *geometry\_type='gltf'*)[](#GeometryResult "Link to this definition")
Bases: `_ViewResult`
Container with the results that should be visualized in a GeometryView. This consists of three-dimensional geometry object(s) and optional text labels.
To enable a geometric object for interaction, the object must be named using the ‘identifier’ argument. In case of a glTF/GLB-file, the objects name can be provided on the “name” key within a node. If none of the objects in the GeometryResult have a name assigned, default names are assigned to all of them (enabling them for interaction). Note: if there are multiple objects with the same name, a number will automatically be appended to enforce uniqueness.
Example viktor.geometry TransformableObject(s):
```
geometry = vkt.Sphere(Point(0, 0), 10, identifier="MySphere")
vkt.GeometryResult(geometry) # or [obj1, obj2, ...] in case of multiple objects
```
By specifying the geometry\_type you can render 3D geometry files either by providing a path, URL, or dynamically created (e.g. using trimesh). Currently supported geometry types are: “gltf”, “3dm”.
Example static geometry file from path:
```
geometry = vkt.File.from_path(Path(__file__).parent / "my_model.gltf")
vkt.GeometryResult(geometry, geometry_type="gltf")
```
Example static geometry file from a URL:
```
geometry = vkt.File.from_url("https://github.com/KhronosGroup/glTF-Sample-Models/tree/main/2.0/CesiumMilkTruck/glTF-Binary/CesiumMilkTruck.glb")
vkt.GeometryResult(geometry, geometry_type="gltf")
```
Example from FileField:
```
vkt.GeometryResult(params.my_geometry_file, geometry_type="gltf")
```
Example dynamic geometry file (e.g. using trimesh):
```
sphere = trimesh.creation.uv_sphere(10)
scene = trimesh.Scene(geometry={'sphere': sphere})
geometry = vkt.File()
with geometry.open_binary() as w:
w.write(trimesh.exchange.gltf.export_glb(scene))
vkt.GeometryResult(geometry, geometry_type="gltf")
```
* Parameters:
* **geometry** ([`TransformableObject`](https://docs.viktor.ai/sdk/api/geometry/.md#TransformableObject "viktor.geometry.TransformableObject") | `Sequence`\[[`TransformableObject`](https://docs.viktor.ai/sdk/api/geometry/.md#TransformableObject "viktor.geometry.TransformableObject")] | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | [`FileResource`](https://docs.viktor.ai/sdk/api/api-v1/.md#FileResource "viktor.api_v1.FileResource")) – TransformableObject(s) that contain the geometric objects, or a geometry file such as glTF/GLB (v2.0) ().
* **geometry\_type** (`str`) – Type of loader that should be used to render the geometry (“gltf”, “3dm”)
New in v14.4.0
.
* **labels** (`List`\[[`Label`](#Label "viktor.views.Label")]) – Text labels that can be used to provide additional information.
## GeometryView[](https://docs.viktor.ai/sdk/api/views/.md#_GeometryView "Direct link to GeometryView")
* *class *viktor.views.GeometryView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *view\_mode='3D'*, *default\_shadow=False*, *up\_axis='Z'*, *x\_axis\_to\_right=None*, *visible=True*)[](#GeometryView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
Function decorator to instruct the controller method to return a geometry view (2D / 3D).
Example usage:
```
@GeometryView("3D model")
def get_geometry_view(self, params, **kwargs):
...
return GeometryResult(...)
@GeometryView("2D model", view_mode='2D')
def get_geometry_view_2d(self, params, **kwargs):
...
return GeometryResult(...)
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
See [`GeometryResult`](#GeometryResult "viktor.views.GeometryResult") for example implementations.
* Parameters:
* **label** (`str`) – See [`View`](#View "viktor.views.View").
* **duration\_guess** (`int`) – See [`View`](#View "viktor.views.View").
* **description** (`str`) – See [`View`](#View "viktor.views.View").
* **update\_label** (`str`) – See [`View`](#View "viktor.views.View").
* **view\_mode** (`Literal`\[`'2D'`, `'3D'`]) –
Sets the view mode:
* ’3D’: Camera is free to move and user can choose between orthographic and perspective view.
* ’2D’: Camera is fixed on the xy-plane and view is orthographic.
* **default\_shadow** (`bool`) – Show shadow when editor is opened. User can still switch it off.
* **up\_axis** (`Literal`\[`'Y'`, `'Z'`]) – (view\_mode=’3D’ only) Upwards pointing axis. Possible options: ‘Y’, ‘Z’ (default: ‘Z’)
* **x\_axis\_to\_right** (`bool`) – (view\_mode=’3D’ and up\_axis=’Y’ only) X-axis pointing to the right in the initial view
New in v14.8.0
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## IFCAndDataResult[](https://docs.viktor.ai/sdk/api/views/.md#_IFCAndDataResult "Direct link to IFCAndDataResult")
* *class *viktor.views.IFCAndDataResult(*ifc*, *data*)[](#IFCAndDataResult "Link to this definition")
Bases: `_ViewResult`
New in v14.6.0
Container with the results that should be visualized in an IFCAndDataView.
Please have a look at IFCResult for examples.
* Parameters:
* **ifc** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | [`FileResource`](https://docs.viktor.ai/sdk/api/api-v1/.md#FileResource "viktor.api_v1.FileResource")) – IFC geometry file.
* **data** ([`DataGroup`](#DataGroup "viktor.views.DataGroup")) – Result data.
## IFCAndDataView[](https://docs.viktor.ai/sdk/api/views/.md#_IFCAndDataView "Direct link to IFCAndDataView")
* *class *viktor.views.IFCAndDataView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#IFCAndDataView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
New in v14.6.0
Function decorator to instruct the controller method to return a combined view consisting of an IFCView and a DataView.
Example usage:
```
@IFCAndDataView("IFC and data view")
def get_ifc_and_data_view(self, params, **kwargs):
ifc = File.from_path(Path(__file__).parent / 'sample.ifc')
data = ...
return IFCAndDataResult(ifc, data)
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## IFCResult[](https://docs.viktor.ai/sdk/api/views/.md#_IFCResult "Direct link to IFCResult")
* *class *viktor.views.IFCResult(*ifc*)[](#IFCResult "Link to this definition")
Bases: `_ViewResult`
New in v14.6.0
IFC to be visualized in an IFCView.
Example static geometry file from path:
```
ifc = File.from_path(Path(__file__).parent / 'sample.ifc')
IFCResult(ifc)
```
Example static geometry file from a URL:
```
ifc = File.from_url("https://github.com/IFCjs/test-ifc-files/raw/main/Others/haus.ifc")
IFCResult(ifc)
```
**(new in v14.6.1)** In order to improve performance it is possible to use the value of a FileField (i.e. FileResource) directly:
```
IFCResult(params.file_field)
```
* Parameters:
**ifc** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | [`FileResource`](https://docs.viktor.ai/sdk/api/api-v1/.md#FileResource "viktor.api_v1.FileResource")) – IFC geometry file.
## IFCView[](https://docs.viktor.ai/sdk/api/views/.md#_IFCView "Direct link to IFCView")
* *class *viktor.views.IFCView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#IFCView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
New in v14.6.0
Function decorator to instruct the controller method to return an IFCView.
Example usage:
```
@IFCView("IFC view")
def get_ifc_view(self, params, **kwargs):
ifc = File.from_path(Path(__file__).parent / 'sample.ifc')
return IFCResult(ifc)
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## ImageAndDataResult[](https://docs.viktor.ai/sdk/api/views/.md#_ImageAndDataResult "Direct link to ImageAndDataResult")
* *class *viktor.views.ImageAndDataResult(*image*, *data*)[](#ImageAndDataResult "Link to this definition")
Bases: `_ViewResult`
New in v13.7.0
Container with the image and result data that should be visualized in a ImageAndDataView.
Supported image types are ‘svg’, ‘jpeg’, ‘png’, ‘gif’.
* Parameters:
* **image** (`StringIO` | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File")) – image file.
* **data** ([`DataGroup`](#DataGroup "viktor.views.DataGroup")) – Result data.
## ImageAndDataView[](https://docs.viktor.ai/sdk/api/views/.md#_ImageAndDataView "Direct link to ImageAndDataView")
* *class *viktor.views.ImageAndDataView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#ImageAndDataView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
New in v13.7.0
Function decorator to instruct the controller method to return a combined view consisting of an image and data.
Supported image types are ‘svg’, ‘jpeg’, ‘png’, ‘gif’.
Example usage:
```
@vkt.ImageAndDataView("Image View")
def get_image_data_view(self, params, **kwargs):
...
return vkt.ImageAndDataResult(image, data_group)
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## ImageResult[](https://docs.viktor.ai/sdk/api/views/.md#_ImageResult "Direct link to ImageResult")
* *class *viktor.views.ImageResult(*image*)[](#ImageResult "Link to this definition")
Bases: `_ViewResult`
New in v13.7.0
Image to be visualized in an ImageView.
Supported image types are ‘svg’, ‘jpeg’, ‘png’, ‘gif’.
Example from FileField:
```
vkt.ImageResult(params.my_image_file)
```
* Parameters:
**image** (`StringIO` | `BytesIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | [`FileResource`](https://docs.viktor.ai/sdk/api/api-v1/.md#FileResource "viktor.api_v1.FileResource")) – image file.
- *classmethod *from\_path(*file\_path*)[](#ImageResult.from_path "Link to this definition")
Use file path to construct the image result.
* Parameters:
**file\_path** (`str` | `bytes` | `PathLike`) – Path to the image.
* Return type:
[`ImageResult`](#ImageResult "viktor.views.ImageResult")
## ImageView[](https://docs.viktor.ai/sdk/api/views/.md#_ImageView "Direct link to ImageView")
* *class *viktor.views.ImageView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#ImageView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
New in v13.7.0
Function decorator to instruct the controller method to return an ImageView.
Supported image types are ‘svg’, ‘jpeg’, ‘png’, ‘gif’.
Example usage:
```
@vkt.ImageView("Image View")
def get_image_view(self, params, **kwargs):
file_path = Path(__file__).parent / 'sample.png'
return vkt.ImageResult(File.from_path(file_path)) # or `vkt.ImageResult.from_path(file_path)`
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## InteractionEvent[](https://docs.viktor.ai/sdk/api/views/.md#_InteractionEvent "Direct link to InteractionEvent")
* *class *viktor.views.InteractionEvent(*event\_type*, *value*)[](#InteractionEvent "Link to this definition")
Event triggered by the user as a consequence of an [`viktor.parametrization.Interaction`](https://docs.viktor.ai/sdk/api/parametrization/.md#Interaction "viktor.parametrization.Interaction").
Warning
Do not instantiate this class directly, it is returned as ‘event’ in the method of the button with the corresponding interaction.
* Parameters:
* **event\_type** (`str`) – type of the event (‘map\_select’)
* **value** (`Any`) –
value of the user performed interaction. Type depends on event\_type:
* map\_select: List\[Union\[str, int]] = identifier of selected features
## Label[](https://docs.viktor.ai/sdk/api/views/.md#_Label "Direct link to Label")
* *class *viktor.views.Label(*point*, *\*text*, *size\_factor=1*, *color=(0, 0, 0)*)[](#Label "Link to this definition")
Text label
* Parameters:
* **point** ([`Point`](https://docs.viktor.ai/sdk/api/geometry/.md#Point "viktor.geometry.Point")) – Position of the label.
* **text** (`str`) – Text to show; multiple text arguments will each be shown on a new line.
* **size\_factor** (`float`) – Factor to be applied to the font size (0 < size\_factor <= 10).
* **color** ([`Color`](https://docs.viktor.ai/sdk/api/core/.md#Color "viktor.core.Color")) – Color of the text.
- *property *point*: [Point](https://docs.viktor.ai/sdk/api/geometry/.md#Point "viktor.geometry.Point")*[](#Label.point "Link to this definition")
* serialize()[](#Label.serialize "Link to this definition")
* Return type:
`dict`
- *property *text*: str | Tuple\[str, ...]*[](#Label.text "Link to this definition")
## MapAndDataResult[](https://docs.viktor.ai/sdk/api/views/.md#_MapAndDataResult "Direct link to MapAndDataResult")
* *class *viktor.views.MapAndDataResult(*features*, *data*, *labels=None*, *legend=None*, *\**, *interaction\_groups=None*, *attribution=None*)[](#MapAndDataResult "Link to this definition")
Bases: [`GeoJSONAndDataResult`](#GeoJSONAndDataResult "viktor.views.GeoJSONAndDataResult")
Container with the Map data and result data that should be visualized in a MapAndDataView. Optionally a legend and map labels can be included, as well as an attribution text for the data shown on the map.
* Parameters:
* **features** (`List`\[[`MapFeature`](#MapFeature "viktor.views.MapFeature")]) – List that contains the map objects.
* **data** ([`DataGroup`](#DataGroup "viktor.views.DataGroup")) – Result data.
* **labels** (`List`\[[`MapLabel`](#MapLabel "viktor.views.MapLabel")]) – Labels that should be placed on the map.
* **legend** ([`MapLegend`](#MapLegend "viktor.views.MapLegend")) – Map legend.
* **interaction\_groups** (`Dict`\[`str`, `Sequence`\[`int` | `str` | [`MapFeature`](#MapFeature "viktor.views.MapFeature")]]) – create named groups that can be referred to in a map interaction
New in v13.2.0
* **attribution** (`str`) – text appended to the map’s attribution line (bottom-right), e.g. to credit a data source. Plain text (HTML is not interpreted), at most 200 characters. The base map provider attribution is always shown
New in v14.37.0
- *property *features*: List\[[MapFeature](#MapFeature "viktor.views.MapFeature")]*[](#MapAndDataResult.features "Link to this definition")
* *property *geojson*: dict*[](#MapAndDataResult.geojson "Link to this definition")
## MapAndDataView[](https://docs.viktor.ai/sdk/api/views/.md#_MapAndDataView "Direct link to MapAndDataView")
* *class *viktor.views.MapAndDataView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#MapAndDataView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
Function decorator to instruct the controller method to return a combined view consisting of a Map and data.
Example usage:
```
@vkt.MapAndDataView("Map / Data")
def get_map_data_view(self, params, **kwargs):
...
return vkt.MapAndDataResult(...)
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## MapCircle[](https://docs.viktor.ai/sdk/api/views/.md#_MapCircle "Direct link to MapCircle")
* *class *viktor.views.MapCircle(*center*, *radius*, *\**, *num\_edges=64*, *fill\_opacity=None*, *stroke\_opacity=None*, *stroke\_width=None*, *dash\_size=None*, *gap\_size=None*, *\*\*kwargs*)[](#MapCircle "Link to this definition")
Bases: [`MapFeature`](#MapFeature "viktor.views.MapFeature")
New in v14.22.0
Represents a circular polygon on the Earth’s surface formed by a latitude/longitude coordinate and radius \[m].
Example usage:
```
circle = MapCircle(
center=MapPoint(52.373922404495474, 5.2459716796875),
radius=500
)
```
* Parameters:
* **center** ([`MapPoint`](#MapPoint "viktor.views.MapPoint")) – Center point of the circle.
* **radius** (`float`) – Radius in \[m].
* **num\_edges** (`int`) – Number of polygon edges.
* **fill\_opacity** (`float`) – opacity of the interior, between 0.0 and 1.0
New in v14.30.0
.
* **stroke\_opacity** (`float`) – opacity of the border, between 0.0 and 1.0
New in v14.30.0
.
* **stroke\_width** (`float`) – width of the border, greater than or equal to 0
New in v14.30.0
.
* **dash\_size** (`float`) – size of the dashes of a dashed border, relative to the width of the path
New in v14.30.0
.
* **gap\_size** (`float`) – size of the gaps of a dashed border, relative to the width of the path
New in v14.30.0
.
* **kwargs** (`Any`) – See [`MapFeature`](#MapFeature "viktor.views.MapFeature") for possible kwargs.
## MapEntityLink[](https://docs.viktor.ai/sdk/api/views/.md#_MapEntityLink "Direct link to MapEntityLink")
* *class *viktor.views.MapEntityLink(*label*, *entity\_id*)[](#MapEntityLink "Link to this definition")
Represents a link between a feature in a MapView and a specific entity.
Example usage:
```
gef_link = MapEntityLink('GEF x', gef_entity_id)
gef_marker = MapPoint(51.99311570849245, 4.385752379894256, entity_links=[gef_link])
```
* Parameters:
* **label** (`str`) – text which is shown to the user.
* **entity\_id** (`int`) – id of the linked entity.
## MapFeature[](https://docs.viktor.ai/sdk/api/views/.md#_MapFeature "Direct link to MapFeature")
* *class *viktor.views.MapFeature(*\**, *title=None*, *description=None*, *color=(39, 45, 51)*, *entity\_links=None*, *identifier=None*)[](#MapFeature "Link to this definition")
Bases: `ABC`
Base class for features that can be shown in a MapView. See the documentation of the subclasses for example implementations.
* Parameters:
* **title** (`str`) – Title of a clickable map feature.
* **description** (`str`) – Description of a clickable map feature.
* **color** ([`Color`](https://docs.viktor.ai/sdk/api/core/.md#Color "viktor.core.Color")) – Specifies the color of the map feature.
* **entity\_links** (`List`\[[`MapEntityLink`](#MapEntityLink "viktor.views.MapEntityLink")]) – When clicking on the map feature, links towards multiple entities can be shown.
* **identifier** (`int` | `str`) – feature identifier
New in v13.2.0
## MapLabel[](https://docs.viktor.ai/sdk/api/views/.md#_MapLabel "Direct link to MapLabel")
* *class *viktor.views.MapLabel(*lat*, *lon*, *text*, *scale*, *\**, *fixed\_size=False*)[](#MapLabel "Link to this definition")
Text which is placed as an overlay on the map.
Scale 0-5 is approximately the scale for countries:
[](https://docs.viktor.ai/_images/map_label_scale_0_5.png)
Scale 6-10 is approximately the scale for cities:
[](https://docs.viktor.ai/_images/map_label_scale_6_11.png)
Scale 11-15 is approximately the scale for neighborhoods and streets
[](https://docs.viktor.ai/_images/map_label_scale_11_15.png)
Scale 16-18 is approximately for individual houses.
[](https://docs.viktor.ai/_images/map_label_scale_14_19.png)
* Parameters:
* **lat** (`float`) – Latitude of text in degrees.
* **lon** (`float`) – Longitude of text in degrees.
* **text** (`str`) – Text with is displayed on the map.
* **scale** (`float`) – Size of the text on an exponential scale. See example in class docstring for estimate.
* **fixed\_size** (`bool`) – When True, the size of the text is fixed regardless of zoom level (default: False).
## MapLegend[](https://docs.viktor.ai/sdk/api/views/.md#_MapLegend "Direct link to MapLegend")
* *class *viktor.views.MapLegend(*entries*)[](#MapLegend "Link to this definition")
A legend which is placed as an overlay on a map view.
Example usage:
```
legend = MapLegend([
(Color.from_hex('#0016FF'), "I'm blue"),
(Color.from_hex('#FF0000'), "I'm red"),
...
])
```
* Parameters:
**entries** (`List`\[`Tuple`\[[`Color`](https://docs.viktor.ai/sdk/api/core/.md#Color "viktor.core.Color"), `str`]]) – Items in the legend, defined by color and label.
## MapLine[](https://docs.viktor.ai/sdk/api/views/.md#_MapLine "Direct link to MapLine")
* *class *viktor.views.MapLine(*start\_point*, *end\_point*, *\*\*kwargs*)[](#MapLine "Link to this definition")
Bases: [`MapPolyline`](#MapPolyline "viktor.views.MapPolyline")
Represents a line on the earth’s surface between two latitude/longitude pairs.
In case multiple line segments are to be created, a [`MapPolyline`](#MapPolyline "viktor.views.MapPolyline") may be preferred.
Example usage:
```
line = MapLine(
MapPoint(51.99311570849245, 4.385752379894256),
MapPoint(52.40912125231122, 5.031738281255681)
)
```
* Parameters:
* **start\_point** ([`MapPoint`](#MapPoint "viktor.views.MapPoint")) – Map point with latitude and longitude pair.
* **end\_point** ([`MapPoint`](#MapPoint "viktor.views.MapPoint")) – Map point with latitude and longitude pair.
* **kwargs** (`Any`) – See [`MapPolyline`](#MapPolyline "viktor.views.MapPolyline") and [`MapFeature`](#MapFeature "viktor.views.MapFeature") for possible kwargs.
- *property *end\_point*: [MapPoint](#MapPoint "viktor.views.MapPoint")*[](#MapLine.end_point "Link to this definition")
* *property *start\_point*: [MapPoint](#MapPoint "viktor.views.MapPoint")*[](#MapLine.start_point "Link to this definition")
## MapPoint[](https://docs.viktor.ai/sdk/api/views/.md#_MapPoint "Direct link to MapPoint")
* *class *viktor.views.MapPoint(*lat*, *lon*, *alt=0*, *\**, *icon=None*, *size='medium'*, *\*\*kwargs*)[](#MapPoint "Link to this definition")
Bases: [`MapFeature`](#MapFeature "viktor.views.MapFeature")
Represents a point on the Earth’s surface described by a latitude/longitude coordinate pair.
Example usage:
```
marker = MapPoint(51.99311570849245, 4.385752379894256)
```
* Parameters:
* **lat** (`float`) – Latitude.
* **lon** (`float`) – Longitude.
* **alt** (`float`) – Altitude.
* **icon** (`str`) – icon to be shown (default: “pin”). See below for all possible icons.
* **size** (`Literal`\[`'small'`, `'medium'`, `'large'`]) – size of the marker (“small” | “medium” | “large”)
New in v14.5.0
.
* **kwargs** (`Any`) – See [`MapFeature`](#MapFeature "viktor.views.MapFeature") for possible kwargs.
List of icons:
> * arrow-down: [](https://docs.viktor.ai/_images/arrow-down.svg)
>
> * arrow-left: [](https://docs.viktor.ai/_images/arrow-left.svg)
>
> * arrow-right: [](https://docs.viktor.ai/_images/arrow-right.svg)
>
> * arrow-up: [](https://docs.viktor.ai/_images/arrow-up.svg)
>
> * chevron-down: [](https://docs.viktor.ai/_images/chevron-down.svg)
>
> * chevron-left: [](https://docs.viktor.ai/_images/chevron-left.svg)
>
> * chevron-right: [](https://docs.viktor.ai/_images/chevron-right.svg)
>
> * chevron-up: [](https://docs.viktor.ai/_images/chevron-up.svg)
>
> * circle: [](https://docs.viktor.ai/_images/circle.svg)
>
> * circle-filled: [](https://docs.viktor.ai/_images/circle-filled.svg)
>
> * cross: [](https://docs.viktor.ai/_images/cross.svg)
>
> * diamond: [](https://docs.viktor.ai/_images/diamond.svg)
>
> * diamond-horizontal: [](https://docs.viktor.ai/_images/diamond-horizontal.svg)
>
> * drop: [](https://docs.viktor.ai/_images/drop.svg)
>
> * exclamation-circle: [](https://docs.viktor.ai/_images/exclamation-circle.svg)
>
> * exclamation-circle-filled: [](https://docs.viktor.ai/_images/exclamation-circle-filled.svg)
>
> * message: [](https://docs.viktor.ai/_images/message.svg)
>
> * minus: [](https://docs.viktor.ai/_images/minus.svg)
>
> * minus-circle: [](https://docs.viktor.ai/_images/minus-circle.svg)
>
> * minus-circle-filled: [](https://docs.viktor.ai/_images/minus-circle-filled.svg)
>
> * pin: [](https://docs.viktor.ai/_images/pin.svg)
>
> * pin-add: [](https://docs.viktor.ai/_images/pin-add.svg)
>
> * pin-edit: [](https://docs.viktor.ai/_images/pin-edit.svg)
>
> * plus: [](https://docs.viktor.ai/_images/plus.svg)
>
> * plus-circle: [](https://docs.viktor.ai/_images/plus-circle.svg)
>
> * plus-circle-filled: [](https://docs.viktor.ai/_images/plus-circle-filled.svg)
>
> * plus-thick: [](https://docs.viktor.ai/_images/plus-thick.svg)
>
> * question-circle: [](https://docs.viktor.ai/_images/question-circle.svg)
>
> * question-circle-filled: [](https://docs.viktor.ai/_images/question-circle-filled.svg)
>
> * square: [](https://docs.viktor.ai/_images/square.svg)
>
> * square-filled: [](https://docs.viktor.ai/_images/square-filled.svg)
>
> * star: [](https://docs.viktor.ai/_images/star.svg)
>
> * triangle: [](https://docs.viktor.ai/_images/triangle.svg)
>
> * triangle-down: [](https://docs.viktor.ai/_images/triangle-down.svg)
>
> * triangle-down-filled: [](https://docs.viktor.ai/_images/triangle-down-filled.svg)
>
> * triangle-filled: [](https://docs.viktor.ai/_images/triangle-filled.svg)
>
> * triangle-left: [](https://docs.viktor.ai/_images/triangle-left.svg)
>
> * triangle-left-filled: [](https://docs.viktor.ai/_images/triangle-left-filled.svg)
>
> * triangle-right: [](https://docs.viktor.ai/_images/triangle-right.svg)
>
> * triangle-right-filled: [](https://docs.viktor.ai/_images/triangle-right-filled.svg)
>
> * viktor: [](https://docs.viktor.ai/_images/viktor.svg)
>
> * warning: [](https://docs.viktor.ai/_images/warning.svg)
>
> * warning-filled: [](https://docs.viktor.ai/_images/warning-filled.svg)
>
> * wye: [](https://docs.viktor.ai/_images/wye.svg)
* *property *alt*: float*[](#MapPoint.alt "Link to this definition")
- *classmethod *from\_geo\_point(*point*, *\**, *icon=None*, *size='medium'*, *\*\*kwargs*)[](#MapPoint.from_geo_point "Link to this definition")
Instantiates a MapPoint from the provided GeoPoint.
* Parameters:
* **point** ([`GeoPoint`](https://docs.viktor.ai/sdk/api/geometry/.md#GeoPoint "viktor.geometry.GeoPoint")) – GeoPoint.
* **icon** (`str`) – icon to be shown (default: “pin”). For a complete list of all available markers, see `__init__()`
* **size** (`Literal`\[`'small'`, `'medium'`, `'large'`]) – size of the marker (“small” | “medium” | “large”)
New in v14.5.0
.
* **kwargs** (`Any`) – See [`MapFeature`](#MapFeature "viktor.views.MapFeature") for possible kwargs.
* Return type:
[`MapPoint`](#MapPoint "viktor.views.MapPoint")
* *property *lat*: float*[](#MapPoint.lat "Link to this definition")
- *property *lon*: float*[](#MapPoint.lon "Link to this definition")
## MapPolygon[](https://docs.viktor.ai/sdk/api/views/.md#_MapPolygon "Direct link to MapPolygon")
* *class *viktor.views.MapPolygon(*points*, *\**, *holes=None*, *fill\_opacity=None*, *stroke\_opacity=None*, *stroke\_width=None*, *dash\_size=None*, *gap\_size=None*, *\*\*kwargs*)[](#MapPolygon "Link to this definition")
Bases: [`MapFeature`](#MapFeature "viktor.views.MapFeature")
Represents a polygon on the earth’s surface formed by a set of latitude/longitude pairs.
Example usage:
```
polygon = MapPolygon([
MapPoint(52.373922404495474, 5.2459716796875),
MapPoint(52.10313118589299, 5.3997802734375),
MapPoint(52.373922404495474, 5.57281494140625),
])
```
* Parameters:
* **points** (`List`\[[`MapPoint`](#MapPoint "viktor.views.MapPoint")]) – Map points with latitude and longitude pair. The profile is automatically closed, so it is not necessary to add the start point at the end.
* **holes** (`List`\[[`MapPolygon`](#MapPolygon "viktor.views.MapPolygon")]) – List of interior polygons which form holes in the exterior polygon.
* **fill\_opacity** (`float`) – opacity of the interior, between 0.0 and 1.0
New in v14.30.0
.
* **stroke\_opacity** (`float`) – opacity of the border, between 0.0 and 1.0
New in v14.30.0
.
* **stroke\_width** (`float`) – width of the border, greater than or equal to 0
New in v14.30.0
.
* **dash\_size** (`float`) – size of the dashes of a dashed border, relative to the width of the path
New in v14.30.0
.
* **gap\_size** (`float`) – size of the gaps of a dashed border, relative to the width of the path
New in v14.30.0
.
* **kwargs** (`Any`) – See [`MapFeature`](#MapFeature "viktor.views.MapFeature") for possible kwargs.
- *classmethod *from\_geo\_polygon(*polygon*, *\*\*kwargs*)[](#MapPolygon.from_geo_polygon "Link to this definition")
Instantiates a MapPolygon from the provided GeoPolygon.
* Parameters:
* **polygon** ([`GeoPolygon`](https://docs.viktor.ai/sdk/api/geometry/.md#GeoPolygon "viktor.geometry.GeoPolygon")) – GeoPolygon.
* **kwargs** (`Any`) – See [`MapFeature`](#MapFeature "viktor.views.MapFeature") for possible kwargs.
* Return type:
[`MapPolygon`](#MapPolygon "viktor.views.MapPolygon")
* *property *holes*: List\[[MapPolygon](#MapPolygon "viktor.views.MapPolygon")]*[](#MapPolygon.holes "Link to this definition")
- *property *points*: List\[[MapPoint](#MapPoint "viktor.views.MapPoint")]*[](#MapPolygon.points "Link to this definition")
## MapPolyline[](https://docs.viktor.ai/sdk/api/views/.md#_MapPolyline "Direct link to MapPolyline")
* *class *viktor.views.MapPolyline(*\*points*, *stroke\_opacity=None*, *stroke\_width=None*, *dash\_size=None*, *gap\_size=None*, *\*\*kwargs*)[](#MapPolyline "Link to this definition")
Bases: [`MapFeature`](#MapFeature "viktor.views.MapFeature")
Represents a polyline on the earth’s surface between several latitude/longitude pairs.
Example usage:
```
line = MapPolyline(
MapPoint(51.99311570849245, 4.385752379894256),
MapPoint(52.40912125231122, 5.031738281255681),
...
)
```
* Parameters:
* **points** ([`MapPoint`](#MapPoint "viktor.views.MapPoint")) – MapPoints with latitude and longitude pair.
* **stroke\_opacity** (`float`) – opacity of the line, between 0.0 and 1.0
New in v14.30.0
.
* **stroke\_width** (`float`) – width of the line, greater than or equal to 0
New in v14.30.0
.
* **dash\_size** (`float`) – size of the dashes of a dashed line, relative to the width of the path
New in v14.30.0
.
* **gap\_size** (`float`) – size of the gaps of a dashed line, relative to the width of the path
New in v14.30.0
.
* **kwargs** (`Any`) – See [`MapFeature`](#MapFeature "viktor.views.MapFeature") for possible kwargs.
- *classmethod *from\_geo\_polyline(*polyline*, *\*\*kwargs*)[](#MapPolyline.from_geo_polyline "Link to this definition")
Instantiates a MapPolyline from the provided GeoPolyline.
* Parameters:
* **polyline** ([`GeoPolyline`](https://docs.viktor.ai/sdk/api/geometry/.md#GeoPolyline "viktor.geometry.GeoPolyline")) – GeoPolyline.
* **kwargs** (`Any`) – See [`MapFeature`](#MapFeature "viktor.views.MapFeature") for possible kwargs.
* Return type:
[`MapPolyline`](#MapPolyline "viktor.views.MapPolyline")
* *property *points*: List\[[MapPoint](#MapPoint "viktor.views.MapPoint")]*[](#MapPolyline.points "Link to this definition")
## MapResult[](https://docs.viktor.ai/sdk/api/views/.md#_MapResult "Direct link to MapResult")
* *class *viktor.views.MapResult(*features*, *labels=None*, *legend=None*, *\**, *interaction\_groups=None*, *attribution=None*)[](#MapResult "Link to this definition")
Bases: [`GeoJSONResult`](#GeoJSONResult "viktor.views.GeoJSONResult")
Container with the Map data that should be visualized in a MapView. Optionally a legend and map labels can be included, as well as an attribution text for the data shown on the map.
* Parameters:
* **features** (`List`\[[`MapFeature`](#MapFeature "viktor.views.MapFeature")]) – List that contains the map objects.
* **labels** (`List`\[[`MapLabel`](#MapLabel "viktor.views.MapLabel")]) – Labels that should be placed on the map.
* **legend** ([`MapLegend`](#MapLegend "viktor.views.MapLegend")) – Map legend.
* **interaction\_groups** (`Dict`\[`str`, `Sequence`\[`int` | `str` | [`MapFeature`](#MapFeature "viktor.views.MapFeature")]]) – create named groups that can be referred to in a map interaction
New in v13.2.0
* **attribution** (`str`) – text appended to the map’s attribution line (bottom-right), e.g. to credit a data source. Plain text (HTML is not interpreted), at most 200 characters. The base map provider attribution is always shown
New in v14.37.0
- *property *features*: List\[[MapFeature](#MapFeature "viktor.views.MapFeature")]*[](#MapResult.features "Link to this definition")
* *property *geojson*: dict*[](#MapResult.geojson "Link to this definition")
## MapView[](https://docs.viktor.ai/sdk/api/views/.md#_MapView "Direct link to MapView")
* *class *viktor.views.MapView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#MapView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
Function decorator to instruct the controller method to return a Map (geographic data) view.
Example usage:
```
@vkt.MapView("Map")
def get_map_view(self, params, **kwargs):
...
return vkt.MapResult(...)
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## PDFResult[](https://docs.viktor.ai/sdk/api/views/.md#_PDFResult "Direct link to PDFResult")
* *class *viktor.views.PDFResult(*\**, *file=None*, *url=None*)[](#PDFResult "Link to this definition")
Bases: `_ViewResult`
PDF document to be visualized in a PDFView. Can be defined from a File object or from a URL (direct-sharing). If both file and url are defined, url takes precedence.
In case of URL: the hosting website must allow for direct accessing for the document to be shown. If this is forbidden (undefined CORS-headers), the document can alternatively be shown via the file argument with a File.from\_url(…), in which it is downloaded first and viewed subsequently (indirect-sharing).
Example usages:
From URL (direct-sharing):
```
PDFResult(url="https://www...")
```
From URL (indirect-sharing):
```
f = File.from_url("https://www...")
PDFResult(file=f)
```
From path:
```
file_path = Path(__file__).parent / 'sample.pdf'
PDFResult.from_path(file_path) # or ...
PDFResult(File.from_path(file_path))
```
From FileField:
```
PDFResult(file=params.my_pdf_file)
```
* Parameters:
* **file** ([`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | [`FileResource`](https://docs.viktor.ai/sdk/api/api-v1/.md#FileResource "viktor.api_v1.FileResource")) – PDF document to view
* **url** (`str`) – URL of PDF document to view. If accessing the PDF directly from the URL is not allowed by the host website (undefined CORS-headers), this will result in the document not showing up in the view (as an alternative one can use File.from\_url).
- *classmethod *from\_path(*file\_path*)[](#PDFResult.from_path "Link to this definition")
Create the PDFResult from a path to the PDF file.
* Parameters:
**file\_path** (`str` | `bytes` | `PathLike`) – file path to a PDF file
* Return type:
[`PDFResult`](#PDFResult "viktor.views.PDFResult")
## PDFView[](https://docs.viktor.ai/sdk/api/views/.md#_PDFView "Direct link to PDFView")
* *class *viktor.views.PDFView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#PDFView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
Function decorator to instruct the controller method to return a PDFView.
Example usage:
```
@PDFView("PDF View")
def get_pdf_view(self, params, **kwargs):
file_path = Path(__file__).parent / 'sample.pdf'
return PDFResult(File.from_path(file_path)) # or `PDFResult.from_path(file_path)`
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## PlotlyAndDataResult[](https://docs.viktor.ai/sdk/api/views/.md#_PlotlyAndDataResult "Direct link to PlotlyAndDataResult")
* *class *viktor.views.PlotlyAndDataResult(*figure*, *data*)[](#PlotlyAndDataResult "Link to this definition")
Bases: `_ViewResult`
Plotly figure to be visualized in a PlotlyAndDataView. The figure can be provided in json-string or dict format.
**(new in v14.22.0)** Support a plotly ‘Figure’ object.
Example usage:
```
@PlotlyAndDataView("Plotly and data view")
def get_plotly_and_data_view(self, params, **kwargs):
data_group = ...
fig = go.Figure(
data=[go.Bar(x=[1, 2, 3], y=[1, 3, 2])],
layout=go.Layout(title=go.layout.Title(text="A Figure Specified By A Graph Object"))
)
return PlotlyAndDataResult(fig, data_group)
```
* Parameters:
* **figure** (`str` | `dict` | `Figure`) – Plotly figure
* **data** ([`DataGroup`](#DataGroup "viktor.views.DataGroup")) – result data
## PlotlyAndDataView[](https://docs.viktor.ai/sdk/api/views/.md#_PlotlyAndDataView "Direct link to PlotlyAndDataView")
* *class *viktor.views.PlotlyAndDataView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#PlotlyAndDataView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
Function decorator to instruct the controller method to return a combined view consisting of a PlotlyView and a DataView.
Example usage:
```
@PlotlyAndDataView("Plotly and data view")
def get_plotly_and_data_view(self, params, **kwargs):
...
return PlotlyAndDataResult(figure, data_group)
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## PlotlyResult[](https://docs.viktor.ai/sdk/api/views/.md#_PlotlyResult "Direct link to PlotlyResult")
* *class *viktor.views.PlotlyResult(*figure*)[](#PlotlyResult "Link to this definition")
Bases: `_ViewResult`
Plotly figure to be visualized in a PlotlyView. The figure can be provided in json-string or dict format.
**(new in v14.22.0)** Support a plotly ‘Figure’ object.
Example usages:
```
@PlotlyView("Plotly view")
def get_plotly_view(self, params, **kwargs):
fig = go.Figure(
data=[go.Bar(x=[1, 2, 3], y=[1, 3, 2])],
layout=go.Layout(title=go.layout.Title(text="A Figure Specified By A Graph Object"))
)
return PlotlyResult(fig)
```
```
@PlotlyView("Plotly view")
def get_plotly_view(self, params, **kwargs):
fig = {
"data": [{"type": "bar", "x": [1, 2, 3], "y": [1, 3, 2]}],
"layout": {"title": {"text": "A Figure Specified By Python Dictionary"}}
}
return PlotlyResult(fig)
```
* Parameters:
**figure** (`str` | `dict` | `Figure`) – Plotly figure
## PlotlyView[](https://docs.viktor.ai/sdk/api/views/.md#_PlotlyView "Direct link to PlotlyView")
* *class *viktor.views.PlotlyView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#PlotlyView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
Function decorator to instruct the controller method to return a PlotlyView.
Example usage:
```
@PlotlyView("Plotly view")
def get_plotly_view(self, params, **kwargs):
...
return PlotlyResult(figure)
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## Summary[](https://docs.viktor.ai/sdk/api/views/.md#_Summary "Direct link to Summary")
* *class *viktor.views.Summary(*\*\*items*)[](#Summary "Link to this definition")
Bases: `OrderedDict`
Summary of resulting data items, which can be used in the summary view of an entity.
Example usage:
```
class Controller:
...
summary = Summary(
item_1=SummaryItem(...),
item_2=SummaryItem(...),
item_3=SummaryItem(...)
)
```
* Parameters:
**items** ([`SummaryItem`](#SummaryItem "viktor.views.SummaryItem")) – Items that are shown in the summary, with a maximum of 6 items per summary.
## SummaryItem[](https://docs.viktor.ai/sdk/api/views/.md#_SummaryItem "Direct link to SummaryItem")
* *class *viktor.views.SummaryItem(*label*, *item\_type*, *source*, *value\_path*, *\**, *suffix=''*, *prefix=''*)[](#SummaryItem "Link to this definition")
A summary consists of SummaryItem objects, that define which input / result values should be displayed.
Suppose we have a data view with a controller method ‘data\_view’, which returns a DataItem with key ‘output\_item\_1’. The following summary item can be constructed to refer to this result:
```
item_1 = SummaryItem('Label', float, 'data_view', 'output_item_1', suffix='N')
```
Suppose we have a parametrization with a certain parameter defined as geometry.input.length, this can be converted to a summary item by doing:
```
item_2 = SummaryItem('Length', float, 'parametrization', 'geometry.input.length', suffix='m')
```
* Parameters:
* **label** (`str`) – Text label of the item.
* **item\_type** (`Type`\[`str` | `float`]) – Type of value, options are ‘str’ | ‘float’.
* **source** (`str`) – Source from which the input / output should be extracted.
* **value\_path** (`str`) – Dotted path of value in parametrization / data structure of view. e.g: level1.level2.value
* **suffix** (`str`) – A suffix will be put behind the value to provide additional information such as units.
* **prefix** (`str`) – A prefix will be put in front of the value to provide info such as a dollar sign.
## TableCell[](https://docs.viktor.ai/sdk/api/views/.md#_TableCell "Direct link to TableCell")
* *class *viktor.views.TableCell(*value*, *\**, *text\_color=None*, *background\_color=None*, *text\_style=None*)[](#TableCell "Link to this definition")
## TableHeader[](https://docs.viktor.ai/sdk/api/views/.md#_TableHeader "Direct link to TableHeader")
* *class *viktor.views.TableHeader(*title*, *\**, *align=None*, *num\_decimals=None*, *width=None*, *flex=None*, *min\_width=None*, *max\_width=None*)[](#TableHeader "Link to this definition")
Header object that can be used in [`TableResult`](#TableResult "viktor.views.TableResult") to set styling.
* Parameters:
* **title** (`str`) – Title that will be shown in the header.
* **align** (`Literal`\[`'center'`, `'left'`, `'right'`] | `None`) – Visual alignment of the corresponding row/column values within the table
* **num\_decimals** (`int` | `None`) – Number of decimals that is shown for the row/column values (requires corresponding row/column to contain only numbers).
* **width** (`int` | `None`) – Fixed width of the column in pixels. Mutually exclusive with `flex`.
New in v14.34.0
* **flex** (`int` | `float` | `None`) – Width of the column as a ratio relative to other columns that use `flex` (e.g. a column with `flex=2` becomes twice as wide as a column with `flex=1`). Mutually exclusive with `width`.
New in v14.34.0
* **min\_width** (`int` | `None`) – Minimum width of the column in pixels.
New in v14.34.0
* **max\_width** (`int` | `None`) – Maximum width of the column in pixels.
New in v14.34.0
## TableResult[](https://docs.viktor.ai/sdk/api/views/.md#_TableResult "Direct link to TableResult")
* *class *viktor.views.TableResult(*data*, *\**, *column\_headers=None*, *row\_headers=None*, *enable\_sorting\_and\_filtering=None*, *enable\_column\_autosizing=False*, *show\_index=True*, *index\_header=None*)[](#TableResult "Link to this definition")
Bases: `_ViewResult`
New in v14.13.0
Data to be visualized in an TableView.
Example of a simple TableResult:
```
data = [
[1.5, "Square"],
[3.1, "Circle"],
]
TableResult(data)
```
Example of a simple TableResult with column header titles:
```
data = [
[1.5, "Square"],
[3.1, "Circle"],
]
TableResult(data, column_headers=["Area [m²]", "Shape"])
```
Example of a more complex TableResult with column and cell styling:
```
data = [
[1.5, "Square"],
[
TableCell(3.1, text_color=Color.green()),
TableCell("Circle", background_color=Color(211, 211, 211), text_style='italic')
],
]
TableResult(data, column_headers=[
TableHeader("Area [m²]", num_decimals=2),
TableHeader("Shape", align='center')
]))
```
Example of a transposed table:
```
data = [
[1.5, "Square"],
[3.1, "Circle"],
]
transposed_data = [list(i) for i in zip(*data)]
TableResult(
transposed_data,
row_headers=[
TableHeader("Area [m²]", num_decimals=2),
TableHeader("Shape", align='center')
],
column_headers=["Object 1", "Object 2"]
))
```
Example of a pandas Dataframe object:
```
df = pd.DataFrame([[1, 4], [2, 3]])
TableResult(df)
```
Example of a pandas Styler object:
```
df = pd.DataFrame([[1, 4], [2, 3]])
styler = df.style.highlight_min(color="red")
TableResult(styler)
```
Result to be shown in a TableView.
In case the data is a pandas Styler object, the following properties will be inherited:
* background\_color (per cell)
* text\_color (per cell)
* text\_style (per cell, bold or italic)
* align (per column/row, only if all cells in a row/column have the same alignment)
- Parameters:
* **data** (`Sequence`\[`Sequence`\[`str` | `float` | `int` | `bool` | `datetime` | `date` | `None` | [`TableCell`](#TableCell "viktor.views.TableCell")]] | `DataFrame` | `Styler`) – Table content. Can also be a pandas DataFrame or Styler object.
* **column\_headers** (`Sequence`\[`str` | [`TableHeader`](#TableHeader "viktor.views.TableHeader")] | `None`) – Headers shown above the columns. Can be used for custom titles and styling. In case the data is a pandas Styler object, this can be set explicitly to overwrite the generated titles and styling.
* **row\_headers** (`Sequence`\[`str` | [`TableHeader`](#TableHeader "viktor.views.TableHeader")] | `None`) – Headers shown next to the rows. Can be used for custom titles and styling. In case the data is a pandas Styler object, this can be set explicitly to overwrite the generated titles and styling.
* **enable\_sorting\_and\_filtering** (`bool` | `None`) – Enable sorting and filtering on columns. If set to None (default), sorting and filtering will be enabled if each of the columns in data is of homogeneous type, and disabled otherwise. If sorting and filtering is enabled explicitly, each column must be of homogeneous type.
* **enable\_column\_autosizing** (`bool`) – Fit all columns to their content (including headers) on render, honouring any per-column min/max width. Defaults to False.
New in v14.34.0
* **show\_index** (`bool`) – Show the auto-generated index (position + 1) on axes without headers. If set to False, the index is hidden on both axes. Provided row\_headers/column\_headers are always shown regardless; this flag only suppresses the auto-generated index on an axis without headers.
New in v14.34.0
* **index\_header** ([`TableHeader`](#TableHeader "viktor.views.TableHeader") | `None`) – Sizes the index column (the leftmost column that shows the row headers). Only the sizing properties (`width`, `flex`, `min_width`, `max_width`) of the provided [`TableHeader`](#TableHeader "viktor.views.TableHeader") take effect; `title`, `align` and `num_decimals` are ignored.
New in v14.34.0
## TableView[](https://docs.viktor.ai/sdk/api/views/.md#_TableView "Direct link to TableView")
* *class *viktor.views.TableView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#TableView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
New in v14.13.0
Function decorator to instruct the controller method to return an TableView.
Example usage:
```
@TableView("Table view")
def get_table_view(self, params, **kwargs):
data = [
[2.5, 7, "Square"],
[1.5, 8, "Circle"],
]
return TableResult(data, column_headers=["Width", "Height", "Shape"])
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## View[](https://docs.viktor.ai/sdk/api/views/.md#_View "Direct link to View")
* *class *viktor.views.View(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#View "Link to this definition")
Bases: `ABC`
Warning
Do not use this class directly in an application.
Base-class of a function decorator that can be used to specify the desired view to be returned. See the subclasses for specific examples of each type of view.
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## WebAndDataResult[](https://docs.viktor.ai/sdk/api/views/.md#_WebAndDataResult "Direct link to WebAndDataResult")
* *class *viktor.views.WebAndDataResult(*\**, *html=None*, *url=None*, *data=None*)[](#WebAndDataResult "Link to this definition")
Bases: `_ViewResult`
Container with the web data and result data that should be visualized in a WebAndDataView.
The Web part can be constructed in two ways, which should not be used together:
* url: to serve a URL (takes precedence if both are defined)
* html: for serving a single html page
- Parameters:
* **html** (`StringIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `str`) – HTML formatted content.
* **url** (`str`) – Direct URL.
* **data** ([`DataGroup`](#DataGroup "viktor.views.DataGroup")) – Result data.
## WebAndDataView[](https://docs.viktor.ai/sdk/api/views/.md#_WebAndDataView "Direct link to WebAndDataView")
* *class *viktor.views.WebAndDataView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#WebAndDataView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
Function decorator to instruct the controller method to return a combined view consisting of web-content and data.
Example usage:
```
@WebAndDataView("Web / Data")
def get_web_data_view(self, params, **kwargs):
# calculate data
...
return WebAndDataResult(html="Hello world", data=data_group)
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
## WebResult[](https://docs.viktor.ai/sdk/api/views/.md#_WebResult "Direct link to WebResult")
* *class *viktor.views.WebResult(*\**, *html=None*, *url=None*)[](#WebResult "Link to this definition")
Bases: `_ViewResult`
Container with the data that should be visualized in a WebView. There are two options, which should not be used together:
* url: to serve a URL (takes precedence if both are defined)
* html: for serving a single html page
Example usage:
```
@vkt.WebView("Hello world")
def get_web_view(self, params, **kwargs):
html = textwrap.dedent("""
My View
Hello world 🌎
""")
return vkt.WebResult(html=html)
```
```
@vkt.WebView('Python wiki')
def get_web_view(self, params, **kwargs):
return vkt.WebResult(url='https://en.wikipedia.org/wiki/Python_(programming_language)')
```
* Parameters:
* **html** (`StringIO` | [`File`](https://docs.viktor.ai/sdk/api/core/.md#File "viktor.core.File") | `str`) – HTML formatted content.
* **url** (`str`) – Direct URL.
- *classmethod *from\_path(*file\_path*)[](#WebResult.from_path "Link to this definition")
* Return type:
[`WebResult`](#WebResult "viktor.views.WebResult")
## WebView[](https://docs.viktor.ai/sdk/api/views/.md#_WebView "Direct link to WebView")
* *class *viktor.views.WebView(*label*, *duration\_guess=None*, *\**, *description=None*, *update\_label=None*, *visible=True*, *\*\*kwargs*)[](#WebView "Link to this definition")
Bases: [`View`](#View "viktor.views.View")
Function decorator to instruct the controller method to return a web-content view.
Example usage:
```
@vkt.WebView("Hello world")
def get_web_view(self, params, **kwargs):
return vkt.WebResult(html="Hello world")
```
**(new in v14.15.0)** The ‘duration\_guess’ argument is now optional.
* Parameters:
* **label** (`str`) – Name which is shown on tab in interface. e.g: ‘3D Representation’
* **duration\_guess** (`int`) – Estimation of view calculation in seconds. This will be used to add a manual refresh button for long-running tasks (larger than 3s). This estimation does not need to be very precise, but the performance will be better if this is close to the real maximum computation time (defaults to 1).
* **description** (`str`) – Show more information to the user through a tooltip on hover (max. 200 characters).
* **update\_label** (`str`) – Name which is shown on the update button in case of a slow view (max. 30 characters).
* **visible** (`bool` | `Callable`) – Visibility of the view. Can depend on params by using a callback function
New in v14.22.0
---