Archicad 28 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 ACAPI_GraphicalOverride_EnableRenovationOverride (bool *oldOverrideVal, const bool *newOverrideVal)
 Enables renovation graphical overrides during ACAPI_DrawingPrimitive_ShapePrims.
 
GSErrCode ACAPI_GraphicalOverride_EnableVisualOverride (bool *oldOverrideVal, const bool *newOverrideVal)
 Enables graphical overrides during ACAPI_DrawingPrimitive_ShapePrims.
 
GSErrCode ACAPI_GraphicalOverride_GetOverrideCombinationList (GS::Array< API_Guid > &combinationList)
 Retrieves a list of all override combinations in the current plan.
 
GSErrCode ACAPI_GraphicalOverride_GetOverrideRuleGroupList (GS::Array< API_Guid > &ruleGroupList)
 Retrieves a list of all override rule groups in the current plan.
 
GSErrCode ACAPI_GraphicalOverride_GetOverrideRuleList (GS::Array< API_Guid > &ruleList)
 Retrieves a list of all override rules in the current plan.
 
GSErrCode ACAPI_GraphicalOverride_GetOverrideCombination (API_OverrideCombination &combination, GS::Array< API_Guid > *ruleList=nullptr)
 Retrieves an override combination identified by its guid or name.
 
GSErrCode ACAPI_GraphicalOverride_GetOverrideRuleGroup (API_OverrideRuleGroup &ruleGroup, GS::Array< API_Guid > *ruleList=nullptr)
 Retrieves an override rule group identified by its guid or name.
 
GSErrCode ACAPI_GraphicalOverride_GetOverrideRuleById (API_OverrideRule &rule)
 Retrieves an override rule identified by its guid.
 
GSErrCode ACAPI_GraphicalOverride_GetOverrideRuleByName (API_OverrideRule &rule, const API_Guid &ruleGroup)
 Retrieves an override rule identified by its name.
 
GSErrCode ACAPI_GraphicalOverride_CreateOverrideCombination (API_OverrideCombination &combination, const GS::Array< API_Guid > &ruleList)
 Creates an override combination.
 
GSErrCode ACAPI_GraphicalOverride_CreateOverrideRuleGroup (API_OverrideRuleGroup &ruleGroup)
 Creates an override rule group.
 
GSErrCode ACAPI_GraphicalOverride_CreateOverrideRule (API_OverrideRule &rule, const API_Guid &ruleGroup)
 Creates an override rule.
 
GSErrCode ACAPI_GraphicalOverride_ChangeOverrideCombination (const API_OverrideCombination &combination, const GS::Array< API_Guid > *const ruleList=nullptr)
 Changes an override combination identified by its guid.
 
GSErrCode ACAPI_GraphicalOverride_ChangeOverrideRuleGroup (const API_OverrideRuleGroup &ruleGroup)
 Changes an override rule group identified by its guid.
 
GSErrCode ACAPI_GraphicalOverride_ChangeOverrideRule (const API_OverrideRule &rule)
 Changes an override rule identified by its guid.
 
GSErrCode ACAPI_GraphicalOverride_MoveOverrideRule (const API_Guid &rule, const API_Guid &targetRuleGroup, const API_Guid *nextRule)
 Moves an override rule between override rule groups.
 
GSErrCode ACAPI_GraphicalOverride_DeleteOverrideCombination (const API_Guid &combination)
 Deletes an override combination identified by its guid.
 
GSErrCode 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 ACAPI_GraphicalOverride_DeleteOverrideRule (const API_Guid &rule)
 Deletes an override rule identified by its guid.
 
GSErrCode ACAPI_GraphicalOverride_SetOverrideRuleGroupOrder (const GS::Array< API_Guid > &orderedRuleGroupIds)
 Sets the order of rule groups in the current project.
 
GSErrCode 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 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 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 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:1001

◆ ACAPI_GraphicalOverride_ChangeOverrideRule()

GSErrCode 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 ACAPI_GraphicalOverride_ChangeOverrideRule(const API_OverrideRule &rule)
Changes an override rule identified by its guid.
Represents an override rule.
Definition: APIdefs_Environment.h:1195
GS::UniString name
The name of the rule, that is unique within the project.
Definition: APIdefs_Environment.h:1207

◆ ACAPI_GraphicalOverride_ChangeOverrideRuleGroup()

GSErrCode ACAPI_GraphicalOverride_ChangeOverrideRuleGroup ( const API_OverrideRuleGroup ruleGroup)

Changes an override rule group identified by its guid.

Since
Archicad 27
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 from Override_Test / TestNormalUsage
// We can rename a rule group using the ACAPI_GraphicalOverride_ChangeOverrideRuleGroup function
ruleGroup1.name = "TestGroup1 - Renamed";
ASSERT_NO_ERROR (ACAPI_GraphicalOverride_ChangeOverrideRuleGroup (ruleGroup1));
ASSERT (ruleGroup1.guid != APINULLGuid);
ASSERT (ruleGroup1.name == "TestGroup1 - Renamed");
constexpr API_Guid APINULLGuid
Represents an empty API guid.
Definition: API_Guid.hpp:241
GSErrCode ACAPI_GraphicalOverride_ChangeOverrideRuleGroup(const API_OverrideRuleGroup &ruleGroup)
Changes an override rule group identified by its guid.

◆ ACAPI_GraphicalOverride_CreateOverrideCombination()

GSErrCode 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 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:1013

◆ ACAPI_GraphicalOverride_CreateOverrideRule()

GSErrCode 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 from Override_Test / TestNormalUsage
// Get the data of a rule using ACAPI_GraphicalOverride_GetOverrideRule knowing its guid
API_OverrideRule rule = {ruleList[0]};
// A new rule can be created using the ACAPI_GraphicalOverride_CreateOverrideRule function.
API_OverrideRule newRule = {APINULLGuid, "Override_Test Add-on's Rule", rule.style, ""};
ASSERT_NO_ERROR (ACAPI_GraphicalOverride_CreateOverrideRule (newRule, ruleGroup1.guid));
GSErrCode ACAPI_GraphicalOverride_GetOverrideRuleById(API_OverrideRule &rule)
Retrieves an override rule identified by its guid.
GSErrCode ACAPI_GraphicalOverride_CreateOverrideRule(API_OverrideRule &rule, const API_Guid &ruleGroup)
Creates an override rule.
API_OverrideRuleStyle style
Specifies what, and how this rule should override.
Definition: APIdefs_Environment.h:1213

◆ ACAPI_GraphicalOverride_CreateOverrideRuleGroup()

GSErrCode ACAPI_GraphicalOverride_CreateOverrideRuleGroup ( API_OverrideRuleGroup ruleGroup)

Creates an override rule group.

Since
Archicad 27
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 from Override_Test / TestNormalUsage
// Create an empty rule group using the ACAPI_GraphicalOverride_CreateOverrideRuleGroup function
API_OverrideRuleGroup ruleGroup1 = {APINULLGuid, "TestGroup1"};
ASSERT_NO_ERROR (ACAPI_GraphicalOverride_CreateOverrideRuleGroup (ruleGroup1));
// the create method generated a guid
ASSERT (ruleGroup1.guid != APINULLGuid);
GSErrCode ACAPI_GraphicalOverride_CreateOverrideRuleGroup(API_OverrideRuleGroup &ruleGroup)
Creates an override rule group.
Represents a group of override rules with a name.
Definition: APIdefs_Environment.h:1023
API_Guid guid
The unique identifier of the rule group.
Definition: APIdefs_Environment.h:1029

◆ ACAPI_GraphicalOverride_DeleteOverrideCombination()

GSErrCode 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 ACAPI_GraphicalOverride_GetOverrideCombinationList(GS::Array< API_Guid > &combinationList)
Retrieves a list of all override combinations in the current plan.
GSErrCode ACAPI_GraphicalOverride_DeleteOverrideCombination(const API_Guid &combination)
Deletes an override combination identified by its guid.

◆ ACAPI_GraphicalOverride_DeleteOverrideRule()

GSErrCode 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 ACAPI_GraphicalOverride_GetOverrideRuleList(GS::Array< API_Guid > &ruleList)
Retrieves a list of all override rules in the current plan.
GSErrCode ACAPI_GraphicalOverride_DeleteOverrideRule(const API_Guid &rule)
Deletes an override rule identified by its guid.

◆ ACAPI_GraphicalOverride_DeleteOverrideRuleGroup()

GSErrCode ACAPI_GraphicalOverride_DeleteOverrideRuleGroup ( const API_Guid ruleGroup)

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

Since
Archicad 27
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 from Override_Test / TestNormalUsage
API_OverrideRuleGroup ruleGroup { APINULLGuid, "TestGroup1" };
if (ACAPI_GraphicalOverride_GetOverrideRuleGroup (ruleGroup) == NoError) {
ASSERT_NO_ERROR (ACAPI_GraphicalOverride_DeleteOverrideRuleGroup (ruleGroup.guid));
}
GSErrCode 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 ACAPI_GraphicalOverride_GetOverrideRuleGroup(API_OverrideRuleGroup &ruleGroup, GS::Array< API_Guid > *ruleList=nullptr)
Retrieves an override rule group identified by its guid or name.

◆ ACAPI_GraphicalOverride_EnableRenovationOverride()

GSErrCode 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 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 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 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 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 ACAPI_GraphicalOverride_GetOverrideRuleById ( API_OverrideRule rule)

Retrieves an override rule identified by its guid.

Since
Archicad 27
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 from Override_Test / TestNormalUsage
// After that we can retrieve that rule using ACAPI_GraphicalOverride_GetOverrideRule
API_OverrideRule newRule2 = {newRule.guid};
ASSERT_NO_ERROR (ACAPI_GraphicalOverride_GetOverrideRuleById (newRule2));
API_Guid guid
The unique identifier for the override rule.
Definition: APIdefs_Environment.h:1201

◆ ACAPI_GraphicalOverride_GetOverrideRuleByName()

GSErrCode ACAPI_GraphicalOverride_GetOverrideRuleByName ( API_OverrideRule rule,
const API_Guid ruleGroup 
)

Retrieves an override rule identified by its name.

Since
Archicad 27
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 from Override_Test / TestNormalUsage
// We can do that also using the rule's name
API_OverrideRule newRule3 = {APINULLGuid, newRule.name};
ASSERT_NO_ERROR (ACAPI_GraphicalOverride_GetOverrideRuleByName (newRule3, ruleGroup1.guid));
ASSERT (newRule == newRule3);
GSErrCode ACAPI_GraphicalOverride_GetOverrideRuleByName(API_OverrideRule &rule, const API_Guid &ruleGroup)
Retrieves an override rule identified by its name.

◆ ACAPI_GraphicalOverride_GetOverrideRuleGroup()

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

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

Since
Archicad 27
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 from Override_Test / TestNormalUsage
// We can retrieve the contained rules of a rule group with the ACAPI_GraphicalOverride_GetOverrideRuleGroup function
// if we specify an array of API_Guids for the contained rules
API_OverrideRuleGroup queriedRuleGroup = { ruleGroup1.guid };
GS::Array<API_Guid> rulesInGroup1;
ASSERT_NO_ERROR (ACAPI_GraphicalOverride_GetOverrideRuleGroup (queriedRuleGroup, &rulesInGroup1));
ASSERT (queriedRuleGroup.name == ruleGroup1.name);
ASSERT (rulesInGroup1.GetSize () == 2);
ASSERT (rulesInGroup1[0] == newRule.guid);
ASSERT (rulesInGroup1[1] == anotherTestRule.guid);
GS::UniString name
The name of the rule group, that is unique within its project.
Definition: APIdefs_Environment.h:1035

◆ ACAPI_GraphicalOverride_GetOverrideRuleGroupList()

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

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

Since
Archicad 27
Parameters
ruleGroupList[out] The list of all override rule groups in the current plan.
Returns
  • NoError - The function has completed with success.
Example from Override_Test / TestNormalUsage
// We can query the ordered list of all rule groups using the ACAPI_GraphicalOverride_GetOverrideRuleGroupList function
GS::Array<API_Guid> ruleGroups;
ASSERT_NO_ERROR (ACAPI_GraphicalOverride_GetOverrideRuleGroupList (ruleGroups));
ASSERT (ruleGroups.GetSize () >= 2);
ASSERT (ruleGroups[ruleGroups.GetSize () - 2] == ruleGroup1.guid);
ASSERT (ruleGroups[ruleGroups.GetSize () - 1] == ruleGroup2.guid);
GSErrCode ACAPI_GraphicalOverride_GetOverrideRuleGroupList(GS::Array< API_Guid > &ruleGroupList)
Retrieves a list of all override rule groups in the current plan.

◆ ACAPI_GraphicalOverride_GetOverrideRuleList()

GSErrCode 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 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 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:1339
Visual overridden image descriptor.
Definition: APIdefs_Environment.h:1383
API_OverrideStyle overrideStyle
The visual override style of the preview image.
Definition: APIdefs_Environment.h:1395
API_ImageViewID view
The view type identifier.
Definition: APIdefs_Environment.h:1389
GSHandle vectorImageHandle
Handle for the output vector image.
Definition: APIdefs_Environment.h:1401
NewDisplay::NativeImage * nativeImagePtr
Pointer to the output native image.
Definition: APIdefs_Environment.h:1407

◆ ACAPI_GraphicalOverride_MoveOverrideRule()

GSErrCode 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 from Override_Test / TestNormalUsage
// We can move a rule from a rule group to a target rule group using the ACAPI_GraphicalOverride_MoveOverrideRule function
ASSERT_NO_ERROR (ACAPI_GraphicalOverride_MoveOverrideRule (newRule.guid, ruleGroup2.guid, nullptr));
// Checking that the move was successful (group 1 is empty, group 2 contains the moved rule)
rulesInGroup1.Clear ();
ASSERT_NO_ERROR (ACAPI_GraphicalOverride_GetOverrideRuleGroup (ruleGroup1, &rulesInGroup1));
ASSERT (rulesInGroup1.GetSize () == 1);
ASSERT (rulesInGroup1[0] == anotherTestRule.guid);
GS::Array<API_Guid> rulesInGroup2;
ASSERT_NO_ERROR (ACAPI_GraphicalOverride_GetOverrideRuleGroup (ruleGroup2, &rulesInGroup2));
ASSERT (rulesInGroup2.GetSize () == 1);
ASSERT (rulesInGroup2[0] == newRule.guid);
GSErrCode ACAPI_GraphicalOverride_MoveOverrideRule(const API_Guid &rule, const API_Guid &targetRuleGroup, const API_Guid *nextRule)
Moves an override rule between override rule groups.

◆ ACAPI_GraphicalOverride_SetOverrideRuleGroupOrder()

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

Sets the order of rule groups in the current project.

Since
Archicad 27
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 from Override_Test / TestNormalUsage
// Switch the last two and apply the new order
ruleGroups[ruleGroups.GetSize () - 2] = ruleGroup2.guid;
ruleGroups[ruleGroups.GetSize () - 1] = ruleGroup1.guid;
// We can reorder the rule groups using the ACAPI_GraphicalOverride_SetOverrideRuleGroupOrder function
ASSERT_NO_ERROR (ACAPI_GraphicalOverride_SetOverrideRuleGroupOrder (ruleGroups));
GSErrCode ACAPI_GraphicalOverride_SetOverrideRuleGroupOrder(const GS::Array< API_Guid > &orderedRuleGroupIds)
Sets the order of rule groups in the current project.

◆ ACAPI_GraphicalOverride_SetOverrideRuleOrder()

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

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

Since
Archicad 27
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 from Override_Test / TestNormalUsage
// We can reorder the rules in a rule group using the ACAPI_GraphicalOverride_SetOverrideRuleOrder function
rulesInGroup1[0] = anotherTestRule.guid;
rulesInGroup1[1] = newRule.guid;
ASSERT_NO_ERROR (ACAPI_GraphicalOverride_SetOverrideRuleOrder (ruleGroup1.guid, rulesInGroup1));
rulesInGroup1.Clear ();
ASSERT_NO_ERROR (ACAPI_GraphicalOverride_GetOverrideRuleGroup (ruleGroup1, &rulesInGroup1));
ASSERT (rulesInGroup1.GetSize () == 2);
ASSERT (rulesInGroup1[0] == anotherTestRule.guid);
ASSERT (rulesInGroup1[1] == newRule.guid);
GSErrCode ACAPI_GraphicalOverride_SetOverrideRuleOrder(const API_Guid &ruleGroup, const GS::Array< API_Guid > &orderedRuleIds)
Sets the order of rules in the specified override rule group.