Author Topic: SCH Query - find parts where specific parameter equals a specific value?  (Read 1505 times)

0 Members and 1 Guest are viewing this topic.

Offline ajbTopic starter

  • Super Contributor
  • ***
  • Posts: 2721
  • Country: us
I'm trying to find a way to quickly list all of the parts in a project that have a specific parameter that equals a specific value.  The "Find Text" tool (Ctrl+F) in the schematic editor only seems to search part and net designators.  I could sift through the SCH List to find the right parts, except the list doesn't seem to show custom parameters for some reason (they appear in the "Choose Columns" dialog, but are blank when displayed in the SCH List window).  There are built-in query fields to return *parameters* that have specific names (ParameterName) or specific values (ParameterValue), but I can't seem to find a way to return the *parts* that have those parameters.  The ParametersList field seems like it might work, but I can't get it to return anything at all, and while the example seems like it should return a part the description doesn't mention parts at all:

Quote
PARAMETERSLIST FIELD

Description
Returns all Parameter Set, Pin, Port, Probe, and Sheet Symbol objects having a Parameters List property that complies with the Query.
Note: The ParametersList property is only defined for Parameter Set, Pin, Port, Probe, and Sheet Symbol objects.
Syntax
ParametersList : String
Example
ParametersList = 'Manufacturer=Motorola, Supplier=Dick Smith Electronics'
Returns all Parameter Set, Pin, Port, Probe, and Sheet Symbol objects that have two parameters, when the first parameter has a Name property of 'Manufacturer' and a Value property of 'Motorola', and the second parameter has a Name property of 'Supplier' and a Value property of 'Dick Smith Electronics'.

Is there another way to do this that I'm missing?
 

Offline ajbTopic starter

  • Super Contributor
  • ***
  • Posts: 2721
  • Country: us
Re: SCH Query - find parts where specific parameter equals a specific value?
« Reply #1 on: February 27, 2017, 08:59:47 pm »
So it finally occurred to me to use the "Find Similar Objects" tool to generate an expression, and it turns out that HasParameter will do what I need .  It's documented on the same page I was looking at before, I just glossed over the description. |O

Quote
HASPARAMETER MEMBERSHIP CHECK

Description
Returns all Parameter Set, Part, Pin, Port, Probe, and Sheet Symbol objects incorporating a Parameter object having a Parameter Name property and (Parameter) Value property that complies with the Query.
Syntax
HasParameter(ParameterName : String , ParameterValue : String) : Boolean
The ParameterName string specifies the Parameter Name property of the Parameter.
The ParameterValue string specifies the (Parameter) Value property of the Parameter.
Examples
HasParameter('Comment','1k')
HasParameter('Comment','1k') = True
Returns all Parameter Set, Part, Pin, Port, Probe, and Sheet Symbol objects incorporating a Parameter object that has a Parameter Name property of 'Comment' and a (Parameter) Value property of '1k'.

HasParameter('Text Field1','CAPACITOR')
HasParameter('Text Field1','CAPACITOR') = True
Returns all Parameter Set, Part, Pin, Port, Probe, and Sheet Symbol objects incorporating a Parameter object that has a Parameter Name property of 'Text Field1' and a (Parameter) Value property of 'CAPACITOR'.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf