ACAPI_​ActivatePropertyObjectHandler

Activates or deactivates an add-on’s property handler.

    GSErrCode  ACAPI_ActivatePropertyObjectHandler (
        short     strResID,
        bool      active
    );

 

Parameters

strResID
[in] tells for which property handler is this command issued
active
[in] turns the property handler on/off

 

Return Values

NoError
The function has completed with success.

For other common API errors see the API Errors document.

 

Remarks

Only one property handler can be active in Archicad at a time. The return value of this functions depends on the user, as a dialog pops up when you issue this command. When the function returns, you should adjust your menu items accordingly.

This function is a non-undoable data structure modifier function. See more details on this topic at Command Overview.

 

Example


if (ACAPI_ActivatePropertyObjectHandler (stringResID, !checkedAssignProperty) == NoError) {

    checkedAssignProperty = !checkedAssignProperty;

    API_MenuItemRef mir;
    Int32           flags;

    BNZeroMemory (&mir, sizeof (API_MenuItemRef));
    mir.menuResID = menuResID;
    mir.itemIndex = 1;
    ACAPI_Interface (APIIo_GetMenuItemFlagsID, &mir, &flags);
    if (checkedAssignProperty)
        flags = flags | API_MenuItemChecked;
    else
        flags = flags & !API_MenuItemChecked;

    ACAPI_Interface (APIIo_SetMenuItemFlagsID, &mir, &flags);
}

 

Requirements

Version: API 4.1 or later
Header: ACAPinc.h

 

See Also

ACAPI_Register_PropertyObjectHandler, ACAPI_Install_PropertyObjectHandler, API Functions