StockDataCollection Class — NXOpen Python API Reference 12.0.0 documentation

# StockDataCollection Class

class `NXOpen.Routing.``StockDataCollection`

  Bases: `object`

  Represents a collection of `NXOpen.Routing.StockData` objects.

  To obtain an instance of this class, refer to `NXOpen.Routing.RouteManager`

  New in version NX4.0.0.

# Methods

Method | Description
--- | ---
CreateStockData | Creates (or finds an existing `NXOpen.Routing.StockData`) object in the work part that has the characteristics specified by the input list of characteristic values.
RemoveUnusedStockData | Logs for deletion any `NXOpen.Routing.StockData` objects in the input part not referenced by any `NXOpen.Routing.Stock`, `NXOpen.Routing.Wire` and `NXOpen.Routing.CrossSection` not referenced by any `NXOpen.Routing.StockData`.

# Method Detail

## CreateStockData

`StockDataCollection.``CreateStockData`

  Overloaded method CreateStockData

  - `CreateStockData(values)`
  - `CreateStockData()`

  `-------------------------------------`

  Creates (or finds an existing `NXOpen.Routing.StockData`) object in the work part that has the characteristics specified by the input list of characteristic values. Creates the stock by copying the stock defined in the qualified part to the work part. The qualified stock part is specified by the PART_NAME or MEMBER_NAME in the list. If there is no PART_NAME or MEMBER_NAME a stock data, the OD or WIDTH/HEIGHT values are used to generate either a circular or rectangular stock data.

  Use this routine to create stock data’s in the work part in order to create stocks. Use `Routing.RouteManager.PartTypeFlag()` to create a qualified stock data part.

  Example Use:

  values = theSession.Preferences.RoutingApplicationView.PartPreferences.PartLibrary.CreateCriteria ( ); values.SetCharacteristic ( “OD”, 10.0 ); stock_data = workPart.RouteManager.StockDataCollection.CreateStockData ( values ); stocks = workPart.RouteManager.StockCollection.CreateStock ( stock_data, anchor, cross_section, segments ); workPart.RouteManager.SetPartTypeFlag( Routing.RouteManager.PartType.Stock );

  Signature `CreateStockData(values)`

  Parameters: | values (`NXOpen.Routing.CharacteristicList`) –
  Returns: |
  Return type: | `NXOpen.Routing.StockData`

  New in version NX4.0.0.

  License requirements: routing_advanced (“Routing Advanced”), routing_base (“Routing Basic”)

  `-------------------------------------`

  Creates a new stock data in the work part. The new stock data contains all of the `NXOpen.Routing.CrossSection` and `NXOpen.Routing.Anchor` objects in the work part. After calling this routine call `Routing.RouteManager.PartTypeFlag()` to `NXOpen.Routing.RouteManagerPartType.Stock`, `NXOpen.Routing.RouteManagerPartType.Overstock`, or `NXOpen.Routing.RouteManagerPartType.Filler` to properly qualify this as a stock definition part.

  Signature `CreateStockData()`

  Returns: |
  Return type: | `NXOpen.Routing.StockData`

  New in version NX4.0.0.

  License requirements: routing_advanced (“Routing Advanced”), routing_base (“Routing Basic”)

  `-------------------------------------`

## RemoveUnusedStockData

`StockDataCollection.``RemoveUnusedStockData`

  Logs for deletion any `NXOpen.Routing.StockData` objects in the input part not referenced by any `NXOpen.Routing.Stock`, `NXOpen.Routing.Wire` and `NXOpen.Routing.CrossSection` not referenced by any `NXOpen.Routing.StockData`.

  Signature `RemoveUnusedStockData()`

  New in version NX5.0.0.

  License requirements: routing_advanced (“Routing Advanced”), routing_base (“Routing Basic”)