cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Collaborate forum

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"
4 REPLIES 4

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
Champion
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 macOS Ventura / AC26UKI (most recent builds)

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

Start a new conversation!

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!