.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 13
ReneRam
645 Views, 12 Replies

DBMODE?

Wondering how this can be possible.

According to the online help:

DBMODE (System Variable)
Type: Integer
Saved in: Not-saved
Initial value: 0

Indicates the drawing modification status. The setting is stored as a bitcode using the sum of the following values:

1 Object database modified
4 Database variable modified
8 Window modified
16 View modified
32 Field modified

The DBMOD value is reset to 0 when you save the drawing.

I'm checking the value of DBMODE in my program before running some code. The Drawing is new, the action performed is a "Zoom Extents", so I presume the value should be 24 (8+16).
The value I read in the debugger is 23, and if I check in AutoCAD with no program running, simply with the Variable Editor, here's the result.

Anyone knows how to explain this?
René
12 REPLIES 12
Message 2 of 13
Anonymous
in reply to: ReneRam

I'm not sure what needs explaining other than that when you test a bit-encoded value, you mask out the bits you don't care about, so I guess at this point, the question is, what is it that you want to know?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5884834@discussion.autodesk.com...
Wondering how this can be possible.

According to the online help:

DBMODE (System Variable)
Type: Integer
Saved in: Not-saved
Initial value: 0

Indicates the drawing modification status. The setting is stored as a bitcode using the sum of the following values:

1 Object database modified
4 Database variable modified
8 Window modified
16 View modified
32 Field modified

The DBMOD value is reset to 0 when you save the drawing.

I'm checking the value of DBMODE in my program b
efore running some code. The Drawing is new, the action performed is a "Zoom Extents", so I presume the value should be 24 (8+16).
The value I read in the debugger is 23, and if I check in AutoCAD with no program running, simply with the Variable Editor, here's the result.

Anyone knows how to explain this?
René
Message 3 of 13
ReneRam
in reply to: ReneRam

It's a real simple question, how can you get "23"? as displayed in the attached image.

Since the value of DBMODE is the SUM of the following integers 1,4,8,16,32.
Message 4 of 13
Anonymous
in reply to: ReneRam

But, it's not the sum of just those. The second bit (i.e. 2) is also used,
it just isn't documented (I don't know why). The second bit indicates that
a symbol table has been modified.

wrote in message news:5885876@discussion.autodesk.com...
It's a real simple question, how can you get "23"? as displayed in the
attached image.

Since the value of DBMODE is the SUM of the following integers 1,4,8,16,32.
Message 5 of 13
ReneRam
in reply to: ReneRam

Thanks Art,
as I said in my first post. the only information I had was from the online help of AutoCAD.
René
Message 6 of 13
Anonymous
in reply to: ReneRam

Not every bit is is documented (for various reasons, including that non one bothered to update the docs).

In the case of bit-encoded values, that means that some bits may not be documented, but when you work with bit-encoded values, you don't have to concern yourself with undocumented/uninterested bits in any case, because you have to mask them out.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5885876@discussion.autodesk.com...
It's a real simple question, how can you get "23"? as displayed in the attached image.

Since the value of DBMODE is the SUM of the following integers 1,4,8,16,32.
Message 7 of 13
artisteroi
in reply to: ReneRam

autocad starts counting at 0 zero so 24 (8+16) = 23
Message 8 of 13
NathTay
in reply to: ReneRam

Wrong. The correct answer has already been posted.
Message 9 of 13
artisteroi
in reply to: ReneRam

the answer may have been posted, but Autocad does count from zero.
Message 10 of 13
NathTay
in reply to: ReneRam

You're answer is wrong and contradicts the correct answer posted.
Message 11 of 13
artisteroi
in reply to: ReneRam

It is possible that when using the .net or arx interfaces for programming AutoCAD can be conditioned to not count from zero. That is possible. But Native Autocad programming Lisp, VBA does count from Zero, and I have 1 .net that counts from zero as well. I have at leat a dozen programs that count and create lists and all sorts of thing. They all start from zero. Can you make it skip Zero and count from 1? Maybe. But if you don't force it to count from 1 it will start at zero. I am not contradicting anyones answer. I am just telling you how Auotcad can come up with a value that is 1 less than it should be. Nuff said
Message 12 of 13
dmarcotte4
in reply to: ReneRam

Hi artisteroi,

I think your confusing bit fields/ bit-encoded values, with an array index.
Message 13 of 13
NathTay
in reply to: ReneRam

It can not in this situation. The bitcode values are constant and the resultant value is simply an addition of those codes. It has absolutely nothing to do with counting from 0. Therefore your answer is wrong and it does contradict the correct answer given.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost