Archicad 28 C++ API
Loading...
Searching...
No Matches
ACAPI::MEP::v1::Bend Class Referencefinal

The Bend can connect two straight RoutingSegments with the same dimensions but different directions. More...

#include <MEPBend.hpp>

Inheritance diagram for ACAPI::MEP::v1::Bend:
ACAPI::MEP::v1::ElementBase ACAPI::v1::ElementBase ACAPI::v1::Object

Public Member Functions

std::optional< double > GetInsulationThickness () const
 
double GetWidth () const
 
double GetHeight () const
 
ConnectorShape GetShape () const
 
double GetRadius () const
 
Result< double > GetFactorRadius () const
 The radius of the Bend is calculated with the help of this value in the case of rectangular Duct and Cable Carrier.
 
UniqueID GetRoutingNodeId () const
 
Domain GetDomain () const
 
BendDefault PickUpDefault () const
 
Result< UniqueIDGetPreferenceTable () const
 
- Public Member Functions inherited from ACAPI::MEP::v1::ElementBase
bool Exists () const
 
std::vector< UniqueIDGetPortIDs () const
 
std::vector< UniqueIDGetDirectConnectedMEPElementIds () const
 
API_Coord3D GetAnchorPoint () const
 
Orientation GetOrientation () const
 
API_Guid GetObjectId () const
 
- Public Member Functions inherited from ACAPI::v1::ElementBase
UniqueID GetElemId () const
 Get unique identifier of the ElementBase object.
 
Result< void > IsEditable () const
 Checks whether the element is editable.
 
- Public Member Functions inherited from ACAPI::v1::Object
 Object (std::shared_ptr< Impl::ObjectImpl > impl)
 Constructs a new object.
 
const API_TokenGetToken () const
 Get the token for this object.
 

Static Public Member Functions

static Result< BendGet (const UniqueID &uniqueId)
 Returns a Bend.
 

Additional Inherited Members

- Protected Member Functions inherited from ACAPI::MEP::v1::ElementBase
 ElementBase (std::shared_ptr< Impl::IElementBaseImpl > impl)
 Constructs an ElementBase with an element base implementation.
 
- Protected Member Functions inherited from ACAPI::v1::ElementBase
 ElementBase (std::shared_ptr< Impl::ObjectImpl > impl)
 Constructs a new ElementBase.
 
- Protected Member Functions inherited from ACAPI::v1::Object
 ~Object ()
 Default destructor.
 
- Protected Attributes inherited from ACAPI::v1::Object
std::shared_ptr< Impl::ObjectImplmImpl
 Impl object given by constructor.
 

Detailed Description

The Bend can connect two straight RoutingSegments with the same dimensions but different directions.

This type of element can be placed in RoutingNodes.

Since
Archicad 27
Example code snippet from Test/New MEP
Getters
if (bend.IsErr ()) {
ACAPI_WriteReport (bend.UnwrapErr ().text.c_str (), false);
return;
}
Reporter bendReporter (3);
bendReporter.Add ("Bend id", id);
bendReporter.SetTabCount (4);
ACAPI::Result<double> factorRadius = bend->GetFactorRadius ();
if (factorRadius.IsOk ())
bendReporter.Add ("Factor Radius", *factorRadius);
bendReporter.Add ("Radius", bend->GetRadius ());
bendReporter.Add ("Width", bend->GetWidth ());
bendReporter.Add ("Height", bend->GetHeight ());
bendReporter.Add ("Shape", bend->GetShape ());
std::optional<double> insulation = bend->GetInsulationThickness ();
insulation.has_value () ? bendReporter.Add ("Insulation thickness", *insulation) : bendReporter.Add ("Does not have insulation.");
bendReporter.Write ();
static Result< Bend > Get(const UniqueID &uniqueId)
Returns a Bend.
Result is the standard return type of API functions.
Definition: Result.hpp:845
E UnwrapErr() const
Unwraps the error value contained in the Result. Trying to UnwrapErr the value while it contains an O...
Definition: Result.hpp:1140
bool IsErr() const
Definition: Result.hpp:945
bool IsOk() const
Definition: Result.hpp:940
void ACAPI_WriteReport(const GS::UniString &format, bool withDial,...)
Writes a report string into the Report Windowot into a custom alert window.
Labeling
for (const UniqueID& bendId : routingSegment->GetBendIds ()) {
const API_Guid labelGuid = PlaceLabelOn (bendId);
if (labelGuid == APINULLGuid)
return Error;
GS::Array<API_Guid> connectedLabels;
ERRCHK_NO_ASSERT (ACAPI_Grouping_GetConnectedElements (GSGuid2APIGuid (bendId.GetGuid ()), API_LabelID, &connectedLabels));
if (!connectedLabels.Contains (labelGuid))
return Error;
}
The MEP unique identifier.
Definition: MEPUniqueID.hpp:30
constexpr API_Guid APINULLGuid
Represents an empty API guid.
Definition: API_Guid.hpp:241
API_Guid & GSGuid2APIGuid(GS::Guid &guid)
Converting from GS::Guid to API_Guid.
Definition: API_Guid.hpp:95
GSErrCode ACAPI_Grouping_GetConnectedElements(const API_Guid &guid, const API_ElemType &connectedElemType, GS::Array< API_Guid > *connectedElements, API_ElemFilterFlags filterBits=APIFilt_None, const API_Guid &renovationFilterGuid=APINULLGuid)
Returns a list of elements connected to the given element.
Error type for ACAPI::Result containing an error message and an error code.
Definition: Result.hpp:47
Represents a GS::Guid in the API layer.
Definition: API_Guid.hpp:46

Member Function Documentation

◆ Get()

static Result< Bend > ACAPI::MEP::v1::Bend::Get ( const UniqueID uniqueId)
static

Returns a Bend.

Parameters
uniqueIdThe UniqueID of the requested Bend.
Returns
If the uniqueId belongs to a Bend, returns the object associated to it, otherwise Error.

◆ GetDomain()

Domain ACAPI::MEP::v1::Bend::GetDomain ( ) const
Returns
Returns the domain of the Bend.

◆ GetFactorRadius()

Result< double > ACAPI::MEP::v1::Bend::GetFactorRadius ( ) const

The radius of the Bend is calculated with the help of this value in the case of rectangular Duct and Cable Carrier.

Returns
Returns the factor radius of the Bend in the case of rectangular Duct and Cable Carrier, otherwise Error.

◆ GetHeight()

double ACAPI::MEP::v1::Bend::GetHeight ( ) const
Returns
Returns the height of the Bend.

◆ GetInsulationThickness()

std::optional< double > ACAPI::MEP::v1::Bend::GetInsulationThickness ( ) const
Returns
Returns the insulation thickness if the Bend has insulation, otherwise std::nullopt. Bend of cable carrier domain cannot have insulation.

◆ GetPreferenceTable()

Result< UniqueID > ACAPI::MEP::v1::Bend::GetPreferenceTable ( ) const
Returns
Returns the UniqueID of the PreferenceTable if a circular DuctBend or a PipeBend, in the case of rectangular DuctBend and CableCarrierBend returns Error.

◆ GetRadius()

double ACAPI::MEP::v1::Bend::GetRadius ( ) const
Returns
Returns the radius of the Bend.

◆ GetRoutingNodeId()

UniqueID ACAPI::MEP::v1::Bend::GetRoutingNodeId ( ) const
Returns
Returns the UniqueID of the RoutingNode that it belongs to.

◆ GetShape()

ConnectorShape ACAPI::MEP::v1::Bend::GetShape ( ) const
Returns
Returns the shape of the Bend.

◆ GetWidth()

double ACAPI::MEP::v1::Bend::GetWidth ( ) const
Returns
Returns the width of the Bend.

◆ PickUpDefault()

BendDefault ACAPI::MEP::v1::Bend::PickUpDefault ( ) const
Returns
Returns a BendDefault with the parameters of the object it was called for.