StockCollection Class

class NXOpen.Routing.StockCollection

Bases: object

Represents a collection of NXOpen.Routing.Stock objects.

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

New in version NX4.0.0.

Methods

Method Description
AddStock Creates stock on the given segments.
ConvertToStockAsComponents Converts a part file from Legacy Stock into Stock as Components.
CreateStock Creates a NXOpen.Routing.Stock object.
GetComponentStock Returns the NXOpen.Routing.Stock that controls the given component.
RemoveAllFillerStocks Removes all filler stocks from the input set of segments.
RemoveStock Removes all stocks (excluding flexed stocks) from the input set of segments.
ResetReferenceStock Resets the reference NXOpen.Routing.Stock information to None.
SetAttachedStockLength Set the length of the NXOpen.Routing.Stock to which a NXOpen.Assemblies.Component object is attached.
SetReferenceStockFromObject Sets the reference NXOpen.Routing.Stock information based on the NXOpen.Routing.Stock associated with this object.
UpdateBundleStockForFiller Update the bundle stock if the NXOpen.Routing.Filler stock is created underneath it.

Method Detail

AddStock

StockCollection.AddStock

Overloaded method AddStock

  • AddStock(stockPart, dataCharx, segments, routeLevel)
  • AddStock(stockPart, dataCharx, segments, routeLevel, isSpaceReservation)
  • AddStock(stockPart, dataCharx, segments, routeLevel, isSpaceReservation, anchorName)

-------------------------------------

Creates stock on the given segments. The segments do not need to be in order, and don’t necessarily have to form a single path.

Signature AddStock(stockPart, dataCharx, segments, routeLevel)

Parameters:

New in version NX5.0.0.

License requirements: routing_base (“Routing Basic”)

-------------------------------------

Creates normal or space reservation stock on the given segments. The segments do not need to be in order, and don’t necessarily have to form a single path.

Signature AddStock(stockPart, dataCharx, segments, routeLevel, isSpaceReservation)

Parameters:
Returns:

Array of stocks created

Return type:

list of NXOpen.Routing.Stock

New in version NX7.5.2.

License requirements: routing_base (“Routing Basic”)

-------------------------------------

Creates normal or space reservation stock on the given segments. The segments do not need to be in order, and don’t necessarily have to form a single path.

Signature AddStock(stockPart, dataCharx, segments, routeLevel, isSpaceReservation, anchorName)

Parameters:
Returns:

Array of stocks created

Return type:

list of NXOpen.Routing.Stock

New in version NX7.5.2.

License requirements: routing_base (“Routing Basic”)

-------------------------------------

ConvertToStockAsComponents

StockCollection.ConvertToStockAsComponents

Converts a part file from Legacy Stock into Stock as Components.

Converts all stocks whose use is NXOpen.Routing.StockUse.LegacyStock into NXOpen.Routing.StockUse.StockAsComponent stocks by creating components for each stock. After calling this routine, all new stocks in this part will have components associated with them.

Signature ConvertToStockAsComponents(convertSpaceReservartion, nameType)

Parameters:
  • convertSpaceReservartion (bool) – If true, convert Space Reservation as Components
  • nameType (NXOpen.Routing.ComponentName) – Naming scheme to use for components. Calls ??? on each new stock component if input is RoutingComponentName.Permanent.

New in version NX7.5.2.

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

CreateStock

StockCollection.CreateStock

Creates a NXOpen.Routing.Stock object.

Signature CreateStock(stockData, anchor, crossSection, segments)

Parameters:
Returns:

The resulting array of newly created NXOpen.Routing.Stock

objects. :rtype: list of NXOpen.Routing.Stock

New in version NX4.0.0.

License requirements: routing_base (“Routing Basic”)

GetComponentStock

StockCollection.GetComponentStock

Returns the NXOpen.Routing.Stock that controls the given component.

Only returns a NXOpen.Routing.Stock if the input component is a component created by a Stock as Components stock object.

Signature GetComponentStock(component)

Parameters:component (NXOpen.Assemblies.Component) –
Returns:Returns None if the input component is not controlled

by a NXOpen.Routing.Stock :rtype: NXOpen.Routing.Stock

New in version NX4.0.0.

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

RemoveAllFillerStocks

StockCollection.RemoveAllFillerStocks

Removes all filler stocks from the input set of segments.

Signature RemoveAllFillerStocks(segments)

Parameters:segments (list of NXOpen.Routing.ISegment) –

New in version NX5.0.4.

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

RemoveStock

StockCollection.RemoveStock

Removes all stocks (excluding flexed stocks) from the input set of segments.

Signature RemoveStock(segments)

Parameters:segments (list of NXOpen.Routing.ISegment) –

New in version NX5.0.0.

License requirements: routing_base (“Routing Basic”)

ResetReferenceStock

StockCollection.ResetReferenceStock

Resets the reference NXOpen.Routing.Stock information to None.

The information attributes are rotation, twist, negate, flip, port and anchor. They determine the default creation options for the new stock. This information is used during path creation.

Signature ResetReferenceStock()

New in version NX5.0.0.

License requirements: routing_base (“Routing Basic”)

SetAttachedStockLength

StockCollection.SetAttachedStockLength

Set the length of the NXOpen.Routing.Stock to which a NXOpen.Assemblies.Component object is attached.

Signature SetAttachedStockLength(partOcc)

Parameters:partOcc (NXOpen.Assemblies.Component) –

New in version NX5.0.0.

License requirements: routing_base (“Routing Basic”)

SetReferenceStockFromObject

StockCollection.SetReferenceStockFromObject

Sets the reference NXOpen.Routing.Stock information based on the NXOpen.Routing.Stock associated with this object.

Signature SetReferenceStockFromObject(object)

Parameters:object (NXOpen.NXObject) –

New in version NX5.0.0.

License requirements: routing_base (“Routing Basic”)

UpdateBundleStockForFiller

StockCollection.UpdateBundleStockForFiller

Update the bundle stock if the NXOpen.Routing.Filler stock is created underneath it.

Signature UpdateBundleStockForFiller(segments)

Parameters:segments (list of NXOpen.Routing.ISegment) –

New in version NX5.0.0.

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