几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-05-06, 06:50 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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 ]
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭



所有的时间均为北京时间。 现在的时间是 06:29 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多