![]() |
【转帖】oda 1.06 vs new 1.08 and 1.09 nls problem
oda 1.06 vs new 1.08 and 1.09 nls problem
oda 1.06 vs new 1.08 and 1.09 nls problem h! all about 2 months ago i wrote some small interfece for creating dxf projects based on old version oda 1.06 all idea of creating dxf is based on insertion of many other small dxf file into one data base and writnig all together to target dxf pseudo code: init od creating databse load ("1.dxf","blockname1")(1.08 1.09 problem) load ("2.dxf","blockname2") load ("3.dxf","blockname3") insertblock("blockname1",pos,scale,etc..) insertblock("blockname2",pos,scale,etc..) insertblock("blockname3",pos,scale,etc..) write created batabase to file deinit od all linked with oda 1.06 autocad 2k show this project properly all loaded object are same like in orginal all is fine but i had to change for new library 1.08 for graphics viewer purpose this same scenery but another library end effect is not the same like in case of 1.06 some of loaded dxf files has a wrong block references or rotation text etc.. or new lib oda show some hide entites like text (another nls)? problem is not of insertblock all pos scale rot are corect but with reading of dxf files into databse any idea ? p.s. i sent concret dxf macro with this problem when i loading this file to ac2k is problem with code page and ac will attmpt to convert some text entites message from ac "nls files required to convert the text entities " maybe here is a problem but old version of oda hide this problem i think maybe this macro has wrong element ? sorry for all this quest but i am not expert in ac just pure programmer ;] and i have to know which of this side is incorect macro or oda engine ? best regards rafal aka ice-k attached files odamfcapp viewer ok from odamfc viewer this example seems to be okey what is wrong with my code ? any help please ;] try this: oddb::measurementvalue measure = oddb::kenglish; pdb = theapp.createdatabase(true, measure); still wrong thnx but this same result default argument is kenglish m_odsrvices.createdatabase(); that what i wrote if i load this example directly to odamfc viewer all is fine but not if i will genrating separate of this elements to common batabase like: my code creting data base m_hfileout.open(cdwgname); m_pdb = m_odsrvices.createdatabase(); if (m_pdb.isnull()) return false; m_pdb->settilemode(tilemode); m_odb is common target datbase and i load many elements as blocks oddbdatabaseptr odtmpdb = m_odsrvices.readfile(pfilename); m_pdb->insert(odstring(pdscblockname), odtmpdb); last step is creating block reference and assign to blockid oddbobjectid srcblockid m_blockidmap[pblockname]; oddbblocktablerecordptr pdestblock m_pdb->getmodelspaceid().safeopenobject(oddb::kforwrite) ; ddbblockreferenceptr pblkref = oddbblockreference::createobject(); pdestblock->appendoddbentity(pblkref); pblkref->setblocktablerecord(srcblockid); pblkref->setposition(odgepoint3d(pos.x,pos.y,pos.z)); pblkref->setrotation(rot.x); pblkref->setscalefactors(odgescale3d(scale.x,scale.y,scale .z)); would you help me what is wrong with this simple impl ? again thnx for help rafal p.s. maybe codepage ? hmm for some reason - your codepage is being set to 932. prior to createdatabase set your code page to 1245/ansi with odsrvices.setsystemcodepage( cp_ansi_1252 ); codepage hello my codepage is default ansi_1252 it seems to be problem with conversion from 932 to 1252 while reading dxf to database i have 30 dxf macros in this code how may i convert this obejcts ? one way by convering in ac but will be batter if will be convering in oda i think ? rafal ok - i think i understand the problem now. the strings used to hold all the table names/layers ...text and other items that are stored in one of the dxf files you have are mbcs strings such that they wouldn't be interpreted correctly if the codepage were to remain as ansi. i don't readily know a solution for you at this point - other than to say that functionality for globally changing all the strings to match a certain codepage would be a feature we would like to have. we hope to be providing support for this in the future. back to the 1.06 ver okey i understand but tell me why older version like 1.06 hide this problem ,1.09 not is possible to shwich oda 1.09 to hide this texts or force to convering ? okey my idea now is to force people which created this dxf macros to convert/create in common codepage and will be okey i think thnx for your time rafal aka ice-k thats interesting. can you provide that file that you created with 1.06 so that we might peek at it? i will prepare all staff okey no problem i have to rebuild my app to 1.06 and iwill sent two dxf generated projects with macro witch i used dxf give 3h thnx staff ready to fetch okey here u have all project generated by this same interface app but different library rafal any news ? h! did u fetch this stuff ? some problems with zip ?? i have it - looking into it. are these drawings the *result* or are they the ones read into the resultant drawing? result used_dxf_macros_problem from this directory i loading dxf to common database and prepare insertion of blocks all project write to files terminalstripoda_v106.dxf and terminalstripoda_v106.dxf [ oda 1.06 ] load c2938617.dxf ->[ insertblock ] load c2938617.dxf ->[ insertblock ] = terminalstripoda_v106.dxf load c2938743.dxf ->[ insertblock ] [ oda 1.09 ] load c2938617.dxf ->[ insertblock ] load c2938617.dxf ->[ insertblock ] = terminalstripoda_v109.dxf load c2938743.dxf ->[ insertblock ] |
所有的时间均为北京时间。 现在的时间是 06:53 AM. |