OperationCreateNCFilesByPartId Method

Creates NC files from the selected parts using the given NC template name.

See Tekla Structures Help for more information about NC files.

Namespace:  Tekla.Structures.Model.Operations
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2023.0.3
public static bool CreateNCFilesByPartId(
	string NCFileSettings,
	string DestinationFolder,
	Identifier PartID,
	out string DstvOutput,
	bool CreatePopMarks = false,
	string PopMarkSettingsFileName = "",
	bool CreateContourMarking = false,
	string ContourMarkingSettingsFileName = ""


Type: SystemString
The name of the NC setting template to be used in creation.
Type: SystemString
The name of the folder where NC files are created. If defined, overrides the default folder in the setting template.
Type: Tekla.StructuresIdentifier
The identifier of the part.
Type: SystemString
The DSTV output as string.
CreatePopMarks (Optional)
Type: SystemBoolean
Create pop-marks during export.
PopMarkSettingsFileName (Optional)
Type: SystemString
The name of the pop-mark setting file to be used in creation.
CreateContourMarking (Optional)
Type: SystemBoolean
Create contour marking during export.
ContourMarkingSettingsFileName (Optional)
Type: SystemString
The name of the contour marking setting file to be used in creation.

Return Value

Type: Boolean
True if the NC files are created, false if the numbering is not up-to-date or the used configuration is wrong.
ArgumentExceptionThrown when the NCFileSettings is not defined.
ArgumentNullExceptionThrown when the NCFileSettings is null.
using Tekla.Structures.Model;
using Tekla.Structures.Model.Operations;
using Tekla.Structures.Model.UI;

using System.Collections;
using System.Windows.Forms;

public class Example
       public void Example1()
           Picker Picker = new Picker();

               Beam Beam1 = Picker.PickObject(Picker.PickObjectEnum.PICK_ONE_PART, "Pick object to Create NC for") as Beam;

               Identifier BeamId = Beam1.Identifier;

               string DstvOutput;
               if (Operation.CreateNCFilesByPartId("DSTV for profiles", "", BeamId, out DstvOutput, true, "standard", true, "standard"))
                   MessageBox.Show("NC creation successful");
                   //DstvOutput will contain all the info from exported dstv file
           catch { }
See Also
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.