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.

Assembly Class

The Assembly class defines a single manufacturing unit: objects that are bolted or welded together in the workshop. An assembly has a main part and secondary assemblables attached to it. The number of secondaries is limited to 2048. Hierarchical assemblies can also have subassemblies attached to them and they can have a parent assembly instance.
Inheritance Hierarchy

Namespace:  Tekla.Structures.Model
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2023.0.1
Syntax
[SerializableAttribute]
public sealed class Assembly : ModelObject

The Assembly type exposes the following members.

Constructors
  NameDescription
Public methodAssembly
Creates a new assembly instance.
Top
Properties
  NameDescription
Public propertyAssemblyNumber
Defines the numbering in the assembly sense. If the members are empty and zero, the main part attributes are used.
Public propertyIdentifier
The identifier of the object.
(Inherited from Object.)
Public propertyIsUpToDate
Gets if the object does not have a modification which is not shared.
(Inherited from ModelObject.)
Public propertyModificationTime
Gets latest time of the object was modified or created.
(Inherited from ModelObject.)
Public propertyName
The name of the assembly.
Top
Methods
  NameDescription
Public methodAdd(ArrayList)
Adds an array list of given assemblable instances to the assembly. For assemblies use Add(Assembly Assembly). Notice that adding other than assembly instances will actually assume that you are adding objects to a cast unit assembly.
Public methodAdd(Assembly)
Adds a new subassembly for the assembly instance.
Public methodAdd(IAssemblable)
Adds the given assemblable instance to the assembly. Notice that adding other than assembly instances will assume that you are adding objects to a cast unit assembly.
Public methodCompareTo(Object)
Compares Identifiers of model objects.
(Inherited from ModelObject.)
Public methodCompareTo(Assembly)
Compares the instantiated assembly with another one.
Public methodDelete
Explodes the assembly instance.
(Overrides ModelObjectDelete.)
Public methodDeleteUserDefinedCoordSys
Deletes the assembly's user defined coordinate system, if it has one.
Public methodEquals
Check if Identifiers of model objects are same.
(Inherited from ModelObject.)
Public methodCode exampleGetAllReportProperties
Retrieves all properties for the model object in one hashtable. Type for the returned value must be checked using type casting.
(Inherited from ModelObject.)
Public methodGetAllUserProperties
Retrieves all properties for the model object in one hashtable. Type for the returned value must be checked using type casting.
(Inherited from ModelObject.)
Public methodGetAssembly
Returns the assembly instance the assembly belongs to (null if none).
Public methodGetAssemblyType
Returns the type of the assembly.
Public methodGetChildren
Returns an enumerator of all the children model objects.
(Inherited from ModelObject.)
Public methodGetCoordinateSystem
Returns the coordinate system for the given model object.
(Inherited from ModelObject.)
Public methodGetDoubleReportProperties
Retrieves multiple double report properties for the model object. It is faster to fetch multiple properties at once.
(Inherited from ModelObject.)
Public methodGetDoubleUserProperties
Retrieves all double properties for the model object.
(Inherited from ModelObject.)
Public methodGetDynamicStringProperty
Gets a dynamic string property from the model object.
(Inherited from ModelObject.)
Public methodGetFatherComponent
Returns the father component of the model object.
(Inherited from ModelObject.)
Public methodGetFatherPour
Returns the pour that the assembly is directly associated to.
Public methodGetFatherPourUnit
Returns the pour unit that the bolt group is associated to.
Public methodGetHierarchicObjects
Returns an enumerator of all the connected hierarchic objects.
(Inherited from ModelObject.)
Public methodGetIntegerReportProperties
Retrieves multiple integer report properties for the model object. It is faster to fetch multiple properties at once.
(Inherited from ModelObject.)
Public methodGetIntegerUserProperties
Retrieves all integer properties for the model object.
(Inherited from ModelObject.)
Public methodGetMainObject
Selects and returns the main object of the assembly or null if none.
Public methodGetMainPart
Selects and returns the main part of the assembly or null if none.
Public methodGetPhase
Retrieves the phase of the model object (the phase number, the phase name, the phase comment and whether the phase is the current one or not).
(Inherited from ModelObject.)
Public methodGetReportProperty(String, Double)
Retrieves a double property of the report for the model object.
(Inherited from ModelObject.)
Public methodGetReportProperty(String, Int32)
Retrieves an integer property of the report for the model object.
(Inherited from ModelObject.)
Public methodGetReportProperty(String, String)
Retrieves a string property of the report for the model object.
(Inherited from ModelObject.)
Public methodGetSecondaries
Selects and returns all the secondary assemblables belonging to the assembly. The method replaces the old GetObjects() method. Notice that the number of secondaries is limited to 2048.
Public methodGetStringReportProperties
Retrieves multiple string report properties for the model object. It is faster to fetch multiple properties at once.
(Inherited from ModelObject.)
Public methodGetStringUserProperties
Retrieves all string properties for the model object.
(Inherited from ModelObject.)
Public methodGetSubAssemblies
Selects and returns a list of subassemblies belonging to the assembly.
Public methodGetUserProperty(String, Double)
Retrieves a double property for the model object.
(Inherited from ModelObject.)
Public methodGetUserProperty(String, Int32)
Retrieves an integer property for the model object.
(Inherited from ModelObject.)
Public methodGetUserProperty(String, String)
Retrieves a string property for the model object.
(Inherited from ModelObject.)
Public methodHasUserDefinedCoordSys
Returns whether the assembly has a user defined coordinate system.
Public methodInsert
Inserts the Assembly instance in the model. At the moment only rebar assemblies can be inserted. The main object of the assembly must be a Reinforcement or RebarSet. If the main rebar is not set (null), the main rebar will be automatically set to the secondary rebar with the biggest weight.
(Overrides ModelObjectInsert.)
Public methodModify
Modifies the assembly instance in the model.
(Overrides ModelObjectModify.)
Public methodRemove
Removes the given instance from the assembly. Before removing steel parts from an assembly all connecting workshop welds and bolts must be deleted.
Public methodSelect
Selects the assembly instance from the model. The identifier of the instance must be set.
(Overrides ModelObjectSelect.)
Public methodSetDynamicStringProperty
Sets a dynamic string property for the model object.
(Inherited from ModelObject.)
Public methodSetLabel
Sets a label for an object when a new instance is created, this method must be called before Insert. The label is used in plug-ins for identifying the changed object in modification.
(Inherited from ModelObject.)
Public methodSetMainObject
Sets the main object of the assembly.
Public methodSetMainPart
Sets the main part of the assembly.
Public methodSetPhase
Sets the phase of the model object.
(Inherited from ModelObject.)
Public methodSetUserDefinedCoordSys
Set user defined assembly coordinate system. If set, GetCoordinateSystem will return this value.
Public methodSetUserProperties
Sets multiple properties for the model object.
(Inherited from ModelObject.)
Public methodSetUserProperty(String, Double)
Sets a double property for the model object.
(Inherited from ModelObject.)
Public methodSetUserProperty(String, Int32)
Sets an integer property for the model object.
(Inherited from ModelObject.)
Public methodSetUserProperty(String, String)
Sets a string property for the model object.
(Inherited from ModelObject.)
Top
Examples
using Tekla.Structures.Model;
using Tekla.Structures.Geometry3d;
using System;

public class Example
{
       public void Example1()
       {
           Beam beam1 = new Beam(new Point(0,0,0), new Point(1000,0,0));
           Beam beam2 = new Beam(new Point(0,0,0), new Point(0,0,1000));

           beam1.Profile.ProfileString = "380*380";
           beam1.Material.MaterialString = "K40-1";

           beam2.Profile.ProfileString = "380*380";
           beam2.Material.MaterialString = "K40-1";

           beam1.Insert();
           beam2.Insert();

           Assembly assembly = beam1.GetAssembly();
           assembly.Add(beam2);

           if(!assembly.Modify())
               Console.WriteLine("Assembly Modify Failed!");
       }

       public void Example2()
       {
           // Create some rebars.
           var rebarSet = new RebarSet();
           var rebarGroup = new RebarGroup();
           var singleRebar = new SingleRebar();
           // Set rebar properties here (code omitted).
           rebarSet.Insert();
           rebarGroup.Insert();
           singleRebar.Insert();

           // Create a rebar assembly.
           var rebarAssembly = new Assembly();
           rebarAssembly.SetMainObject(rebarSet);
           rebarAssembly.Add(rebarGroup);
           rebarAssembly.Add(singleRebar);
           rebarAssembly.Insert();
       }
}
See Also
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.