v2.33
 
How to work with object parametric representation

Overview

Some model objects support additional interface to describe their parametric representation. Now they are IWallParams, IColumnParams, IFloorParams, IBeamParams that can be queried from corresponding objects. Receiving the representation of other objects is under development as well as editing.

How to obtain the parametric representation

The code below demonstrates how to get beam parametric representation.

C++

auto pProject = m_pApplication->GetProject();
auto pBeamStyleManager = pProject->BeamStyleManager;
auto pModelObjects = pProject->Model->GetObjects();
for (int i = 0; i < pModelObjects->Count; i++)
{
auto pModelObject = pModelObjects->GetByIndex(i);
Renga::IBeamParamsPtr pBeamParams;
pModelObject->QueryInterface(&pBeamParams);
if (pBeamParams)
{
// getting the baseline of the beam
auto pBaseLineInLevelSpace = pBeamParams->GetBaseline();
// getting beam profile
auto pProfile = pBeamStyleManager->GetBeamStyle(pBeamParams->StyleId)->Profile;
auto pProfilePlacement = pBeamParams->GetProfilePlacement();
// geting another information
}
}

C#

var project = m_app.Project;
var beamStyleManager = project.BeamStyleManager;
var modelObjects = project.Model.GetObjects();
for (int i = 0; i < modelObjects.Count; i++)
{
var modelObject = modelObjects.GetByIndex(i);
var beamParams = modelObject as Renga.IBeamParams;
if (beamParams != null)
{
// getting the baseline of the beam
auto pBaseLineInLevelSpace = pBeamParams->GetBaseline();
// getting beam profile
auto pProfile = pBeamStyleManager->GetBeamStyle(pBeamParams->StyleId)->Profile;
auto pProfilePlacement = pBeamParams->GetProfilePlacement();
}
}

See also

Related samples

  • BeamParams