Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Deck of Cards
idbimcreateBimUnit
Card
defaulttrue
labelURL / Resource / JSON Structure
Resource: content/units

URLhttps://api-stage.bimplus.net/v2/content/units

Example: https://api-stage.bimplus.net/v2/content/units

JSON Structure of unit

Name

Mandatory / Optional

Type

Description

name

mandatory

string

Name of the unit

description

optional

string

Short description of the unit

unitmandatorystringSymbol of the unit
contexUnitTypeoptionalstringContext unit type
baseunitsoptionalarray of jsonsList of base units

 

The "baseunits" property is an array of jsons with following definitions :

NameMandatory/OptionalTypeDescription
baseunitidoptionalstring(guid)Base unit ID
usequenceoptionalintUnit sequence (default is 1)
upoweroptionalintUnit power (default is 1)

ufactor

optional

int

Unit factor (default is 1)

Card
labelHTTP Method
 POST
Card
labelDescription
 Creates

Creates a new unit. An unit can be created fresh(base unit) or

we can derive an unit from a base unit by specifying the baseunitid

it can be derived from one or more base units ( defined by property "baseunits" ).

Here is a simple explanation of how to create a derived unit, e.g. gram per square meter "g/m2" :

Code Block
titlejson description
"baseunits": [
      {
        "baseunitid": "3b871b65-516e-4e7e-a35f-faa7501d5d0d", // ID of kilogram "kg"
        "usequence": 1,   // first in the sequence
        "ufactor": 0.001, // gram is 0.001 * kg
        "upower": 1       // no power used
      },
      {
        "baseunitid": "7be3452a-47f9-4fd8-bd94-ef6c967d684e",  // ID of meter "m"
        "usequence": 2,   // second in the sequence
        "ufactor": 1,     // 1 * meter
        "upower": -1      // meter ^-1
      }
    ]
Card
labelRequest
Code Block
borderColorGreen
langxml
titleHeaders
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json
Code Block
borderColorRed
langxml
titleJSON
{
  "name": "MyDerivedUnit",
  "description": "Example of derived unit",
  "symbol": "Sym",
  "baseunits" : [
      {
            "baseunitid": "3b871b65-516e-4e7e-a35f-faa7501d5d0d",
            "usequence": 1,
            "ufactor": 2,
            "upower": 3
      }
  ]
}
Card
labelResponse
Code Block
borderColorGreen
langxml
titleStatus
Status: 201 Created
Code Block
borderColorRed
langxml
titleJSON
{
  "id": "9c75f2e7-bf66-4274-96a6-fb61ecb0e21a",
  "name": "MyDerivedUnit",
  "description": "Example of derived unit",
  "symbol": "Sym",
  "baseunits" : [
      {
            "baseunitid": "3b871b65-516e-4e7e-a35f-faa7501d5d0d",
            "usequence": 1,
            "ufactor": 2,
            "upower": 3
      }
  ]
}

...