Library Query Functions

Old Content - visit altium.com/documentation

The following content has been imported from Legacy Help systems and is in the process of being checked for accuracy.

This section covers Library Query functions used by the Query System in Altium Designer.

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
Returns all Schematic Library Component objects having a designator property that complies with the Query.
Syntax
Designator : String
Examples
Designator Like 'C*'
Returns all Components that have a Designator property of 'C*'.

Designator <> 'C*'
Returns all objects except these Component objects that have a Designator property of 'C*'.

Description Field

Description
Returns all Library Component objects having a Description property that complies with the Query.
Syntax
Description: String
Examples
Description = 'F*'
Returns all components or footprints that have a Description property with the first character of the string starting with F.

HasModel Field

Description
Returns schematic components which meet the query criteria that has the HasModel keyword with the specified model type, model name and current model.
Syntax
HasModel(ModelType : String , ModelName : String , CurrentModelOnly : Boolean) : Boolean
The ModelType string specifies the Type property of a linked Model, and must be one of the strings from the following list:
'PCB3DLIB' , 'PCBLIB' , 'SI' , 'SIM'
Those strings respectively select linked Models having Type properties of PCB3D, Footprint, Signal Integrity, and Simulation.
The ModelName string specifies the Name property of a linked Model.
The CurrentModelOnly parameter specifies whether or not a linked Model (also) has to be a Current Model of each Part. When this is False, a linked Model does not have to be a Current Model (but it still can be); when this is True, a linked Model does have to be a Current Model.
Examples
HasModel('PCBLIB','SOIC14',False)
HasModel('PCBLIB','SOIC14',False) = True
Returns all Part objects that are linked to a Footprint Model which has a Name property of 'SOIC14'; that Model does not have to be each Part's Current Footprint Model (but it can be).

HasModel('PCBLIB','DIP14',True)
HasModel('PCBLIB','DIP14',True) = True
Returns all Part objects that are linked to a Footprint Model which has a Name property of 'DIP14'; for each Part returned, that Model also has to be its Current Footprint Model.

HasModel('SI','RES1',False)
HasModel('SI','RES1',False) = True
Returns all Part objects that are linked to a Signal Integrity Model which has a Name property of 'RES1'; that Model does not have to be each Part's Current Signal Integrity Model (but it can be).

HasModel('SIM','RESISTOR',True)
HasModel('SIM','RESISTOR',True) = True
Returns all Part objects that are linked to a Simulation Model which has a Name property of 'RESISTOR'; for each Part returned, that Model also has to be its Current Simulation Model.

HasModelParameter Field

Description
The HasModelParameter keyword permits users to specify the Name and Value properties of a Parameter which is contained within a linked Model, and optionally whether that Model is a Current Model of each Part. (Each Part can be linked to Models of Footprint, Simulation, PCB3D, and Signal Integrity types. It is possible to link a Part to more than one Model of the same type, but only one Model of each type can be selected as a Part's Current Model.)
Syntax
HasModelParameter(ParameterName : String , ParameterValue : String , CurrentModelOnly : Boolean) : Boolean
The ParameterName string specifies the Parameter Name property of the Parameter contained in the linked Model.
The ParameterValue string specifies the (Parameter) Value property of the Parameter contained in the linked Model.
The CurrentModelOnly parameter specifies whether or not the linked Model (which contains a compliant Parameter) has to be a Current Model of each Part. When this is False, the linked Model does not have to be a Current Model (but it still can be); when this is True, the linked Model does have to be a Current Model.
Examples
HasModelParameter('Inductance A','1mH',False)
HasModelParameter('Inductance A','1mH',False) = True
Returns all Part objects that are linked to a Model which contains a Parameter that has a Parameter Name property of 'Inductance A' and a (Parameter) Value property of '1mH'; that Model does not have to be a Current Model of each Part (but it can be).

HasModelParameter('Coupling Factor','0.999',True)
HasModelParameter('Coupling Factor','0.999',True) = True
Returns all Part objects that are linked to a Model which contains a Parameter that has a Parameter Name property of 'Coupling Factor' and a (Parameter) Value property of '0.999', when that Model is also a Current Model of the Part.

Height Field

Description
Returns all footprint objects within PCB libraries having a Height property that complies with the Query that has the Height keyword.
Syntax
Height : Number
Example
(Height > 10) and (Height < 25)
Returns all the footprints with a height property of between 10 and 25 mils.

LibraryName field

Description
Returns all Library Components having a LibraryName property that complies with the Query. You need to specify the search type on the Libraries Search dialog when searching for PCB Libraries, Schematic Libraries etc. There can be multiple libraries that have the same name living in different locations on the hard disk for example and those components will be returned from these libraries.
Syntax
LibraryName : String
Examples
LibraryName = '4 Port Serial Interface.PcbLib'
Returns all footprints that live in a library specified by the LibraryName property as long as the Search type is set to Protel Footprints.

LibraryName = '3M Card CompactFlash.IntLib'
Returns all footprints that live in an integrated library specified by the LibraryName property if the Search type is set to Protel Footprints or returns all components if the Search type is set to Components etc.

LibraryPath field

Description
Returns all Library Component objects having a LibraryPath property that references that specific library and complies with the Query. You need to specify the search type on the Libraries Search dialog when searching for PCB iIbraries, Schematic Libraries etc.
Syntax
LibraryPath: String
Examples
LibraryPath = 'C:\Program Files\Altium Designer\Examples\Reference Designs\4 Port Serial Interface\Libraries\4 Port Serial Interface.PcbLib'
Returns all Footprints etc that points to a specific library.

LibraryPath = 'C: \Program Files\Altium Designer\Library\3m\3M Card CompactFlash.IntLib'
Returns all Components or Footprints etc that have a LibraryPath property of the full path to the specified library depending on which Search type is set in the Libraries Search dialog.

LibReference Field

Description
Returns all Library Component objects having a LibReference property which meet the query criteria.
Syntax
LibReference : String
Examples
LibReference Like 'C*'
Returns all Components that have a LibReference property of strings that start with C.

Name field

Description
Returns all Footprints or Schematic Library Component objects having a Name property that complies with the Query. The Libraries Search dialog needs to be set to the search type before you can do a search with a specified query.
Syntax
Name : String
Examples
Name = 'DIP14'
Returns all Footprints/Components that have a Name property of 'DIP14' as long the appropriate library exists.

PadCount Field

Description
Returns all footprints having a Pad Count property that complies with the Query.
Syntax
PadCount : Number
Examples
PadCount > 60
Returns all footprints that have a pad count of greater than 60

PartCount Field

Description
Returns all Schematic Library Component objects having a Part Count property that complies with the Query. Note, a component can have more than one part. For example a 74HC32 integrated circuit has 4 OR gates and thus there are four parts for the 74HC32 multi-part component.
Syntax
PartCount : Number
Examples
PartCount > 4
returns all components that have more than 4 parts.

PinCount Field

Description
Returns all Schematic Library Component objects having a Pin Count property that complies with the Query.
Syntax
PinCount : Number
Examples
PinCount < 2
returns the components in the installed libraries that have less than 2 pins.

SourceLibraryName field

Description
Returns all Library Component or Footprint objects having a Source Library Name property that represents the source library which complies with the Query. The Source Library Name property represents the name of the source library such as the Schematic Library or the PCB library. Integrated Libraries do not work in this case.
Syntax
SourceLibraryName : String
Examples
SourceLibraryName = '4 Port Serial Interface.PcbLib'
Returns all footprints that live in a library specified by the SourceLibraryName property as long as the Search type is set to Protel Footprints.

SourceLibraryPath field

Description
Returns all Library Component objects having a SourceLibraryPath property that references that specific library (PCBLib or SchLIB) and complies with the Query. You need to specify the search type on the Libraries Search dialog when searching for PCB iIbraries, Schematic Libraries etc. The Source Library path property represents the full path and name of the source library such as the Schematic Library or the PCB library. Integrated Libraries do not work in this case.
Syntax
SourceLibraryPath: String
Examples
SourceLibraryPath = 'C:\Program Files\Altium Designer\Examples\Reference Designs\4 Port Serial Interface\Libraries\4 Port Serial Interface.PcbLib'
Returns all Footprints etc that points to a specific library.

You are reporting an issue with the following selected text and/or image within the active document: