- UID
- 1
- 积分
- 15887
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-3
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
通过该教学,朋友们可以学到如何修改只读的系统变量DBMO,可以欺骗ACAD,告诉它图形并没有编辑修改过.
Acdbdistof() modifies the database (dbmod)
ID 30563
Applies to: AutoCAD 2000
Date 6/22/2000
This document is part of Visual Lisp AcDbDatabase ObjectARX System Variable
Question
Whenever there is a call to acdbDisToF() the DBMOD variable is modified, even
though the drawing is not modified. Why does this occur?
Answer
The implementation of ads_distof() used in AutoCAD R14 was changed in AutoCAD
2000.
In AutoCAD 2000, an AutoCAD variable does the conversion. After finishing the
conversion, it sets the variable back to the previous value, and the result of
the variable change is that DBMOD gets modified.
To solve this problem you can use these two new functions:
AcApDocument::pushDbmod()
AcApDocument::popDbmod()
pushDbmod() saves the current setting of DBMOD, and popDbmod() restores the
value. Between the two calls you can use functions that modify the database.
These functions should be used only to do the drawing initialization when a new
drawing is created, or when a drawing is opened.
Please note that calls to pushDbmod() must be paired with calls to popDbmod().
To solve the problem with acdbDisToF(), you can capsulate the call between the
new functions:
// Before using acdbDisToF() save the current DBMOD value.
curDoc()->pushDbmod();
// Do the conversion.
double value;
acdbDisToF("1.234", 2, &value);
acutPrintf("\nFloat value: %f", value);
// Restore the previous value of DBMOD.
curDoc()->popDbmod(); |
|