.NET

Reply
Active Contributor
ReneRam
Posts: 41
Registered: ‎03-30-2004
Message 1 of 13 (137 Views)

DBMODE?

137 Views, 12 Replies
03-25-2008 10:09 AM
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é
*Tony Tanzillo
Message 2 of 13 (132 Views)

Re: DBMODE?

03-26-2008 06:36 AM 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é
Active Contributor
ReneRam
Posts: 41
Registered: ‎03-30-2004
Message 3 of 13 (132 Views)

Re: DBMODE?

03-26-2008 07:43 AM 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.
*Art Cooney
Message 4 of 13 (132 Views)

Re: DBMODE?

03-26-2008 11:02 AM 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.
Active Contributor
ReneRam
Posts: 41
Registered: ‎03-30-2004
Message 5 of 13 (132 Views)

Re: DBMODE?

03-26-2008 02:10 PM 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é
*Tony Tanzillo
Message 6 of 13 (132 Views)

Re: DBMODE?

03-26-2008 03:24 PM 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.
Active Contributor
artisteroi
Posts: 30
Registered: ‎05-08-2007
Message 7 of 13 (132 Views)

Re: DBMODE?

04-18-2008 06:48 AM in reply to: ReneRam
autocad starts counting at 0 zero so 24 (8+16) = 23
Distinguished Contributor
NathTay
Posts: 1,691
Registered: ‎12-15-2003
Message 8 of 13 (132 Views)

Re: DBMODE?

04-20-2008 03:38 PM in reply to: ReneRam
Wrong. The correct answer has already been posted.
Active Contributor
artisteroi
Posts: 30
Registered: ‎05-08-2007
Message 9 of 13 (132 Views)

Re: DBMODE?

04-25-2008 04:25 AM in reply to: ReneRam
the answer may have been posted, but Autocad does count from zero.
Distinguished Contributor
NathTay
Posts: 1,691
Registered: ‎12-15-2003
Message 10 of 13 (132 Views)

Re: DBMODE?

04-27-2008 04:09 PM in reply to: ReneRam
You're answer is wrong and contradicts the correct answer posted.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.