几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(C++) (http://www.dimcax.com/hust/forumdisplay.php?f=34)
-   -   【转帖】acedgetenv和acedsetenv函数使用!!! (http://www.dimcax.com/hust/showthread.php?t=6074)

yang686526 2009-04-14 02:56 PM

【转帖】acedgetenv和acedsetenv函数使用!!!
 
acedgetenv和acedsetenv函数使用!!!
acedgetenv和acedsetenv函数使用!!!
有人用过acedgetenv和acedsetenv函数吗?
我怎么使用都不行,是不是arx中声明了没有实现哦???????
下雨天打光脚板——脚踏实地
extern "c" int acedgetenv(const achar * sym,achar * var);
syminput environment variable name to get, which is case sensitive in all environments (visual lisp, objectarx, and vb/activex)
varoutput preallocated buffer to be filled in with environment variable value (a buffer size of 1024 bytes should be sufficient)
retrieves the value of an environment variable. looks first in the autocad-specific fixedprofile/general section of the registry:
hkey_current_user software autodesk autocad r15.0 <install id> fixedprofile general
if an entry is not found in the registry, retrieves the value from the windows system environment table.
include file
acedads.h

这段是帮助文档的话,说的很清楚了,这是得对应注册表的键值。如果要得系统变量用acedgetvar,不清楚你为什么要用这个函数,肯定是实现了的,不可能没实现。
那你的意思就是如果我想获得cad中的系统变量和改变cad的系统变量只有通过注册表了是不是?
那arx中还定义这两个函数干什么呢?
下雨天打光脚板——脚踏实地
参考这个帖:)
我们这样用这些涵数的,
示例代码如下:
struct resbuf cmd, rb1,rb2 , *dxf;
ads_name ename;
ads_point pt1 ;
int m,n,k;
//acedgetvar("osmode", & os);
cmd.restype = rtreal;
cmd.resval.rreal = 0;
acedsetvar("cmdecho", &cmd);//(setvar "cmdecho" 0)
可是这是acedgetvar,和acedgetenv的声明不一样哦
下雨天打光脚板——脚踏实地


所有的时间均为北京时间。 现在的时间是 03:31 AM.