Parts in SystemWeaver have a property called PartNo which indicates a part's ordinal number within other parts of the same part type (part group). This number (highlighted below) can be seen by default in the Parts view. Items do not have the PartNo property. This article provides one example of how to order rows in a table/grid by part number using .OrderBy(PartNo).



Example Data


Example Configuration

<Grid>
  <Columns>
    <ItemNameColumn width="200"/>
  </Columns>  
  <ForEach select="/part::DREC.OrderBy(PartNo)">
    <Row>
        <ForEach select="/defobj::">
            <RowObject name="defObj"/>
        </ForEach>
    </Row>
  </ForEach>
</Grid>


Note: It is important to separate the traversing of the parts from the items. An expression like "/part::ASID.OrderBy(PartNo)/defobj::" would return a list of items in default alphabetical order.


Example Result 


If OrderBy is not specified at all, parts will return in the default alphabetical order by Name.