Close

Relief for ODA Team in Ukraine

Learn more
ODA BimRv SDK
Hosted Families in ODA BimRv SDK

A family is created using a family template that corresponds to the type of element that the family will create. The template contains the information required to place the family in projects. Most of the family templates are named according to the type of element family created from them: wall-based, ceiling-based, floor-based, roof-based, line-based, face-based. These are host-based templates. A host-based family can have an instance in a project only if an element of its host type is present.

Family Template Description
Wall-based Use to create components that will be inserted into walls. For example, doors, windows.
Ceiling-based Use to create components that will be inserted into ceilings. For example, sprinklers.
Floor-based Use for components that will be inserted into floors.
Roof-based Use for components that will be inserted into roofs. For example, roof fans.
Standalone Use for components that are not host-dependent. For example, furniture, ducts, and fittings.
Adaptive Use to create components that need to flexibly adapt to many unique contextual conditions.
Line-based The line-based templates can be used to create detail and model families that use 2-position placement.
Face-based Use to create plane-based families that can modify their hosts. Instances of these families can be placed on any surface, regardless of their orientation.
Specialty Use when the family requires unique interaction with the model. For example, the Structural Framing template.

Using the ODA BimRv API, you can determine if a family was created using a wall-, floor-, face-, ceiling- or roof-based template.

The solution for a family that hasn't been instantiated yet is to access the OdBm::BuiltInParameter::FAMILY_HOSTING_BEHAVIOR parameter to get this information. This parameter value is stored as an integer value, and the integer values imply the following about the templates (hosting behavior):

  • Wall-based: 1
  • Floor-based: 2
  • Ceiling-based: 3
  • Roof-based: 4
  • Face-based: 5

The families created using line- and pattern-based templates, however, return an integer value of 0 and cannot be determined using this method.

OdBm::FamilyHosting::Enum is defined to help understand the hosting behavior of a family, for example:


OdBmCommandContextPtr pDbCmdCtx(pCmdCtx);
OdBmDatabasePtr pDb = pDbCmdCtx->database();
OdBmElementPtr pElem = pDb->getOwnerFamilyId().safeOpenObject();
OdTfVariant vValue;
if (pElem->getParam(OdBm::BuiltInParameter::FAMILY_HOSTING_BEHAVIOR, vValue) == eOk)
{
  switch (vValue.getInt32())
  {
  case OdBm::FamilyHosting::Wall:
    // Wall hosted;
    break;
  case OdBm::FamilyHosting::Floor:
    // Floor hosted;
    break;
  case OdBm::FamilyHosting::Ceiling:
    // Ceiling hosted
    break;
  case OdBm::FamilyHosting::Roof:
    // Roof hosted
    break;
  case OdBm::FamilyHosting::Face:
    // Face hosted
    break;
  case OdBm::FamilyHosting::NotHosted:
    // NotHosted family;
    break;
  default:
    break;
  }
}
else
{
  //message when the value is invalid
}
      

See Also:

ODA BimRv SDK Database Overview
Database Transactions in BimRv SDK
Copyright © 2002 – 2022. Open Design Alliance. All rights reserved.