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.

Phase Class

The Phase class defines a model object phase.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.ModelPhase

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

The Phase type exposes the following members.

Constructors
  NameDescription
Public methodPhase
Instantiates a new phase with the phase number 0.
Public methodPhase(Int32)
Instantiates a new phase with the given phase number.
Public methodPhase(Int32, String, String, Int32)
Instantiates a new phase with the given parameters.
Top
Properties
  NameDescription
Public propertyIsCurrentPhase
The value is 1 if the phase is the current phase, 0 otherwise.
Public propertyPhaseComment
The phase comment.
Public propertyPhaseName
The phase name.
Public propertyPhaseNumber
The phase number.
Top
Methods
  NameDescription
Public methodDelete
Deletes a phase. The current phase cannot be deleted.
Public methodGetUserProperty(String, Double)
Retrieves a double property for the phase.
Public methodGetUserProperty(String, Int32)
Retrieves an integer property for the phase.
Public methodGetUserProperty(String, String)
Retrieves a string property for the phase.
Public methodInsert
Creates a new phase.
Public methodModify
Modifies a phase.
Public methodSelect
Selects a phase.
Public methodSetUserProperty(String, Double)
Sets a double property for the phase.
Public methodSetUserProperty(String, Int32)
Sets an integer property for the phase.
Public methodSetUserProperty(String, String)
Sets a string property for the phase.
Top
Examples
using Tekla.Structures.Model;
using Tekla.Structures.Geometry3d;
using System;

public class Example
{
       public void Example1()
       {
           Point Point1 = new Point(4000, 4000, 0);
           Point Point2 = new Point(7000, 4000, 0);
           Point Point3 = new Point(4000, 6000, 0);
           Point Point4 = new Point(7000, 6000, 0);
           Beam Beam1 = new Beam(Point1, Point2);
           Beam Beam2 = new Beam(Point3, Point4);
           Beam1.Profile.ProfileString = "HEA400";
           Beam1.Finish = "PAINT";
           Beam2.Profile.ProfileString = "HEA400";
           Beam2.Finish = "PAINT";
           Beam1.Insert();
           Beam2.Insert();
           Phase Beam1Phase = new Phase();
           Beam1.GetPhase(out Beam1Phase);
           int PhaseNumber = Beam1Phase.PhaseNumber;
           string PhaseName = Beam1Phase.PhaseName;
           string PhaseComment = Beam1Phase.PhaseComment;
           Phase Beam2Phase = new Phase();
           Beam2.GetPhase(out Beam2Phase);
           if(Beam1Phase.PhaseNumber != Beam2Phase.PhaseNumber)
           {
               if(Convert.ToBoolean(Beam1Phase.IsCurrentPhase))
                   Beam2.SetPhase(Beam1Phase);
               else
                   Beam1.SetPhase(Beam2Phase);
           }
       }
}
See Also