Skip to content

MidasCivil Specific Adapter Features

Peter Nugent edited this page Sep 10, 2024 · 25 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

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.

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.

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

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

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 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

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