ade_altpdefine

Land Desktop Development ARX CPP SDK

Up a level
ade_altpdefine
 
 

Creates a property alteration expression.

ade_id ade_altpdefine(

char* property,

struct resbuf* value);

Returns a property alteration expression ID or ADE_NULLID.

property Property to alter. See the Alterable Properties table below
value New value (type varies), or a range table expression that determines the new value. See Using a Range Table later in this topic.

Note  If you use a range table expression instead of an explicit value argument, you must represent it in the resbuf as all one string.

You must release the resbuf.

Using a Range Table

The following code generates a property alteration expression that adds a yellow text object to each queried entity. The text object displays which layer the entity came from. Note how the value argument is prepared by using ads_buildlist to define and populate the required resbuf.

char* propName = "textobject";
struct resbuf* pPropValueRb = ads_buildlist
    (
        RTLB,
            RTLB,
            RTSTR, "color", RTSTR, "yellow",
            RTDOTE,
            RTLB,
            RTSTR, "textvalue", RTSTR, ".Layer",
            RTDOTE,
        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);

A list of one or more property alteration expressions constitutes a property alteration definition. If there is a current property alteration definition when you create a property alteration expression, the new expression is added to it. When you execute a Draw query, each queried entity is altered in accord with the current property alteration definition.

The following table lists the alterable properties:

Alterable Properties
blockname Block name (RTSTR)
color Color (RTSTR)
elevation Z coordinate (RTPOINT) in the user coordinate system
height Text height (RTREAL)
layer Layer name (RTSTR)
linetype Line type (RTSTR)
rotation Rotation (RTREAL)
scale Scaling factor (RTREAL). For example, 1.2 = 120%
style Text style (RTSTR)
width Line width (RTREAL)
textvalue Text value (RTSTR)
thickness Thickness (RTREAL)
hatch List of dotted pairs that define the hatch properties.
See Hatch properties below
textobject List of dotted pairs that define the text object properties.
See Text object properties below

To add a hatch pattern to each queried entity, as long as it is a closed polygon, specify "hatch" for the property argument. The value argument is then a list of dotted pairs. Each dotted pair is composed of a hatch property and a string value.

Hatch Properties
pattern Hatch pattern name (RTSTR)
scale Scaling factor (RTSTR). For example, "1.2" = 120%
rotation Rotation of the hatch pattern (RTSTR)
layer Name of the layer that contains the hatch pattern (RTSTR)
color Hatch pattern color (RTSTR)

To create a text object for each queried entity, specify "textobject" for the property argument. The value argument is then a list of dotted pairs. Each dotted pair is composed of a text object property and a string value. The value element in the dotted pair can be an explicit value or a range table expression that determines a value.

Text Object Properties
textvalue Text to display (RTSTR)
height Text height (RTSTR)
inspt Point where text is inserted (expression as a RTSTR)
justify Text alignment (RTSTR). For example, "center".
style Text style (RTSTR)
layer Name of the layer on which the text object resides (RTSTR)
color Text color (RTSTR)
rotation Rotation of the text object (RTSTR)