主要内容

partrepo.collection.listDataSetsForBlock

Lists parts available for block

Since R2026a

    Description

    partsTable = partrepo.collection.listDataSetsForBlock(blockName) lists the parts available for the specified block.

    example

    Examples

    collapse all

    This example shows how to list the installed part parameterizations for a Resistor block from the Simscape foundation library.

    The MyResistors_1.0.0.mldatx file is a collection with three parts that parameterize the Resistor block in the Simscape foundation library. Install the collection.

    partrepo.collection.install("MyResistors_1.0.0.mldatx",Overwrite=true)
    Successfully installed part collection. Details:
    
       Collection ID: MyOrg.MyResistors 
       Version: 1.0.0 
       
       Data set IDs:
          MyManufacturer|R-0001|Resistor 1
          MyManufacturer|R-0002|Resistor 2
          MyManufacturer|R-0003|Resistor 3 
       
       Blocks with data sets from this collection:
          fl_lib/Electrical/Electrical Elements/Resistor
    

    The MyResistorModel model contains three Simscape foundation library Resistor blocks in parallel. Open the model.

    open("MyResistorModel")

    To display the parts available for the Resistor block, use the partrepo.collection.listDataSetsForBlock function.

    partrepo.collection.listDataSetsForBlock("MyResistorModel/Resistor 1")
    ans=3×2 table
        "MyOrg.MyResistors"    "MyManufacturer|R-0001|Resistor 1"
        "MyOrg.MyResistors"    "MyManufacturer|R-0002|Resistor 2"
        "MyOrg.MyResistors"    "MyManufacturer|R-0003|Resistor 3"
    
    

    Input Arguments

    collapse all

    Simscape block for which to list available parts, specified as a string scalar, character vector, or block handle.

    Output Arguments

    collapse all

    Parts available to apply to the block, returned as a table.

    Version History

    Introduced in R2026a