![]() |
【转帖】rouble With Linestyle Names
trouble with linestyle names
trouble with linestyle names i've had some trouble with linestyle names with spaces in them, so i have been replacing the spaces with underscores when loading files as follows: //change line type names to use underscores instead of spaces to avoid problems oddblinetypetableptr plinetypes = m_pdb->getlinetypetableid().safeopenobject(); oddblinetypetableiteratorptr piter = plinetypes->newiterator(); oddblinetypetablerecordptr plinetyperec; for (piter->start(); !piter->done(); piter->step()) { plinetyperec = piter->getrecordid().safeopenobject(); cstring strlname = plinetyperec->getname(); if(strlname.replace(' ', '_')) { //changes were made, so change name plinetyperec->setname((const char*)strlname); } } i've got a dwg file today that throws an exception in the "setname" method... any idea why? second, should blanks in linestyles be causing me trouble? it seems some other programs insert underscores, so i was gixing my problem by emulating them. jack warner alpine engineered products, inc. spaces in symbol table record names are valid since r15. dwgdirect while saving files to minor versions renames such records and saves round trip information to file so that the names get restored if file is loaded by dwgdirect or autocad 2000+. while renaming records you can get exception if the table already contains a record with the new name (name is not unique). you can get text message using oderror::description() sergey slezkin thanks... ...that was very helpful. "while renaming" - i mean "calling setname()". dwgdirect takes care about keeping names unique (it appends digits to the name if it conflicts with existing one). sergey slezkin |
| 所有的时间均为北京时间。 现在的时间是 04:14 PM. |