To control Tekla model object representation

Good afternoon,

I’m new in Grasshopper but not in Tekla and I’m trying “sell” it to my manager to use it for data manipulation for BIM purposes.

I can use Grasshopper on an existing Tekla model and extract information of UDA, or create new UDAs, but…

Is there a way of changing the object representation according to an specified data? Not changing the class. So any manager can see easily colorised relevant info at that moment on the live Tekla model. More like a colorised 3D report basically.

Thank you in advanced for any idea of how to achieve it.

Luciano

Hi,

In Tekla you can define view filters for some/all objects based on UDA values. It’s a bit cumbersome to set-up but once it’s done, you merely have to update the UDAs (using GH for instance, or by hand) and in that view representation, colors will update accordingly.

Hi,

Thank you for the reply. I know how to control it in Tekla, but I was looking a way of controlling the representation via GH only. Is that possible?

Luciano.

Three lines of code can do that, actually.

using Tekla.Structures;
using Tekla.Structures.Model;
using Tekla.Structures.Model.UI;

  private void RunScript(object modelObj, System.Drawing.Color color)
  {
    Tekla.Structures.Model.ModelObject mo = modelObj as Tekla.Structures.Model.ModelObject;
    Tekla.Structures.Model.UI.Color col = new Tekla.Structures.Model.UI.Color(((double) color.R) / 255, ((double) color.G) / 255, ((double) color.B) / 255);
    Tekla.Structures.Model.UI.ModelObjectVisualization.SetTemporaryState(new List<Tekla.Structures.Model.ModelObject>(){mo}, col);

  }

Right clic in Tekla > Redraw view returns the display to normal.

TeklaTempColors.gh (2.9 KB)

5 Likes

Uh thank you so much, on Monday I’ll try it. Seems promising!