![]() |
【转帖】how to set a value for oddbobjectid
how to set a value for oddbobjectid ?
how to set a value for oddbobjectid ? i move my application from odt to dd, when it saves a drawing to dwg i have to set specific handler value for some objects. in odt a handle was an array of 8 bytes and to assign value was not a problem, but with dd i can't find the way. to read dd handler value i use the following code: byte buf[8]; objectid.gethandle().bytes( buf ); where objectid has type oddbobjectid how to set my value to the objectid variable? see dwgdirect refernece (faq) sergey slezkin the example in the faq shows how to assign handle for entities, but what about layers, linetypes, etc.? i use a code like this: code: oddblayertableptr podlayers = poddb->getlayertableid().safeopenobject( oddb::kforwrite ); oddblayertablerecordptr podlayer = oddblayertablerecord::createobject(); podlayer->setname( szname ); podlayers->add( podlayer ); there are no way to specify a handle the second question: oddbhandle keeps a handle value in a variable of oduint64 type. i don't understand from the documentation how to set low and hi values. can you help me? in similar way: code: // add the layer to database with a specified handle pdb->addoddbobject( player, // object to add oddbobjectid::knull, // ownerid is set when entity is added to block mylayerhandle); // custom object handle // add the layer to the table playertable->add(player); oduint64 is typedefed to appropriate 64-bit integer buit-in type if it's supported by hardware. for example __int64 for msvc. if int64 is not supported it's emulated (see int64.h) if you platform does not support int64 you can use: oduint64 val = hi << 32 + low; sergey slezkin thank you very much! |
所有的时间均为北京时间。 现在的时间是 11:45 PM. |