Tekla Open API

Detailed and full API reference helps you master Tekla Open API

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: 2018.1.0.0 (2018.1.0.0)
Syntax
[SerializableAttribute]
public sealed class Phase

The Phase type exposes the following members.

Constructors
  Name Description
Public method Phase
Instantiates a new phase with the phase number 0.
Public method Phase(Int32)
Instantiates a new phase with the given phase number.
Public method Phase(Int32, String, String, Int32)
Instantiates a new phase with the given parameters.
Top
Properties
  Name Description
Public property IsCurrentPhase
The value is 1 if the phase is the current phase, 0 otherwise.
Public property PhaseComment
The phase comment.
Public property PhaseName
The phase name.
Public property PhaseNumber
The phase number.
Top
Methods
  Name Description
Public method Delete
Deletes a phase. The current phase cannot be deleted.
Public method GetUserProperty(String, Double)
Retrieves a double property for the phase.
Public method GetUserProperty(String, Int32)
Retrieves an integer property for the phase.
Public method GetUserProperty(String, String)
Retrieves a string property for the phase.
Public method Insert
Creates a new phase.
Public method Modify
Modifies a phase.
Public method Select
Selects a phase.
Public method SetUserProperty(String, Double)
Sets a double property for the phase.
Public method SetUserProperty(String, Int32)
Sets an integer property for the phase.
Public method SetUserProperty(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