在网页中如何写字典?
MxDraw网页开发|冯美娟|2018-11-21 14:25
-
回答:
function wirteVer(sName,sVal) { var database =mxOcx.GetDatabase(); var dict = database.GetNamedObjectsDictionary(); var myDict = dict.GetAt("MyExDataDictName"); if (myDict == null) { myDict = dict.AddObject("MyExDataDictName", "McDbDictionary"); } var rec = myDict.GetAt(sName); if (rec == null) { rec = myDict.AddXRecord(sName); } //构造一个过滤链表 /*var spFilte = mxOcx.NewResbuf();*/ var res = mxOcx.NewResbuf(); res.AddString(sVal); rec.SetXRecordData(res); } function wirte( sender, e) { wirteVer("MyName", "666666"); alert("写入成功"); }