ade_altpgetprop

Land Desktop Development ARX CPP SDK

Up a level
ade_altpgetprop
 
 

Gets a property alteration expression.

struct resbuf*

ade_altpgetprop(

ade_id altp_id);

Returns a property alteration expression ID or NULL.

altp_id Property alteration expression ID.

You must release the resbuf.

See ade_altpdefine for information about property alteration expressions.

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_altpgetprop() and automatically assumes that a "Text Object" type is going to be accessed. The property names and the corresponding values associated with the "Text Object" type are displayed, then the resbufs are released as required.

char* propName = "textobject";
struct resbuf* pPropValueRb = acutBuildList(
                                                RTLB,
                                                    RTSTR, "color",
                                                    RTDOTE,
                                                    RTSTR, "yellow",
                                                RTLE,
                                                RTLB,
                                                    RTSTR, "textvalue",
                                                    RTDOTE,
                                                    RTSTR, ".Layer",
                                                RTLE, 0
                                            );
ade_id propAltID = ade_altpdefine(propName, pPropValueRb);
if (ADE_NULLID != propAltID) {
    acutPrintf(
        "\nThe property alteration expression ID is: %.0lf"
        , propAltID);
}
else {
    acutPrintf(
        "\nNo property alteration expression ID was set");
}
acutRelRb(pPropValueRb);
struct resbuf* pPropAltExprRb = ade_altpgetprop(propAltID);
if (NULL != pPropAltExprRb) {
    acutPrintf(
        "\n\nThe \"%s\" property contains the following value pairs:"
            , pPropAltExprRb->resval.rstring);
    if (NULL != (pPropAltExprRb = pPropAltExprRb->rbnext)) {
    struct resbuf* rb = pPropAltExprRb;
        while(rb != NULL) {
            switch(rb->restype)
            {
                case RTSTR:
                    acutPrintf(
                        "\n\n\t\tThe \"%s\" property"
                        , rb->resval.rstring, rb->resval.rstring);
                    break;
                case RTDOTE:
                    if (NULL != (rb = rb->rbnext))
                    acutPrintf(
                        " contains the value \"%s\""
                        , rb->resval.rstring);
                    break;
                default:
                    break;
            }
            rb = rb->rbnext;
        }
    }
}
else {
    acutPrintf(
        "\nNo property alteration expression information was retrieved");
}
acutRelRb(pPropAltExprRb);