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

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

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
Virtuoso
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 Big Sur / AC24UKI (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

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!