Close

Relief for ODA Team in Ukraine

Learn more
ODA BimRv SDK
How to Retrieve Element Parameters and Parameter Values

ODA BimRv SDK provides the API for getting element parameters and parameter values:

  • The getListParams() method from the OdBmObject class and its descendants is used for getting the list of built-in (system) element parameters. This method accepts an array of built-in parameter objects, fills and returns it. Each parameter object is an instance of OdBm::BuiltInParameterDefinition class defined in the BimRv/Include/Database/BmBuiltInParameter.h header file. This method is currently available for OdBmElement and OdBmVWall classes.
  • One of the getParam() methods of the OdBmElement class (and its descendants) can be used for getting the current value of the parameter.

The OdBmElement class interface provides a set of getParam() methods. Which version of getParam() method should be used, depends on:

  • The data type of the parameter value: double, OdInt32, String or an element identifier (an OdBmObjectId class instance)
  • Whether the parameter is built-in (system) or not.

If you need to get the value of a built-in parameter, use one of the following methods:


OdResult getParam(const OdBm::BuiltInParameter::Enum& parameterId, double& value) const;
OdResult getParam(const OdBm::BuiltInParameter::Enum& parameterId, OdInt32& value) const;
OdResult getParam(const OdBm::BuiltInParameter::Enum& parameterId, OdString& value) const;
OdResult getParam(const OdBm::BuiltInParameter::Enum& parameterId, OdBmObjectId& value) const;

If the parameter is not built-in, you should use another method signature:


OdResult getParam(const OdBmObjectId& parameterId, double& value) const;
OdResult getParam(const OdBmObjectId& parameterId, OdInt32& value) const;
OdResult getParam(const OdBmObjectId& parameterId, OdString& value) const;
OdResult getParam(const OdBmObjectId& parameterId, OdBmObjectId& value) const;

If you don't know the storage type of a built-in parameter, you can use data type independent version of getParam() method that returns an OdTfVariant value:


OdResult getParam(const OdBm::BuiltInParameter::Enum& parameterId, OdTfVariant& value) const;

Or, for non built-in parameters:


OdResult getParam(const OdBmObjectId& parameterId, OdTfVariant& value) const;

As you can see from getParam() method definitions, this method returns an OdResult value. The getParam() method can return one of the following values:

  • eOk — The requested parameter is found in the list of available parameters and the parameter value was successfully received.
  • eNotImplementedYet — The requested parameter is found in the list of available parameters, but the parameter value is not yet implemented.
  • eParamHasNoValue — The requested parameter is found in the list of available parameters, but the value of the parameter is absent (parameter doesn't have a value).
  • eKeyNotFound — The requested parameter is not found in the list of available parameters.

See Also

Overview of Parameters
Work with Parameters
Copyright © 2002 – 2022. Open Design Alliance. All rights reserved.