没有合适的资源?快使用搜索试试~ 我知道了~
首页Altium Designer强大的Query Language Reference.pdf
Altium Designer强大的Query Language Reference.pdf
需积分: 49 309 浏览量
更新于2023-05-25
评论
收藏 2.51MB PDF 举报
入门教材,适合广泛应用,对于初学者可以进行体系建立,了解当前时代更新知识。紧跟时代变化知识体系。快来看一看。
资源详情
资源评论
资源推荐

Altium Designer精英
Q群 126958605
TR0110 (v1.7) April 21, 2008 1
Query Language Reference
Summary
Technical Reference
TR0110 (v1.7) April 21, 2008
This reference manual describes the Query Language used in Altium Designer.
This reference details the following in Altium Designer:
• Query Helper
• Library Functions
• Schematic Functions
• PCB Functions
• System Functions.
What is a Query?
Underlying Altium Designer is a powerful data filtering and editing system that lets you instruct the software to return you a
specified set of objects. This instruction is entered in the form of a Query.
A query is a string you enter using specific keywords and syntax, which will return the targeted objects. There are many
keywords available, allowing you to target objects by their type, their properties, or both.
For help on a specific query keyword, press F1 when the cursor is in the keyword. Use the links below for more information on
the query system, operators, and tips on writing queries.
Use the Query Helper dialog for a list of keywords. To easily re-use popular queries add them to your Favorites (copy them from
the History list). Favorites can be accessed from the Favorites dialog, or by pressing the Y shortcut in the schematic or PCB
editors.
Links
Introduction to the Query Language
An Insider’s Guide to the Query Language

Altium Designer精英
Q群 126958605
Query Language Reference
2 TR0110 (v1.7) April 21, 2008
Query Operators
The following is a list of the operator buttons available from the Query Helper dialog:
Arithmetic Operators
Addition Operator +
Example:
NetPinCount + NetViaCount
Subtraction Operator, -
Example:
ArcStopAngle – ArcStartAngle
Multiplication operator, *
Example:
PadXSize_BottomLayer * PadYSize_BottomLayer
Division Operator, /
Example:
HoleDiameter / ViaDiameter
Integral Division operator, Div
Example:
Color Div 65536
This calculates Color divided by 65536 and the fractional part of the result is discarded.
Mod This is used to obtain the remainder from an integral division operation, equivalent to determining a mathematical modulus.
Example:
Color Mod 256
This calculates the remainder when Color is divided by 256 without determining the fractional part of the result.
Logic Operators
Logical AND operator, And
Logical AND operator, && This is also used to implement Logical AND, but has a lower order of precedence.
Examples:
IsPad And OnMultiLayer
IsPad && OnMultiLayer
Logical Or operator, Or
|| This is also used to implement Logical OR, but has a lower order of precedence.
Example:
IsPad Or IsVia
IsPad || IsVia
EXCLUSIVE OR operator, Xor This is used to implement Logical EXCLUSIVE OR.
Example:
OnMultiLayer Xor (HoleDiameter <> 0)

Altium Designer精英
Q群 126958605
Query Language Reference
TR0110 (v1.7) April 21, 2008 3
To be returned, an object has to either be on the Multi-Layer layer and have a Hole Diameter that is zero, or not be on the Multi-
Layer layer and have a Hole Diameter that is not zero.
Not This is used to implement Logical NOT.
Example:
Not OnMultiLayer
To be returned, an object has to not be on the Multi-Layer layer.
Comparison Operators
< This means Less Than.
Example:
HoleDiameter < 40
<= This means Less Than Or Equal To.
Example:
HoleDiameter <= 40
>= This means Greater Than Or Equal To.
Example:
HoleDiameter >= 40
> This means Greater Than.
Example:
HoleDiameter > 40
<> This means Not Equal To.
Example:
HoleDiameter <> 40
To be returned, an object has to have a Hole Diameter which is not equal to 40.
= This means Equal To.
Example:
HoleDiameter = 40
To be returned, an object has to have a Hole Diameter which is equal to 40.
Between ... And ... This means Greater Than Or Equal To the first number, and Less Than Or Equal To the second number.
Example:
HoleDiameter Between 30 And 50
To be returned, an object has to have a Hole Diameter that is greater than or equal to 30, and less than or equal to 50.
Like Keywords that are used in conjunction with user-specified strings require that these strings be exactly specified whenever
these strings are being compared by the = operator. The use of the Like operator permits the provision of strings which contain
one or more Wild Card characters, thus supporting the comparison of strings which are not exactly specified. (See the
immediately following Section for a description of Wild Card Characters.)
Example:
Name Like 'ADDR?*'
This returns objects having a Name property whose associated (text) string begins with 'ADDR' and which contains at least one
more character; the string property required has thus not been exactly specified, but has been partially specified.

Altium Designer精英
Q群 126958605
Query Language Reference
4 TR0110 (v1.7) April 21, 2008
Wild Card Characters
Wild Card characters permit the provision of strings which are not exactly specified. These characters are typically used in
conjunction with other characters, resulting in the provision of strings which are partially specified. A few exceptional keywords
can accept string parameters that are not exactly specified, but for the most part, strings can only contain Wild Card characters
when these are being compared by the Like operator.
? This can be replaced by a single character of any type.
Example:
Footprint Like 'DIP1?'
This returns objects which have a Footprint property of 'DIP10', or 'DIP12', or 'DIP14', etc.
* This can be replaced by any number of characters, each of which can be of any type.
Example:
Footprint Like 'SIP*'
This returns objects which have a Footprint property of 'SIP1', or 'SIP12', or 'SIP216', etc. (Any objects having a Footprint
property of 'SIP' are also returned, because * can also be replaced by no characters.)
Boolean Strings
True This affirms the meaning of a Keyword.
Example:
IsPad = True
To be returned, an object has to be a pad.
False This negates the meaning of a Keyword.
Example:
IsVia = False
To be returned, an object has to not be a via.
Brackets and Order of Precedence
It is highly advisable to use brackets within a query whenever there is any possibility whatsoever that the query might not be
correctly interpreted.
The following two queries provide a demonstration of how brackets are used in order to eliminate ambiguity:
((IsPad And OnMultiLayer) Or IsVia) And (HoleDiameter < 16)
(IsPad And OnMultiLayer) Or (IsVia And (HoleDiameter < 16))
Both of those queries return all vias whose hole diameter is less than 16mil, but each of them differs in which pads are also
returned. The first query returns pads on the Multi-Layer layer whose hole diameter is less than 16mil, but the second query
returns all pads on the Multi-Layer layer, regardless of their hole diameters.
Brackets have the highest precedence within an order of precedence that has been defined for the various operators provided,
and which determines how queries are interpreted by the software (whenever the user has not provided brackets). The
sequence of this order is as follows:
Brackets
Not
^, *, /, Div, Mod, And
+, -, Or, Xor
=, <>, <, >, <=, >=

Altium Designer精英
Q群 126958605
Query Language Reference
TR0110 (v1.7) April 21, 2008 5
&&, ||
Ambiguities are resolved by working from left to right. Parentheses are evaluated from inside to outside and equal levels are
done left to right.
Examples:
A And B Or C becomes (A And B) Or C
A * B + C becomes (A * B) + C
This order of precedence is similar to that used in Pascal type languages. However, generous usage of brackets removes
doubt, and makes the resulting queries easier to read by others.
Library Functions
Comment Field
Description
Returns all Library Component objects having a Comment property that complies with the Query.
Note: The child objects of these Component objects are not returned. The Comment property is only defined for Component
objects.
Syntax
Comment : String
Examples
Comment = '100nF'
Returns all Components that have a Comment property of '100nF'.
Comment <> '100nF'
Returns all objects except these Component objects that have a Comment property of '100nF'. (Only Component objects have
a Comment property, thus the remaining objects that do not have a Comment property of '100nF' are returned by this Query.)
ComponentType Field
Description
Returns all Schematic Library Component objects having a ComponentType property that complies with the Query. Note, a
component type can be one of the following types; Standard, Mechanical, Graphical, Net Tie, Net Tie (In BOM), Standard (No
BOM).
Syntax
ComponentType : String
Examples
ComponentType = 'Graphical'
Returns all Part objects that have a 'Graphical' Component Type property.
ComponentType <> 'Standard'
Returns all objects except Part objects that have a 'Standard' Component Type property. (Only Part objects have a
ComponentType property, so all remaining types of objects do not have a 'Standard' ComponentType property, and are thus
also returned by this Query.)
IsPart && ComponentType <> 'Standard'
Returns all Part objects that do not have a 'Standard' Component Type property.
Designator Field
Description
剩余348页未读,继续阅读

















安全验证
文档复制为VIP权益,开通VIP直接复制

评论0