API Reference

Detailed and full API reference helps you master Tekla development

This is the most recent version of Tekla Open API.
For older versions, please visit Tekla Warehouse.

OperationCreateNCFilesFromSelected Method (String, String)

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: 2020.0.0.0 (2020.0.55582.0)
public static bool CreateNCFilesFromSelected(
	string NCFileSettings,
	string DestinationFolder


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.

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.
Exception Condition
ArgumentException Thrown when the NCFileSettings is not defined.
ArgumentNullException Thrown 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;
               ArrayList Parts = new ArrayList();

               Tekla.Structures.Model.UI.ModelObjectSelector MOS = new Tekla.Structures.Model.UI.ModelObjectSelector();

               if (Operation.CreateNCFilesFromSelected("DSTV for profiles", ""))
                   MessageBox.Show("NC creation successful");
               MOS.Select(new ArrayList()); //remove UI selection
           catch { }
See Also