map_pltdefget

Land Desktop Development ARX CPP SDK

Up a level
map_pltdefget
 
 

Gets the value of an attribute of the plot set definition.

int

map_pltdefget(

char *name,

char *attr,

struct resbuf **res);

Returns RTNORM or RTERROR.

name The name of the plot set.
attr Name of the plot set attribute to retrieve.
res Pointer to a pointer to the resbuf containing the given plot set attribute

This function returns the value of the attribute through the resbuf parameter. If the function returns RTNORM, you must release the resbuf.

To get the value of an attribute for the current plot set, use map_pltCurrGet.

The data type of the return value depends on the attribute.

The following sample populates a resbuf with the value of the plot set description for a specified plot set. Map_pltDefGet() is called with all required parameters, and if the operation is successful the specified plot set and description are displayed. The resbuf is then released as required.

char* pszPlotSetName = "ADSRX_Sample";
char* pszPlotSetAttrb = "desc";
struct resbuf* pPlotSetAttrbValueRb = NULL;
int returnCode = map_pltDefGet(pszPlotSetName, pszPlotSetAttrb, &pPlotSetAttrbValueRb;);
if (RTNORM == returnCode){
    acutPrintf(
        "\nThe \"%s\" plot set attribute; \"%s\" contains the following value: \n\t\"%s\""
        , pszPlotSetName, pszPlotSetAttrb, pPlotSetAttrbValueRb->resval.rstring);
}
else {
    acutPrintf(
        "\nThe plot set attribute \"%s\" could not be obtained."
        , pszPlotSetAttrb);
}
acutRelRb(pPlotSetAttrbValueRb);