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.

ModelObjectVisualization Class

The class to set and clear temporary visualization (color and transparency) for model objects in view. Permananet representation will be restored when view is redrawed or temporary visualization is cleared. Can be used also to fetch current permanent representation of model object.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.Model.UIModelObjectVisualization

Namespace:  Tekla.Structures.Model.UI
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2018.1.0.0 (2018.1.0.0)
Syntax
[SerializableAttribute]
public static class ModelObjectVisualization

The ModelObjectVisualization type exposes the following members.

Methods
  Name Description
Public methodStatic member ClearAllTemporaryStates
Clears temporary visualization from all model objects and restores permanent representation.
Public methodStatic member GetRepresentation
Gets current permanent representation (red, blue, green and transparency) of given model object
Public methodStatic member SetTemporaryState(ListIdentifier, Color)
Sets visualization temporary state (red, blue, green and transparency) for given model object identifiers
Public methodStatic member SetTemporaryState(ListModelObject, Color)
Sets visualization temporary state (red, blue, green and transparency) for given model objects
Public methodStatic member SetTemporaryStateForAll
Sets temporary visualization state (red, blue, green and transparency) for all model objects
Public methodStatic member SetTransparency(ListIdentifier, TemporaryTransparency)
Restores permanent representation settings and sets temporary transparency for given model object identifiers
Public methodStatic member SetTransparency(ListModelObject, TemporaryTransparency)
Restores permanent representation settings and sets temporary transparency for given model objects
Public methodStatic member SetTransparencyForAll
Restores permanent representation settings and sets temporary transparency for all model objects
Top
Examples
using Tekla.Structures.Model;
using Tekla.Structures.Geometry3d;
using System.Collections;

public class Example
{
       public void Example1()
       {
           Model model = new Model();

           Beam b = new Beam(new Point(0,0,0), new Point(0,0,6000));
           Beam b1 = new Beam(new Point(0,1000,0), new Point(0,1000,6000));
           Beam b2 = new Beam(new Point(0,2000,0), new Point(0,2000,6000));
           b.Material.MaterialString = b1.Material.MaterialString = b2.Material.MaterialString = "Steel_Undefined";
           b.Profile.ProfileString = b1.Profile.ProfileString = b2.Profile.ProfileString = "PL10*1000";

           b.Insert();
           b1.Insert();
           b2.Insert();

           model.CommitChanges();

           var blueObjects = new List<ModelObject> { b , b2 };

           var redObjects = new List<ModelObject> { b1 };

           ModelObjectVisualization.SetTransparencyForAll(TemporaryTransparency.HIDDEN); 
           ModelObjectVisualization.SetState(blueObjects, new TSM.UI.Color(0.0, 0.0, 1.0));
           ModelObjectVisualization.SetState(redObjects, new TSM.UI.Color(1.0, 0.0, 0.0));

       }
}
See Also