ade_qrysettype

Land Desktop Development ARX CPP SDK

Up a level
ade_qrysettype
 
 

Sets the query mode: Preview, Draw, or Report.

int

ade_qrysettype(

char* qrytype,

ade_boolean multiline,

char* templ,

char* filename);

Returns RTNORM or an error code.

qrytype Query mode: "preview", "draw", or "report", where "preview" = Display queried objects without retrieving them, similar to Quick View, "draw" = Get queried objects from source drawings or external databases and copy to the current drawing, and "report" = Direct queried information to an output file.
multiline Whether to write report rows for sub-objects: TRUE or FALSE, where TRUE = Write report rows for sub-objects (objects such as vertices of polylines and attributes of blocks), and FALSE = Write lines for top-level objects only. Relevant only if qrytype is "report".
templ Ordered list of object properties to report. Each list element defines a report column. For example, ".type,.layer". Relevant only if qrytype is "report".
filename Path and file name of the output file. Relevant only if qrytype is "report".

This function affects the current query.

The three optional parameters, multiline, templ, and filename, are relevant only if the query mode is "report". If the query mode is "preview" or "draw", omit them.

The following example sets the query mode to Report using ade_qrysettype(). The templ, (pszReportTemplate) parameter represents output of a layer name, and two object data fields.

char* pszQueryType = "Report";
char* pszReportTemplate = ".Layer,:AGE_30_49@riblkgrp,:AMERI_ES@riblkgrp";
char* pszReportFileName = "C:\\ADSRX\\QueryOutput\\Report_010404.txt";
ade_boolean bIsMultiline = ADE_FALSE;
int resultCode = ade_qrysettype(
                    pszQueryType,
                    bIsMultiline,
                    pszReportTemplate,
                    pszReportFileName);
if (RTNORM == resultCode){
    acutPrintf(
        "\nThe report query type has been set.");
}
else {
    acutPrintf(
        "\nUnable to set query type.");
}