Archicad 29 C++ API
Loading...
Searching...
No Matches
ACAPI::ZoneLabelingSettings Class Reference

A class that contains functions related to zone labeling by favorite. More...

#include <ZoneLabelingSettings.hpp>

Inheritance diagram for ACAPI::ZoneLabelingSettings:
ACAPI::Object

Classes

class  Modifier
 Modifier of the ZoneLabelingSettings. More...
 

Public Member Functions

bool IsAutomaticLabelingOn () const
 A function to return if a label should automatically be placed onto new zone or not.
 
Result< GS::UniString > GetSelectedFavoriteName () const
 A function to return the selected favorite from infobox for zone.
 
template<class ModifierFunc >
Result< void > Modify (ModifierFunc &&modifierFunc)
 Executes the given modifier scope in a NotUndoable command.
 
- Public Member Functions inherited from ACAPI::Object
 Object (std::shared_ptr< Impl::ObjectImpl > impl)
 Constructs a new object.
 
const API_TokenGetToken () const
 Get the token for this object.
 

Friends

ZoneLabelingSettings CreateZoneLabelingSettings ()
 A function to create zone labeling settings instance, that lets you query and manipulate zone label favorite related data.
 

Additional Inherited Members

- Protected Member Functions inherited from ACAPI::Object
 ~Object ()
 Default destructor.
 
- Protected Attributes inherited from ACAPI::Object
std::shared_ptr< Impl::ObjectImplmImpl
 Impl object given by constructor.
 

Detailed Description

A class that contains functions related to zone labeling by favorite.

Since
Archicad 28

Member Function Documentation

◆ GetSelectedFavoriteName()

Result< GS::UniString > ACAPI::ZoneLabelingSettings::GetSelectedFavoriteName ( ) const

A function to return the selected favorite from infobox for zone.

Returns
Returns an error if the process fails for some reason, otherwise the selected favorite from infobox.
  • APIERR_GENERAL - Label favorite could not find.
Example
ACAPI::Result<GS::UniString> result = zoneLabelingSetting.GetSelectedFavoriteName ();
if (result.IsErr ()) {
ACAPI_WriteReport (result.UnwrapErr ().text.c_str (), true);
return;
}
FavoriteManager favoriteManager = ACAPI::Favorite::GetFavoriteManager ();
ACAPI::Result<ACAPI::Favorite::Favorite> favorite = favoriteManager.GetFavoriteByName (*result);
if (favorite.IsErr ()) {
ACAPI_WriteReport (favorite.UnwrapErr ().text.c_str (), true);
return;
}

◆ IsAutomaticLabelingOn()

bool ACAPI::ZoneLabelingSettings::IsAutomaticLabelingOn ( ) const

A function to return if a label should automatically be placed onto new zone or not.

Returns
Returns if a label should automatically be placed onto new zones or not.

◆ Modify()

template<class ModifierFunc >
Result< void > ACAPI::ZoneLabelingSettings::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.

Friends And Related Symbol Documentation

◆ CreateZoneLabelingSettings

ZoneLabelingSettings CreateZoneLabelingSettings ( )
friend

A function to create zone labeling settings instance, that lets you query and manipulate zone label favorite related data.

Returns
Returns the zone labeling settings instance.