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

acedGetEnv和acedSetEnv函数使用!!!

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

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

<p class="signature">extern "C" int acedGetEnv(const ACHAR * sym,ACHAR * var);</p><table class="argumentList"><tbody><tr valign="baseline"><td class="argumentName">sym</td><td class="argumentDescription">Input environment variable name to get, which is case sensitive in all environments (Visual LISP, ObjectARX, and VB/ActiveX)</td></tr><tr valign="baseline"><td class="argumentName">var</td><td class="argumentDescription">Output preallocated buffer to be filled in with environment variable value (a buffer size of 1024 bytes should be sufficient)</td></tr></tbody></table><p>Retrieves the value of an environment variable. Looks first in the AutoCAD-specific FixedProfile/General section of the registry:<br/></p><pre>HKEY_CURRENT_USER
    Software
      Autodesk
            AutoCAD
                R15.0
                  &lt;Install ID&gt;
                        FixedProfile
                            General</pre><br/>If an entry is not found in the registry, retrieves the value from the Windows system environment table. <p></p><p>Note This function will not work for AutoCAD sysvars. For AutoCAD sysvars, use <a href="mk:@MSITStore:C:\ObjectARX%202008\docs\arxref.chm::/Globals/AcEd/acedGetVar.htm">acedGetVar()</a>.</p><p>If acedGetEnv() succeeds, it returns RTNORM; otherwise it returns RTERROR. This function is the complement of the <a href="mk:@MSITStore:C:\ObjectARX%202008\docs\arxref.chm::/Globals/AcEd/acedSetEnv.htm">acedSetEnv()</a> function.</p><h2>Include File</h2><p>acedads.h
        </p><p>这段是帮助文档的话,说的很清楚了,这是得对应注册表的键值。如果要得系统变量用acedGetVar,不清楚你为什么要用这个函数,肯定是实现了的,不可能没实现。</p>

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

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

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

<p>参考这个帖:)</p><p><a href="http://bbs.mjtd.com/forum.php?mod=viewthread&tid=58568&amp;replyID=&amp;skin=1">http://bbs.mjtd.com/forum.php?mod=viewthread&tid=58568&amp;replyID=&amp;skin=1</a></p><p>我们这样用这些涵数的,</p><p>示例代码如下:<br/>struct resbuf cmd, rb1,rb2 , *dxf;<br/>&nbsp;&nbsp;ads_name Ename;<br/>&nbsp;&nbsp;ads_point pt1 ;<br/>&nbsp;&nbsp;int m,n,k;<br/>&nbsp;&nbsp;//acedGetVar("osmode", &amp; os);<br/>&nbsp;&nbsp;cmd.restype = RTREAL;<br/>&nbsp;&nbsp;cmd.resval.rreal = 0;<br/>&nbsp;&nbsp;acedSetVar("cmdecho", &amp;cmd);//(SETVAR "CMDECHO" 0)<br/></p>

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

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