FileNew Class

class NXOpen.FileNew

Bases: NXOpen.Builder

Represents a NXOpen.FileNew

This class is not directly created. The creator of the super class does the real work

New in version NX5.0.0.

Properties

Property Description
Application Returns or sets the application type for the new file being created
ApplicationName Returns or sets the application type for the new file being created Use NXOpen.FileNew.GetApplicationNames() to get valid application names.
DesignElementState Returns or sets the state for the new design element.
DesignElementType Returns or sets the design element type for the new design element.
DisplayPartOption Returns or sets the display part option.
ItemType Returns or sets the item type for the new file.
MakeDisplayedPart Returns or sets the property that controls if the new file should be made the displayed part
MasterFileName Returns or sets the name of the master model part to be referenced.
NewFileName Returns or sets the name of the new file being created
RelationType Returns or sets the relation type of the underlying template which is used for the new file being created.
Specialization Returns or sets the specialization for the new file
Tag Returns the Tag for this object.
TemplateFileName Returns or sets the name of the template part from which to create the new file
TemplatePresentationName Returns or sets the presentation name of the underlying template which is used for the new file being created
TemplateType Returns or sets the template type for the new file being created
Units Returns or sets the units for the new file being created
UseBlankTemplate Returns or sets the property that controls if the new file should be created using a blank template.
UsesMasterModel Returns or sets the uses master model flag of the underlying template which is used for the new file being created.

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.
GetAddMasterFlag Returns logical value to indicate whether master to be added as child component
GetApplicationNames Returns all registered application names.
GetAvailableTemplates Returns the available templates for the session
GetCanCreateAltrep Gets the flag specifying if the current template customization allows Alternate representation creation using the template
GetCommittedObjects For builders that create more than one object, this method returns the objects that are created by commit.
GetObject Returns the object currently being edited by this builder.
SetAddMasterFlag Sets addMaster flag
SetCanCreateAltrep Sets the flag specifying if the current template customization allows Alternate representation creation using the template
SetPartOperationCreateBuilder Sets NXOpen.PDM.PartOperationBuilder
SetProjectsData Teamcenter projects data
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

Application

FileNew.Application

Returns or sets the application type for the new file being created

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

Getter Method

Signature Application

Returns:
Return type:NXOpen.FileNewApplication

New in version NX5.0.0.

Deprecated since version NX9.0.0: Use NXOpen.FileNew.ApplicationName() that takes a string name instead.

License requirements: None.

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

Setter Method

Signature Application

Parameters:application (NXOpen.FileNewApplication) –

New in version NX5.0.0.

Deprecated since version NX9.0.0: Use NXOpen.FileNew.ApplicationName() that takes a string name instead.

License requirements: None.

ApplicationName

FileNew.ApplicationName

Returns or sets the application type for the new file being created Use NXOpen.FileNew.GetApplicationNames() to get valid application names.

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

Getter Method

Signature ApplicationName

Returns:
Return type:str

New in version NX5.0.0.

License requirements: None.

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

Setter Method

Signature ApplicationName

Parameters:application (str) –

New in version NX5.0.0.

License requirements: None.

DesignElementState

FileNew.DesignElementState

Returns or sets the state for the new design element.

It can be a comma separated string in case the underlying template supports multiple design element states

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

Getter Method

Signature DesignElementState

Returns:
Return type:str

New in version NX8.5.0.

License requirements: None.

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

Setter Method

Signature DesignElementState

Parameters:deState (str) –

New in version NX8.5.0.

License requirements: None.

DesignElementType

FileNew.DesignElementType

Returns or sets the design element type for the new design element.

It can be a comma separated string in case the underlying template supports multiple design element types

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

Getter Method

Signature DesignElementType

Returns:
Return type:str

New in version NX8.5.0.

License requirements: None.

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

Setter Method

Signature DesignElementType

Parameters:deType (str) –

New in version NX8.5.0.

License requirements: None.

DisplayPartOption

FileNew.DisplayPartOption

Returns or sets the display part option.

See NXOpen.DisplayPartOption.

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

Getter Method

Signature DisplayPartOption

Returns:
Return type:NXOpen.DisplayPartOption

New in version NX12.0.0.

License requirements: None.

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

Setter Method

Signature DisplayPartOption

Parameters:displayPartOption (NXOpen.DisplayPartOption) –

New in version NX12.0.0.

License requirements: None.

ItemType

FileNew.ItemType

Returns or sets the item type for the new file.

It can be a comma separated string in case the underlying template supports multiple item types

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

Getter Method

Signature ItemType

Returns:
Return type:str

New in version NX8.5.0.

License requirements: None.

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

Setter Method

Signature ItemType

Parameters:itemType (str) –

New in version NX8.5.0.

License requirements: None.

MakeDisplayedPart

FileNew.MakeDisplayedPart

Returns or sets the property that controls if the new file should be made the displayed part

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

Getter Method

Signature MakeDisplayedPart

Returns:
Return type:bool

New in version NX5.0.0.

License requirements: None.

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

Setter Method

Signature MakeDisplayedPart

Parameters:makeDisplayedPart (bool) –

New in version NX5.0.0.

License requirements: None.

MasterFileName

FileNew.MasterFileName

Returns or sets the name of the master model part to be referenced.

May be NULL if creating a master part

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

Getter Method

Signature MasterFileName

Returns:
Return type:str

New in version NX5.0.0.

License requirements: None.

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

Setter Method

Signature MasterFileName

Parameters:masterFileName (str) –

New in version NX5.0.0.

License requirements: None.

NewFileName

FileNew.NewFileName

Returns or sets the name of the new file being created

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

Getter Method

Signature NewFileName

Returns:
Return type:str

New in version NX5.0.0.

License requirements: None.

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

Setter Method

Signature NewFileName

Parameters:fileName (str) –

New in version NX5.0.0.

License requirements: None.

RelationType

FileNew.RelationType

Returns or sets the relation type of the underlying template which is used for the new file being created.

If set to ‘Specification’, this means non-master template is used for part creation and it will require NXOpen.FileNew.UsesMasterModel() to be set to ‘Yes’

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

Getter Method

Signature RelationType

Returns:
Return type:str

New in version NX8.5.3.

License requirements: None.

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

Setter Method

Signature RelationType

Parameters:relationType (str) –

New in version NX8.5.3.

License requirements: None.

Specialization

FileNew.Specialization

Returns or sets the specialization for the new file

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

Getter Method

Signature Specialization

Returns:
Return type:str

New in version NX8.5.0.

License requirements: None.

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

Setter Method

Signature Specialization

Parameters:specialization (str) –

New in version NX8.5.0.

License requirements: None.

TemplateFileName

FileNew.TemplateFileName

Returns or sets the name of the template part from which to create the new file

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

Getter Method

Signature TemplateFileName

Returns:
Return type:str

New in version NX5.0.0.

License requirements: None.

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

Setter Method

Signature TemplateFileName

Parameters:templateFileName (str) –

New in version NX5.0.0.

License requirements: None.

TemplatePresentationName

FileNew.TemplatePresentationName

Returns or sets the presentation name of the underlying template which is used for the new file being created

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

Getter Method

Signature TemplatePresentationName

Returns:
Return type:str

New in version NX8.5.0.

License requirements: None.

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

Setter Method

Signature TemplatePresentationName

Parameters:presentationName (str) –

New in version NX8.5.0.

License requirements: None.

TemplateType

FileNew.TemplateType

Returns or sets the template type for the new file being created

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

Getter Method

Signature TemplateType

Returns:
Return type:NXOpen.FileNewTemplateType

New in version NX8.0.0.

License requirements: None.

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

Setter Method

Signature TemplateType

Parameters:templateType (NXOpen.FileNewTemplateType) –

New in version NX8.0.0.

License requirements: None.

Units

FileNew.Units

Returns or sets the units for the new file being created

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

Getter Method

Signature Units

Returns:
Return type:NXOpen.PartUnits

New in version NX5.0.0.

License requirements: None.

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

Setter Method

Signature Units

Parameters:units (NXOpen.PartUnits) –

New in version NX5.0.0.

License requirements: None.

UseBlankTemplate

FileNew.UseBlankTemplate

Returns or sets the property that controls if the new file should be created using a blank template.

If set to False, then a valid file name for an existing template part file must be supplied to NXOpen.FileNew.TemplateFileName(). If set to True, this means that no template is used during creation.

Note: This property should be set to True only while creating traditional items with template type set as FileNewTemplateType.Item

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

Getter Method

Signature UseBlankTemplate

Returns:
Return type:bool

New in version NX5.0.0.

License requirements: None.

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

Setter Method

Signature UseBlankTemplate

Parameters:useBlankTemplate (bool) –

New in version NX5.0.0.

License requirements: None.

UsesMasterModel

FileNew.UsesMasterModel

Returns or sets the uses master model flag of the underlying template which is used for the new file being created.

If set to ‘No’, this means that master template is used for part creation. If set to ‘Yes’, this means non-master template is used and it will require master model part to be specified for part creation

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

Getter Method

Signature UsesMasterModel

Returns:
Return type:str

New in version NX8.5.3.

License requirements: None.

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

Setter Method

Signature UsesMasterModel

Parameters:usesMasterModel (str) –

New in version NX8.5.3.

License requirements: None.

Method Detail

GetAddMasterFlag

FileNew.GetAddMasterFlag

Returns logical value to indicate whether master to be added as child component

Signature GetAddMasterFlag()

Returns:whether master to be added as child component
Return type:bool

New in version NX6.0.0.

Deprecated since version NX10.0.0: Use NXOpen.PDM.PartOperationCreateBuilder.GetAddMaster() to get addMaster flag.

License requirements: None.

GetApplicationNames

FileNew.GetApplicationNames

Returns all registered application names.

These name should be used while setting the application name in ApplicationName().

Signature GetApplicationNames()

Returns:All registered application names
Return type:list of str

New in version NX9.0.0.

License requirements: None.

GetAvailableTemplates

FileNew.GetAvailableTemplates

Returns the available templates for the session

Signature GetAvailableTemplates()

Returns:array of available template names
Return type:list of str

New in version NX6.0.0.

License requirements: None.

GetCanCreateAltrep

FileNew.GetCanCreateAltrep

Gets the flag specifying if the current template customization allows Alternate representation creation using the template

Signature GetCanCreateAltrep()

Returns:
Return type:bool

New in version NX10.0.0.

License requirements: None.

SetAddMasterFlag

FileNew.SetAddMasterFlag

Sets addMaster flag

Signature SetAddMasterFlag(addMaster)

Parameters:addMaster (bool) – whether master to be added as child component

New in version NX6.0.0.

Deprecated since version NX10.0.0: Use NXOpen.PDM.PartOperationCreateBuilder.SetAddMaster() to set addMaster flag.

License requirements: None.

SetCanCreateAltrep

FileNew.SetCanCreateAltrep

Sets the flag specifying if the current template customization allows Alternate representation creation using the template

Signature SetCanCreateAltrep(createAltrep)

Parameters:createAltrep (bool) –

New in version NX10.0.0.

License requirements: None.

SetPartOperationCreateBuilder

FileNew.SetPartOperationCreateBuilder

Sets NXOpen.PDM.PartOperationBuilder

Signature SetPartOperationCreateBuilder(partOperationBuilder)

Parameters:partOperationBuilder (NXOpen.PDM.PartOperationBuilder) –

New in version NX10.0.0.

License requirements: None.

SetProjectsData

FileNew.SetProjectsData

Teamcenter projects data

Signature SetProjectsData(projectName, assignmentState)

Parameters:
  • projectName (list of str) – name of the project
  • assignmentState (list of int) – assignment state

New in version NX6.0.0.

Deprecated since version NX10.0.0: Use NXOpen.Session.AssignRemoveProjects() to assign/remove projects.

License requirements: None.

Validate

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