PartCollection Class¶
-
class
NXOpen.
PartCollection
¶ Bases:
object
Represents the collection of all parts in a session.
Several methods including
NXOpen.PartCollection.NewDisplay()
,NXOpen.PartCollection.OpenDisplay()
andNXOpen.BasePart.SaveAs()
can take part names in NX Manager command-line format while running in NX Manager mode. This format is as follows:Master Part: <@>DB/part-number/revision <@>DB/part-number/revision/master <@>DB/part-number/revision/master <@>DB/part-number/revision/master/version Non-Master Part: <@>DB/part-number/revision/type/name <@>DB/part-number/revision/type/name/version
The separator character (‘/’) may be any character not used in the part-number, revision or type fields. It is inferred as the first character after the “<@>DB” prefix.
To obtain an instance of this class, refer to
NXOpen.Session
New in version NX3.0.0.
Properties¶
Property | Description |
---|---|
AllowMultipleDisplayedParts | Returns the option indicating if more than one displayed part is allowed in this session. |
BaseDisplay | Returns the currently active display part of the session. |
BaseWork | Returns the current work part of the session. |
Display | Returns the currently active display part of the session. |
Work | Returns the current work part of the session. |
WorkComponent | Returns the work component. |
LoadOptions | The NXOpen.LoadOptions that determines how parts are loaded in this session |
SaveOptions | The NXOpen.SaveOptions that determines how parts are saved in this session |
PDMPartManager | The NXOpen.PDM.PartManager that manages creation of parts in NX Manager mode |
ShapeSearchManager | The NXOpen.ShapeSearch.SearchManager that manages shape search in this session |
Methods¶
Method | Description |
---|---|
AddPartClosedHandler | Registers a user defined method that is called whenever a part is in the process of being closed |
AddPartCreatedHandler | Registers a user defined method that is called whenever a new part is created |
AddPartModifiedHandler | Registers a user defined method that is called whenever a part is modified |
AddPartOpenedHandler | Registers a user defined method that is called whenever a part is opened |
AddPartRenamedHandler | Registers a user defined method that is called whenever a part is renamed |
AddPartSavedAsHandler | Registers a user defined method that is called whenever a part is saved as a specified name |
AddPartSavedHandler | Registers a user defined method that is called whenever a part is saved |
AddWorkPartChangedHandler | Registers a method that is called whenever the work part changes |
CloseAll | Closes all the parts open in the session. |
ClosePasswordSafe | This method is for closing the currently open password safe. |
CreateGenericFileNewBuilder | Creates a NXOpen.Gateway.GenericFileNewBuilder |
CreateLinkedMirrorPartBuilder | Creates a NXOpen.LinkedMirrorPartBuilder |
FileNew | Creates a NXOpen.FileNew |
FindObject | Finds the NXOpen.BasePart with the given name. |
ForceSaveAll | Saves all parts in a session. |
GetDisplayedParts | Returns all parts that are currently displayed. |
GetMirrorCsysOptionOfMirrorPart | Get the type of mirror coordinate system for the given linked mirrored part |
GetMirrorPartType | Get the type of linked mirrored part |
GetMirrorPlaneDataOfMirrorPart | Get the origin point and the normal direction of the mirror plane for the given linked mirrored part |
GetSourcePartNameOfMirrorPart | Get source part name of mirror part |
ImportToolDesignPackage | Import tool design package |
IsExactMirroredPart | Check whether given part is an exact linked mirrored part |
IsMirroredPart | Check whether given part is a linked mirrored part |
NewBaseDisplay | Creates a new part and sets this part as the active display part. |
NewDisplay | Creates a new .prt part and sets this part as the active display part. |
NewPartCloseResponses | Constructs a new PartCloseResponses class. |
Open | Opens an existing .prt part, but does not set it to be the active display part. |
OpenActiveDisplay | Opens an existing part and sets this part as the active display part. |
OpenBase | Opens an existing part, but does not set it to be the active display part. |
OpenBaseDisplay | Opens an existing part and sets this part as the active display part. |
OpenDisplay | Opens an existing .prt part and sets this part as the active display part. |
OpenPasswordSafe | This method is for opening a password safe. |
OpenSeedPartBlankTemplate | Open unpopulated dataset with blank template |
RefreshPartNavigator | Refreshes the part navigator. |
RemovePartClosedHandler | Unregisters a user defined method that is called whenever a part is in the process of being closed |
RemovePartCreatedHandler | Unregisters a user defined method that is called whenever a new part is created |
RemovePartModifiedHandler | Unregisters a user defined method that is called whenever a part is modified |
RemovePartOpenedHandler | Unregisters a user defined method that is called whenever a part is opened |
RemovePartRenamedHandler | Unregisters a user defined method that is called whenever a part is renamed |
RemovePartSavedAsHandler | Unregisters a user defined method that is called whenever a part is saved as a specified name |
RemovePartSavedHandler | Unregisters a user defined method that is called whenever a part is saved |
RemovePassword | Remove password of the part. |
RemoveWorkPartChangedHandler | Unregisters a method that is called whenever the work part changes. |
ReopenAll | Reopens all modified parts in the session. |
SaveAll | Saves all modified parts in a session. |
SetActiveDisplay | Sets the active display part. |
SetAllowMultipleDisplayedParts | Sets the option indicating if more than one displayed part is allowed in this session. |
SetDisplay | Sets the active display part. |
SetMirrorPartType | Set the type of linked mirrored part |
SetNonmasterSeedPartData | Set non master seed part data for opening unpopulated non master part |
SetOpenPassword | Input password for opening the part. |
SetPassword | Set password to the part. |
SetSeedPartTemplateData | Specify template data to open seed part or empty item revision |
SetWork | Sets the current work part in the active display part. |
SetWorkComponent | Sets the work component in the currently active display part. |
SetWorkComponentOverride | Sets the component with override part as the work component in the active display part. |
SolveAllPostponedConstraints | Solves all the constraints, that have been postponed in their arrangement, in every loaded part in the session. |
Enumerations¶
PartCollectionMultipleDisplayedPartStatus Enumeration | Represents the status if Multiple Display Parts are allowed or not. |
PartCollectionRefsetOption Enumeration | Controls the reference set used when setting the work component. |
PartCollectionSdpsStatus Enumeration | Indicates the reason why it was not possible to use Design in Context (i.e. to set the work part to a component of the new active displayed part.) |
PartCollectionSetProtectionOn Enumeration | Specifies the parts to which the password protection operation will apply. |
PartCollectionWorkComponentOption Enumeration | Controls the behavior when setting the work component. |
Property Detail¶
AllowMultipleDisplayedParts¶
-
PartCollection.
AllowMultipleDisplayedParts
¶ Returns the option indicating if more than one displayed part is allowed in this session.
-------------------------------------
Getter Method
Signature
AllowMultipleDisplayedParts
Returns: Return type: NXOpen.PartCollectionMultipleDisplayedPartStatus
New in version NX12.0.0.
License requirements: None.
BaseDisplay¶
-
PartCollection.
BaseDisplay
¶ Returns the currently active display part of the session.
-------------------------------------
Getter Method
Signature
BaseDisplay
Returns: Return type: NXOpen.BasePart
New in version NX4.0.0.
License requirements: None.
BaseWork¶
-
PartCollection.
BaseWork
¶ Returns the current work part of the session.
This is either the active display part, or a part represented by a component in the active display part’s
NXOpen.Assemblies.ComponentAssembly
. See:NXOpen.PartCollection.WorkComponent()
-------------------------------------
Getter Method
Signature
BaseWork
Returns: Return type: NXOpen.BasePart
New in version NX4.0.0.
License requirements: None.
Display¶
-
PartCollection.
Display
¶ Returns the currently active display part of the session.
An error will be thrown if the active display part is not a .prt part.
-------------------------------------
Getter Method
Signature
Display
Returns: Return type: NXOpen.Part
New in version NX3.0.0.
License requirements: None.
Work¶
-
PartCollection.
Work
¶ Returns the current work part of the session.
This is either the active display part, or a part represented by a component in the active display part’s
NXOpen.Assemblies.ComponentAssembly
. See:NXOpen.PartCollection.WorkComponent()
An error will be thrown if the work part is not a .prt part.
-------------------------------------
Getter Method
Signature
Work
Returns: Return type: NXOpen.Part
New in version NX3.0.0.
License requirements: None.
WorkComponent¶
-
PartCollection.
WorkComponent
¶ Returns the work component.
This is the component in the active display part’s
NXOpen.Assemblies.ComponentAssembly
which represents the current work part. Note that there may be several different components which represent the same work part. In this case, one of them will be selected as the work component.-------------------------------------
Getter Method
Signature
WorkComponent
Returns: The work component. Return type: NXOpen.Assemblies.Component
New in version NX3.0.0.
License requirements: None.
LoadOptions¶
-
PartCollection.
LoadOptions
¶ The
NXOpen.LoadOptions
that determines how parts are loaded in this sessionSignature
LoadOptions
New in version NX3.0.0.
Returns: Return type: NXOpen.LoadOptions
SaveOptions¶
-
PartCollection.
SaveOptions
¶ The
NXOpen.SaveOptions
that determines how parts are saved in this sessionSignature
SaveOptions
New in version NX3.0.0.
Returns: Return type: NXOpen.SaveOptions
PDMPartManager¶
-
PartCollection.
PDMPartManager
¶ The
NXOpen.PDM.PartManager
that manages creation of parts in NX Manager modeSignature
PDMPartManager
New in version NX3.0.0.
Returns: Return type: NXOpen.PDM.PartManager
ShapeSearchManager¶
-
PartCollection.
ShapeSearchManager
¶ The
NXOpen.ShapeSearch.SearchManager
that manages shape search in this sessionSignature
ShapeSearchManager
New in version NX6.0.0.
Returns: Return type: NXOpen.ShapeSearch.SearchManager
Method Detail¶
AddPartClosedHandler¶
-
PartCollection.
AddPartClosedHandler
¶ Registers a user defined method that is called whenever a part is in the process of being closed
Signature
AddPartClosedHandler(handler)
Parameters: handler (CallableObject) – method to register Returns: identifier of registered method (used to unregister the method) Return type: int New in version NX6.0.0.
License requirements: None.
AddPartCreatedHandler¶
-
PartCollection.
AddPartCreatedHandler
¶ Registers a user defined method that is called whenever a new part is created
Signature
AddPartCreatedHandler(handler)
Parameters: handler (CallableObject) – method to register Returns: identifier of registered method (used to unregister the method) Return type: int New in version NX6.0.0.
License requirements: None.
AddPartModifiedHandler¶
-
PartCollection.
AddPartModifiedHandler
¶ Registers a user defined method that is called whenever a part is modified
Signature
AddPartModifiedHandler(handler)
Parameters: handler (CallableObject) – method to register Returns: identifier of registered method (used to unregister the method) Return type: int New in version NX6.0.0.
License requirements: None.
AddPartOpenedHandler¶
-
PartCollection.
AddPartOpenedHandler
¶ Registers a user defined method that is called whenever a part is opened
Signature
AddPartOpenedHandler(handler)
Parameters: handler (CallableObject) – method to register Returns: identifier of registered method (used to unregister the method) Return type: int New in version NX6.0.0.
License requirements: None.
AddPartRenamedHandler¶
-
PartCollection.
AddPartRenamedHandler
¶ Registers a user defined method that is called whenever a part is renamed
Signature
AddPartRenamedHandler(handler)
Parameters: handler (CallableObject) – method to register Returns: identifier of registered method (used to unregister the method) Return type: int New in version NX6.0.0.
License requirements: None.
AddPartSavedAsHandler¶
-
PartCollection.
AddPartSavedAsHandler
¶ Registers a user defined method that is called whenever a part is saved as a specified name
Signature
AddPartSavedAsHandler(handler)
Parameters: handler (CallableObject) – method to register Returns: identifier of registered method (used to unregister the method) Return type: int New in version NX6.0.0.
License requirements: None.
AddPartSavedHandler¶
-
PartCollection.
AddPartSavedHandler
¶ Registers a user defined method that is called whenever a part is saved
Signature
AddPartSavedHandler(handler)
Parameters: handler (CallableObject) – method to register Returns: identifier of registered method (used to unregister the method) Return type: int New in version NX6.0.0.
License requirements: None.
AddWorkPartChangedHandler¶
-
PartCollection.
AddWorkPartChangedHandler
¶ Registers a method that is called whenever the work part changes
Signature
AddWorkPartChangedHandler(handler)
Parameters: handler (CallableObject) – method to register Returns: identifier of registered method (used to unregister the method) Return type: int New in version NX6.0.0.
License requirements: None.
CloseAll¶
-
PartCollection.
CloseAll
¶ Closes all the parts open in the session.
Signature
CloseAll(closeModified, responses)
Parameters: - closeModified (
NXOpen.BasePartCloseModified
) – Behavior of close if component parts are modified. - responses (
NXOpen.PartCloseResponses
) – Class representing list of parts to close or leave open if modified. Only used if closed_modified is set toNXOpen.BasePartCloseModified.UseResponses
. IfNXOpen.BasePartCloseModified.UseResponses
is set, then any parts that are candidates for being closed that are not in this list will be closed whether modified or not. SeeNXOpen.PartCloseResponses
for how to add responses to this class.
New in version NX3.0.0.
License requirements: None.
- closeModified (
ClosePasswordSafe¶
-
PartCollection.
ClosePasswordSafe
¶ This method is for closing the currently open password safe.
This method should only be used with GC Toolkits.
Signature
ClosePasswordSafe()
New in version NX11.0.0.
License requirements: None.
CreateGenericFileNewBuilder¶
-
PartCollection.
CreateGenericFileNewBuilder
¶ Creates a
NXOpen.Gateway.GenericFileNewBuilder
Signature
CreateGenericFileNewBuilder()
Returns: Return type: NXOpen.Gateway.GenericFileNewBuilder
New in version NX11.0.0.
License requirements: None.
CreateLinkedMirrorPartBuilder¶
-
PartCollection.
CreateLinkedMirrorPartBuilder
¶ Creates a
NXOpen.LinkedMirrorPartBuilder
Signature
CreateLinkedMirrorPartBuilder(part)
Parameters: part ( NXOpen.Part
) –Returns: the LinkedMirrorPartBuilder object Return type: NXOpen.LinkedMirrorPartBuilder
New in version NX8.5.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
FileNew¶
-
PartCollection.
FileNew
¶ Creates a
NXOpen.FileNew
Signature
FileNew()
Returns: Return type: NXOpen.FileNew
New in version NX5.0.0.
License requirements: None.
FindObject¶
-
PartCollection.
FindObject
¶ Finds the
NXOpen.BasePart
with the given name.The part must have been loaded in this session. This function acceps full path name or leaf name in case of native mode and would expect CLI format name (e.g., “@DB/peters-part/A/spec/sheet1”) in case of managed mode NX. An exception will be thrown if no object can be found with the given name.
Signature
FindObject(name)
Parameters: name (str) – Full name or leaf name or CLI name (in managed mode) Returns: The part with the given name. Return type: NXOpen.BasePart
New in version NX3.0.0.
License requirements: None.
ForceSaveAll¶
-
PartCollection.
ForceSaveAll
¶ Saves all parts in a session.
Signature
ForceSaveAll()
Returns: Parts that could not be saved and their associated errors. Return type: NXOpen.PartSaveStatus
New in version NX6.0.0.
License requirements: None.
GetDisplayedParts¶
-
PartCollection.
GetDisplayedParts
¶ Returns all parts that are currently displayed.
The first part in this list will be the active display part. See also
NXOpen.PartCollection.Display()
,NXOpen.PartCollection.Work()
**Note:</b> NX operations are generally performed in the active display part. Before performing operations in a display part you should first activate it with
NXOpen.PartCollection.SetActiveDisplay()
.Signature
GetDisplayedParts()
Returns: Parts that are currently displayed Return type: list of NXOpen.BasePart
New in version NX12.0.0.
License requirements: None.
GetMirrorCsysOptionOfMirrorPart¶
-
PartCollection.
GetMirrorCsysOptionOfMirrorPart
¶ Get the type of mirror coordinate system for the given linked mirrored part
Signature
GetMirrorCsysOptionOfMirrorPart(part)
Parameters: part ( NXOpen.Part
) – input linked mirror part. Error is raised if input is not a linked mirror partReturns: Return type: NXOpen.LinkedMirrorPartBuilderMirrorCsysOption
New in version NX8.5.1.
License requirements: solid_modeling (“SOLIDS MODELING”)
GetMirrorPartType¶
-
PartCollection.
GetMirrorPartType
¶ Get the type of linked mirrored part
Signature
GetMirrorPartType(part)
Parameters: part ( NXOpen.Part
) – input partReturns: Return type: NXOpen.LinkedMirrorPartBuilderMirrorPartTypeOption
New in version NX8.5.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
GetMirrorPlaneDataOfMirrorPart¶
-
PartCollection.
GetMirrorPlaneDataOfMirrorPart
¶ Get the origin point and the normal direction of the mirror plane for the given linked mirrored part
Signature
GetMirrorPlaneDataOfMirrorPart(part)
Parameters: part ( NXOpen.Part
) – input linked mirror part. Error is raised if input is not a linked mirror partReturns: a tuple Return type: A tuple consisting of (mirrorPlaneOrigin, mirrorPlaneDirection). mirrorPlaneOrigin is a NXOpen.Point3d
. mirror plane origin mirrorPlaneDirection is aNXOpen.Vector3d
. mirror plane normal directionNew in version NX8.5.1.
License requirements: solid_modeling (“SOLIDS MODELING”)
GetSourcePartNameOfMirrorPart¶
-
PartCollection.
GetSourcePartNameOfMirrorPart
¶ Get source part name of mirror part
Signature
GetSourcePartNameOfMirrorPart(mirrorPart)
Parameters: mirrorPart ( NXOpen.Part
) – input partReturns: Return type: str New in version NX8.5.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
ImportToolDesignPackage¶
-
PartCollection.
ImportToolDesignPackage
¶ Import tool design package
Signature
ImportToolDesignPackage(filename, outputDirectory)
Parameters: - filename (str) – Tool design package
- outputDirectory (str) – Output directory
Returns: a tuple
Return type: A tuple consisting of (part, loadStatus, saveStatus). part is a
NXOpen.Part
. Top level assembly loadStatus is aNXOpen.PartLoadStatus
. Parts that could not be loaded and their associated errors. saveStatus is aNXOpen.PartSaveStatus
. Parts that could not be saved and their associated errors.New in version NX9.0.0.
License requirements: None.
IsExactMirroredPart¶
-
PartCollection.
IsExactMirroredPart
¶ Check whether given part is an exact linked mirrored part
Signature
IsExactMirroredPart(part)
Parameters: part ( NXOpen.Part
) – input partReturns: Return type: bool New in version NX8.5.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
IsMirroredPart¶
-
PartCollection.
IsMirroredPart
¶ Check whether given part is a linked mirrored part
Signature
IsMirroredPart(part)
Parameters: part ( NXOpen.Part
) – input partReturns: Return type: bool New in version NX8.5.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
NewBaseDisplay¶
-
PartCollection.
NewBaseDisplay
¶ Creates a new part and sets this part as the active display part.
Signature
NewBaseDisplay(name, units)
Parameters: - name (str) – Name of new part
- units (
NXOpen.BasePartUnits
) – Units of new part
Returns: Newly created part
Return type: New in version NX4.0.0.
License requirements: None.
NewDisplay¶
-
PartCollection.
NewDisplay
¶ Creates a new .prt part and sets this part as the active display part.
**Note:</b> This method should only be used to create new .prt parts. Use
NXOpen.PartCollection.NewBaseDisplay()
to create other types of parts other than .prt parts.Signature
NewDisplay(name, units)
Parameters: - name (str) – Name of new part
- units (
NXOpen.PartUnits
) – Units of new part
Returns: Newly created part
Return type: New in version NX3.0.0.
License requirements: None.
NewPartCloseResponses¶
-
PartCollection.
NewPartCloseResponses
¶ Constructs a new PartCloseResponses class.
This class is used to communicate whether to close certain parts if they are modified during part close.
Signature
NewPartCloseResponses()
Returns: Return type: NXOpen.PartCloseResponses
New in version NX4.0.0.
License requirements: None.
Open¶
-
PartCollection.
Open
¶ Opens an existing .prt part, but does not set it to be the active display part.
See
OpenDisplay()
.**Note:</b> This method should only be used to open .prt parts. Use
NXOpen.PartCollection.OpenBase()
to open other types of parts other than .prt parts.Signature
Open(filename)
Parameters: filename (str) – Returns: a tuple Return type: A tuple consisting of (part, loadStatus). part is a NXOpen.Part
. loadStatus is aNXOpen.PartLoadStatus
. Parts that could not be loaded and their associated errors.New in version NX3.0.0.
License requirements: None.
OpenActiveDisplay¶
-
PartCollection.
OpenActiveDisplay
¶ Opens an existing part and sets this part as the active display part.
Depending on the input options this part may be displayed in addition to other, already displayed part. See also See
NXOpen.DisplayPartOption
.Signature
OpenActiveDisplay(filename, displayPartOption)
Parameters: - filename (str) –
- displayPartOption (
NXOpen.DisplayPartOption
) – Controls whether or not the part will replace the existing active display part.
Returns: a tuple
Return type: A tuple consisting of (part, loadStatus). part is a
NXOpen.BasePart
. loadStatus is aNXOpen.PartLoadStatus
. Parts that could not be loaded and their associated errors and warnings.New in version NX12.0.0.
License requirements: None.
OpenBase¶
-
PartCollection.
OpenBase
¶ Opens an existing part, but does not set it to be the active display part.
See
OpenBaseDisplay()
.**Note:</b> This method can also be used to open bookmark files and parts other than .prt parts.
Signature
OpenBase(filename)
Parameters: filename (str) – Returns: a tuple Return type: A tuple consisting of (part, loadStatus). part is a NXOpen.BasePart
. loadStatus is aNXOpen.PartLoadStatus
. Parts that could not be loaded and their associated errors.New in version NX4.0.0.
License requirements: None.
OpenBaseDisplay¶
-
PartCollection.
OpenBaseDisplay
¶ Opens an existing part and sets this part as the active display part.
This is equivalent to
OpenActiveDisplay()
with the optionNXOpen.DisplayPartOption.ReplaceExisting
.This method will load components in the following manner depending on how the
NXOpen.LoadOptions.ComponentsToLoad()
property is set:1) “All Components” (
NXOpen.LoadOptionsLoadComponents.All
) will load all components of the assembly.2) “Last Used Component Set” (
NXOpen.LoadOptionsLoadComponents.LastSet
) will load the components in the last saved component set.3) “No Components” (
NXOpen.LoadOptionsLoadComponents.None
), “Use Last Filter” (NXOpen.LoadOptionsLoadComponents.LastFilter
) or “Specify Filter” (NXOpen.LoadOptionsLoadComponents.SpecifyFilter
) will load none of the components of the assembly.**Note:</b> This method can also be used to open bookmark files and parts other than .prt parts.
**Note:</b> If this method is used in batch mode for a bookmark file which had been created using any of these options:
BasePartBookmarkOption.AllPlusDisplay
BasePartBookmarkOption.ComponentGroupsLoadOptionsPlusDisplay
BasePartBookmarkOption.ComponentGroupsOnlyPlusDisplay
BasePartBookmarkOption.DisplayOnly
the display data in the bookmark file will not be applied to the active display part.Signature
OpenBaseDisplay(filename)
Parameters: filename (str) – Returns: a tuple Return type: A tuple consisting of (part, loadStatus). part is a NXOpen.BasePart
. loadStatus is aNXOpen.PartLoadStatus
. Parts that could not be loaded and their associated errors.New in version NX4.0.0.
License requirements: None.
OpenDisplay¶
-
PartCollection.
OpenDisplay
¶ Opens an existing .prt part and sets this part as the active display part.
**Note:</b> This method should only be used to open .prt parts. Use
NXOpen.PartCollection.OpenBaseDisplay()
to open other types of parts other than .prt parts.This method will load components in the following manner depending on how the
NXOpen.LoadOptions.ComponentsToLoad()
property is set:1) “All Components” (
NXOpen.LoadOptionsLoadComponents.All
) will load all components of the assembly.2) “Last Used Component Set” (
NXOpen.LoadOptionsLoadComponents.LastSet
) will load the components in the last saved component set.3) “No Components” (
NXOpen.LoadOptionsLoadComponents.None
), “Use Last Filter” (NXOpen.LoadOptionsLoadComponents.LastFilter
) or “Specify Filter” (NXOpen.LoadOptionsLoadComponents.SpecifyFilter
) will load none of the components of the assembly.Signature
OpenDisplay(filename)
Parameters: filename (str) – Returns: a tuple Return type: A tuple consisting of (part, loadStatus). part is a NXOpen.Part
. loadStatus is aNXOpen.PartLoadStatus
. Parts that could not be loaded and their associated errors.New in version NX3.0.0.
License requirements: None.
OpenPasswordSafe¶
-
PartCollection.
OpenPasswordSafe
¶ This method is for opening a password safe.
This method should only be used with GC Toolkits.
Signature
OpenPasswordSafe(fileName, password)
Parameters: - fileName (str) –
- password (str) – open password
New in version NX11.0.0.
License requirements: None.
OpenSeedPartBlankTemplate¶
-
PartCollection.
OpenSeedPartBlankTemplate
¶ Open unpopulated dataset with blank template
Signature
OpenSeedPartBlankTemplate(filename, addMaster)
Parameters: - filename (str) – Name of the part
- addMaster (bool) – whether to add master as component
New in version NX6.0.0.
License requirements: None.
RemovePartClosedHandler¶
-
PartCollection.
RemovePartClosedHandler
¶ Unregisters a user defined method that is called whenever a part is in the process of being closed
Signature
RemovePartClosedHandler(id)
Parameters: id (int) – identifier for method to unregister New in version NX6.0.0.
License requirements: None.
RemovePartCreatedHandler¶
-
PartCollection.
RemovePartCreatedHandler
¶ Unregisters a user defined method that is called whenever a new part is created
Signature
RemovePartCreatedHandler(id)
Parameters: id (int) – identifier for method to unregister New in version NX6.0.0.
License requirements: None.
RemovePartModifiedHandler¶
-
PartCollection.
RemovePartModifiedHandler
¶ Unregisters a user defined method that is called whenever a part is modified
Signature
RemovePartModifiedHandler(id)
Parameters: id (int) – identifier for method to unregister New in version NX6.0.0.
License requirements: None.
RemovePartOpenedHandler¶
-
PartCollection.
RemovePartOpenedHandler
¶ Unregisters a user defined method that is called whenever a part is opened
Signature
RemovePartOpenedHandler(id)
Parameters: id (int) – identifier for method to unregister New in version NX6.0.0.
License requirements: None.
RemovePartRenamedHandler¶
-
PartCollection.
RemovePartRenamedHandler
¶ Unregisters a user defined method that is called whenever a part is renamed
Signature
RemovePartRenamedHandler(id)
Parameters: id (int) – identifier for method to unregister New in version NX6.0.0.
License requirements: None.
RemovePartSavedAsHandler¶
-
PartCollection.
RemovePartSavedAsHandler
¶ Unregisters a user defined method that is called whenever a part is saved as a specified name
Signature
RemovePartSavedAsHandler(id)
Parameters: id (int) – identifier for method to unregister New in version NX6.0.0.
License requirements: None.
RemovePartSavedHandler¶
-
PartCollection.
RemovePartSavedHandler
¶ Unregisters a user defined method that is called whenever a part is saved
Signature
RemovePartSavedHandler(id)
Parameters: id (int) – identifier for method to unregister New in version NX6.0.0.
License requirements: None.
RemovePassword¶
-
PartCollection.
RemovePassword
¶ Overloaded method RemovePassword
RemovePassword(part)
RemovePassword(part, partoption)
-------------------------------------
Remove password of the part. This method should only be used with GC Toolkits.
Signature
RemovePassword(part)
Parameters: part ( NXOpen.Part
) –New in version NX8.5.0.
Deprecated since version NX11.0.0: Use overloaded RemovePassword instead.
License requirements: None.
-------------------------------------
This method is for deleting security on part(s). This method should only be used with GC Toolkits.
Signature
RemovePassword(part, partoption)
Parameters: - part (
NXOpen.Part
) – - partoption (
NXOpen.PartCollectionSetProtectionOn
) – parts on which security is to be removed.
New in version NX11.0.0.
License requirements: None.
-------------------------------------
RemoveWorkPartChangedHandler¶
-
PartCollection.
RemoveWorkPartChangedHandler
¶ Unregisters a method that is called whenever the work part changes.
Signature
RemoveWorkPartChangedHandler(id)
Parameters: id (int) – identifier for method to unregister New in version NX6.0.0.
License requirements: None.
ReopenAll¶
-
PartCollection.
ReopenAll
¶ Reopens all modified parts in the session.
Signature
ReopenAll(closeModified, responses)
Parameters: - closeModified (
NXOpen.BasePartCloseModified
) – Behavior of close if component parts are modified. - responses (
NXOpen.PartCloseResponses
) – Class representing list of parts to close or leave open if modified. Only used if closed_modified is set toNXOpen.BasePartCloseModified.UseResponses
. IfNXOpen.BasePartCloseModified.UseResponses
is set, then any parts that are candidates for being closed that are not in this list will be closed whether modified or not. SeeNXOpen.PartCloseResponses
for how to add responses to this class.
Returns: Report
containing results of reopen command :rtype:
NXOpen.PartReopenReport
New in version NX4.0.0.
License requirements: None.
- closeModified (
SaveAll¶
-
PartCollection.
SaveAll
¶ Saves all modified parts in a session.
Signature
SaveAll()
Returns: a tuple Return type: A tuple consisting of (anyPartsModified, saveStatus). anyPartsModified is a bool. Indicates whether any parts in the session were actually modified before the save operation was called. If false, then no parts were modified and, thus, a save was not attempted on any of the parts. saveStatus is a NXOpen.PartSaveStatus
. Parts that could not be saved and their associated errors.New in version NX3.0.0.
License requirements: None.
SetActiveDisplay¶
-
PartCollection.
SetActiveDisplay
¶ Sets the active display part.
Depending on the input options this part may be displayed in addition to other, already displayed part. See also See
NXOpen.DisplayPartOption
.Signature
SetActiveDisplay(part, displayPartOption, workPartOption)
Parameters: - part (
NXOpen.BasePart
) – The new displayed part - displayPartOption (
NXOpen.DisplayPartOption
) – Controls whether or not the part will replace the existing active display part. - workPartOption (
NXOpen.PartDisplayPartWorkPartOption
) – Controls what the work part will be in the new active display part.
Returns: a tuple
Return type: A tuple consisting of (status, loadStatus). status is a
NXOpen.PartCollectionSdpsStatus
. Returns OK if the work part could be maintained, or a status code indicating the reason loadStatus is aNXOpen.PartLoadStatus
. Any errors and warnings found when loading the new display part.New in version NX12.0.0.
License requirements: None.
- part (
SetAllowMultipleDisplayedParts¶
-
PartCollection.
SetAllowMultipleDisplayedParts
¶ Sets the option indicating if more than one displayed part is allowed in this session.
When the value is changed to false all inactive displayed parts will be undisplayed and only the active part, if any, is left visible. Any future operations that change active display part will not cause multiple parts to be displayed at the same time. Instead, the contents of the single active graphics window will be replaced with the new displayed part. See also
NXOpen.PartCollection.SetActiveDisplay()
. Queries toNXOpen.PartCollection.AllowMultipleDisplayedParts()
will returnNXOpen.PartCollectionMultipleDisplayedPartStatus.DisabledByCustomer
.When the value is changed to true, NX will allow multiple displayed parts. This will not restore any previously removed inactive windows.
This option will rollback on undo.
Signature
SetAllowMultipleDisplayedParts(additionalPartsDisplayed)
Parameters: additionalPartsDisplayed (bool) – New in version NX12.0.0.
License requirements: None.
SetDisplay¶
-
PartCollection.
SetDisplay
¶ Sets the active display part.
This is equivalent to
NXOpen.PartCollection.SetActiveDisplay()
with the optionNXOpen.DisplayPartOption.ReplaceExisting
.Signature
SetDisplay(part, maintainWorkPart, setEntirePart)
Parameters: - part (
NXOpen.BasePart
) – The new active display part - maintainWorkPart (bool) – If true, and if the current work part is a component of the new active display part, then the work part remains unchanged. Otherwise the work part is set to the new active display part.
- setEntirePart (bool) – If true, and if maintain_work_part is true, the reference set of the work_component will be set to “Entire Part”. If false, it will be left unchanged. See
NXOpen.Assemblies.ComponentAssembly.ReplaceReferenceSet()
Returns: a tuple
Return type: A tuple consisting of (status, loadStatus). status is a
NXOpen.PartCollectionSdpsStatus
. Returns OK if the work part could be set as requested, or a status code indicating the reason why this was not possible. loadStatus is aNXOpen.PartLoadStatus
. Any errors and warnings found when loading the new display part.New in version NX3.0.0.
License requirements: None.
- part (
SetMirrorPartType¶
-
PartCollection.
SetMirrorPartType
¶ Set the type of linked mirrored part
Signature
SetMirrorPartType(part, mirrorOption)
Parameters: - part (
NXOpen.Part
) – input part - mirrorOption (
NXOpen.LinkedMirrorPartBuilderMirrorPartTypeOption
) –
New in version NX8.5.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
- part (
SetNonmasterSeedPartData¶
-
PartCollection.
SetNonmasterSeedPartData
¶ Set non master seed part data for opening unpopulated non master part
Signature
SetNonmasterSeedPartData(filename)
Parameters: filename (str) – Name of the part New in version NX6.0.0.
License requirements: None.
SetOpenPassword¶
-
PartCollection.
SetOpenPassword
¶ Input password for opening the part.
Signature
SetOpenPassword(fileName, password)
Parameters: - fileName (str) –
- password (str) – open password
New in version NX8.5.0.
License requirements: None.
SetPassword¶
-
PartCollection.
SetPassword
¶ Overloaded method SetPassword
SetPassword(part, uAdminPassword, uReadPassword, uWritePassword, uFullControlPassword)
SetPassword(part, adminPassword, readPassword, writePassword, fullControlPassword, partoption)
-------------------------------------
Set password to the part. This method should only be used with GC Toolkits.
Signature
SetPassword(part, uAdminPassword, uReadPassword, uWritePassword, uFullControlPassword)
Parameters: - part (
NXOpen.Part
) – - uAdminPassword (str) – admin password
- uReadPassword (str) – read password
- uWritePassword (str) – write password
- uFullControlPassword (str) – full control password
New in version NX8.5.0.
Deprecated since version NX11.0.0: Use overloaded SetPassword instead.
License requirements: None.
-------------------------------------
This method is for setting a new password for a part. Once a password is set the part can not be recovered if the original password is lost or forgotten. Store the password in a safe and secure location. This method should only be used with GC Toolkits.
Signature
SetPassword(part, adminPassword, readPassword, writePassword, fullControlPassword, partoption)
Parameters: - part (
NXOpen.Part
) – - adminPassword (str) – admin password
- readPassword (str) – read password
- writePassword (str) – write password
- fullControlPassword (str) – full control password
- partoption (
NXOpen.PartCollectionSetProtectionOn
) – parts on which security is to be added.
New in version NX11.0.0.
License requirements: None.
-------------------------------------
SetSeedPartTemplateData¶
-
PartCollection.
SetSeedPartTemplateData
¶ Specify template data to open seed part or empty item revision
Signature
SetSeedPartTemplateData(filename, templateName, addMaster)
Parameters: - filename (str) – Name of the part
- templateName (str) – Name of the template
- addMaster (bool) – Whether master should be added as child
New in version NX6.0.0.
License requirements: None.
SetWork¶
-
PartCollection.
SetWork
¶ Sets the current work part in the active display part.
The work component will be set to one of the visible components that represent this part in the currently active display part. See
SetWorkComponent()
. If no visible component is available, then an exception is thrown.Signature
SetWork(part)
Parameters: part ( NXOpen.BasePart
) – The new work part.New in version NX3.0.0.
License requirements: None.
SetWorkComponent¶
-
PartCollection.
SetWorkComponent
¶ Overloaded method SetWorkComponent
SetWorkComponent(workComponent)
SetWorkComponent(workComponent, refsetOption, visibility)
-------------------------------------
Sets the work component in the currently active display part. If the part represented by the new work component is not already the work part, then sets the work part appropriately. The new component’s reference set will be set to “Entire Part”.
Note that if the given work component is not visible, but an alternative component which represents the same part is visible, then the alternative component will be chosen as the new work component. If no visible component can be found, an exception is thrown
Signature
SetWorkComponent(workComponent)
Parameters: workComponent ( NXOpen.Assemblies.Component
) – The new work component. This must be a component defined in theNXOpen.Assemblies.ComponentAssembly
of the active display part. May be Assemblies.Component.NULL, in which case the work part is reset to the active display part.Returns: Any errors found when loading the new work part. Return type: NXOpen.PartLoadStatus
New in version NX3.0.0.
License requirements: None.
-------------------------------------
Sets the work component in the active display part. If the part represented by the new work component is not already the work part, then sets the work part appropriately.
Signature
SetWorkComponent(workComponent, refsetOption, visibility)
Parameters: - workComponent (
NXOpen.Assemblies.Component
) – The new work component. This must be a component defined in theNXOpen.Assemblies.ComponentAssembly
of the active display part. May be Assemblies.Component.NULL, in which case the work part is reset to the active display part. - refsetOption (
NXOpen.PartCollectionRefsetOption
) – Controls the reference set of the new component. - visibility (
NXOpen.PartCollectionWorkComponentOption
) – Controls the behavior if the new component is not visible
Returns: Any errors found when loading the new work part.
Return type: New in version NX3.0.0.
License requirements: None.
-------------------------------------
SetWorkComponentOverride¶
-
PartCollection.
SetWorkComponentOverride
¶ Sets the component with override part as the work component in the active display part.
Error is raised, if component doesn’t have override part.
Signature
SetWorkComponentOverride(workComponent)
Parameters: workComponent ( NXOpen.Assemblies.Component
) – The new work component. This must be a component defined in theNXOpen.Assemblies.ComponentAssembly
of the active display part.Returns: Any errors found when loading the new work part. Return type: NXOpen.PartLoadStatus
New in version NX10.0.0.
License requirements: None.
SolveAllPostponedConstraints¶
-
PartCollection.
SolveAllPostponedConstraints
¶ Solves all the constraints, that have been postponed in their arrangement, in every loaded part in the session.
This could lead to updating the model if required.
Signature
SolveAllPostponedConstraints()
New in version NX9.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)