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: 2024.0.0+a110b435391768740483e3032720a566518c9a63
Syntax
[SerializableAttribute]
public static class ModelObjectVisualization

The ModelObjectVisualization type exposes the following members.

Methods
  NameDescription
Public methodStatic memberClearAllTemporaryStates
Clears temporary visualization from all model objects and restores permanent representation.
Public methodStatic memberGetRepresentation
Gets current permanent representation (red, blue, green and transparency) of given model object
Public methodStatic memberSetTemporaryState(ListIdentifier, Color)
Sets visualization temporary state (red, blue, green and transparency) for given model object identifiers
Public methodStatic memberSetTemporaryState(ListModelObject, Color)
Sets visualization temporary state (red, blue, green and transparency) for given model objects
Public methodStatic memberSetTemporaryStateForAll
Sets temporary visualization state (red, blue, green and transparency) for all model objects
Public methodStatic memberSetTransparency(ListIdentifier, TemporaryTransparency)
Restores permanent representation settings and sets temporary transparency for given model object identifiers
Public methodStatic memberSetTransparency(ListModelObject, TemporaryTransparency)
Restores permanent representation settings and sets temporary transparency for given model objects
Public methodStatic memberSetTransparencyForAll
Restores permanent representation settings and sets temporary transparency for all model objects
Top
Examples
using Tekla.Structures.Model;
using Tekla.Structures.Model.UI;
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.SetTemporaryState(blueObjects, new TSM.UI.Color(0.0, 0.0, 1.0));
           ModelObjectVisualization.SetTemporaryState(redObjects, new TSM.UI.Color(1.0, 0.0, 0.0));

       }
}
See Also
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.
Previous
Next