![]() |
【转帖】loadlinetypefile throws exception
loadlinetypefile throws exception
loadlinetypefile throws exception hello. i am trying to load one of the standard line type files from autocad (acad.lin) into a database. but no matter how i try, i always get the exception oderror with code 156, "undefined linetype". this happens only when i want to load all line types from the acad.lin with the call code: m_pdb->loadlinetypefile("*", "u:\\acad.lin", oddb::kdltreplace);when i give a specific line type name as the first parameter, it works fine. i also checked the forum thread hi, i can't reproduce described exception. may be something wrong with linetype file. are you can attach your acad.lin file? loadlinetypefile throws exception quote: originally posted by amark hi, i can't reproduce described exception. may be something wrong with linetype file. are you can attach your acad.lin file? yes, i added the file (as .lin is not a valid extension to upload a file, i renamed it to acad.lin.txt). but it is just the autocad standard file, and can be loaded in the odamfcapp, so it is quite surely ok. i forgot to mention in my original post: i am using version 2.7.1. the code to which i added the loadlinetypefile just for testing works fine for years now: code: m_pdb = m_svcs.readfile(odwfilename, true, false, oda::ksharedenyread); m_pdb->loadlinetypefile("*", "u:\\acad.lin", oddb::kdltreplace);i also tried to start with a freshly generated database: code: m_pdb = m_svcs.createdatabase(); m_pdb->loadlinetypefile("*", "u:\\acad.lin", oddb::kdltreplace);but everything has the same result: oderror: undefined linetype the parameter oddb::kdltreplace seems not to be evaluated: if i set it to oddb::kdltignore or oddb::kdltnotapplicable does not make any difference, but gives the exception. i must be missing something there, maybe just as the poster of the thread in my original post. attached files (5.5 kb, 1 views) hi, yes, the file is normal. i call loadlinetypefile() method after read file and after database creation in our odamfcapp and odwriteex samples, but i not see any exceptions, so i don't have answer why in your code it is throwed. i test only on windows-vc8 platform. what platform are you use? may be something wrong with other platform builds. do you override services createfile() or findfile() methods in your code? quote: originally posted by amark hi, yes, the file is normal. i call loadlinetypefile() method after read file and after database creation in our odamfcapp and odwriteex samples, but i not see any exceptions, so i don't have answer why in your code it is throwed. i test only on windows-vc8 platform. what platform are you use? may be something wrong with other platform builds. do you override services createfile() or findfile() methods in your code? yes, i found it now! it were the complex linetypes which failed to load. they need to have a .shx-file. i override the findfile() method, which now expects to have the .shx-file in the same directory as the .lin-file. unfortunately, the appropriate .shx-file did not exist in that directory. but the oderror code "undefined linetype" is misleading, it should be something more meaningful imho. thank you for your support, amark :-) |
所有的时间均为北京时间。 现在的时间是 03:59 AM. |