主要内容

findComponents

Find components in a cadnet

Since R2025a

    Description

    components = findComponents(cadobj,) returns list of components.

    components = findComponents(cadobj,SearchBy,value) returns component specified by type of search and component value.

    example

    Examples

    collapse all

    Import PCB database.

    pfile = pcbFileRead("native_ExampleBoard_Allegro")
    pfile = 
      pcbFileRead with properties:
    
               FileName: 'native_ExampleBoard_Allegro'
              NumLayers: 5
             MetalLayer: [1 3 5]
        DielectricLayer: [2 4]
            LayerHeight: [0.0184 0.0104 0.0092 0.0012 0]
             NumCadnets: 7
           NumPadStacks: 6
          NumComponents: 8
               NumParts: 5
    
    

    Get cadnet list.

    cadnetList(pfile)
    ans=7×4 table
        CadnetIdx        CadnetName         NumPins    Length
        _________    ___________________    _______    ______
    
            1        {'Unconnected_Net'}       3           0 
            2        {'NET_OUTV'       }       2       0.615 
            3        {'NET_GND'        }       1        0.46 
            4        {'NET_IN22'       }       2       0.645 
            5        {'NET_IN11'       }       4       0.488 
            6        {'NET_INNEG'      }       2       0.515 
            7        {'NET_INPOS'      }       2       0.676 
    
    

    Create cadnet object from list,

    cadobj=cadnet(pfile,"NET_IN11")
    cadobj = 
      cadnet with properties:
    
            pcBoard: [1×1 pcbFileRead]
         CadnetName: 'NET_IN11'
            NumPins: 4
        NumSurfaces: 2
            NumVias: 4
          NumTraces: 4
        TotalLength: 0.4880
            Voltage: 'NoDef'
         LayerRange: [1 3 5]
         EntityList: [1×1 struct]
    
    

    Find components in cadnet.

    findComponents(cadobj)
    ans=4×5 table
        ComponentIndex    Refdes    PinList    ComponentType          Part      
        ______________    ______    _______    ______________    _______________
    
              1           "C3"       "1"       {'Capacitor' }    {'CAPGEN080'  }
              2           "R2"       "2"       {'Resistor'  }    {'RESGEN080'  }
              3           "TP1"      "1"       {'Test Point'}    {'IOSINGLEPIN'}
              4           "U1"       "A1"      {'IC'        }    {'IC6ANT'     }
    
    

    Find components of type IC.

    findComponents(cadobj,"ComponentType","IC")
    ans=1×5 table
        ComponentIndex    Refdes    PinList    ComponentType       Part   
        ______________    ______    _______    _____________    __________
    
              1            "U1"      "A1"         {'IC'}        {'IC6ANT'}
    
    

    Find components of part number IC6ANT

    findComponents(cadobj,"PartNumber","IC6ANT")
    ans=1×5 table
        ComponentIndex    Refdes    PinList    ComponentType       Part   
        ______________    ______    _______    _____________    __________
    
              1            "U1"      "A1"         {'IC'}        {'IC6ANT'}
    
    

    Input Arguments

    collapse all

    Input specified as a cadnet object.

    Data Types: string

    Find components in a cadnet by component type or part number, specified as "ComponentType" or "PartNumber" respectively.

    Example: findComponents(cadobj,"ComponentType","value)

    Individual cadnet part name or part number in PCB database, specified by name or number. When SearchBy is "ComponentType" specify part name from the suggested list. When SearchBy is "PartNumber" specify part number from the suggested list.

    Example: findComponents(cadobj,"ComponentType","U1") finds component "U1" pins in cadnet cadobj.

    Output Arguments

    collapse all

    Output returned as a list of components contained in cadnet, or as single cadnet component when using search by component or part number.

    Version History

    Introduced in R2025a