Data Expressions

AutoCAD Map 3D AutoLISP

Up a level
Data Expressions
 
 

Data expressions are used as querycond arguments in ade_querydefine calls that define Data conditions.

They have the following format.

(datatype tablename.fieldname operator value [subclasses])

Data Expression Parameters

datatype Data type to match (string): "objdata", "attrib", "aselink", "EED", or "feature".
tablename Depends on the datatype argument. See the Tablename And Fieldname Arguments table below.
fieldname Depends on the datatype argument. See the Tablename And Fieldname Arguments table below.
operator Comparison operator (string): "=", ">", "<", "<=", ">=", or "<>". Note that the only valid operator in a string context is "=".
value Value to match.
subclasses Optional. T or nil. The default if the argument is omitted is T. This setting has no effect unless datatype is "feature". T means return objects belonging to the feature class identified by the tablename argument, including objects belonging to any subclass of that feature. nil means do not include objects belonging to such a subclass.

The tablename and fieldname arguments depend on the datatype argument:

Tablename and Fieldname Arguments
datatype tablename fieldname
objdata Table name. Field name.
attrib Block name. Attribute definition.
aselink Link template. Column name.
EED RegApp name. EED field name.
feature Feature Class name. Property name.

Data Expression Examples

The following examples define Data conditions of various types.

(ade_qrydefine 
    '("" "" "" "Data"  
      ("attrib" "*.Type" "=" "c*")"")) 

(ade_qrydefine 
    '("" "" "" "Data"  
      ("objdata" "mytable.fl1" "=" "1")"")) 

(ade_qrydefine 
    '("" "" "" "Data"  
      ("aselink" "cpu_lpn.cpu" "=" "MAC2LC")"")) 

(ade_qrydefine 
    '("" "" "" "Data"  
      ("EED" "REGAPP.STREET" "=" "Willow")"")) 

(ade_qrydefine 
    '("" "" "" "Data"  
      ("EED" "REGAPP.#NUMBER" "=" "512")"")) 

(ade_qrydefine 
    '("" "" "" "Data"  
      ("EED" "REGAPP.&SQLLINK;" "=" "MAC2LC")"")) 

Note in the last example that &SQLLINK is not treated as a link template key. It is treated just like any other ADE 1.0 EED field. For example, if an object has EED such as

(-3 (1000 . "&EEDFIELD;" = "1234"))

then the Data condition to retrieve the object is written as follows:

("EED" "REGAPP.&EEDFIELD;" "=" "1234")

If the EED is defined by

(-3 (1000 . "&EEDFIELD;" = "'First', 'Last'"))

then the Data condition to retrieve the object is written as follows:

("EED" "REGAPP.&EEDFIELD;" "=" "'First', 'Last'")

In other words, everthing after the equal sign is treated as one string. That way you can use any pattern (for wcmatch) in the query.