ade_altpsetprop

Land Desktop Development ARX CPP SDK

Up a level
ade_altpsetprop
 
 

Modifies a property alteration expression.

int

ade_altpsetprop(

ade_id propId,

char* property,

struct resbuf* value);

Returns RTNORM or an error code.

altp_id Property alteration expression ID.
property Property to alter.
value The new value (type varies).

See ade_altpdefine for information about properties and values.

The following example creates an initial property alteration expression using ade_altpdefine(). This expression is based on a "Text Object" type and sets the color property to yellow and the text property to .layer. The property alteration expression ID returned by ade_altpdefine() is used by ade_altpsetprop() and automatically assumes that a "Text Object" type is going to be modified. The property param identifies a specific property of the "Text Object" type and the value resbuf contains the new value for that specific property. If the operation is successful, information is displayed about the modification and the resbuf(s) are released as required.

char* pszPropertyType = "textobject";
struct resbuf* pPropValuePairRb = acutBuildList(
        RTLB,
            RTSTR, "color",
            RTDOTE,
            RTSTR, "yellow",
        RTLE,
        RTLB,
            RTSTR, "textvalue",
            RTDOTE,
            RTSTR, ".Layer",
        RTLE, 0
    );
ade_id propAltID = ade_altpdefine(pszPropertyType, pPropValuePairRb);
char* pszPropertyName = "color";
struct resbuf* pNewPropValueRb = acutBuildList(RTSTR, "green", 0);
int resultCode = ade_altpsetprop(propAltID, pszPropertyName, pNewPropValueRb);
if (RTNORM == resultCode) {
    acutPrintf(
        "\nThe \"%s\" property list contains the property \"%s\" which was assigned a new value of \"%s\""
        , pszPropertyType, pszPropertyName, pNewPropValueRb->resval.rstring);
}
else {
    acutPrintf(
        "\nNo property modification was performed.");
}
acutRelRb(pPropValuePairRb);
acutRelRb(pNewPropValueRb);