高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】dictionary variables
dictionary variables
dictionary variables
hi guys,
i am using dwg direct to read and write dwg/dxf drawings. there is a oddbdictionaryvar class that allows you to get and set variables into user dictionaries. this class refers to the objectarx class acdbdictionaryvar, which does not exist in objectarx the libraries.
am i missing something?
that is because you are not supposed to set dictionary variables directly. use database functions instead.
vladimir
dictionary variables
i have an application running on our own cad system that uses odb to read and write dwg files. in this application i use oddbdictionaryvar to read and write certain dictionary settings.
on the other hand, i have the same application running in autocad using objectarx2008. now, objectarx does not have an acdbdictionaryvar class. how can i read the same setting in my autocad implementation that i wrote to a dwg file from my own cad system and visa-versa?
you may use oddbdatabase::setsysvar in dd and ::acedsetvar in arx.
vladimir
dictionary variables
thanks fot the quick reply. i cannot use system variables, as i have lots of settings that needs to be organized in dictionaries. i need to be able to get a dictionary
oddbobjectid dictid = pparentdict->getat((odstring)entry->getname(), &status);
and then ultimately
oddbdictionaryvarptr pobj;
pobj = oddbdictionaryvar::createobject();
pobj->setvalue((odstring)entry->getvaluestring());
oddbobjectid objid = pparentdict->setat((odstring)entry->getname(),pobj);
than i need to get the same dictionary objects from my app written in arx.
well, it was a bad idea, to use dictionary variables to store custom settings. there is a special class acdbxrecord, designed to store custom data in dictionaries.
anyway, you may read your data in arx via acdbentget. you'll have to parse resulting resbuf chain though. it has dxf-like format. i.e. dictionary variable will look like
(100 . "dictionaryvariables") (280 . 0) (1 . "variablevalue"))
vladimir
|