StockBuilder Class¶
-
class
NXOpen.MechanicalRouting.StockBuilder¶ Bases:
NXOpen.BuilderBuilder for creating/editing stocks.
Create Stock: Takes a set of segments and assign the selected the stock to the segments. The stock style and orientation settings are optional. Edit Stock: Takes in the selected stock to edit as input and redefines the stock with the new settings.
To create a new instance of this class, use
NXOpen.MechanicalRouting.BuilderFactory.CreateStockBuilder()Default values.
Property Value OrientationAngle.Value 0 New in version NX11.0.0.
Properties¶
| Property | Description |
|---|---|
| CrossSectionDirection | Returns or sets the orientation vector. |
| MirrorCrossSection | Returns or sets the mirror cross section value. |
| OrientationAngle | Returns the angle. |
| SegmentCollector | Returns the routing object collector that collects segments to assign stock to. |
| StockAnchor | Returns or sets |
| StockSettings | Returns the path stock settings required to assign stock |
| Tag | Returns the Tag for this object. |
Methods¶
| Method | Description |
|---|---|
| Commit | Commits any edits that have been applied to the builder. |
| Destroy | Deletes the builder, and cleans up any objects created by the builder. |
| GetCommittedObjects | For builders that create more than one object, this method returns the objects that are created by commit. |
| GetLogicalObjects | Returns the :py:class:`PDM.LogicalObject`s that represent content that will be created by this builder. |
| GetObject | Returns the object currently being edited by this builder. |
| PreCommit | Performs the operations needed prior to a commit. |
| ShowResults | Updates the model to reflect the result of an edit to the model for all builders that support showing results. |
| Validate | Validate whether the inputs to the component are sufficient for commit to be called. |
Property Detail¶
CrossSectionDirection¶
-
StockBuilder.CrossSectionDirection¶ Returns or sets the orientation vector.
cross section direction of the stock.
-------------------------------------Getter Method
Signature
CrossSectionDirectionReturns: Return type: NXOpen.DirectionNew in version NX11.0.0.
License requirements: routing_base (“Routing Basic”)
-------------------------------------Setter Method
Signature
CrossSectionDirectionParameters: orientationVector ( NXOpen.Direction) –New in version NX11.0.0.
License requirements: routing_base (“Routing Basic”)
MirrorCrossSection¶
-
StockBuilder.MirrorCrossSection¶ Returns or sets the mirror cross section value.
-------------------------------------Getter Method
Signature
MirrorCrossSectionReturns: Return type: bool New in version NX11.0.0.
License requirements: routing_base (“Routing Basic”)
-------------------------------------Setter Method
Signature
MirrorCrossSectionParameters: flag (bool) – New in version NX11.0.0.
License requirements: routing_base (“Routing Basic”)
OrientationAngle¶
-
StockBuilder.OrientationAngle¶ Returns the angle.
Determines the rotation angle of the stock.
-------------------------------------Getter Method
Signature
OrientationAngleReturns: Return type: NXOpen.ExpressionNew in version NX11.0.0.
License requirements: routing_base (“Routing Basic”)
SegmentCollector¶
-
StockBuilder.SegmentCollector¶ Returns the routing object collector that collects segments to assign stock to.
-------------------------------------Getter Method
Signature
SegmentCollectorReturns: Return type: NXOpen.Routing.RouteObjectCollectorNew in version NX11.0.0.
License requirements: routing_base (“Routing Basic”)
StockAnchor¶
-
StockBuilder.StockAnchor¶ Returns or sets
-------------------------------------Getter Method
Signature
StockAnchorReturns: Return type: str New in version NX11.0.0.
License requirements: routing_base (“Routing Basic”)
-------------------------------------Setter Method
Signature
StockAnchorParameters: anchorName (str) – New in version NX11.0.0.
License requirements: routing_base (“Routing Basic”)
StockSettings¶
-
StockBuilder.StockSettings¶ Returns the path stock settings required to assign stock
-------------------------------------Getter Method
Signature
StockSettingsReturns: Return type: NXOpen.MechanicalRouting.PathStockPreferenceBuilderNew in version NX11.0.0.
License requirements: routing_base (“Routing Basic”)
Method Detail¶
GetLogicalObjects¶
-
StockBuilder.GetLogicalObjects¶ Returns the :py:class:`PDM.LogicalObject`s that represent content that will be created by this builder.
Signature
GetLogicalObjects()Returns: Return type: list of NXOpen.PDM.LogicalObjectNew in version NX11.0.1.
License requirements: routing_base (“Routing Basic”)
PreCommit¶
-
StockBuilder.PreCommit¶ Performs the operations needed prior to a commit.
This method has to be called before invoking commit.
Signature
PreCommit()New in version NX11.0.1.
License requirements: routing_base (“Routing Basic”)
Validate¶
-
StockBuilder.Validate¶ Validate whether the inputs to the component are sufficient for commit to be called.
If the component is not in a state to commit then an exception is thrown. For example, if the component requires you to set some property, this method will throw an exception if you haven’t set it. This method throws a not-yet-implemented NXException for some components.
Signature
Validate()Returns: Was self validation successful Return type: bool New in version NX3.0.1.
License requirements: None.