Skip to content

MidasCivil Specific Adapter Features

Emma Sander edited this page Jul 21, 2025 · 27 revisions

Using the MidasCivil_Adapter

Folder Structure

To use the MidasCivil_Adapter you will need an .mcb file (this can be empty) saved in a separate folder. We recommend a separate folder for each model so you can store the .mcb, .mct and any associated results.

MidasCivilFolderStructure

We recommend exporting the .mct file, even if the .mcb file is blank. This will take in to account the following:

  • Any existing objects in your model when you push
  • The version of MidasCivil you are using
  • The units you are using in your MidasCivil file

Here is how to export an .mct file:

MCTExport

Adapter

For MidasCivil

The Adapter requires you to point to a .mcb file. As the Adapter does not use an API it is not required when Pushing and Pulling objects. However, we feel it is useful to have a session of MidasCivil open with the file you intend to Push objects too.

Running the adapter will read the .mct file and breakdown all the sections in to individual text files:

MidasCivilRunAdapter When pushing objects the adapter will read the current .txt file before pushing or create a new .txt file.

For MidasCivil NX

The Adapter for MidasCivil NX does use an API and needs to be set up slightly differently. The Adapter still requires you to point to a .mcb file, running the adapter will open this file.

Before running the adapter the MidasCivil NX application needs to be opened and connected to the API. To do this, navigate to the Apps tab, then open the API Settings and select Connect. Best practice is to connect to the API in the API Settings as this has proven more reliable, however the shortcut next to the API Settings can also be used.

To connect to the MidasCivil NX application the Adapter also requires you to provide the current mAPI-key. The mAPI-key is found under the API Settings and remains the same until refreshed. It is generally advised to keep the mAPI-key safe or regularly refreshed as it may allow others to access your MidasCivil application. The mAPI-key should be provided in the mApiKey midasCivilSetting of the Adapter.

Version

Best practice is to export an .mct file and let the Adapter determine the version of MidasCivil you are using.

Otherwise, the version can be overridden at Adapter level using the constructor.

Lastly, if an .mct file is not provided, and the version is not overridden then a default version will be assumed.

MidasCivil NX

To access the MidasCivil NX version of the Adapter one of the supported versions ending in .nx must be entered in the Version option of the midasCivilSettings.

Units

The BHoM is defined in SI units as per the units convention.

The MidasCivil_Toolkit has functionality to convert from SI units to the following units (and their derivatives) through the use of the Localisation_Toolkit:

  • Length: M, CM, MM, FT, IN
  • Force: N, KN, KGF, TONF, LBF, KIPS
  • Temperature: C, F

Note that Metric and Imperial units are not supported together i.e. KIPS/M.

Combining Text Files

When pushing models lots of individual .txt files can be generated. Therefore, it is convenient to combine them all so that a single file can be loaded in to MidasCivil. The method is: BH.Engine.MidasCivil.Compute.CombineTextFiles(filepath, types, active)

Note: The filepath is the .mcb file, and not the Adapter object:

CombineTextFiles

Loading an .mct file to MidasCivil

MidasCivilLoadMCT

MidasCivil NX

For the NX version of the Adapter textfiles or .mct files can be loaded using the ImportFile Command in addition to using the MCT Command Shell as shown above.

Adapter Specific Features

Properties

SurfaceProperty

Thickness properties in MidasCivil do not have a name. When the SurfaceProperty is read, it is assigned the name "t = panel.SurfaceProperty.Thickness()m". This is required to invoke the comparer and to avoid duplicates occuring.

Thickness objectives in MidasCivil now own a name property from MidasCivil 2020 (v8.8.5) onwards as detailed in #141. This is available in the MCT Command Shell but not in the user interface (UI).

Loads

GravityLoad

When a GravityLoad object is Pushed, it will be applied to all objects irrespective of what objects are specified in the load.

BarDistributedLoad/BarVaryingDistributedLoad/BarPointForce

The distance used on a BarDistributedLoad BarVaryingDistrbutedLoad BarPointForce all use parametric distances when Pushed or Pulled to Midas. The MidasCivil_Toolkit has no way of distinguishing whether the object Pulled from MidasCivil_Toolkit is using an absolute or parametric distance, therefore users must always use parametric distances to comply with the BHoM objects.

AreaDifferentialTemperautreLoad

The differential temperature load in Midas takes a single input to define the temperature differential. It is centred about the origin, so will result in an equal temperature change top and bottom (see middle diagram below). Therefore, to achieve the desired temperature profile (right diagram) a constant offset needs to be applied using an AreaUniformTemperatureLoad.

image

Pulling Results

MidasCivil

To pull results from MidasCivil there some manual steps that must be carried out first:

  1. Display all results in MidasCivil.
  2. Export to Excel, do not change the file name.
  3. Save file to the same folder as the .mcb file in the Results folder. Pull results from MidasCivil_Toolkit

Please note that when pulling results from MidasCivil in some unit configurations there can be a small (0.2%) impact on the accuracy of results. This is due to the default setting of number of decimal places in the Style Dialogue and the exported results. To rectify this, simply increase the number of decimal places in the Style Dialogue before exporting the .csv files.

MidasCivil NX

For the NX Adapter pulling results directly from the model is supported without any manual steps. Just ensure the model is solved and connected to the API.

MidasCivil Versions

MidasCivil Version *VERSION
MidasCivil 2018 v1.1 8.6.5
MidasCivil 2019 v1.1 8.7.5
MidasCivil 2019 v2.2 8.8.1
MidasCivil 2020 v1.1 8.8.5
MidasCivil 2020 v3.2 8.9.5
MidasCivil 2021 v1.1 9.0.0
MidasCivil 2021 v1.2 9.0.0
MidasCivil 2022 v1.1 9.0.5
MidasCivil 2022 v1.2 9.1.0
MidasCivil 2023 v1.1 9.4.0
MidasCivil 2024 v1.1 9.4.5
MidasCivil 2024 v2.1 9.5.0
MidasCivil NX v9.5.0 9.5.0.nx
MidasCivil NX v9.5.5 9.5.5.nx

Calculating the Shear Factor (Qby and Qbz)

The shear factor is calculated by evaluating the first moment of area (Q) about the centroid and dividing by the thickness (T). image