Working with AutoCAD entities
Bit encoded Data (cont.)
- If we logand two numbers together, it will tell us which bits match
- Is a polyline (R13 style) 3D? Is the 70 assocd value have a 8? Lets say the 70 assocd value was 25.
25 = 0*128 + 0*64 + 0*32+ 1*16 + 1*8 + 0*4 + 0*2 + 1*1 = 00011001
8 = 0*128 + 0*64 + 0*32+ 0*16 + 1*8 + 0*4 + 0*2 + 0*1 = 00001000
- Matchup wherever the numbers are both 1s
00011001
00001000
00001000 = 8
- So yes, the polyline is 3D
(if (= 8 (logand 25 8))
(print Polyline is 3D)
(print Polyline is NOT 3D)
)