几何尺寸与公差论坛------致力于产品几何量公差标准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-04, 07:50 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】display drawing without background

display drawing without background

display drawing without background
we are implementing dwgdirect in a c++ mfc application, where the drawing will be displayed among other components. displaying the drawing works fine, and also all other components drawn after the import of the drawing shows, but anything done prior to the dwg import is hidden by the drawing's background.
how to avoid drawing any background or how to make the background transparent?

m j
# 25th january 2005, 07:32 am

moderator join date: dec 1969
posts: 811
there is no way to control this in our 1.12 version, but we will provide a mechanism for controlling this in our upcoming 1.13 release.


npeterson
# 6th april 2005, 07:40 pm

registered user join date: mar 2005
posts: 5
i am having a similar problem. i orginally created a dwg to wmf conversion program using the opendwg toolkit\viewkit, which did not seem to output the background of paperspace drawings.
now i am trying to recreated the exact same wmf image using the dgwdirect c++ library, and now the background of paperspace drawings are forcing the wmf image to be slightly larger than expected. if there was some way to prevent the background from being drawn, i could prevent this.
when will dwgdirect 1.13 be available, with the ability to surpress the background?
regards,
sijmen.

sijmeng
# 7th april 2005, 08:40 am

moderator join date: dec 1969
posts: 811
we are polishing it right now, and if all goes well it should be available early next week.


npeterson
# 22nd april 2005, 03:04 am

registered user join date: oct 2002
posts: 16
how can i avoid the background being cleared in the newly released version 1.13?

stefan hestner
# 22nd april 2005, 04:04 am

moderator join date: mar 2002
posts: 2,994
see "control of background paper display during vectorization" in release notes.
sergey slezkin

sslezkin
# 25th april 2005, 01:52 am

registered user join date: oct 2002
posts: 16
i have looked at the oddblayoutpaperpe class but i dont think that it can solve my problem. what i wonder is if it's possible to prevent the window background from being cleared when i call odgsdevice->update(). i would like to draw several dwg-files in the same window but for each call to update the background is erased. (same problem as described by the signature m j originally).

stefan hestner
# 25th april 2005, 07:29 pm

registered user join date: may 2003
location: brisbane, australia
posts: 39
its important to note that the background is not cleared. when the drawing is rendered, it draws a solid polygon over any previously rendered drawing, which represents the background. you simply need to prevent the background from being rendered.
add the following code somewhere in a header file:
code:
#include "odacommon.h"
#include "staticrxobject.h "
#include "dblayoutpaperpe.h"
class cdwglayoutpapercustomizationpe : public odstaticrxobject<oddblayoutpaperpe>
{
public:
virtual bool drawpaper(const oddblayout* , odgiworlddraw* pwd, odgepoint3d* points) { return true; }
virtual bool drawborder(const oddblayout* , odgiworlddraw* pwd, odgepoint3d* points) { return true; }
virtual bool drawmargins(const oddblayout* , odgiworlddraw* pwd, odgepoint3d* points) { return true; }
};
then in your code after calling odinitialize(...) and odgsinitialize(), add the following code:
code:
// add the extension to disable the drawing border from being rendered.
cdwglayoutpapercustomizationpe paperdrawingpe;
oddblayout::desc()->addx(oddblayoutpaperpe::desc(), &paperdrawingpe);
and finally, just before calling odgsuninitialize() and oduninitialize(), add the following code:
code:
// remove the extension to disable the drawing border from being rendered.
oddblayout::desc()->delx(oddblayoutpaperpe::desc());
this will prevent any of the border and background from being rendered.
regards,
sijmen.

sijmen.grunbauer@mincom.com
# 26th april 2005, 03:30 am

registered user join date: oct 2002
posts: 16
thanks for your help sijmen. but i still don't get it right. i have implemented the three draw-methods, and have them to do nothing but return true. and i have checked in the debugger that they are called. the solid polygon is still drawn, making everything hidden.
i have also tried to set the clearscreen flag to false but the only effect it has is that the polygon changes color to black:
odgsdeviceptr->odrxdictionaryptr->putat("clearscreen", odrxvariantvalue(false));
another problem is that i need this to work in model space layouts as well.
wbr,
stefan

stefan hestner

none
? | ?
thread tools



display modes
linear mode


search this thread

rate this thread
excellent
good
average
bad
terrible

posting rules
you may post new threads
you may post replies
you may post attachments
you may edit your posts
is on
are on
code is off
html code is off
forum jump
user control panel private messages subscriptions who's online search forums forums home general topics news questions and remarks business issues industry commentary general software issues documentation issues future directions dwg libraries dwgdirect.net dwgdirect, c++ version dwgdirectx, activex version adtdirect/c3ddirect opendwg toolkit/viewkit dgn libraries dgndirect, c++ version (2.x+) dgndirect libraries (legacy 0.99xx)
all times are gmt -7. the time now is 12:19 amfff">.
- - -
copyright ?2000 - 2009, jelsoft enterprises ltd.
copyright 1998-2008 open design alliance inc.
there is no way to control this in our 1.12 version, but we will provide a mechanism for controlling this in our upcoming 1.13 release.

i am having a similar problem. i orginally created a dwg to wmf conversion program using the opendwg toolkit\viewkit, which did not seem to output the background of paperspace drawings.
now i am trying to recreated the exact same wmf image using the dgwdirect c++ library, and now the background of paperspace drawings are forcing the wmf image to be slightly larger than expected. if there was some way to prevent the background from being drawn, i could prevent this.
when will dwgdirect 1.13 be available, with the ability to surpress the background?
regards,
sijmen.
we are polishing it right now, and if all goes well it should be available early next week.

how can i avoid the background being cleared in the newly released version 1.13?
see "control of background paper display during vectorization" in release notes.
sergey slezkin
i have looked at the oddblayoutpaperpe class but i dont think that it can solve my problem. what i wonder is if it's possible to prevent the window background from being cleared when i call odgsdevice->update(). i would like to draw several dwg-files in the same window but for each call to update the background is erased. (same problem as described by the signature m j originally).
its important to note that the background is not cleared. when the drawing is rendered, it draws a solid polygon over any previously rendered drawing, which represents the background. you simply need to prevent the background from being rendered.
add the following code somewhere in a header file:
code:
#include "odacommon.h"
#include "staticrxobject.h "
#include "dblayoutpaperpe.h"
class cdwglayoutpapercustomizationpe : public odstaticrxobject<oddblayoutpaperpe>
{
public:
virtual bool drawpaper(const oddblayout* , odgiworlddraw* pwd, odgepoint3d* points) { return true; }
virtual bool drawborder(const oddblayout* , odgiworlddraw* pwd, odgepoint3d* points) { return true; }
virtual bool drawmargins(const oddblayout* , odgiworlddraw* pwd, odgepoint3d* points) { return true; }
};
then in your code after calling odinitialize(...) and odgsinitialize(), add the following code:
code:
// add the extension to disable the drawing border from being rendered.
cdwglayoutpapercustomizationpe paperdrawingpe;
oddblayout::desc()->addx(oddblayoutpaperpe::desc(), &paperdrawingpe);
and finally, just before calling odgsuninitialize() and oduninitialize(), add the following code:
code:
// remove the extension to disable the drawing border from being rendered.
oddblayout::desc()->delx(oddblayoutpaperpe::desc());
this will prevent any of the border and background from being rendered.
regards,
sijmen.
thanks for your help sijmen. but i still don't get it right. i have implemented the three draw-methods, and have them to do nothing but return true. and i have checked in the debugger that they are called. the solid polygon is still drawn, making everything hidden.
i have also tried to set the clearscreen flag to false but the only effect it has is that the polygon changes color to black:
odgsdeviceptr->odrxdictionaryptr->putat("clearscreen", odrxvariantvalue(false));
another problem is that i need this to work in model space layouts as well.
wbr,
stefan
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】value of drawing check yang686526 American standards 0 2009-05-04 11:08 AM
【转帖】good example of engineering drawing yang686526 American standards 0 2009-04-29 08:15 PM
【转帖】drawing number system - do you still indicate dwg sie in the yang686526 American standards 0 2009-04-29 07:45 PM
【转帖】decimal dimensioningfractional equivalents yang686526 American standards 0 2009-04-29 07:28 PM
【转帖】asme - where to star yang686526 American standards 0 2009-04-29 07:28 PM


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


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