Inclination marker for&nsbp;ArchiCAD

Ivan @ 24 / 06 / 2021 @ Blog / ArchiCAD / BIM / Programming / Ссылки
( / / )

Время чтения: ~ 6 мин.

I have rebuilt an existing custom roof inclination marker (roof slope arrow) for ArchiCAD 23+ (found log ago on one of ArchiCAD forums, not sure on which one 🙂 ) so it can now show the inclination value in percents or degrees alongside the arrow which automatically turns in the direction of the inclination.

How it works: an empty roof window element is used with a custom marker element. Both are included in the set.

How to use:

  • put a roof window/opening in a roof
  • set this opening to use the given element (must add two library objects from the folder to the project library)
  • set the window’s opening to use the given marker element
  • set up the settings of the marker element

Download the set here.

Please, feel free to alter it or mail me your questions.

Here is the code of the marker:

eps = 0.0001
paperToModel = GLOB_SCALE/1000

define style  'txtStyle'  AC_TextFont_1, AC_TextSize_1, 8, AC_TextStyle_1
style 'txtStyle'

rot2 -90

unid=1
ms=AC_MarkerSize*paperToModel
bb=ms*1.5

hotspot2 -bb,   0 
hotspot2 bb+ms, 0


line2 -bb, 0, bb+ms, 0
add2 bb+ms, 0
line2 0, 0, -ms, -ms*0.3
line2 0, 0, -ms, ms*0.3
del 1


xPos = 0
yPos = 0


if show_slope_inclination = 1 then

    r = request ("View_Rotangle", "", _angleViewRot)
    _totalRotate    = (SYMB_ROTANGLE + _angleViewRot) MOD 360
    _nTrans = 0
!    if (_totalRotate > (90 + EPS) & _totalRotate < (270 + EPS)) then
!        rot2 180
!        _nTrans = _nTrans + 1
!    endif
   
    if (_totalRotate > (150 + EPS) &  _totalRotate < (360 + EPS) &  _totalRotate > (270 + EPS)) then
        rot2 180
        _nTrans = _nTrans + 1
    endif
  
! no idea how it turned out to be working, but it works somehow 

    if (_totalRotate > (180 + EPS) &  _totalRotate < (270 + EPS)) then
        rot2 180
        _nTrans = _nTrans + 1
    endif


    if inclination_in_percents then an_gle=STR(TAN(ROOF_ANGLE)*100, 3, 2) !CHANGE THE 3 to whatever number you like to set the number of digits after the point
    
    ! SAVE THE TEXT VARIABLE BEFORE THE STRIPPING PROCESS
    if inclination_in_percents then
        numberToStripZeroes = an_gle
    else
        numberToStripZeroes = STR(ROOF_ANGLE, 3, 2)
    endif

    numberToStripZeroes = STR(_totalRotate, 3, 2)

    ! STRIP ZEROES FROM THE END
    _newStr = ""        ! intialize a new empty string

    ! _currStr = "12,10"
    len = STRLEN (numberToStripZeroes  )
    _newStr = STRSUB (numberToStripZeroes  , len - 2, len)
    if _newStr = ",00" then
        _newStr = STRSUB (numberToStripZeroes  , 0, len-3)
    else
        _newStr = numberToStripZeroes  
    endif
    
    
    ! OUTPUT THE TEXT
    if inclination_in_percents then
        TEXT2 xPos, yPos, "i = "+ _newStr +"%"
    else
        TEXT2 xPos, yPos, "i = "+ _newStr +"°"
    endif
endif
del _nTrans


After googling a bit, I found this official solution. Still, I like mine more.


Similar Posts:


Subscribe!

Instagram
VK
Facebook
YouTube!
Telegram!

Subscribe to mail list



* clicking the ‘Subscribe’ button you agree that your personal data will be processed