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

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】has oddbviewportsetnonrectclipentityid9...0 been cha (http://www.dimcax.com/hust/showthread.php?t=16462)

yang686526 2009-05-05 11:47 AM

【转帖】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


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