RuntimeNCBuilder Class

class NXOpen.Mechatronics.RuntimeNCBuilder

Bases: NXOpen.Builder

Represents a NXOpen.Mechatronics.RuntimeNCBuilder.

To create a new instance of this class, use NXOpen.Mechatronics.RuntimeNCCollection.CreateRuntimeNcBuilder()

New in version NX9.0.0.

Properties

Property Description
FlagOfUsingContainer Returns or sets the flag which indicates whether to put the MCD connected objects to the specific ‘Runtime NC’ container or not.
FlagOfUsingSpecifiedMCF Returns or sets the flag which indicates whether use the specified MCF or not.
Name Returns or sets the name.
SpecifiedMCF Returns or sets the user specified MCF File.
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.
ExportNCCode This method is used to export current loaded NC Code to disk file.
GetAxesAndMachineEvents This method is used to get the axes that involved the motion of CSE output event, and the machine event (e.
GetCommittedObjects For builders that create more than one object, this method returns the objects that are created by commit.
GetMCDConnection This method is used to get the MCD connected object to the specified axis or machine event
GetObject Returns the object currently being edited by this builder.
LoadNCFile This method is used to load NC file.
RunCSE This method is used to run NC Code via CSE in order to get output events
SetMCDConnection This method is used to set the MCD connected object to the specified axis or machine event
ShowResults Updates the model to reflect the result of an edit to the model for all builders that support showing results.
UpdateNCCode This method is used to update NC code.
Validate Validate whether the inputs to the component are sufficient for commit to be called.

Property Detail

FlagOfUsingContainer

RuntimeNCBuilder.FlagOfUsingContainer

Returns or sets the flag which indicates whether to put the MCD connected objects to the specific ‘Runtime NC’ container or not.

true means put the MCD connected objects to the specific container (creates the container if it is not exist); false means restore the MCD connected objects to the original default folder, and remove the ‘Runtime NC’ container.

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

Getter Method

Signature FlagOfUsingContainer

Returns:
Return type:bool

New in version NX9.0.0.

License requirements: None.

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

Setter Method

Signature FlagOfUsingContainer

Parameters:flagOfUsingContainer (bool) –

New in version NX9.0.0.

License requirements: nx_mcd_core (“MECHATRONICS CONCEPT DESIGNER”)

FlagOfUsingSpecifiedMCF

RuntimeNCBuilder.FlagOfUsingSpecifiedMCF

Returns or sets the flag which indicates whether use the specified MCF or not.

True means use user specified MCF file for running CSE, or use the Standard MCF file in MCD kits.

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

Getter Method

Signature FlagOfUsingSpecifiedMCF

Returns:
Return type:bool

New in version NX9.0.0.

License requirements: None.

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

Setter Method

Signature FlagOfUsingSpecifiedMCF

Parameters:flagOfUsingSpecifiedMCF (bool) –

New in version NX9.0.0.

License requirements: nx_mcd_core (“MECHATRONICS CONCEPT DESIGNER”)

Name

RuntimeNCBuilder.Name

Returns or sets the name.

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

Getter Method

Signature Name

Returns:
Return type:str

New in version NX9.0.0.

License requirements: None.

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

Setter Method

Signature Name

Parameters:name (str) –

New in version NX9.0.0.

License requirements: nx_mcd_core (“MECHATRONICS CONCEPT DESIGNER”)

SpecifiedMCF

RuntimeNCBuilder.SpecifiedMCF

Returns or sets the user specified MCF File.

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

Getter Method

Signature SpecifiedMCF

Returns:
Return type:str

New in version NX9.0.0.

License requirements: None.

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

Setter Method

Signature SpecifiedMCF

Parameters:specifiedMCF (str) –

New in version NX9.0.0.

License requirements: nx_mcd_core (“MECHATRONICS CONCEPT DESIGNER”)

Method Detail

ExportNCCode

RuntimeNCBuilder.ExportNCCode

This method is used to export current loaded NC Code to disk file.

Signature ExportNCCode(ncFile)

Parameters:ncFile (str) –

New in version NX9.0.0.

License requirements: nx_mcd_core (“MECHATRONICS CONCEPT DESIGNER”)

GetAxesAndMachineEvents

RuntimeNCBuilder.GetAxesAndMachineEvents

This method is used to get the axes that involved the motion of CSE output event, and the machine event (e.

g. ToolChange) that fired by CSE. These axes and machine events are used to connect with MCD objects, so in the MCD simulation stage, the CSE will know which MCD runtime object will be driven.

Signature GetAxesAndMachineEvents()

Returns:a tuple
Return type:A tuple consisting of (axisNames, machineEventNames) axisNames is a list of str. The axis names which involved in CSE motion. machineEventNames is a list of str. The name of events fired by CSE.

New in version NX9.0.0.

License requirements: nx_mcd_core (“MECHATRONICS CONCEPT DESIGNER”)

GetMCDConnection

RuntimeNCBuilder.GetMCDConnection

This method is used to get the MCD connected object to the specified axis or machine event

Signature GetMCDConnection(isAxis, axisOrEventName)

Parameters:
  • isAxis (bool) – Flag indicates whether the MCD object is set to connect with axis or machine event.
  • axisOrEventName (str) – Axis or machine event name.
Returns:

MCD connected object.

The object type can be Mechatronics.PositionControl for the motion axis; or Mechatronics.SpeedControl for the spinde axis; or Mechatronics.GanttOperationObject for the machine event. :rtype: NXOpen.TaggedObject

New in version NX9.0.0.

License requirements: nx_mcd_core (“MECHATRONICS CONCEPT DESIGNER”)

LoadNCFile

RuntimeNCBuilder.LoadNCFile

This method is used to load NC file.

Signature LoadNCFile(ncFile)

Parameters:ncFile (str) –

New in version NX9.0.0.

License requirements: nx_mcd_core (“MECHATRONICS CONCEPT DESIGNER”)

RunCSE

RuntimeNCBuilder.RunCSE

This method is used to run NC Code via CSE in order to get output events

Signature RunCSE()

Returns:a tuple
Return type:A tuple consisting of (isRunningOK, errMsg, lineNum, ncLine) isRunningOK is a bool. True means CSE returns succeed result, or failure. errMsg is a str. Error message if CSE return false. lineNum is a int. The NC line number at which CSE failed. ncLine is a str. The NC Code for which CSE failed.

New in version NX9.0.0.

License requirements: nx_mcd_core (“MECHATRONICS CONCEPT DESIGNER”)

SetMCDConnection

RuntimeNCBuilder.SetMCDConnection

This method is used to set the MCD connected object to the specified axis or machine event

Signature SetMCDConnection(isAxis, axisOrEventName, mcdConnectedTag)

Parameters:
  • isAxis (bool) – Flag indicates whether the MCD object is set to connect with axis or machine event.
  • axisOrEventName (str) – Axis or machine event name.
  • mcdConnectedTag (NXOpen.TaggedObject) – MCD connected object. The object type can be Mechatronics.PositionControl for the motion axis; or Mechatronics.SpeedControl for the spinde axis; or Mechatronics.GanttOperationObject for the machine event.

New in version NX9.0.0.

License requirements: nx_mcd_core (“MECHATRONICS CONCEPT DESIGNER”)

UpdateNCCode

RuntimeNCBuilder.UpdateNCCode

This method is used to update NC code.

Signature UpdateNCCode(ncCodeLines)

Parameters:ncCodeLines (list of str) –

New in version NX9.0.0.

License requirements: nx_mcd_core (“MECHATRONICS CONCEPT DESIGNER”)

Validate

RuntimeNCBuilder.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.