leasson 发表于 2008-5-30 23:45:00

acedGetEnv和acedSetEnv函数使用!!!

有人用过acedGetEnv和acedSetEnv函数吗?
我怎么使用都不行,是不是ARX中声明了没有实现哦???????

bluelightcsy 发表于 2008-6-3 09:47:00

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
                  
                        FixedProfile
                            General
If an entry is not found in the registry, retrieves the value from the Windows system environment table.
Note This function will not work for AutoCAD sysvars. For AutoCAD sysvars, use .
If acedGetEnv() succeeds, it returns RTNORM; otherwise it returns RTERROR. This function is the complement of thefunction.
Include Fileacedads.h
       
这段是帮助文档的话,说的很清楚了,这是得对应注册表的键值。如果要得系统变量用acedGetVar,不清楚你为什么要用这个函数,肯定是实现了的,不可能没实现。

leasson 发表于 2008-6-4 22:15:00

那你的意思就是如果我想获得CAD中的系统变量和改变CAD的系统变量只有通过注册表了是不是?
那ARX中还定义这两个函数干什么呢?

BDYCAD 发表于 2008-6-9 09:08:00

参考这个帖:)
我们这样用这些涵数的,
示例代码如下:
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)

leasson 发表于 2008-6-12 22:08:00

可是这是acedGetVar,和acedGetEnv的声明不一样哦
页: [1]
查看完整版本: acedGetEnv和acedSetEnv函数使用!!!