Project data & BIM
About BIM-based management of attributes, schedules, templates, favorites, hotlinks, projects in general, quality assurance, etc.

Roof slope label

Anonymous
Not applicable
I created a roof slope label with autotext using:
CONCAT ( STR ( TAN ( PITCH ) * 12, 0 ), "/12 - PITCH" )
which works except that for a low slope roof it will not show the fraction, IE 1/2"/12" is shown as 0"/12"
7 REPLIES 7
Peter Baksa
Graphisoft
Graphisoft
Hi,

This looks like a property expression, which is not GDL, but I guess it is rounding down to 0. I don't know if a property expression can be used to format a number as a dimension, probably not.

In GDL you can use STR{2} to format numbers as dimensions. REQUEST ("Linear_dimension" ...) can be used to get the format string that the user set in the work environment.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
DGSketcher
Legend
If you assign the roof pitch using Autotext (#Pitch) in a label does it not display in your required units?
I'm in metric so it may be a regional unit problem.
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
Peter Baksa
Graphisoft
Graphisoft
I played around with it and got a solution.
There is an STRCALCUNIT function that formats a length with the work environment calculation units.
The result of TAN has to be converted from a number to a length: 1 ft * TAN( {Property:Roof/Pitch} )
STRCALCUNIT ( 1 ft * TAN ( {Property:Roof/Pitch} ) ) will give the number you need.

CONCAT ( STRCALCUNIT ( 1 ft * TAN ( {Property:Roof/Pitch} ) ); "/12\"" ) is the concatenated expression, \" is needed to write an " inside a string. It renders a different character on the UI, but works.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

This is giving me a Syntax Error. When I jump to the last  valid character, it's right after CONCAT

reidweber_0-1676394323426.png

 

ArchiCAD 24, 25 & 26 US
WINDOWS PC, 16GB RAM, Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz 3.40 GHZ, NVIDIA GEForce GTX 970, ASUS, CM6870, Rev X.0x

I'm having similar syntax error as reidweber.   Hoping to open the thread again to find a solution.  Rather than /12 I would like to put /1'-0" at the end of the expression.  Would that be .... /1\'\-\0\"") 

ArchiCAD v27 (since v11)
MacBook Pro M1 Max, 64GB
macOS Sonoma
cmb
Booster

The error at CONCAT is your local language setting of your system. You need to put a comma in the list of elements being operated on by the CONCAT. The person posting CONCAT ( STRCALCUNIT ( 1 ft * TAN ( {Property:Roof/Pitch} ) ); "/12\"" ) is somewhere where they use a semicolon.

cmb
Booster

Here's an expression that will yield a label that looks like 3/4"/12". One issue that comes up if you have calculation units set to feet and inches is that the label will throw up a value like 0'-3/4", which isn't kosher.

The 0'- gets replaced with a null ("").

REPLACE ( CONCAT ( STRCALCUNIT ( 12 in * TAN ( {Property:Roof/Pitch} ) ), "/12\"" ), 1, 3, "" )

 
 

Screenshot 2024-08-04 130706.png