Main Content

componentData

Component data

Since R2025a

    Description

    compdata = componentData(partobj) returns the component object of a part object.

    example

    compdata = componentData(partobj,'compName','cname') returns the component data of a part object for a specified component name.

    Examples

    collapse all

    Use the componentData function to get the component data of a pcb part.

    Read-in a pcb file

    Use the pcbFileRead object to read in a file. Accepted file formats are:

    • ODB++

    • Allegro

    • Native

    Here we are using a native format file

    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 part list

    Use the partList function to get the part list of the pcb

    partList(pfile)
    ans=5×2 table
        PartIdx       PartName    
        _______    _______________
    
           1       {'IOSINGLEPIN'}
           2       {'IC6ANT'     }
           3       {'CAPGEN080'  }
           4       {'RESGENH40'  }
           5       {'RESGEN080'  }
    
    

    Create a part object

    Create a part object of 'IC6ANT'

    partobj = part(pfile,"IC6ANT")
    partobj = 
      part with properties:
    
              pcBoard: [1×1 pcbFileRead]
             PartName: 'IC6ANT'
        NumComponents: 1
        ComponentInfo: [1×7 table]
    
    

    Get the component data

    Use the componentData function to get the component data of the part

    compdata = componentData(partobj)
    compdata = 
      component with properties:
    
                 pcBoard: [1×1 pcbFileRead]
           ComponentName: 'U1'
                PartName: 'IC6ANT'
           ComponentType: 'IC'
                 NumPins: 6
                   Value: ''
                Facement: 'TOP'
        ComponentPinInfo: [6×7 table]
    
    

    Input Arguments

    collapse all

    The part object specified as a string.

    Example: compdata = componentData(partobjname)

    Data Types: string

    Optional component name of the part object specified as a string. If compName is not specified then data will be returned for all components of the part.

    Example: compdata = componentData(partobjname,'U1') returns component data of part with compName specified asU1.

    Data Types: string

    Output Arguments

    collapse all

    Returns the component object of a part object.

    Version History

    Introduced in R2025a