GetReportProperty has never thrown an exception at me. When it can’t give you what you asked for, it returns false, leaves your variable alone and lets you carry on. So the bug doesn’t show up in Visual Studio. It shows up later, in a report someone else reads.
There are two ways to get a wrong number out of it. One returns false. The other returns a number that looks fine and is off by a factor of a billion. Below are both, and the probe I run before I trust a property I haven’t used before.
What you’re actually reading
Report properties are the values Tekla calculates for you: weight, length, area, position mark, profile, phase. They’re the same names you pick as content attributes in Template Editor. If a report or a drawing table can show it, your C# can usually read it.
There are three overloads on ModelObject, and no setter. Report properties are read-only; SetReportProperty doesn’t exist.
bool GetReportProperty(string name, ref string value);
bool GetReportProperty(string name, ref double value);
bool GetReportProperty(string name, ref int value);
Look at the return type. That bool is the only error message you’ll get. On false, your ref variable keeps whatever you put in it. Initialise it to 0 and you read 0. And 0 kg looks like data.
Wrong overload: the silent false
Every report property has one stored type. Ask for it with a different type and Tekla doesn’t convert. It just says no.
// Wrong: WEIGHT is a number. The string overload won't hand you "412.3".
string weightText = "";
beam.GetReportProperty("WEIGHT", ref weightText); // false (or ""), never the weight
// Right: double for a number, and check what came back.
double weight = 0;
if (beam.GetReportProperty("WEIGHT", ref weight))
Console.WriteLine($"Weight: {weight:F1} kg");
else
Console.WriteLine("WEIGHT is not available on this object");
So where do you find the right type? Not in the API. There’s no enum of report properties, and the list changes with your environment and localisation. The source of truth is Tekla’s own attribute file, contentattributes_global.lst, in your environment folders. Its datatype column tells you the overload:
| .lst datatype | Overload to use | Examples |
|---|---|---|
| FLOAT | ref double | WEIGHT, LENGTH, AREA, VOLUME, COG_X |
| CHARACTER | ref string | NAME, PROFILE, MATERIAL, PART_POS |
| INTEGER | ref int | PHASE |
For the names themselves, open Template Editor and use the content attribute picker. Whatever it lists for your object type is a valid GetReportProperty name in that environment.
Wrong unit: the number that looks fine
This one is worse, because nothing fails. When I was writing the Tekla rules for my AI agent, it assumed report properties come back in one consistent set of units. I corrected it: area in m², volume in mm³. I was half wrong, and so was the first version of this post. A probe on a 6 m precast wall panel, 3600*160, in Tekla 2025 settled it:
| Property | Comes back in | The 6 m wall panel |
|---|---|---|
| LENGTH, HEIGHT, WIDTH, COG_X/Y/Z | mm | 6000.0 |
| WEIGHT, WEIGHT_NET | kg | 8294.4 |
| AREA | mm² | 46,272,000.0 |
| VOLUME | mm³ | 3,455,999,999.9999995 |
The API answers in millimetres all the way: mm, mm², mm³, with weight in kilograms. The agent was closer than I was. The trap is that nobody reads millimetres. Template Editor, your reports and your drawing tables show area in m² and volume in m³, because the template converts the value for display. The unit column in the .lst file is that display unit, not what GetReportProperty returns.
In precast, volume is the number that matters. It’s what the plant pours and what goes on the invoice. That 3.456 m³ panel comes back as 3,455,999,999.9999995, floating point included. If your take-off is nine zeros out, now you know why. If the formwork area is six zeros out, same reason.
double area = 0, volume = 0;
beam.GetReportProperty("AREA", ref area); // mm²
beam.GetReportProperty("VOLUME", ref volume); // mm³
double areaM2 = area / 1e6; // mm² to m²
double volumeM3 = volume / 1e9; // mm³ to m³
The probe I run first
When I meet a property I haven’t used before, I don’t guess the type and I don’t guess the unit. I ask all three overloads once, on a real object, and look at how big the number is.
static void ProbeReportProperty(ModelObject mo, string name)
{
string s = ""; double d = 0; int i = 0;
if (mo.GetReportProperty(name, ref s) && s != "") Console.WriteLine($"{name} = string \"{s}\"");
else if (mo.GetReportProperty(name, ref d)) Console.WriteLine($"{name} = double {d}");
else if (mo.GetReportProperty(name, ref i)) Console.WriteLine($"{name} = int {i}");
else Console.WriteLine($"{name}: not available on this object (or the name is wrong)");
}
The s != "" guard is there on purpose: for some numeric properties the string overload “succeeds” and hands back an empty string. Thirty seconds on one part gives you the name, the type and the unit. A wrong report costs a lot more than thirty seconds.
Before you trust a number
- Always check the
bool. A silentfalseis the normal failure mode. - Match the overload to the
.lstdatatype: FLOAT = double, CHARACTER = string, INTEGER = int. - Get names from Template Editor, not from memory. They vary by environment.
- Don’t assume units. The API returns mm, mm² and mm³. Your report shows m² and m³.
- Position marks (PART_POS, ASSEMBLY_POS) only exist after numbering.
Why I care about units. This is where AI-written Tekla code goes wrong quietly. It compiles, it runs, it hands you a believable number. So both traps are written into the Tekla Open API skill my course members get, and the agent picks the right overload and unit before it writes the code. In the course you build a quantity take-off on exactly these properties, and you learn to check what the agent wrote.
Tekla Open API Course: build real Tekla tools with an AI agent →
Corrected 25 October 2026: an earlier version said AREA comes back in m². It comes back in mm².
Related: Tekla UDAs from C#: why GetUserProperty returns false · Lock and unlock Tekla objects with OBJECT_LOCKED
