CAD on global dictionary to read the extended recording operation (com Interface Web version)

The article written data can be read over the following manner,

js code:

function readGlobalVar(sName) {
 
    // get the CAD database 
    var Database = mxOcx.GetDatabase ();
     // get a global dictionary 
    var dict = database.GetNamedObjectsDictionary ();
     // get a user-defined dictionary, MyExDataDictName a dictionary name 
    var myDict = dict.GetAt ( "MyExDataDictName" );
     IF (myDict == null )
    {
        // no data. 
        return "" ;
    }
    // get extension record data dictionary. 
    var REC = myDict.GetAt (sName);
     IF (REC == null )
    {
        // no data. 
        return "" ;
    }
    // get the data in the record list. 
    var RET = rec.GetXRecordData ();
     IF (RET == null )
         return "" ;
     // return the write data. 
    return ret.AtString (0 );
 
}

Calling code:

var sRet = readGlobalVar("MyData");
if (sRet == "")
{
    Alert ( "no data" )
}
else
{
    alert (Sreten);
}

 

Guess you like

Origin www.cnblogs.com/yzy0224/p/12011068.html