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

problem with rendering linetype scales / printing with new v
problem with rendering linetype scales / printing with new vectorizing classes
i updated my application to use the new dd rendering classes, and i noticed that some bugs where fixed (and another one introduced, like said in my last post...);
anyway, for me these new classes are really great and i would like to use them also for printing, but it seems they're intended only for rendering on screen (hwnd instead a dc); the main reason for that is that the old classes have a bug (that i haven't noticed until dd 1.10) when rendering linetypes different from continuous - the linetype scale changes with the zoom, and when printing the linetype scale is too small (it seems that the global linetype scale factor is ignored); the new classes work very well in this respect, all linetypes are represented correctly and with the right scale.
is this a known bug with the old rendering squeme or is there something that i can do to solve it? (ideally i would like to use the new classes for printing also...); this is really important since these drawings with incorrect line scales are generating problems with our suppliers...
thanks for your attention,
tiago gehring
hi,
with fix attached to new classes must print fine:
code:
void cdwgviewer:nprint(cdc* pdc, cprintinfo* pinfo)
{
crect rcdraw = pinfo->m_rectdraw;
if(m_pprinterdevice.isnull())
{
m_pprinterdevice = theapp.getdevicebyflags(odgsdeviceinfo:dgsdeviceflagprinter | odgsdeviceinfo:dgsdeviceflaggdi);
m_pprinterdevice = oddbgsmanager::setupactivelayoutviews(m_pprinterdevice, this);
odgsdcrect rc(odgsdcpoint(rcdraw.left, rcdraw.bottom-1), odgsdcpoint(rcdraw.right-1, rcdraw.top));
m_pprinterdevice->onsize(rc);
m_pprinterdevice->setlogicalpalette(odcmacadlightpalette(), 256);
m_pprinterdevice->setbackgroundcolor(odrgb(255,255,255));
// copy view data
int n = m_pdevice->numviews();
for(int i=0; i<n; ++i)
{
const odgsview* pfrom = m_pdevice->viewat(i);
odgsview* pto = m_pprinterdevice->viewat(i);
if(pfrom && pto)
{
pto->setview(pfrom->position(), pfrom->target(), pfrom->upvector(),
0.0, pfrom->fieldheight(),
pfrom->isperspective() ? odgsview::kperspective : odgsview::kparallel);
}
}
}
m_pprinterdevice->properties()->putat("windowhdc", odrxvariantvalue((long)pdc->m_hdc));
setplotgeneration(true);
m_pprinterdevice->update(0);
setplotgeneration(false);
cview:nprint(pdc, pinfo);
}
create exgsgdivectorizedevice instance for m_pprinterdevice.
dmitry,
thanks for your reply. i tested your suggestion and was able to print a file, but i still have problems with linetype scales (btw when trying to intantiate a odsmartptr<exgsgdivectorizedevice> object the compiler said that operator -> was ambiguous, so what i did was cast the odgsdevice * into a exgsgdivectorizedevice *);
i also looked at how class exscreendevice is implemented and created a exprinterdevice based on it, so i declare my device as
exprinterdevice<exgsgdivectorizedevice> ptrdevice; it also worked and i was able to print files, but again i have problems with line scales;
what is strange is that the drawing appears ok on screen, it's just when i print it that i have problems. i re-checked how i create the device for viewing and confirmed that it's declared as exscreendevice<exgsgdivectorizedevice>, so for me viewing/printing should use the same vectorizing squeme.
i really don't know what i'm doing wrong, any suggestion appreciated..
thanks again,
tiago
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】problem in linetype rendering yang686526 DirectDWG 0 2009-05-06 10:45 PM
【转帖】linetype rendering question yang686526 DirectDWG 0 2009-05-06 04:51 PM
【转帖】linetype rendering 9simplification 0 yang686526 DirectDWG 0 2009-05-06 04:51 PM
【转帖】extremely slow rendering.... why please help me111 yang686526 DirectDWG 0 2009-05-05 10:43 AM
【转帖】standard drawing scales yang686526 American standards 0 2009-05-04 10:27 AM


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


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