Archicad 28 C++ API
Loading...
Searching...
No Matches
API_AddOnCommand Class Referenceabstract

Base class for the Add-On commands. More...

#include <APIdefs_Registration.h>

Public Member Functions

virtual GS::String GetName () const =0
 Returns the unique name of the command. This name cannot be an empty string or contain '.' characters.
 
virtual GS::String GetNamespace () const =0
 Returns the namespace of the command. This name cannot be an empty string or contain '.' characters.
 
virtual GS::Optional< GS::UniString > GetSchemaDefinitions () const =0
 Returns the schema definitions. Must be a valid JSON string. Types defined in the schema definitions can be used in the input/output schemas.
 
virtual GS::Optional< GS::UniString > GetInputParametersSchema () const =0
 This schema will be used to validate the incoming request parameters. Must be a valid JSON string.
 
virtual GS::Optional< GS::UniString > GetResponseSchema () const =0
 This schema will be used to validate the incoming request response. Must be a valid JSON string.
 
virtual API_AddOnCommandExecutionPolicy GetExecutionPolicy () const =0
 Returns the execution policy.
 
virtual bool IsProcessWindowVisible () const =0
 Controls the visibility of the process window during the command's execution.
 
virtual GS::ObjectState Execute (const GS::ObjectState &parameters, GS::ProcessControl &processControl) const =0
 Write the Add-On command logic inside this function.
 
virtual void OnResponseValidationFailed (const GS::ObjectState &response) const =0
 This function is called when an error occurred inside the Add-On command logic and the output schema validation failed.
 

Detailed Description

Base class for the Add-On commands.

Since
Archicad 26
Remarks
Inherit from this abstract class and implement the required functions to specify an Add-On command. Validating the "{}" string and matching all the input/output schemas. You can install an Add-On command handler with the ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler function.

Member Function Documentation

◆ Execute()

virtual GS::ObjectState API_AddOnCommand::Execute ( const GS::ObjectState &  parameters,
GS::ProcessControl &  processControl 
) const
pure virtual

Write the Add-On command logic inside this function.

Parameters
parametersThe parameters.
processControlThe process window.
Returns
Tells if the process window is currently visible.

◆ GetExecutionPolicy()

virtual API_AddOnCommandExecutionPolicy API_AddOnCommand::GetExecutionPolicy ( ) const
pure virtual

Returns the execution policy.

Returns
The execution policy.

◆ GetInputParametersSchema()

virtual GS::Optional< GS::UniString > API_AddOnCommand::GetInputParametersSchema ( ) const
pure virtual

This schema will be used to validate the incoming request parameters. Must be a valid JSON string.

Returns
The validation schema.

◆ GetName()

virtual GS::String API_AddOnCommand::GetName ( ) const
pure virtual

Returns the unique name of the command. This name cannot be an empty string or contain '.' characters.

Returns
The name of the command.

◆ GetNamespace()

virtual GS::String API_AddOnCommand::GetNamespace ( ) const
pure virtual

Returns the namespace of the command. This name cannot be an empty string or contain '.' characters.

Returns
The namespace of the command.

◆ GetResponseSchema()

virtual GS::Optional< GS::UniString > API_AddOnCommand::GetResponseSchema ( ) const
pure virtual

This schema will be used to validate the incoming request response. Must be a valid JSON string.

Returns
The response schema for the command.

◆ GetSchemaDefinitions()

virtual GS::Optional< GS::UniString > API_AddOnCommand::GetSchemaDefinitions ( ) const
pure virtual

Returns the schema definitions. Must be a valid JSON string. Types defined in the schema definitions can be used in the input/output schemas.

Returns
The add-on command's schema definition.

◆ IsProcessWindowVisible()

virtual bool API_AddOnCommand::IsProcessWindowVisible ( ) const
pure virtual

Controls the visibility of the process window during the command's execution.

Returns
Tells if the process window is currently visible.

◆ OnResponseValidationFailed()

virtual void API_AddOnCommand::OnResponseValidationFailed ( const GS::ObjectState &  response) const
pure virtual

This function is called when an error occurred inside the Add-On command logic and the output schema validation failed.

Parameters
responseThe response.