Archicad 27 C++ API
Loading...
Searching...
No Matches
Graphic Overrides

Functions related to accessing and changing the Graphic Overrides and Graphic Override Combinations. More...

Classes

struct  API_OverrideCombination
 Represents a combination of override rules with a name. More...
 
struct  API_OverrideRuleGroup
 Represents a group of override rules with a name. More...
 
struct  API_OverriddenFillType
 Describes the fill types to be overridden. More...
 
struct  API_OverriddenSurfaceType
 Describes the surface types to be overridden. More...
 
struct  API_OverrideRuleStyle
 Specifies what, and how an API_OverrideRule should override. More...
 
struct  API_OverrideRule
 Represents an override rule. More...
 
struct  API_VisualOverriddenImage
 Visual overridden image descriptor. More...
 

Functions

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_EnableRenovationOverride (bool *oldOverrideVal, const bool *newOverrideVal)
 Enables renovation graphical overrides during ACAPI_DrawingPrimitive_ShapePrims.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_EnableVisualOverride (bool *oldOverrideVal, const bool *newOverrideVal)
 Enables graphical overrides during ACAPI_DrawingPrimitive_ShapePrims.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideCombinationList (GS::Array< API_Guid > &combinationList)
 Retrieves a list of all override combinations in the current plan.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleGroupList (GS::Array< API_Guid > &ruleGroupList)
 Retrieves a list of all override rule groups in the current plan.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleList (GS::Array< API_Guid > &ruleList)
 Retrieves a list of all override rules in the current plan.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideCombination (API_OverrideCombination &combination, GS::Array< API_Guid > *ruleList=nullptr)
 Retrieves an override combination identified by its guid or name.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleGroup (API_OverrideRuleGroup &ruleGroup, GS::Array< API_Guid > *ruleList=nullptr)
 Retrieves an override rule group identified by its guid or name.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleById (API_OverrideRule &rule)
 Retrieves an override rule identified by its guid.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleByName (API_OverrideRule &rule, const API_Guid &ruleGroup)
 Retrieves an override rule identified by its name.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_CreateOverrideCombination (API_OverrideCombination &combination, const GS::Array< API_Guid > &ruleList)
 Creates an override combination.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_CreateOverrideRuleGroup (API_OverrideRuleGroup &ruleGroup)
 Creates an override rule group.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_CreateOverrideRule (API_OverrideRule &rule, const API_Guid &ruleGroup)
 Creates an override rule.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_ChangeOverrideCombination (const API_OverrideCombination &combination, const GS::Array< API_Guid > *const ruleList=nullptr)
 Changes an override combination identified by its guid.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_ChangeOverrideRuleGroup (const API_OverrideRuleGroup &ruleGroup)
 Changes an override rule group identified by its guid.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_ChangeOverrideRule (const API_OverrideRule &rule)
 Changes an override rule identified by its guid.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_MoveOverrideRule (const API_Guid &rule, const API_Guid &targetRuleGroup, const API_Guid *nextRule)
 Moves an override rule between override rule groups.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_DeleteOverrideCombination (const API_Guid &combination)
 Deletes an override combination identified by its guid.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_DeleteOverrideRuleGroup (const API_Guid &ruleGroup)
 Deletes an override rule group identified by its guid and deletes all the override rules it contains.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_DeleteOverrideRule (const API_Guid &rule)
 Deletes an override rule identified by its guid.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_SetOverrideRuleGroupOrder (const GS::Array< API_Guid > &orderedRuleGroupIds)
 Sets the order of rule groups in the current project.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_SetOverrideRuleOrder (const API_Guid &ruleGroup, const GS::Array< API_Guid > &orderedRuleIds)
 Sets the order of rules in the specified override rule group.
 
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetVisualOverriddenImage (const API_Guid &elemGuid, API_VisualOverriddenImage *image)
 Returns visual overridden preview image for and element.
 

Detailed Description

Functions related to accessing and changing the Graphic Overrides and Graphic Override Combinations.

Function Documentation

◆ ACAPI_GraphicalOverride_ChangeOverrideCombination()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_ChangeOverrideCombination ( const API_OverrideCombination combination,
const GS::Array< API_Guid > *const  ruleList = nullptr 
)

Changes an override combination identified by its guid.

Parameters
combination[in] The combination to change.
ruleList[in] The ids of the rules that the combination should "contain", or nullptr if they shouldn't be changed.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The guid did not refer to a valid override combination or an element of the ruleList array did not refer to a valid override rule.
  • APIERR_BADNAME - The specified new name for the combination is invalid (empty, or whitespace only, or contains more than 255 characters)
  • APIERR_NAMEALREADYUSED - The specified new name for the combination is already taken in the current project.
  • APIERR_NOACCESSRIGHT - Tried to change a built-in combination.
Example
GSErrCode MakeOverrideCombinationEmpty (API_OverrideCombination& combination)
{
GS::Array<API_Guid> ruleList;
return ACAPI_GraphicalOverride_ChangeOverrideCombination (combination, ruleList);
}
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_ChangeOverrideCombination(const API_OverrideCombination &combination, const GS::Array< API_Guid > *const ruleList=nullptr)
Changes an override combination identified by its guid.
Represents a combination of override rules with a name.
Definition: APIdefs_Environment.h:896

◆ ACAPI_GraphicalOverride_ChangeOverrideRule()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_ChangeOverrideRule ( const API_OverrideRule rule)

Changes an override rule identified by its guid.

Parameters
rule[in] The rule to change.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The guid did not refer to a valid override rule.
  • APIERR_BADNAME - The specified new name for the rule is invalid (empty, or whitespace only, or contains more than 255 characters)
  • APIERR_NAMEALREADYUSED - The specified new name for the rule is already taken in the current project.
  • APIERR_NOACCESSRIGHT - Tried to change a built-in rule.
Example
GSErrCode ChangeOverrideRuleName (const GS::UniString& newName, API_OverrideRule& rule)
{
rule.name = newName;
}
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_ChangeOverrideRule(const API_OverrideRule &rule)
Changes an override rule identified by its guid.
Represents an override rule.
Definition: APIdefs_Environment.h:1054
GS::UniString name
The name of the rule, that is unique within the project.
Definition: APIdefs_Environment.h:1064

◆ ACAPI_GraphicalOverride_ChangeOverrideRuleGroup()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_ChangeOverrideRuleGroup ( const API_OverrideRuleGroup ruleGroup)

Changes an override rule group identified by its guid.

Parameters
ruleGroup[in] The rule group to change.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The guid did not refer to a valid override rule group or an element of the ruleList array did not refer to a valid override rule.
  • APIERR_BADNAME - The specified new name for the rule group is invalid (empty, or whitespace only, or contains more than 255 characters)
  • APIERR_NAMEALREADYUSED - The specified new name for the rule group is already taken in the current project.
  • APIERR_NOACCESSRIGHT - Tried to change a built-in rule group.
Example
GSErrCode RenameOverrideRuleGroup (API_OverrideRuleGroup& existingRuleGroup, const GS::UniString& newGroupName)
{
existingRuleGroup.name = newGroupName;
}
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_ChangeOverrideRuleGroup(const API_OverrideRuleGroup &ruleGroup)
Changes an override rule group identified by its guid.
Represents a group of override rules with a name.
Definition: APIdefs_Environment.h:915
GS::UniString name
The name of the rule group, that is unique within its project.
Definition: APIdefs_Environment.h:925

◆ ACAPI_GraphicalOverride_CreateOverrideCombination()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_CreateOverrideCombination ( API_OverrideCombination combination,
const GS::Array< API_Guid > &  ruleList 
)

Creates an override combination.

Parameters
combination[in/out] The combination to create. Once the operation is successfully completed, this will hold the valid guid of the created combination.
ruleList[in] The ids of the rules that the combination should "contain".
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The guid of a rule did not refer to a valid override rule.
  • APIERR_BADNAME - The specified name for the combination is invalid (empty, or whitespace only, or contains more than 255 characters)
  • APIERR_NAMEALREADYUSED - The specified name for the combination is already taken in the current project.
Example
GSErrCode CreateEmptyOverrideCombination (const GS::UniString& name, API_OverrideCombination& combination)
{
combination.name = name;
GS::Array<API_Guid> ruleList;
return ACAPI_GraphicalOverride_CreateOverrideCombination (combination, ruleList);
}
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_CreateOverrideCombination(API_OverrideCombination &combination, const GS::Array< API_Guid > &ruleList)
Creates an override combination.
GS::UniString name
The name of the combination, that is unique within its project.
Definition: APIdefs_Environment.h:906

◆ ACAPI_GraphicalOverride_CreateOverrideRule()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_CreateOverrideRule ( API_OverrideRule rule,
const API_Guid ruleGroup 
)

Creates an override rule.

Parameters
rule[in/out] The rule to create. Once the operation is successfully completed, this will hold the valid guid of the created rule.
ruleGroup[in] The rule group the rule should belong to.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The guid or name did not refer to a valid override rule group.
  • APIERR_BADNAME - The specified name for the rule is invalid (empty, or whitespace only, or contains more than 255 characters)
  • APIERR_NAMEALREADYUSED - The specified name for the rule is already taken in the current project.
Example
GSErrCode CreateEmptyOverrideRule (const GS::UniString& name, API_OverrideRule& rule)
{
rule.name = name;
rule.criterionXML = "";
BNZeroMemory (rule.style, sizeof (rule.style));
}
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_CreateOverrideRule(API_OverrideRule &rule, const API_Guid &ruleGroup)
Creates an override rule.
GS::UniString criterionXML
Specifies when this rule should be used. To get the proper criterion XML, save the configured overrid...
Definition: APIdefs_Environment.h:1074
API_OverrideRuleStyle style
Specifies what, and how this rule should override.
Definition: APIdefs_Environment.h:1069

◆ ACAPI_GraphicalOverride_CreateOverrideRuleGroup()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_CreateOverrideRuleGroup ( API_OverrideRuleGroup ruleGroup)

Creates an override rule group.

Parameters
ruleGroup[in/out] The rule group to create. Once the operation is successfully completed, this will hold the valid guid of the created rule group.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADNAME - The specified name for the rule group is invalid (empty, or whitespace only, or contains more than 255 characters)
  • APIERR_NAMEALREADYUSED - The specified name for the rule group is already taken in the current project.
Example
GSErrCode CreateEmptyExampleOverrideRuleGroup (API_OverrideRuleGroup& ruleGroup)
{
ruleGroup.name = "Example Group";
}
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_CreateOverrideRuleGroup(API_OverrideRuleGroup &ruleGroup)
Creates an override rule group.

◆ ACAPI_GraphicalOverride_DeleteOverrideCombination()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_DeleteOverrideCombination ( const API_Guid combination)

Deletes an override combination identified by its guid.

Parameters
combination[in] The guid of the combination to delete.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The guid did not refer to a valid override combination.
  • APIERR_NOACCESSRIGHT - Tried to delete a built-in combination.
Example
GSErrCode DeleteAllUserDefinedOverrideCombination ()
{
GS::Array<API_Guid> combinationList;
GSErrCode err = ACAPI_GraphicalOverride_GetOverrideCombinationList (combinationList);
if (err == NoError) {
for (USize i = 0; i < combinationList.GetSize(); ++i) {
}
}
return err;
}
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideCombinationList(GS::Array< API_Guid > &combinationList)
Retrieves a list of all override combinations in the current plan.
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_DeleteOverrideCombination(const API_Guid &combination)
Deletes an override combination identified by its guid.

◆ ACAPI_GraphicalOverride_DeleteOverrideRule()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_DeleteOverrideRule ( const API_Guid rule)

Deletes an override rule identified by its guid.

Parameters
rule[in] The guid of the rule to delete.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The guid did not refer to a valid override rule.
  • APIERR_NOACCESSRIGHT - Tried to delete a built-in rule.
Example
GSErrCode DeleteAllUserDefinedOverrideRule ()
{
GS::Array<API_Guid> ruleList;
GSErrCode err = ACAPI_GraphicalOverride_GetOverrideRuleList (ruleList);
if (err == NoError) {
for (USize i = 0; i < ruleList.GetSize(); ++i) {
}
}
return err;
}
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleList(GS::Array< API_Guid > &ruleList)
Retrieves a list of all override rules in the current plan.
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_DeleteOverrideRule(const API_Guid &rule)
Deletes an override rule identified by its guid.

◆ ACAPI_GraphicalOverride_DeleteOverrideRuleGroup()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_DeleteOverrideRuleGroup ( const API_Guid ruleGroup)

Deletes an override rule group identified by its guid and deletes all the override rules it contains.

Parameters
ruleGroup[in] The guid of the rule group to delete.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The guid did not refer to a valid override rule group.
  • APIERR_NOACCESSRIGHT - Tried to delete a built-in rule group.
Example
GSErrCode DeleteAllUserDefinedOverrideRuleGroup ()
{
GS::Array<API_Guid> ruleGroupList;
GSErrCode err = ACAPI_GraphicalOverride_GetOverrideRuleGroupList (ruleGroupList);
if (err != NoError)
return err;
for (const API_Guid& ruleGroupGuid : ruleGroupGuids) {
GSErrCode currErr = ACAPI_GraphicalOverride_DeleteOverrideRuleGroup (ruleGroupGuid);
if (currErr != NoError && currErr != APIERR_NOACCESSRIGHT)
err = currErr;
}
return err;
}
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleGroupList(GS::Array< API_Guid > &ruleGroupList)
Retrieves a list of all override rule groups in the current plan.
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_DeleteOverrideRuleGroup(const API_Guid &ruleGroup)
Deletes an override rule group identified by its guid and deletes all the override rules it contains.
Represents a GS::Guid in the API layer.
Definition: API_Guid.hpp:45

◆ ACAPI_GraphicalOverride_EnableRenovationOverride()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_EnableRenovationOverride ( bool *  oldOverrideVal,
const bool *  newOverrideVal 
)

Enables renovation graphical overrides during ACAPI_DrawingPrimitive_ShapePrims.

Parameters
oldOverrideVal[out] Returns the current override state.
newOverrideVal[in] The new override state.
Returns
  • NoError - The function has completed with success.
Remarks
This function determines the behavior of the ACAPI_DrawingPrimitive_ShapePrims function. If the renovation override is set then all primitive elements will be exported using the overriden attributes (as set in the graphical override attributes for the appropriate renovation filter). ACAPI_GraphicalOverride_EnableRenovationOverride is only effective if ACAPI_GraphicalOverride_EnableVisualOverride is enabled.

◆ ACAPI_GraphicalOverride_EnableVisualOverride()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_EnableVisualOverride ( bool *  oldOverrideVal,
const bool *  newOverrideVal 
)

Enables graphical overrides during ACAPI_DrawingPrimitive_ShapePrims.

Parameters
oldOverrideVal[out] Returns the current override state.
newOverrideVal[in] The new override state.
Returns
  • NoError - The function has completed with success.
Remarks
This function determines the behavior of the ACAPI_DrawingPrimitive_ShapePrims function. If the override state is set then all primitive elements will be exported using the overriden attributes. When ACAPI_GraphicalOverride_EnableVisualOverride is enabled, the renovation overrides can still be enabled or disabled with ACAPI_GraphicalOverride_EnableRenovationOverride.

◆ ACAPI_GraphicalOverride_GetOverrideCombination()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideCombination ( API_OverrideCombination combination,
GS::Array< API_Guid > *  ruleList = nullptr 
)

Retrieves an override combination identified by its guid or name.

Parameters
combination[in/out] The guid field specifies the combination to retrieve. If the guid field is APINULLGuid, then the name field is used to find the combination. Once the operation is successfully completed, this will hold the retrieved combination.
ruleList[out] If not a nullptr, then the list of guids of the rules that the combination "contains".
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The guid or name did not refer to a valid override combination.
Example
GSErrCode GetOverrideCombinationNames (GS::Array<GS::UniString>& combinationNames)
{
GS::Array<API_Guid> combinationsGuids;
GSErrCode error = ACAPI_GraphicalOverride_GetOverrideCombinationList (combinationsGuids);
if (error == NoError) {
for (USize i = 0; i < combinationsGuids.GetSize(); ++i) {
API_OverrideCombination combination = {combinationsGuids[i]};
error = ACAPI_GraphicalOverride_GetOverrideCombination (combination, nullptr);
if (error == NoError) {
combinationNames.Push (combination.name);
}
}
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideCombination(API_OverrideCombination &combination, GS::Array< API_Guid > *ruleList=nullptr)
Retrieves an override combination identified by its guid or name.

◆ ACAPI_GraphicalOverride_GetOverrideCombinationList()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideCombinationList ( GS::Array< API_Guid > &  combinationList)

Retrieves a list of all override combinations in the current plan.

Parameters
combinationList[out] The list of all override combinations in the current plan.
Returns
  • NoError - The function has completed with success.
Example
GSErrCode GetOverrideCombinationNames (GS::Array<GS::UniString>& combinationNames)
{
GS::Array<API_Guid> combinationsGuids;
GSErrCode error = ACAPI_GraphicalOverride_GetOverrideCombinationList (combinationsGuids);
if (error == NoError) {
for (USize i = 0; i < combinationsGuids.GetSize(); ++i) {
API_OverrideCombination combination = {combinationsGuids[i]};
error = ACAPI_GraphicalOverride_GetOverrideCombination (combination, nullptr);
if (error == NoError) {
combinationNames.Push (combination.name);
}
}
}
return error;
}

◆ ACAPI_GraphicalOverride_GetOverrideRuleById()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleById ( API_OverrideRule rule)

Retrieves an override rule identified by its guid.

Parameters
rule[in/out] The guid field specifies the rule to retrieve. Once the operation is successfully completed, this will hold the retrieved rule.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The guid did not refer to a valid override rule.
Example
GSErrCode GetOverrideRuleNames (GS::Array<GS::UniString>& ruleNames)
{
GS::Array<API_Guid> rulesGuids;
GSErrCode error = ACAPI_GraphicalOverride_GetOverrideRuleList (rulesGuids);
if (error == NoError) {
for (USize i = 0; i < rulesGuids.GetSize(); ++i) {
API_OverrideRule rule = {rulesGuids[i]};
if (error == NoError) {
ruleNames.Push (rule.name);
}
}
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleById(API_OverrideRule &rule)
Retrieves an override rule identified by its guid.

◆ ACAPI_GraphicalOverride_GetOverrideRuleByName()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleByName ( API_OverrideRule rule,
const API_Guid ruleGroup 
)

Retrieves an override rule identified by its name.

Parameters
rule[in/out] The name field is used to find the rule within the group. Once the operation is successfully completed, this will hold the retrieved rule.
ruleGroupThe guid of the override rule group that contains the rule.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The name did not refer to a valid override rule in that rule group.
Example
API_OverrideRuleGroup ruleGroup = { APINULLGuid, ruleGroupName };
GSErrCode error = ACAPI_GraphicalOverride_GetOverrideRuleGroup (ruleGroup);
if (err != NoError)
return err;
API_OverrideRule rule = { APINULLGuid, ruleName };
if (err != NoError)
return err;
constexpr API_Guid APINULLGuid({})
Represents an empty API guid.
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleByName(API_OverrideRule &rule, const API_Guid &ruleGroup)
Retrieves an override rule identified by its name.
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleGroup(API_OverrideRuleGroup &ruleGroup, GS::Array< API_Guid > *ruleList=nullptr)
Retrieves an override rule group identified by its guid or name.
API_Guid guid
The unique identifier of the rule group.
Definition: APIdefs_Environment.h:920

◆ ACAPI_GraphicalOverride_GetOverrideRuleGroup()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleGroup ( API_OverrideRuleGroup ruleGroup,
GS::Array< API_Guid > *  ruleList = nullptr 
)

Retrieves an override rule group identified by its guid or name.

Parameters
ruleGroup[in/out] The guid field specifies the rule group to retrieve. If the guid field is APINULLGuid, then the name field is used to find the rule group. Once the operation is successfully completed, this will hold the retrieved rule group.
ruleList[out] If not a nullptr, then the list of guids of the rules that belong to the rule group.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The guid or name did not refer to a valid override rule group.
Example
GSErrCode GetOverrideRuleNamesOfExampleGroup (GS::Array<GS::UniString>& ruleNames)
{
API_OverrideRuleGroup ruleGroup = { APINULLGuid, "Example Group" };
GS::Array<API_Guid> ruleGuids;
GSErrCode error = ACAPI_GraphicalOverride_GetOverrideRuleGroup (ruleGroup, &ruleGuids);
if (err != NoError)
return err;
for (const API_Guid& ruleGuid : ruleGuids) {
API_OverrideRule rule = { ruleGuid };
error = ACAPI_GraphicalOverride_GetOverrideRule (rule);
if (error == NoError) {
ruleNames.Push (rule.name);
}
}
return NoError;
}

◆ ACAPI_GraphicalOverride_GetOverrideRuleGroupList()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleGroupList ( GS::Array< API_Guid > &  ruleGroupList)

Retrieves a list of all override rule groups in the current plan.

Parameters
ruleGroupList[out] The list of all override rule groups in the current plan.
Returns
  • NoError - The function has completed with success.
Example
GSErrCode GetOverrideRuleGroupNames (GS::Array<GS::UniString>& ruleGroupNames)
{
GS::Array<API_Guid> ruleGroupGuids;
GSErrCode error = ACAPI_GraphicalOverride_GetOverrideRuleGroupList (ruleGroupGuids);
if (error == NoError) {
for (const API_Guid& ruleGroupGuid : ruleGroupGuids) {
API_OverrideRuleGroup ruleGroup = { ruleGroupGuid };
error = ACAPI_GraphicalOverride_GetOverrideRuleGroup (ruleGroup, nullptr);
if (error == NoError) {
ruleGroupNames.Push (ruleGroup.name);
}
}
}
return error;
}

◆ ACAPI_GraphicalOverride_GetOverrideRuleList()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetOverrideRuleList ( GS::Array< API_Guid > &  ruleList)

Retrieves a list of all override rules in the current plan.

Parameters
ruleList[out] The list of all override rules in the current plan.
Returns
  • NoError - The function has completed with success.
Example
GSErrCode GetOverrideRuleNames (GS::Array<GS::UniString>& ruleNames)
{
GS::Array<API_Guid> rulesGuids;
GSErrCode error = ACAPI_GraphicalOverride_GetOverrideRuleList (rulesGuids);
if (error == NoError) {
for (USize i = 0; i < rulesGuids.GetSize(); ++i) {
API_Overriderule rule = {rulesGuids[i]};
error = ACAPI_GraphicalOverride_GetOverrideRule (rule);
if (error == NoError) {
ruleNames.Push (rule.name);
}
}
}
return error;
}

◆ ACAPI_GraphicalOverride_GetVisualOverriddenImage()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetVisualOverriddenImage ( const API_Guid elemGuid,
API_VisualOverriddenImage image 
)

Returns visual overridden preview image for and element.

Parameters
elemGuid[in] Element reference.
image[in/out] Visual overridden image descriptor.
Returns
  • APIERR_BADID - The element reference is invalid (guid).
  • APIERR_BADPARS - The passed image parameter was nullptr.
  • NoError - The function has completed with success.
Remarks
The output preview image shows an element without concrete geometry and connected elements. Outputs are a vector image and a native image. Do not forget to dispose the handle of the output vector image if it is not needed any more. See API_VisualOverriddenImage structure for further details.
Example
// Copied from Override_Test example Add-On
BNZeroMemory (&image, sizeof (API_VisualOverriddenImage));
image.view = APIImage_Section;
image.overrideStyle.uncutSurfaceType.overridden = true;
image.overrideStyle.uncutSurfaceType.attributeIndex = 5; // Stone - Limestone Fine
NewDisplay::NativeImage sectionNativeImage (250, 250, 32, nullptr);
image.nativeImagePtr = &sectionNativeImage;
if (err != NoError)
ErrorBeep ("ACAPI_GraphicalOverride_GetVisualOverriddenImage (APIImage_Section)", err);
else
DumpVectorImage (image);
BMhFree (image.vectorImageHandle);
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_GetVisualOverriddenImage(const API_Guid &elemGuid, API_VisualOverriddenImage *image)
Returns visual overridden preview image for and element.
API_OverriddenAttributeOrRGB uncutSurfaceType
Specifies how the uncut surfaces should be overridden.
Definition: APIdefs_Environment.h:1177
Visual overridden image descriptor.
Definition: APIdefs_Environment.h:1216
API_OverrideStyle overrideStyle
The visual override style of the preview image.
Definition: APIdefs_Environment.h:1226
API_ImageViewID view
The view type identifier.
Definition: APIdefs_Environment.h:1221
GSHandle vectorImageHandle
Handle for the output vector image.
Definition: APIdefs_Environment.h:1231
NewDisplay::NativeImage * nativeImagePtr
Pointer to the output native image.
Definition: APIdefs_Environment.h:1236

◆ ACAPI_GraphicalOverride_MoveOverrideRule()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_MoveOverrideRule ( const API_Guid rule,
const API_Guid targetRuleGroup,
const API_Guid nextRule 
)

Moves an override rule between override rule groups.

Parameters
rule[in] The id of the rule to move.
targetRuleGroup[in] The id of the rule group the rule should belong to after the move.
nextRule[in] The id of the rule this rule should be right before in the target group. If this is nullptr then the rule will be the last in the target group.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - A guid did not refer to a valid override rule or override rule group, or the referred next rule was not in the target group.
  • APIERR_NAMEALREADYUSED - The specified new name for the rule is already taken in the target group in the current project.
  • APIERR_NOACCESSRIGHT - Insufficient teamwork permission or tried to move a built-in rule
Example
GSErrCode MoveOverrideRule (const API_OverrideRule& rule, const API_OverrideRuleGroup& targetGroup)
{
return ACAPI_GraphicalOverride_MoveOverrideRule (rule.guid, targetGroup.guid, nullptr);
}
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_MoveOverrideRule(const API_Guid &rule, const API_Guid &targetRuleGroup, const API_Guid *nextRule)
Moves an override rule between override rule groups.
API_Guid guid
The unique identifier for the override rule.
Definition: APIdefs_Environment.h:1059

◆ ACAPI_GraphicalOverride_SetOverrideRuleGroupOrder()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_SetOverrideRuleGroupOrder ( const GS::Array< API_Guid > &  orderedRuleGroupIds)

Sets the order of rule groups in the current project.

Parameters
orderedRuleGroupIds[in] The ids of all the user-defined rule groups in the expected order.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - A guid did not refer to a valid override rule group, or the array didn't contain all the user-defined rule groups.
  • APIERR_NOACCESSRIGHT - Insufficient teamwork permission or tried to move a built-in rule
Example
GSErrCode SwitchLastTwoRuleGroups ()
{
GS::Array<API_Guid> ruleGroups;
if (err != NoError)
return err;
if (ruleGroups.GetSize () < 2)
return NoError;
API_Guid tempGuid = ruleGroups[ruleGroups.GetSize () - 2];
ruleGroups[ruleGroups.GetSize () - 2] = ruleGroups[ruleGroups.GetSize () - 1];
ruleGroups[ruleGroups.GetSize () - 1] = tempGuid;
}
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_SetOverrideRuleGroupOrder(const GS::Array< API_Guid > &orderedRuleGroupIds)
Sets the order of rule groups in the current project.

◆ ACAPI_GraphicalOverride_SetOverrideRuleOrder()

GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_SetOverrideRuleOrder ( const API_Guid ruleGroup,
const GS::Array< API_Guid > &  orderedRuleIds 
)

Sets the order of rules in the specified override rule group.

Parameters
ruleGroup[in] The guid of the rule group all the rules belong to.
orderedRuleIds[in] The ids of all the rules in the expected order.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - A guid did not refer to a valid override rule, or the array didn't contain all the rules in the override rule group.
  • APIERR_NOACCESSRIGHT - Insufficient teamwork permission or tried to reorder rules in a built-in group.
Example
GSErrCode SwitchLastTwoRules (const API_Guid& ruleGroupId)
{
API_OverrideRuleGroup ruleGroup { ruleGroupId };
GS::Array<API_Guid> rules;
GSErrCode err = ACAPI_GraphicalOverride_GetOverrideRuleGroup (ruleGroup, &rules);
if (err != NoError)
return err;
if (rules.GetSize () < 2)
return NoError;
API_Guid tempGuid = rules[rules.GetSize () - 2];
rules[rules.GetSize () - 2] = rules[rules.GetSize () - 1];
rules[rules.GetSize () - 1] = tempGuid;
return ACAPI_GraphicalOverride_SetOverrideRuleOrder (ruleGroup.guid, rules);
}
GSErrCode __ACENV_CALL ACAPI_GraphicalOverride_SetOverrideRuleOrder(const API_Guid &ruleGroup, const GS::Array< API_Guid > &orderedRuleIds)
Sets the order of rules in the specified override rule group.