{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Connecting to server...\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "import sys\n",
    "from RFEM.enums import *\n",
    "from math import pi\n",
    "import json\n",
    "from RFEM.initModel import Model, Calculate_all, insertSpaces, SetAddonStatus,clearAttributes, deleteEmptyAttributes, ConvertToDlString, ConvertToDlString\n",
    "from RFEM.enums import (\n",
    "    NodalSupportType, SurfaceLoadDirection,\n",
    "    SurfaceLoadDistribution, ActionCategoryType, LineSupportType,\n",
    "    MemberLoadDirection, MemberLoadDistribution, MemberType,\n",
    "    CaseObjectType, NodalLoadDirection,AddOn,DesignSituationType,SurfaceReinforcementLocationType, \n",
    "    SurfaceReinforcementType, SurfaceReinforcementDirectionType, SurfaceReinforcementDesignDirection,\n",
    "    DurabilityStructuralClassType, DurabilityAllowanceDeviationType,ReinforcementDirectionType,OptimizerType,\n",
    "    OptimizationTargetValueType,GlobalParameterUnitGroup, GlobalParameterDefinitionType, ObjectTypes,ActionCategoryType, ActionType, ObjectTypes,MaterialDefinitionType,\n",
    "    MaterialType, MaterialModel, MaterialStiffnessModificationType, PoissonRatioEditableGroupType,\n",
    ")\n",
    "from RFEM.BasicObjects.node import Node\n",
    "from RFEM.BasicObjects.line import Line\n",
    "from RFEM.BasicObjects.material import Material\n",
    "from RFEM.BasicObjects.thickness import Thickness\n",
    "from RFEM.BasicObjects.surface import Surface\n",
    "from RFEM.BasicObjects.member import Member\n",
    "from RFEM.BasicObjects.section import Section\n",
    "from RFEM.TypesForLines.lineSupport import LineSupport\n",
    "from RFEM.TypesForNodes.nodalSupport import NodalSupport\n",
    "from RFEM.LoadCasesAndCombinations.loadCase import LoadCase\n",
    "from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings\n",
    "from RFEM.LoadCasesAndCombinations.loadCasesAndCombinations import LoadCasesAndCombinations\n",
    "from RFEM.Loads.surfaceLoad import SurfaceLoad\n",
    "from RFEM.Loads.memberLoad import MemberLoad\n",
    "from RFEM.Loads.lineLoad import LineLoad\n",
    "from RFEM.Loads.nodalLoad import NodalLoad\n",
    "from RFEM.LoadCasesAndCombinations.loadCombination import LoadCombination\n",
    "from RFEM.LoadCasesAndCombinations.designSituation import DesignSituation\n",
    "from RFEM.TypesForSurfaces.surfaceSupport import SurfaceSupport\n",
    "from RFEM.TypesforConcreteDesign.ConcreteSurfaceReinforcements import ConcreteSurfaceReinforcements\n",
    "from RFEM.TypesforConcreteDesign.ConcreteDurability import ConcreteDurability\n",
    "from RFEM.TypesforConcreteDesign.ConcreteReinforcementDirections import ConcreteReinforcementDirection\n",
    "from RFEM.globalParameter import GlobalParameter\n",
    "from RFEM.ConcreteDesign.ConcreteUltimateConfigurations import ConcreteUltimateConfiguration\n",
    "from RFEM.Calculate.optimizationSettings import OptimizerType,OptimizationTargetValueType,OptimizationSettings \n",
    "from RFEM.ImportExport.exports import ExportTo\n",
    "from RFEM.Results.resultTables import ResultTables, GetMaxValue, GetMinValue, GetResultTableParameters\n",
    "from RFEM.dataTypes import inf\n",
    "Model(True, 'MeinTestModell')\n",
    "SetAddonStatus(Model.clientModel,addOn=AddOn.modal_active, status=True)\n",
    "SetAddonStatus(Model.clientModel,addOn=AddOn.cost_estimation_active, status=True)\n",
    "SetAddonStatus(Model.clientModel,addOn=AddOn.concrete_design_active, status=True)\n",
    "Model.clientModel.service.delete_all()  # 🔁 Alles löschen!\n",
    "Model.clientModel.service.begin_modification()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Allgemeiner PROMPT"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Das Modell besteht aus L-Fundament: eine vertikale (20 cm dick) und eine horizontale (22 cm dick), L-förmig verbunden. Es wirken Eigengewicht, eine variable Flächenlast auf der vertikalen und eine konstante Last auf der horizontalen Platte. Alle Elemente und Lasten sind positionsbasiert definiert."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# MATERIAL"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<RFEM.BasicObjects.material.Material at 0x1b41b535f90>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# ---- Material Sec ----\n",
    "Material(\n",
    "    no=1,\n",
    "    name='C20/25 | DIN EN 1992-1-1/NA/A1:2015-12',\n",
    "    comment='C20/25 mit deutschem NA',\n",
    "    model=Model\n",
    ")\n",
    "\n",
    "Material(\n",
    "    no=2,\n",
    "    name='B550S(A)',\n",
    "    model=Model\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# GEOMETRY"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<RFEM.BasicObjects.line.Line at 0x1b41d1d7570>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# ---- Geometry Sec ----\n",
    "\n",
    "# Define nodes\n",
    "Node(1, 0.0, 0.0, 0.0)       # Common starting point for both plates\n",
    "Node(2, 0.75, 0.0, 0.0)      # End of the common edge in the X direction\n",
    "Node(3, 0.0, 0.0, -1.0)      # Bottom of the vertical plate\n",
    "Node(4, 0.75, 0.0, -1.0)     # Bottom end of the vertical plate\n",
    "Node(5, 0.0, 1.0, 0.0)       # End of the horizontal plate in the Y direction\n",
    "Node(6, 0.75, 1.0, 0.0)      # End of the horizontal plate in the X-Y plane\n",
    "\n",
    "# Define lines\n",
    "Line(1, '1 2')               # Common edge between the two plates\n",
    "Line(2, '1 3')               # Vertical edge of the vertical plate\n",
    "Line(3, '2 4')               # Vertical edge of the vertical plate\n",
    "Line(4, '3 4')               # Bottom edge of the vertical plate\n",
    "Line(5, '1 5')               # Horizontal edge of the horizontal plate\n",
    "Line(6, '2 6')               # Horizontal edge of the horizontal plate\n",
    "Line(7, '5 6')               # End edge of the horizontal plate"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# CROSSSECTION"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<RFEM.TypesForSurfaces.surfaceSupport.SurfaceSupport at 0x1b41be8f380>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# ---- Cross Sections Sec ----\n",
    "Thickness(\n",
    "    no=1,\n",
    "    name='Platte mit Globalparameter d',\n",
    "    material_no=1,\n",
    "    uniform_thickness_d=0.20,  # in Meter – wird gleich durch Formel ersetzt\n",
    "    comment='Diese Dicke wird durch Globalparameter d gesteuert',\n",
    "    \n",
    "    model=Model\n",
    ")\n",
    "\n",
    "Thickness(2, 'D2', 1, None)  # Horizontal plate thickness\n",
    "\n",
    "# Define surfaces\n",
    "Surface(1, '1 2 3 4', 1)  # Vertical plate surface\n",
    "Surface(2, '1 5 7 6', 2)  # Horizontal plate surface\n",
    "\n",
    "# Define surface support for the horizontal plate\n",
    "SurfaceSupport(1, '2', 1, 15000)  # Elastic support for the horizontal plate\n",
    "\n",
    "# ---- Cross Sections Sec ----"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# LOADS"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# ---- Loads Sec ----\n",
    "\n",
    "# --- Lastfälle ---\n",
    "LoadCase(1, 'Self-weight', [True, 0.0, 0.0, 1.0])\n",
    "LoadCase(2, \"Erddrucklast Nach Befüllung\")\n",
    "\n",
    "# ---- Loads Sec ----\n",
    "\n",
    "# Define surface loads\n",
    "# Linear varying surface load on the vertical plate\n",
    "SurfaceLoad.Force(\n",
    "    1,  # Load number\n",
    "    2,  # Load case number\n",
    "    '1',  # Surface number as string\n",
    "    SurfaceLoadDirection.LOAD_DIRECTION_LOCAL_Z,  # Load direction\n",
    "    SurfaceLoadDistribution.LOAD_DISTRIBUTION_VARYING_IN_Z,  # Load distribution\n",
    "    [[-1, 0], [0, 50 * 1000]]  # Load parameters: start and end values in N/m²\n",
    ")\n",
    "\n",
    "# Constant surface load on the horizontal plate\n",
    "SurfaceLoad.Force(\n",
    "    2,  # Load number\n",
    "    2,  # Load case number\n",
    "    '2',  # Surface number as string\n",
    "    SurfaceLoadDirection.LOAD_DIRECTION_LOCAL_Z,  # Load direction\n",
    "    SurfaceLoadDistribution.LOAD_DISTRIBUTION_UNIFORM,  # Load distribution\n",
    "    [100 * 1000]  # Load magnitude in N/m²\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Designsituatuion"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<RFEM.LoadCasesAndCombinations.loadCombination.LoadCombination at 0x1b41be8d160>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# ---- DesignSituation Sec ----\n",
    "\n",
    "DesignSituation(\n",
    "    no=1,\n",
    "    design_situation_type=DesignSituationType.DESIGN_SITUATION_TYPE_STR_PERMANENT_AND_TRANSIENT_6_10,\n",
    "    active=True,\n",
    "    name=\"GZT Ständig und vorübergehend (6.10)\",\n",
    "    params=None\n",
    ")\n",
    "\n",
    "LoadCombination(\n",
    "    no=1,\n",
    "    analysis_type=AnalysisType.ANALYSIS_TYPE_STATIC,\n",
    "    name='ULS Kombination',\n",
    "    static_analysis_settings=1,\n",
    "    to_solve=True,\n",
    "    design_situation=1,\n",
    "    combination_items=[\n",
    "        [1.35, 1, 0, True],  # Load factor for self-weight (Load Case 1)\n",
    "        [1.5, 2, 0, True]    # Load factor for live load (Load Case 2)\n",
    "    ]\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# ConcreteDurability"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<RFEM.TypesforConcreteDesign.ConcreteDurability.ConcreteDurability at 0x1b41d1fe3c0>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# ---- ConcreteDurability Sec ----\n",
    "\n",
    "ConcreteDurability(\n",
    "    no=1,\n",
    "    name=\"XC 1\",\n",
    "    members_no=\"1\",\n",
    "    member_sets_no=\"1\",\n",
    "    surfaces_no=\"1, 2\",  # Both surfaces 1 and 2\n",
    "    exposure_classes_reinforcement=[True, False, False, False],  # Only XC is activated\n",
    "    exposure_classes_reinforcement_types=[1],  # Type of exposure (e.g., XC1 = 1)\n",
    "    exposure_classes_concrete=[False, False, False],\n",
    "    exposure_classes_concrete_types=[],\n",
    "    structural_class=[DurabilityStructuralClassType.STANDARD, False, False, False, False],\n",
    "    stainless_steel_reduction=[False],\n",
    "    additional_protection_reduction=[False],\n",
    "    allowance_deviation=[DurabilityAllowanceDeviationType.STANDARD, False],\n",
    "    comment=\"Dauerhaftigkeitsdefinition für Betonbauteile mit Expositionsklasse XC1\",\n",
    "    model=Model\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# ConcreteReinforcementDirection"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<RFEM.TypesforConcreteDesign.ConcreteReinforcementDirections.ConcreteReinforcementDirection at 0x1b41d1ff0e0>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# ---- ConcreteReinforcementDirection Section ----\n",
    "\n",
    "ConcreteReinforcementDirection(\n",
    "    no=1,\n",
    "    name=\"RD 1\",\n",
    "    surfaces=\"1 2\",  # Specify the surfaces for which the reinforcement direction is defined\n",
    "    reinforcement_direction_type=ReinforcementDirectionType.REINFORCEMENT_DIRECTION_TYPE_FIRST_REINFORCEMENT_IN_Y,  # Set reinforcement direction to Y\n",
    "    rotation_parameters=[False, 0.0],  # No rotation angle applied\n",
    "    comment=\"Bewehrung in Y-Richtung für Fläche 1 und 2\",  # Comment describing the reinforcement direction\n",
    "    params=None,  # Additional parameters can be added if necessary\n",
    "    model=Model  # Reference to the model object\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# ConcreteSurfaceReinforcements"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<RFEM.TypesforConcreteDesign.ConcreteSurfaceReinforcements.ConcreteSurfaceReinforcements at 0x1b41d1fee40>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# ---- ConcreteSurfaceReinforcements Section ----\n",
    "\n",
    "ConcreteSurfaceReinforcements(\n",
    "    no=1,\n",
    "    name='OBERBEWEHRUNG',\n",
    "    surfaces='1, 2',  # Apply to surfaces 1 and 2\n",
    "    material='2',  # Use concrete material number 2\n",
    "    location_type=SurfaceReinforcementLocationType.LOCATION_TYPE_ON_SURFACE,  # Place reinforcement on the surface\n",
    "    reinforcement_type=SurfaceReinforcementType.REINFORCEMENT_TYPE_REBAR,  # Use rebar type reinforcement\n",
    "    reinforcement_type_parameters=[None, 0.15, False],  # Diameter unspecified, 15 cm spacing, no stirrups\n",
    "    cover_offset=[True, True, 0.03, 0.03],  # 3 cm cover offset on top and bottom\n",
    "    reinforcement_direction=SurfaceReinforcementDirectionType.REINFORCEMENT_DIRECTION_TYPE_IN_DESIGN_REINFORCEMENT_DIRECTION,  # Align in design direction As1\n",
    "    reinforcement_direction_parameters=[SurfaceReinforcementDesignDirection.DESIGN_REINFORCEMENT_DIRECTION_A_S_1],\n",
    "    comment='Obere Bewehrung Fläche 1 und 2',  # Comment for the reinforcement\n",
    "    params=None,  # No additional parameters\n",
    "    model=Model  # The model to which this reinforcement belongs\n",
    ")\n",
    "\n",
    "# ---- ConcreteSurfaceReinforcements Section ----"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# ConcreteUltimateConfiguration\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<RFEM.ConcreteDesign.ConcreteUltimateConfigurations.ConcreteUltimateConfiguration at 0x1b41d1fe120>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# ---- ConcreteUltimateConfiguration Section ----\n",
    "\n",
    "ConcreteUltimateConfiguration(\n",
    "    no=1,\n",
    "    name='ULS-Standard',  # Name of the ULS configuration\n",
    "    members='All',  # Apply to all members\n",
    "    member_sets='All',  # Apply to all member sets\n",
    "    surfaces='All',  # Apply to all surfaces\n",
    "    surface_sets='All',  # Apply to all surface sets\n",
    "    nodes='',  # No specific nodes defined\n",
    "    comment='ULS-Konfiguration für alle Stabsets',  # Comment for the configuration\n",
    "    params=None,  # No additional parameters\n",
    "    model=Model  # The model to which this configuration belongs\n",
    ")\n",
    "\n",
    "# ---- ConcreteUltimateConfiguration Section ----"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Global Parametrs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "GlobalParameter.AddParameter(\n",
    "    no=1,\n",
    "    name='Dicke',\n",
    "    symbol='d',\n",
    "    unit_group=GlobalParameterUnitGroup.MATERIAL_THICKNESS,  # sehr wichtig!\n",
    "    definition_type=GlobalParameterDefinitionType.DEFINITION_TYPE_OPTIMIZATION,\n",
    "    definition_parameter=[0.20, 0.10, 0.30, 25],  # Meter → wird in mm konvertiert!\n",
    "    comment='Optimierbare Dicke',\n",
    "    model=Model\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Setformula"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Parameter not allowed\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Schritt 3 – Formel auf uniform_thickness_d anwenden (wie Klick auf Globale Parameter in GUI)\n",
    "GlobalParameter.SetFormula(\n",
    "    ObjectType=ObjectTypes.E_OBJECT_TYPE_LINE,\n",
    "    no=1,  # ID der Thickness\n",
    "    parent_no=0,  # kein übergeordnetes Objekt\n",
    "    attribute='uniform_thickness_d',\n",
    "    formula='d',  # bezieht sich auf Symbol des GlobalParameters\n",
    "    model=Model\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Optimierung Werte\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<RFEM.Calculate.optimizationSettings.OptimizationSettings at 0x1b41d1fdfd0>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# ---- OptimizationSettings Section ----\n",
    "\n",
    "OptimizationSettings(\n",
    "    no=1,\n",
    "    number_of_mutations_to_keep=None,  # Not specified in the requirements\n",
    "    target_value_type=OptimizationTargetValueType.MIN_CO2_EMISSIONS,  # Target is to minimize CO₂ emissions\n",
    "    optimizer_type=OptimizerType.ALL_MUTATIONS,  # Use all mutations\n",
    "    percent_of_mutations=0.2,  # 20% mutation rate\n",
    "    optimization_values_table=None,  # No specific table provided\n",
    "    total_number_of_mutations=1,  # Total number of mutations is 1\n",
    "    active=True,  # The optimization setting is active\n",
    "    name=\"CO2-Optimierung\",  # Name of the optimization setting\n",
    "    comment=\"Ziel: Minimale CO₂-Emissionen\",  # Comment describing the goal\n",
    "    params=None,  # No additional parameters\n",
    "    model=Model  # The model to which this optimization setting belongs\n",
    ")\n",
    "\n",
    "# ---- OptimizationSettings Section ----"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# SOLVER AUFRUFEN"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "ename": "WebFault",
     "evalue": "b\"Server raised fault: 'Objekt: Globaler Parameter Nr. 1\\nAttribut: Wert\\nFehler: Bitte geben Sie einen Wert ein, der gr\\xc3\\xb6\\xc3\\x9fer gleich 100 und kleiner gleich 300 ist.'\"",
     "output_type": "error",
     "traceback": [
      "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
      "\u001b[31mWebFault\u001b[39m                                  Traceback (most recent call last)",
      "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[14]\u001b[39m\u001b[32m, line 3\u001b[39m\n\u001b[32m      1\u001b[39m \u001b[38;5;66;03m# ---- Solver Sec ----\u001b[39;00m\n\u001b[32m----> \u001b[39m\u001b[32m3\u001b[39m \u001b[43mModel\u001b[49m\u001b[43m.\u001b[49m\u001b[43mclientModel\u001b[49m\u001b[43m.\u001b[49m\u001b[43mservice\u001b[49m\u001b[43m.\u001b[49m\u001b[43mfinish_modification\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m      5\u001b[39m Calculate_all()\n",
      "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python313\\site-packages\\suds\\client.py:559\u001b[39m, in \u001b[36mMethod.__call__\u001b[39m\u001b[34m(self, *args, **kwargs)\u001b[39m\n\u001b[32m    557\u001b[39m         \u001b[38;5;28;01mreturn\u001b[39;00m (\u001b[32m500\u001b[39m, e)\n\u001b[32m    558\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m559\u001b[39m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mclient\u001b[49m\u001b[43m.\u001b[49m\u001b[43minvoke\u001b[49m\u001b[43m(\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python313\\site-packages\\suds\\client.py:618\u001b[39m, in \u001b[36mSoapClient.invoke\u001b[39m\u001b[34m(self, args, kwargs)\u001b[39m\n\u001b[32m    614\u001b[39m metrics.log.debug(\u001b[33m\"\u001b[39m\u001b[33mmessage for \u001b[39m\u001b[33m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m'\u001b[39m\u001b[33m created: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m\"\u001b[39m,\n\u001b[32m    615\u001b[39m                   \u001b[38;5;28mself\u001b[39m.method.name,\n\u001b[32m    616\u001b[39m                   timer)\n\u001b[32m    617\u001b[39m timer.start()\n\u001b[32m--> \u001b[39m\u001b[32m618\u001b[39m result = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43msoapenv\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    619\u001b[39m timer.stop()\n\u001b[32m    620\u001b[39m metrics.log.debug(\u001b[33m\"\u001b[39m\u001b[33mmethod \u001b[39m\u001b[33m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m'\u001b[39m\u001b[33m invoked: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m\"\u001b[39m,\n\u001b[32m    621\u001b[39m                   \u001b[38;5;28mself\u001b[39m.method.name,\n\u001b[32m    622\u001b[39m                   timer)\n",
      "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python313\\site-packages\\suds\\client.py:658\u001b[39m, in \u001b[36mSoapClient.send\u001b[39m\u001b[34m(self, soapenv)\u001b[39m\n\u001b[32m    656\u001b[39m         result = reply.message\n\u001b[32m    657\u001b[39m     \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m658\u001b[39m         result = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43msucceeded\u001b[49m\u001b[43m(\u001b[49m\u001b[43mbinding\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mreply\u001b[49m\u001b[43m.\u001b[49m\u001b[43mmessage\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    659\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m TransportError \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[32m    660\u001b[39m     \u001b[38;5;28;01mif\u001b[39;00m e.httpcode \u001b[38;5;129;01min\u001b[39;00m (\u001b[32m202\u001b[39m, \u001b[32m204\u001b[39m):\n",
      "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python313\\site-packages\\suds\\client.py:696\u001b[39m, in \u001b[36mSoapClient.succeeded\u001b[39m\u001b[34m(self, binding, reply)\u001b[39m\n\u001b[32m    694\u001b[39m plugins = PluginContainer(\u001b[38;5;28mself\u001b[39m.options.plugins)\n\u001b[32m    695\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(reply) > \u001b[32m0\u001b[39m:\n\u001b[32m--> \u001b[39m\u001b[32m696\u001b[39m     reply, result = \u001b[43mbinding\u001b[49m\u001b[43m.\u001b[49m\u001b[43mget_reply\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mreply\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    697\u001b[39m     \u001b[38;5;28mself\u001b[39m.last_received(reply)\n\u001b[32m    698\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n",
      "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python313\\site-packages\\suds\\bindings\\binding.py:152\u001b[39m, in \u001b[36mBinding.get_reply\u001b[39m\u001b[34m(self, method, reply)\u001b[39m\n\u001b[32m    150\u001b[39m soapenv.promotePrefixes()\n\u001b[32m    151\u001b[39m soapbody = soapenv.getChild(\u001b[33m'\u001b[39m\u001b[33mBody\u001b[39m\u001b[33m'\u001b[39m)\n\u001b[32m--> \u001b[39m\u001b[32m152\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mdetect_fault\u001b[49m\u001b[43m(\u001b[49m\u001b[43msoapbody\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    153\u001b[39m soapbody = \u001b[38;5;28mself\u001b[39m.multiref.process(soapbody)\n\u001b[32m    154\u001b[39m nodes = \u001b[38;5;28mself\u001b[39m.replycontent(method, soapbody)\n",
      "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python313\\site-packages\\suds\\bindings\\binding.py:183\u001b[39m, in \u001b[36mBinding.detect_fault\u001b[39m\u001b[34m(self, body)\u001b[39m\n\u001b[32m    181\u001b[39m p = unmarshaller.process(fault)\n\u001b[32m    182\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m.options().faults:\n\u001b[32m--> \u001b[39m\u001b[32m183\u001b[39m     \u001b[38;5;28;01mraise\u001b[39;00m WebFault(p, fault)\n\u001b[32m    184\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\n",
      "\u001b[31mWebFault\u001b[39m: b\"Server raised fault: 'Objekt: Globaler Parameter Nr. 1\\nAttribut: Wert\\nFehler: Bitte geben Sie einen Wert ein, der gr\\xc3\\xb6\\xc3\\x9fer gleich 100 und kleiner gleich 300 ist.'\""
     ]
    }
   ],
   "source": [
    "# ---- Solver Sec ----\n",
    "\n",
    "Model.clientModel.service.finish_modification()\n",
    "\n",
    "Calculate_all()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# ERGEBNISSE"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
