Does 'chosen options stored as a number in ACAD' ring a bell?

Does 'chosen options stored as a number in ACAD' ring a bell?

Anonymous
Not applicable
616 Views
4 Replies
Message 1 of 5

Does 'chosen options stored as a number in ACAD' ring a bell?

Anonymous
Not applicable

Hello,

It's been 10 years since I've used AutoCAD but then I used it quite extensively.

I remember that for some choice of options (I think) AutoCAD stored this as a number.

Yet the choice could be cumulative., meaning that more than one option could be chosen at the same time. Yet AutoCAD still stored all chosen options in one number, and from this one number it could deduce the options you chose.

Something like each option would be represented by a prime. Option A would be 5, Option B 7, Option C 11. And so if the number stored was 18: it would know you chose 7 and 11. 12 stems from 5 and 7 aso.

But primes don't really work. So I was wondering: does this ring a bell with anyone? What was the real method and in what context?

 

It's been bugging me for a while now (I just love math and this kind of stuff).

Thanks if anyone can help me out.

Have A good day!

0 Likes
Accepted solutions (1)
617 Views
4 Replies
Replies (4)
Message 2 of 5

ВeekeeCZ
Consultant
Consultant
Accepted solution

Its based on the binary system converted to decimal.. and value of osmode for example

1/1 end

10/2 mid

100/4 cen 

1000/8 nod

 

For each bit one unique function, which can be combined. Say 101/5 is cen+end

 

Message 3 of 5

Anonymous
Not applicable

That was it! Thanks!

0 Likes
Message 4 of 5

Kent1Cooper
Consultant
Consultant

They're called "bitcode" values, and are the sum of [not prime numbers but] powers of 2.  It's pretty clear if you read Help about the OSMODE System Variable.

 

They are also used in entity data.  Not all power-of-2 bits are necessarily used in all cases.  For example, the entity data for a lightweight Polyline contains a DXF-code 70 entry, which will contain the 1 bit if it's closed, and/or the 128 bit if linetype generation is enabled for it.  So the value can be only 0, 1, 128, or 129.

Kent Cooper, AIA
0 Likes
Message 5 of 5

Sea-Haven
Mentor
Mentor

Thanks to lee-mac a way to find

 

(if (zerop (logand 32 (getvar "OSMODE")))
(alert "not found")
(alert "32 found")
)

Could loop through a list comparing what is on. 1 2 4 8 16...........

0 Likes