ModelObjectVisualization Class |
The class to set and clear temporary visualization (color and transparency) for model objects in view.
Permanent representation will be restored when view is redrawn or temporary visualization is cleared.
Can be used also to fetch current permanent representation of model object.
SystemObject
Tekla.Structures.Model.UIModelObjectVisualization
Tekla.Structures.Model.UIModelObjectVisualization
Namespace: Tekla.Structures.Model.UI
Assembly: Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2025.0.0-alpha00045580+dc02c3918546f1e94eb2d3b13ea99057fb3313e0
The ModelObjectVisualization type exposes the following members.
| Name | Description | |
|---|---|---|
| ClearAllTemporaryStates |
Clears temporary visualization from all model objects and restores permanent representation.
| |
| ClearTemporaryStates |
Clears temporary visualization from model objects and restores permanent representation.
| |
| GetAllTemporaryColored |
Gets all temporary colored objects and their color
| |
| GetRepresentation |
Gets current permanent representation (red, blue, green and transparency) of given model object
| |
| GetTempRepresentation |
Gets the temporary representation (red, blue, green and transparency) of given model object
| |
| SetTemporaryState(ListIdentifier, Color) |
Sets visualization temporary state (red, blue, green and transparency) for given model object identifiers
| |
| SetTemporaryState(ListModelObject, Color) |
Sets visualization temporary state (red, blue, green and transparency) for given model objects
| |
| SetTemporaryStateForAll |
Sets temporary visualization state (red, blue, green and transparency) for all model objects
| |
| SetTransparency(ListIdentifier, TemporaryTransparency) |
Restores permanent representation settings and sets temporary transparency for given model object identifiers
| |
| SetTransparency(ListModelObject, TemporaryTransparency) |
Restores permanent representation settings and sets temporary transparency for given model objects
| |
| SetTransparencyForAll |
Restores permanent representation settings and sets temporary transparency for all model objects
| |
| SetVisibility |
Sets visibility for given model objects.
|
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)); } public void Example2() { Model model = new Model(); Beam b = new Beam(new Point(0,0,0), new Point(0,0,6000)); b.Material.MaterialString = "Steel_Undefined"; b.Profile.ProfileString = "PL10*1000"; b.Insert(); model.CommitChanges(); var blueObjects = new List<ModelObject> { b }; ModelObjectVisualization.SetVisibility(blueObjects, false); // Makes the beam invisible ModelObjectVisualization.SetVisibility(blueObjects, true); // Makes the beam visible ModelObjectVisualization.SetVisibility(blueObjects, null); // Reset to original state ModelObjectVisualization.SetVisibility(null, true); // Sets all objects visible } }