Extended Command Line Entity Specification

In addition to basic entity specification, entities may be specified using an extended expression. An extended expression identifies one or more entities using a set of entity criteria. These criteria describe properties of the entities one wishes to operate upon.

Extended Parsing Syntax

The most common type of extended parsing expression is in the following format:

{Entity_Type} With {Criteria}

Entity_Type is the name of any type of entity that can be used in a command, such as Curve, Hex, or SideSet. Criteria is a combination of entity properties (such as Length), operators (such as >=), keywords (such as Not), and values (such as 5.3) that can be evaluated to true or false for a given entity. Here are some examples:

curve with length <1

surface with is_meshed = false

node with x_coord > 10 And y_coord > 0

Keywords

These are the keyword defined by extended parsing

Keyword

Description

All, To, Step, By, Except, In, Expand

These keywords are used the same way as in basic entity specification. For example:

draw surface all

draw surface 1 to 5 step 2 curve 1 to 3 in body 4 to 8 by 2

draw hex in face in surface 2

draw node in hex in face in surface 2 curve 1 2 5 to 50 except 2 3 4

Not

Not flips the logical sense of an expression - it changes true to false and false to true. For example:

draw surface with not is_meshed

Of

The "of" operator is used to get an attribute value for a single entity, such as "length of curve 5". Only attributes that return a single numeric value may be used in an "of" expression. There must be only one entity specified after the "of" operator, but it can be identified using any valid entity expression. An example of a complete command which includes the "of" operator is:

list curve with length < length of curve 5 ids

And, Or

These logic operators determine how multiple criteria are combined.

draw surface with length > 3 or with is_meshed = false

< > <= >= = <>

These relational operators compare two expressions. You may use = or == for "equals". <> means "not equal". For example:

draw surface with x_max <= 3

draw volume with z_max <>12.3

+   -   *   /

These arithmetic operators work in the traditional manner.

draw surface with length * 3 + 1.2 > 10

( )

Parentheses are used to group expressions and to override precedence. When in doubt about precedence, use parentheses.

draw surface with length > 3 and ( with is_meshed = false or x_min > 1 )

Functions

The following functions are defined. Not all functions apply to all entities. If a function does not apply to a given entity, the function returns 0 or false.

Keyword Description
ID

the ID of an entity

Length

The length of a curve or edge

Area

The area of a surface.

Volume

The volume of a volume or body.

Exterior_Angle

Works for curves with an exterior angle greater than (>), less than (<), or equal to (=) a given angle in degrees. This is used if you want to do some operation, such as refinement, on all the reentrant curves or curves with surfaces that form a certain angle.

Is_Meshed

Whether a geometric entity has been meshed or not

Is_Spline

Whether a geometric entity is defined using a NURBS representation. Otherwise the entity has an analytic representation.

Is_Plane

Whether a geometric surface is planar.

Is_Periodic

Whether a geometric surface is periodic, such as a sphere or torus.

Is_Sheetbody

A geometric entity is a sheetbody if it is a collection of surfaces that do not form a solid.

Element_Count

The number of elements owned by this geometric entity. Only elements of the same dimension as the entity are counted (number of hexes in a volume, number of faces on a surface, etc.)

Dimension

The topological dimension of an entity (3 for volumes, 2 for surfaces, etc.).

X_Coord, Y_Coord, Z_Coord

The x, y, or z coordinate of the point at the center of the entity's bounding box.

X_Min, Y_Min, Z_Min

The x, y, or z coordinate of the minimum extent of the entity's bounding box

X_Max, Y_Max, Z_Max

The x, y, or z coordinate of the maximum extent of the entity's bounding box

Is_Merged

Whether a geometry entity has a merge flag on. All geometric entities have one set by default.

Is_Virtual

A flag that specifies whether an entity is virtual geometry. An entity is virtual if it has at least one virtual (partition/composite) topology bridge.

Has_Virtual

An entity "has_virtual" if it is virtual itself, or has at least one child virtual entity

Is_Real

An entity "is_real" if it has at least one real (non-virtual) topology bridge.

Num_Parents

Used to specify geometry entities with a specified number of parent entities. May be used to find "free curves" where num_parents=0 or non-manifold curves where num_parents>2.

Block_Assigned

Used to specify elements which have been assigned to a block. This is also useful to find elements NOT assigned to a block by using "not block_assigned".

Has_Scheme

Used to specify geometry entities which have been assigned a specified scheme. The scheme name is specified with the keyword string used when setting the scheme. Wildcards can also be used when specifying the scheme name. For example, draw surface with has_scheme '*map' will draw surfaces with scheme map or submap.

Precedence

For complicated expressions, which entities are referred to is influenced by the order in which portions of the expression are evaluated. This order is determined by precedence. Operators with high precedence are evaluated before operators with low precedence. You may always include parentheses to determine which sub-expressions are evaluated first. Here all operators and keywords listed from high to low precedence. Items listed together have the same precedence and are evaluated from left to right.

(, ) Expand Not *, / +, - <, >, <=, >=, <>, = And, Or Except In Of With

Because of precedence, the following two expressions are identical:

curve with length + 2 * 2 > 10 and length <= 20 in my_group

expand(curve with (((length + (2*2)) > 10 )and( length <= 20 ))) in ( my_group expand )