BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.
SOLVED!

Question about Bitest and Bitest ??

Nader Belal
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
Joachim Suehlo
Advisor
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
Joachim Suehlo . AC12-27 . MAC OSX 13.5 . WIN11
GDL object creation: b-prisma.de

View solution in original post

2 REPLIES 2
Solution
Joachim Suehlo
Advisor
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
Joachim Suehlo . AC12-27 . MAC OSX 13.5 . WIN11
GDL object creation: b-prisma.de
Nader Belal
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.
Learn and get certified!

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!