Description |
Details the syntax for commands available for use in Query Tool scripts.
|
Requirements |
Solve module
|
Conventions |
The following conventions are used when describing the syntax of the commands:
Convention |
Used for |
UPPERCASE |
Query language commands. |
italic |
User supplied parameters. |
bold |
Keywords - text that must be typed exactly as shown. |
| |
Separates syntax items enclosed in brackets or braces. You can only use one of the items. |
[ ] |
Optional syntax items. Do not type the brackets. |
{ } |
Required syntax items. Do not type the braces. |
[...n] |
An indication that the preceding item can be repeated. Do not type [..n] |
|
Commands |
The following commands are available:
|
Comment |
Syntax:
// [ user_entered_comment ]
Example:
set active layer 'Vegetation'
|
Declare |
Syntax:
DECLARE @name { text | integer | real4 | real8 | datetime | boolean } value
Example:
declare @LayerName text 'Vegetation'
set active layer @LayerName
|
Set |
Syntax:
SET active layer { 'layer_name' | unique_layer_id }
SET visibility layer { all | 'layer_name' | unique_layer_id | 'layer_group_name'} { on | off }
SET visibility { all | point | line | alignment | polygon | block | shape | text | image | terrain } { on | off }
Examples:
set active layer 'Vegetation'
set visibility layer 'Road' off
set visibility text off
set visibility layer all off
set visibility layer '*' off
set visibility layer 'Feature Plan' on
set visibility alignment off
|
Select |
Syntax:
SELECT { all | point | line | alignment
| polygon | block | shape | text | image | terrain }
[ FROM { 'layer_name' | unique_layer_id } ]
[ WHERE { { 'attribute_name' | unique_attribute_id | easting | northing | height | class | area | contour | plansymbol | linestyle | blockdefinition | width | length | colour | diameter | fill | breakline | source | useinterrainmodel | units } { = | != | > | < | >= | <= } { value | default } [ and | or ] } [...n] ]
Examples:
select line from 'Road'
select point from 'Lot?'
select point where height = default or height < 0.0
select point from 'Vegetation' where 'Trunk' > 0.2
select polygon from 'Lot' where 'Address'.'Street Number' > 30
select point where class = hcontrol
select polygon where area > 1000
select polygon where colour = #EF75C6
select polygon where fill ='H002'
select point where plansymbol ='S076'
select point where length = 5
select point where width = 5
select point where colour = #FFFF00
select point where colour = RGB(255,255,0)
select line where linestyle ='L053'
select line where width = 2
select line where colour = #00FF00
select line where colour = RGB(0,255,0)
select line where contour = major
select point where easting > 1000
select line where northing >= 5000
select polygon where height = 0
select line where breakline = yes
select polygon where breakline = boundary
select line where source = 'c:\*.dwg'
select point where units = plan.
select alignment where useinterrainmodel = Yes
select alignment where length > 3000
Select block where blockdefinition = 'Arrow'
|
Unselect |
Syntax:
UNSELECT { all | point | line | alignment | polygon | block | shape | text | image | terrain }
[ FROM { 'layer_name' | unique_layer_id } ]
[ WHERE { { 'attribute_name' | unique_attribute_id | easting | northing | height | class | area | contour | plansymbol | linestyle | blockdefinition | width | length | colour | fill | breakline} { = | != | > | < | >= | <= } { value | default } [ and | or ] } [...n] ]
Examples:
unselect point where height = default or height < 0.0
unselect point from 'Vegetation' where 'Trunk' > 0.2
unselect point from 'Tree' where 'Species' = '*Gum'
unselect polygon from 'Lot' where 'Address'.'Street Number' > 30
unselect point where class = hcontrol
unselect polygon where area > 1000
unselect polygon where colour = #EF75C6
unselect polygon where fill = 'H002'
unselect point where plansymbol = 'S076'
unselect point where length = 5
unselect point where width = 5
unselect point where colour = #FFFF00
unselect point where colour = RGB(255,255,0)
unselect line where linestyle ='L053'
unselect line where width = 2
unselect line where colour = #00FF00
unselect line where colour = RGB(0,255,0)
unselect line where contour = major
unselect point where easting > 1000
unselect line where northing >= 5000
unselect polygon where height = 0
unselect line where breakline = No
unselect block where blockdefinition = 'Tree'
|
Delete |
Syntax:
DELETE layer | definition { 'name' | unique_id }
DELETE selected attribute { 'attribute_name' }
DELETE selected
Example:
delete layer 'Vegetation'
set active layer 'Vegetation'
delete definition 'Trunk'
unselect all
select point from 'Road'
select line from 'Vegetation'
delete selected
select point where 'Species' = 'Pine'
delete selected attribute 'Species'
delete selected attribute 'Address'.'Street Number'
|
Insert |
Syntax:
INSERT layer { 'layer_name' | unique_layer_id }
INSERT definition { 'attribute_definition_name' } { text | integer | real4 | real8 | datetime | boolean | group }
INSERT selected attribute { 'attribute_name' } { value }
INSERT selected attribute {'attribute_name'}
USING { attribute | property } { 'attribute_name' | uid | easting | northing | height | length | width | rotation | area | diameter } [{ + | - | * | / } {value | attribute 'attribute_name'}][...n]]
Example:
insert layer 'Title Boundary'
set active layer 'Road'
insert definition 'Width' real4
select line from 'Road'
insert selected attribute 'Width' 0.1
unselect all
select point from 'Vegetation'
insert selected attribute 'Species' using attribute 'Description'
unselect all
select line from 'Fence'
insert selected attribute 'Line Width' using property width
unselect all
select polygon
insert selected attribute 'Area' using property area
unselect all
select polygon
insert selected attribute 'Area' using property area
unselect all
select polygon
insert selected attribute 'Volume' using property area * 2
select all
insert selected attribute 'Diameter' using attribute 'Radius' * 2
select line where contour = major
insert selected attribute 'Height' using property height
Insert definition 'Dimensions' group
Insert definition 'Dimensions'.'Area' Real8
select polygon from 'Lot'
Insert selected attribute 'Dimensions'.'Area' using property area.
select shape from 'Water''
Insert selected attribute 'Pipe Diam' using property diameter
select point from 'Sewage'
update selected attribute 'Diameter' using attribute 'Diameter' / 1000
Insert selected attribute 'Invert' using property Height - attribute 'Depth' - attribute 'Diameter'/>
|
Update |
Syntax:
Used to update layer, attribute and property values for selected objects.
UPDATE selected { easting | northing | height | class | length | width | diameter | plansymbol | linestyle | blockdefinition | colour | backgroundcolour | backgroundfill | useinterrainmodel | selected breakline | units | backgroundheightfactor | backgroundwidthfactor } { value }
UPDATE selected { easting | northing | height | length | width | diameter } USING { attribute | property } { 'attribute_name' | easting | northing | height | length | width } [ { + | - | * | /} { Value | attribute 'attribute_name'} ] [...n]]
UPDATE selected layer { 'layer_name' | unique_layer_id }
UPDATE selected attribute { 'attribute_name' } { value }
UPDATE selected attribute { 'attribute_name' } USING { attribute | property } { 'attribute_name' | uid | easting | northing | height | length | width | rotation | area | diameter } [ { + | - | * | / } {Value | attribute 'attribute_name' } ] [...n]
UPDATE selected attribute { 'attribute_name ' } { add | remove } { prefix | suffix } { value }
UPDATE selected attribute { 'attribute_name ' } { offset } { value }
UPDATE selected attribute { 'attribute_name ' } { renumber } { numeric | replace } { value }
UPDATE selected height { linear_value | default | USING { attribute | property } { 'attribute_name' | easting | northing | height | length | width } [ + | - | * | / {Value} | attribute {'attribute_name'} | USING text ]
Example:
unselect all
select all from 'Existing Road'
update selected layer 'Road'
unselect all
select point from 'Pits'
update selected units ground
update selected plansymbol S045
update selected width using attribute 'Diameter'
update selected length using attribute 'Diameter'
unselect all
select point from 'Control'
update selected class control
unselect all
select all from 'Existing Road'
update selected layer 'Road'
unselect all
select point where 'Species' = 'Pine'
update selected attribute 'Species' 'Pinus'
unselect all
select point from 'Vegetation'
update selected attribute 'Species' using attribute 'Description'
update selected attribute 'Diameter' using attribute 'Radius' * 2
unselect all
select polygon from 'Easement'
update selected attribute 'Name' add prefix 'E'
unselect all
select line from 'Road'
update selected attribute 'Description' remove suffix road
unselect all
select point from 'Topo'
update selected attribute 'Height' offset -0.2
unselect all
select point from 'Default'
update selected attribute 'Name' renumber replace 1000
update selected Height using property height + attribute 'Invert Level'
update selected attribute 'Road Width' using attribute 'Road Width' - attribute 'Kerb Width'
update selected Width using property Width * attribute 'Scale'
unselect all
select point where height = default
update selected height -9999.9999
unselect all
select point where height < 0.0
update selected height default
unselect all
select point where height = default
update selected height using attribute 'Ortho_Height'
update selected height using property height + 50
update selected easting using property easting + 334000.
update selected easting using property easting + 334000.
update selected easting using property easting + 334000.
update selected width using property length.
update selected length using property length * 2.
update selected attribute 'drain width' using property width
update selected attribute 'length' using property length
unselect all
select polygon
update selected colour #4CB4FF
update selected colour rgb(76,180,255)
unselect all
select polygon
update selected colour layer
unselect all
select point from 'traverse'
update selected plansymbol S020
select line from 'traverse'
update selected linestyle 'L094'
unselect all
select polygon
update selected fill none
unselect all
select text
update selected backgroundcolour #FF7F00
update selected background on
update selected backgroundwidthfactor 1.1
update selected backgroundheightfactor 1.1
unselect all
select polygon where breakline = no
select line where breakline = no
update breakline yes
select polygon from 'Lot'
update selected attribute 'Dimensions'.'Area' using property area.
update selected diameter 0.5
update selected attribute 'Pipe Radius' using property diameter 0.5
update selected height using property height + attribute 'Invert Level'
update selected attribute 'Invert Level' 0.000
update selected useinterrainmodel layer
select text where units = plan.
Update selected units ground.
update selected blockdefinition 'Tree'
|
Notes |
- Values for text items that contain spaces or periods must be enclosed in single quotes.
- Attribute, layer, line style, point symbol, fill and block definition names must be enclosed in single quotes.
- The value for datetime must be in 'yyyy-mm-dd hh:mm:ss' format. The following special values can also be used: now (current date and time), curdate (current date), curtime (current date and current time).
- The value for boolean must be either 'true' or 'false'.
- The value for height, length and width is assumed to be in the currently configured linear unit for the project.
- The value for area is assumed to be in the currently configured area unit for the project.
- The value for colour must be either Hex value,'rgb(value,value,value)' or 'layer'.
- The value for plansymbol must be either 'layer', 'none' or 'value'.
- The value for linestyle must be either 'layer', 'none' or 'value'.
- The value for fill must be either 'layer', 'solid', 'none' or 'value'.
- The value for class must be either 'unknown','navigated', 'measured', 'averaged', 'adjusted', 'reference', 'control', 'hcontrol' or 'vcontrol'.
- The value for contour must be either 'major','minor' or 'none'.
- The value for breakline must be either 'yes', 'no' or 'boundary'. Boundary is applicable for polygons only.
- The value for colour and backgroundcolour must be either hex value, 'rgb(value,value,value)' or 'Layer'
- The value for background must be either 'on', 'off', 'projectbackground' or 'layer'.
- The value for useinterrainmodel must be either 'yes', 'no' or 'layer'.
- The value for units must be either 'ground' or 'plan'.
- The value for backgroundheightfactor and backgroundwidthfactor must be a real number.
- When inserting or updating attribute values using numeric properties the attribute type must be either real4, real8, integer or text.
- When performing mathematical operations on attributes the attribute type must be either real4, real8, integer or text.
- When inserting or updating a property or attribute using a mathematical operation on a property, the property must be first. You can perform a mathematical operation using one property only.
- Numeric attribute or property values used to update integer or text attributes, will be converted to match the type of the attribute or property being updated after mathematical operations.
- Updating or inserting an attribute defined as type Real4 or Integer with a point, line or polygon property or an attribute defined as type Real8 could result in a loss of precision.
- Offset values for text attributes must be integers. For other attribute types the offset value must match the value type of the attribute.
- If the attribute being offset is text the last numeric digits are offset. Numeric digits will be added to the end of the attribute if a numeric value is not found. Numeric values in text attributes must always be positive.
- When renumbering with the numeric mode, the last integer in the text attribute is renumbered.
- When renumbering with the replace mode, the entire text attribute is replaced.
- The renumber start value must be between 1 and 1000000. When more than one object is selected, the attribute value increments by one each time an attribute is updated.
- Current units will be used when inserting or updating an attribute.
- Ground units are used when inserting, updating or selecting a plan symbol property or updating an attribute with a plan symbol property. Plan symbols with Units set to Plan are not updated.
- Ground units are used when selecting lines with a specific width.
- Inserting or updating an attribute using the rotation property is precise to the nearest minute.
- Trailing zeros are removed when displaying attributes.
- Text must be a real number in the current locale settings to be used to update the height of a text object.
- When performing a numerical operation on an attribute value for the purpose of inserting the value into another attribute value, the types of both attributes must be the same (Real 4 and Real 8 Types are compatible however a loss of precision may occur.).
- Numerical operations will not be performed on a default height.
- For graphical types with more than one colour (polygons, terrain models and shapes), all displayed components are considered. If a polygons edges and fill are displayed then both the edge and fill colour must match.
- When inserting an attribute value to a line or polygon using the height property, all vertices must share the same height.
- Type an attribute name nested in a group using the format 'Attribute Group Name'.'Attribute Name'.
- Updates to the length and width properties applies to the appearance properties.
- Length refers to the length of a line for alignments or lines and the length of point symbols for points.
- Updates to the easting and northing properties applies to selected points only.
- Use wildcards with the From clause to select or unselect from multiple layers. Use wildcards with the Where clause to select or unselect objects with text attributes which have different values but with some identical text. Wildcard '*' denotes multiple characters can replace the '*'. Wildcard '?' denotes a single character can replace the '?'.
|
Related topics |
|