Archicad 28 C++ API
Loading...
Searching...
No Matches
ACAPI::MEP::v1::RoutingNodeDefault Class Reference

The RoutingNodeDefault contains the necessary non-geometric data for creating and modifying a Routing Node. More...

#include <MEPRoutingNodeDefault.hpp>

Inheritance diagram for ACAPI::MEP::v1::RoutingNodeDefault:
ACAPI::v1::ElementDefault ACAPI::v1::Object

Public Member Functions

BendDefault GetBendDefault () const
 
TransitionDefault GetTransitionDefault () const
 
Domain GetDomain () const
 
PreferredTransitionPlacement GetPreferredTransitionPlacement () const
 
template<class ModifierFunc >
Result< void > Modify (ModifierFunc &&modifierFunc)
 Executes the given modifier scope in a NotUndoable command.
 
void SetBendDefault (const BendDefault &bendDefault) const
 Sets the BendDefault to the RoutingNodeDefault.
 
void SetTransitionDefault (const TransitionDefault &transitionDefault) const
 Sets the TransitionDefault to the RoutingNodeDefault.
 
void SetPreferredTransitionPlacement (PreferredTransitionPlacement preferredTransitionPlacement)
 Sets the rule of the Bend-Transition placement order of the RoutingNodeDefault.
 
- Public Member Functions inherited from ACAPI::v1::ElementDefault
Result< void > SetAsArchicadDefault () const
 Sets the locally prepared Default settings to the Archicad Default.
 
- 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.
 

Protected Member Functions

 RoutingNodeDefault (std::shared_ptr< Impl::IRoutingNodeDefaultImpl > impl)
 Constructs a RoutingNodeDefault with the given implementation.
 
- Protected Member Functions inherited from ACAPI::v1::ElementDefault
 ElementDefault (std::shared_ptr< Impl::ElementDefaultImpl > impl)
 Constructs a new ElementDefault.
 
- Protected Member Functions inherited from ACAPI::v1::Object
 ~Object ()
 Default destructor.
 

Static Protected Member Functions

static Result< RoutingNodeDefaultCreate (const API_Token &token, Domain domain)
 Creates a RoutingNodeDefault with the given token and domain.
 

Friends

class ACAPI::Impl::ObjectCreator
 
Result< RoutingNodeDefaultCreateRoutingNodeDefault (Domain)
 Creates a RoutingNodeDefault.
 

Additional Inherited Members

- Protected Attributes inherited from ACAPI::v1::Object
std::shared_ptr< Impl::ObjectImplmImpl
 Impl object given by constructor.
 

Detailed Description

The RoutingNodeDefault contains the necessary non-geometric data for creating and modifying a Routing Node.

Since
Archicad 27
Example code snippet from Test / New MEP
Take a look at RoutingElementDefault RoutingNodeDefault Modification
// PickUp RoutingElementDefault from RoutingElement
RoutingElementDefault routingElementDefault = routingElement.PickUpDefault ();
// Get RoutingNodeDefault of RoutingElementDefault and modify it
RoutingNodeDefault routingNodeDefault = routingElementDefault.GetRoutingNodeDefault ();
ACAPI::Result<void> nodeDefaultModifyResult = routingNodeDefault.Modify ([&](RoutingNodeDefault::Modifier& modifier) {
modifier.SetPreferredTransitionPlacement (PreferredTransitionPlacement::LargeToSmall);
});
if (nodeDefaultModifyResult.IsErr ())
return nodeDefaultModifyResult.UnwrapErr ().kind;
// Get BendDefault and modify it
BendDefault bendDefault = routingNodeDefault.GetBendDefault ();
ACAPI::Result<void> bendDefaultModifyResult = bendDefault.Modify ([&](BendDefault::Modifier& modifier) {
modifier.SetFactorRadius (0.6);
});
if (bendDefaultModifyResult.IsErr ())
return bendDefaultModifyResult.UnwrapErr ().kind;
// Get TransitionDefault and modify it
TransitionDefault transitionDefault = routingNodeDefault.GetTransitionDefault ();
ACAPI::Result<void> transitionDefaultModifyResult = transitionDefault.Modify ([&](TransitionDefault::Modifier& modifier) {
modifier.SetAngle (35.0);
});
if (transitionDefaultModifyResult.IsErr ())
return transitionDefaultModifyResult.UnwrapErr ().kind;
// Set BendDefault and TransitionDefault back to RoutingNodeDefault
ACAPI::Result<void> nodeDefaultSetBackResult = routingNodeDefault.Modify ([&](RoutingNodeDefault::Modifier& modifier) {
modifier.SetBendDefault (bendDefault);
modifier.SetTransitionDefault (transitionDefault);
});
if (nodeDefaultSetBackResult.IsErr ())
return nodeDefaultSetBackResult.UnwrapErr ().kind;
// Set RoutingNodeDefault back to RoutingElementDefault
ACAPI::Result<void> elementDefaultModifyResult = routingElementDefault.Modify ([&](RoutingElementDefault::Modifier& modifier) {
modifier.SetRoutingNodeDefault (routingNodeDefault);
});
if (elementDefaultModifyResult.IsErr ())
return elementDefaultModifyResult.UnwrapErr ().kind;
// Inject RoutingElementDefault into RoutingElement
ACAPI::Result<void> injectResult = routingElement.Modify ([&routingElementDefault](RoutingElement::Modifier& modifier) {
modifier.Inject (routingElementDefault);
}, "Inject Default into RoutingElement.");
if (injectResult.IsErr ())
return injectResult.UnwrapErr ().kind;
return NoError;
The BendDefault contains the necessary non-geometric data for modifying a Bend.
Definition: MEPBendDefault.hpp:34
Result< void > Modify(ModifierFunc &&modifierFunc)
Executes the given modifier scope in a NotUndoable command.
Definition: MEPBendDefault.hpp:113
The RoutingElementDefault contains the necessary non-geometric data for creating a Routing element.
Definition: MEPRoutingElementDefault.hpp:38
RoutingNodeDefault GetRoutingNodeDefault() const
Result< void > Modify(ModifierFunc &&modifierFunc)
Executes the given modifier scope in a NotUndoable command.
Definition: MEPRoutingElementDefault.hpp:153
The RoutingNodeDefault contains the necessary non-geometric data for creating and modifying a Routing...
Definition: MEPRoutingNodeDefault.hpp:143
Result< void > Modify(ModifierFunc &&modifierFunc)
Executes the given modifier scope in a NotUndoable command.
Definition: MEPRoutingNodeDefault.hpp:229
BendDefault GetBendDefault() const
TransitionDefault GetTransitionDefault() const
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

Constructor & Destructor Documentation

◆ RoutingNodeDefault()

ACAPI::MEP::v1::RoutingNodeDefault::RoutingNodeDefault ( std::shared_ptr< Impl::IRoutingNodeDefaultImpl >  impl)
protected

Constructs a RoutingNodeDefault with the given implementation.

Parameters
implThe given implementation.

Member Function Documentation

◆ Create()

static Result< RoutingNodeDefault > ACAPI::MEP::v1::RoutingNodeDefault::Create ( const API_Token token,
Domain  domain 
)
staticprotected

Creates a RoutingNodeDefault with the given token and domain.

Parameters
tokenThe given token.
domainThe given domain.
Returns
The result of the creation with the created RoutingNodeDefault.

◆ GetBendDefault()

BendDefault ACAPI::MEP::v1::RoutingNodeDefault::GetBendDefault ( ) const
Returns
Returns the BendDefault of the RoutingNodeDefault.

◆ GetDomain()

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

◆ GetPreferredTransitionPlacement()

PreferredTransitionPlacement ACAPI::MEP::v1::RoutingNodeDefault::GetPreferredTransitionPlacement ( ) const
Returns
Returns the rule of the Bend-Transition placement order of the RoutingNodeDefault.

◆ GetTransitionDefault()

TransitionDefault ACAPI::MEP::v1::RoutingNodeDefault::GetTransitionDefault ( ) const
Returns
Returns the TransitionDefault of the RoutingNodeDefault.

◆ Modify()

template<class ModifierFunc >
Result< void > ACAPI::MEP::v1::RoutingNodeDefault::Modify ( ModifierFunc &&  modifierFunc)

Executes the given modifier scope in a NotUndoable command.

Parameters
modifierFuncThe modifier scope (lambda, std::function or function pointer) the caller wants to execute.
Returns
Returns an error if the process of modification fails for some reason, otherwise nothing.

◆ SetBendDefault()

void ACAPI::MEP::v1::RoutingNodeDefault::SetBendDefault ( const BendDefault bendDefault) const

Sets the BendDefault to the RoutingNodeDefault.

Parameters
bendDefaultThe value to be set.

◆ SetPreferredTransitionPlacement()

void ACAPI::MEP::v1::RoutingNodeDefault::SetPreferredTransitionPlacement ( PreferredTransitionPlacement  preferredTransitionPlacement)

Sets the rule of the Bend-Transition placement order of the RoutingNodeDefault.

Parameters
preferredTransitionPlacementThe rule to be set.

◆ SetTransitionDefault()

void ACAPI::MEP::v1::RoutingNodeDefault::SetTransitionDefault ( const TransitionDefault transitionDefault) const

Sets the TransitionDefault to the RoutingNodeDefault.

Parameters
transitionDefaultThe value to be set.

Friends And Related Symbol Documentation

◆ CreateRoutingNodeDefault

Result< RoutingNodeDefault > CreateRoutingNodeDefault ( Domain  domain)
friend

Creates a RoutingNodeDefault.

Parameters
domainThe Domain of the requested RoutingNodeDefault.
Returns
If able, returns a copy of Archicad's current Default of the RoutingNode from the RoutingElement tool for the domain defined by the parameter, otherwise Error.