Roof slope label
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-02-08 06:10 PM - last edited on 2024-12-18 01:26 AM by Laszlo Nagy
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"
- Labels:
-
Classifications & Properties
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-02-08 07:32 PM
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.
Software Engineer, Library
Graphisoft SE, Budapest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-02-08 11:09 PM
I'm in metric so it may be a regional unit problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-02-09 09:01 AM
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.
Software Engineer, Library
Graphisoft SE, Budapest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2023-02-14 06:05 PM
This is giving me a Syntax Error. When I jump to the last valid character, it's right after CONCAT
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2023-06-02 10:47 PM
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\"")
MacBook Pro M1 Max, 64GB
macOS Sequioa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2024-08-03 08:04 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2024-08-04 09:39 PM - edited 2024-08-04 10:07 PM
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, "" )