AutoCad2012新增类AcRxVariablesDictionary 可以获取所有变量名和值

2022-12-04,,

//AutoCad2012新增获取所有变量名和值
AcRxVariablesDictionary *dic=AcRxVariablesDictionary::get();
const AcArray<AcString> aaa= dic->getAllNames();
for (int i=; i<aaa.length(); i++)
{
acutPrintf(_T("\n变量名=%s;"),aaa.at(i));
struct resbuf rb;
Acad::ErrorStatus es= dic->getVariable(aaa.at(i))->getValue(rb);
if (Acad::eOk == es)
{
if (rb.restype == RTSTR)
{
acutPrintf(_T(" 值=%s"),rb.resval.rstring);
}
else if (rb.restype == RTREAL)
{
acutPrintf(_T(" 值=%0.4lf"),rb.resval.rreal);
}
else if (rb.restype == RTSHORT)
{
acutPrintf(_T(" 值=%d"),rb.resval.rint);
}
else if (rb.restype == RTLONG)
{
acutPrintf(_T(" 值=%d"),rb.resval.rlong);
}
}
}

AutoCad2012新增类AcRxVariablesDictionary 可以获取所有变量名和值的相关教程结束。

《AutoCad2012新增类AcRxVariablesDictionary 可以获取所有变量名和值.doc》

下载本文的Word格式文档,以方便收藏与打印。