Location Expressions

Land Desktop Development ARX CPP SDK

Up a level
Location Expressions
 
 

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

There are a number of formats to choose from when writing Location expressions. They are listed below. The format to use depends on the Location type, which is identified in each of the following formats by the first argument. The other arguments are described below.

Location-All

("all")

Location-Bufferfence

("bufferfence" searchtype offset pt1 pt2 ... ptN)

Location-Circle

("circle" searchtype centerpt radius)

Location-Fence

("fence" pt1 pt2 ... ptN)

Location-Point

("point" pt)

Location-Polygon

("polygon" searchtype pt1 pt2 ... ptN)

Location-Polyline-Bufferfence

("polyline" "bufferfence" searchtype offset ename)

Location-Polyline-Fence

("polyline" "fence" ename)

Location-Polyline-Polygon

("polyline" "polygon" searchtype ename)

Location-Window

("window" searchtype pt1 pt2)

Location Expression Parameters

searchtype Search type keyword (string): "inside" or "crossing".
offset Buffer offset distance (real).
ename AutoCAD entity name, or a set of points, or "?". If "?", when the query executes, it prompts the user to click a set of points.
pt ptN centerpt A 2D or 3D point (a list of reals). If a 3D point, the Z coordinate is ignored.
radius Radius (real).

Location Examples

The following examples define Location conditions. The first is a Location-All condition:

(ade_qrydefine 
    '("AND" "(" "NOT" "Location" ("All") "" ) 
)

The second is a Location-Window condition:

(ade_qrydefine 
    '("AND" "" "" "Location"  
      ("window" "crossing" (1.0  2.0) (3.0  4.0)) "")  
)

And the third is a Location-Polyline condition.

(ade_qrydefine 
    (list "AND" "(" "" "Location"  
    (list "polyline" "bufferfence" "inside" 20.0  
    (entlast)) "")  
)

The following three examples of Location-Polyline conditions specify the ename argument in different ways. The first supplies an entity name:

(ade_qrydefine 
    (list "" "" "" "Location"  
    (list "polyline" "polygon" "crossing"  
    (entlast)) "") 
)

The second supplies a set of points:

(ade_qrydefine 
    '("" "" "" "Location"  
        ("polyline" "polygon" "crossing" (

             1           ; 1 = Polyline open, 0 = Polyline closed

             (0 0 1)     ; Direction of normal vector:
                         ; (0 0 1) identifies the Z axis, 
                         ; i.e., this polygon is parallel to 
                         ; the XY plane

             0.000000                        ; Bulge factor of a vertex
             (4.426217 7.991379 0.000000)    ; Coordinates of a vertex

             0.000000
             (2.385054 5.530788 0.000000)

             0.000000
             (4.648083 3.912562 0.000000)

             0.000000
             (5.912716 5.708128 0.000000)

             0.000000
             (7.754200 3.823892 0.000000)

             0.000000
             (8.020439 3.646552 0.000000) ) ) "")
)

And the third prompts the user to click a set of points:

(ade_qrydefine 
    '("" "" "" "Location"  
      ("polyline" "polygon" "crossing" "?") "") 
)