cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:
Starting August 6, 2024, TLS 1.2 will be the minimum required protocol version for Graphisoft products and services that require an online connection. Learn more…
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.
SOLVED!

# Question about Bitest and Bitest ??

Mentor
Hi there,

Can someone put a practical example for the use of BITEST & BITSET ?

*Cause I have always seen them being mentioned in GDL manual but never an example that explains how to use them.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
The masking and status values of some other GDL commands are based on set and unset bits of their binary notation. These functions can be analyzed in binary form.
Example: You have a masking Value of 63, which is 1*1 + 1*2 + 1*4 + 1*8 + 1*16 + 1*32
With Bittest you can check, which of these Bits are set or you can check if one of the Bits is set.
val = 63
TEXT2 0, 0, BITTEST(val, 4) ! = 1
This checks, if the 5th value is set (the value 16); the 1st value (1) is on position 0,
so you have to check
TEXT2 0, 0, BITTEST(val, 0) ! = 1
The binary notation of 63 would be 111111 (this is identical with the italic written 1s above), of 64 would be 1000000
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
2 REPLIES 2
Solution
The masking and status values of some other GDL commands are based on set and unset bits of their binary notation. These functions can be analyzed in binary form.
Example: You have a masking Value of 63, which is 1*1 + 1*2 + 1*4 + 1*8 + 1*16 + 1*32
With Bittest you can check, which of these Bits are set or you can check if one of the Bits is set.
val = 63
TEXT2 0, 0, BITTEST(val, 4) ! = 1
This checks, if the 5th value is set (the value 16); the 1st value (1) is on position 0,
so you have to check
TEXT2 0, 0, BITTEST(val, 0) ! = 1
The binary notation of 63 would be 111111 (this is identical with the italic written 1s above), of 64 would be 1000000
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Mentor
Thank you Joachim Suehlo
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.