![]() |
【转帖】how to hide a layer
how to hide a layer?
how to hide a layer? hi all, i'm trying to implement hide/show function for dwg layers in a dwg file. i can get the list of the layer in layer table, but when i try to set the property i get an assertion error. my "temp" code is this: code: mdbptr = mhostappserv.readfile( infile.c_str(), false, false ); if( !mdbptr.isnull() ) { // layer table smart pointer, opened for read. oddblayertableptr players = mdbptr->getlayertableid().safeopenobject(); oddbsymboltableiteratorptr piter = players->newiterator(); for (piter->start(); !piter->done(); piter->step()) { // layer record smart pointer, opened for read. oddblayertablerecordptr player = piter->getrecordid().safeopenobject(); if( strcmp( lname.c_str(), "801d") == 0 || strcmp( lname.c_str(), "802d") == 0 ) { player->setisoff( true ); } } is "isoff" the right property to be set? do i open the dwg in right way? thank you in advance for help greetings walter myzhar ============== ing. walter lucetti geomind srl pisa - italy ============== myzhar # 26th april 2006, 10:20 am registered user join date: jun 2004 location: italy posts: 115 i think you must set safeopenobject(oddb::kforwrite) because openmode default is oddb::kforread may it be? rareba # 26th april 2006, 11:36 am registered user join date: feb 2006 location: pisa posts: 69 quote: originally posted by rareba i think you must set safeopenobject(oddb::kforwrite) because openmode default is oddb::kforread may it be? ok, you are right! i was searching for this setting in database "readfile". it was simpliest as is seemed thank you walter myzhar ============== ing. walter lucetti geomind srl pisa - italy ============== myzhar none ? | ? thread tools display modes linear mode search this thread rate this thread excellent good average bad terrible posting rules you may post new threads you may post replies you may post attachments you may edit your posts is on are on code is off html code is off forum jump user control panel private messages subscriptions who's online search forums forums home general topics news questions and remarks business issues industry commentary general software issues documentation issues future directions dwg libraries dwgdirect.net dwgdirect, c++ version dwgdirectx, activex version adtdirect/c3ddirect opendwg toolkit/viewkit dgn libraries dgndirect, c++ version (2.x+) dgndirect libraries (legacy 0.99xx) all times are gmt -7. the time now is 11:17 pmfff">. - - - copyright ?2000 - 2009, jelsoft enterprises ltd. copyright 1998-2008 open design alliance inc. i think you must set safeopenobject(oddb::kforwrite) because openmode default is oddb::kforread may it be? quote: originally posted by rareba i think you must set safeopenobject(oddb::kforwrite) because openmode default is oddb::kforread may it be? ok, you are right! i was searching for this setting in database "readfile". it was simpliest as is seemed thank you walter myzhar ============== ing. walter lucetti geomind srl pisa - italy ============== |
所有的时间均为北京时间。 现在的时间是 10:58 AM. |