几何尺寸与公差论坛------致力于产品几何量公差标准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-05, 11:47 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】has oddbviewportsetnonrectclipentityid9...0 been cha

has *oddbviewport::set*non*rect*clip*entity*id(...) been cha
has *oddbviewport::set*non*rect*clip*entity*id(...) been changed?
in my code *oddbviewport::set*non*rect*clip*entity*id(...) worked fine while i was using opendwg version 14.01. since i switched to version 14.02, i am unable to write the created database out into a file: i got an access violation i cannot catch using opendwg's own oderrors. if i comment out this function call, everything works fine (only, of course, i won't get the drawing i want - and got before). has anything been changed with this function? should i switch to the newest (2....) version?
thanks,
miklos
i've switched to version 2.03, the problem remained :-(
miklos
hi,
it will be very helpfull if you reproduce access violation in mfcapp and attach test file. are your application based on one of toolkit example? it can be usefull to look at new 2.03 version of this example... we need some help to reproduce your problem on our side.
dear alexander,
thank you for your reply. what happens again, is this: if i try to export my native draawing in a dxf format using opendwg version 14.02 or 2.03, i got an unahndled exception when the writefile function is running - only if i try to clip my viewport using an ok looking lwpolyline. if i try to export in dwg format, i got the attached drawing1.dwg, which shows a bad paperspace (called modele) when opened using autocad 2005. if i open drawing1.dwg using odamfcapp and save it in either dxf or dwg format, the result seems ok - autocad shows exactly what i want (i am attaching the dwg result: drawing2.dwg).
my main concern is the access violation when i try to export in a dxf format - understandably i cannot demonstarte the result: it is just a small piece of a dxf file - unreadable by any programs.
thanks,
miklos
ooops, the attachments..
sorry, miklos
attached files (30.2 kb, 3 views)
(15.1 kb, 2 views)

hi,
i have found that drawing1.dwg has two viewports in paper space. one is overall viewport and other is viewport to model space. both viewports have viewport clipping. i am not sure that clipping to overall viewport is correct situation. could you try to generate drawing1 file without overall viewport clipping?
dear alexander,
thank you for the fast reply. i have tried your suggestion; unfortunately it has not helped. i am attaching the new files: drawing3.dwg was created by my program - and it shows a bad paperspace in autocad - drawing4.dwg is obtained by reading and saving this file using odamfcapp, and it is ok in autocad.
the worst: if i try to export from my program in dxf format (as i did successfully before version 14.02) i still got the same access violation at the same point of execution (writefile) as before (with the - wrong - 'double clipping').
miklos
attached files (30.3 kb, 5 views)
(15.1 kb, 4 views)

hi
i found that something wrong with viewport parameters. please, check creation of viewport with 66 handle (in drawing3.dwg). it has bad value of view target point - dxf code 17 - viewtarget()\setviewtarget() methods. autocad reports it like (-1.#ind,-1.#ind,-1.#ind).
thank you! that was the problem (previous versions might have set a default value).
miklos
was it problem in your code or toolkit bug ?
follow up: setplotcfgname, etc
it was a problem in my code. my guess is that the target got a default value in a previous version (14.01 and earlier), that's why my code worked before.
unfortunately i am still running into (several) problems when updating to 2.03.
for example when i write sg like this (the original code is more complex of course):
oddbobjectid* pblid = new oddbobjectid();
oddbobjectid layoutid = pdb->createlayout( dd_t("layout"), pblid );
oddblayoutptr lptr = layoutid.safeopenobject(oddb::kforwrite);
oddbplotsettingsvalidatorptr pvalidator = pdb->appservices()-> plotsettingsvalidator();
pvalidator->setplotcfgname( lptr, dd_t("lj1100"), dd_t("legal") );
odstring pstr = lptr->getplotcfgname();
odstring mstr = lptr->getcanonicalmedianame();
then at the end pstr and mstr are empty strings. and i could not find any way to pass the necessary arguments to the layout.
dear alexander, can you help me with this too? what am i doing wrong?
additional info:
the result of setplotcfgname in my previous post is einvalidinput. it beats me why. (nb "lj1100" is found by autocad, and it can print legal - so these arguments can be set in autocad...)
thanks,
miklos
well, odresult setplotcfgname has output odresult, check it for errors.
oddbplotsettingsvalidator:lotdevicelist method return all available printing devices. oddbplotsettingsvalidator::canonicalmedianamelist return paper names for active print device. please, test output arrays for methods. device name for setplotcfgname must be from list returned by plotdevicelist.
also check that you have plotsettingsvalidator module loaded to your application ( :drxdynamiclinker()->loadapp(l"plotsettingsvalidator"); ) the best example of how to use validator is mfcapp and page setup dialog.
mfcapp's page setup dialog has list of supported devices on your pc, but if your application hasn't loaded validator module, list of supported device is very small (none device + dwf device)
thank you again!
i've missed that loading :-(
miklos
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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



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


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