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

odamfcapp print and preview
odamfcapp print and preview
hi
to print and preview its necessary that the view (zoom) is the same for print as view. this is not functioning in the 1.13 version.
also i need to get the printername substituted with a function to retreive the default printer (in a valid way), and the it uses the printer setup with print setup.
in my case it allways tells me:
"this printer configuraion cannot be used. the default print device has been substituted.";
any help will be received with a smile.
laurs
hi,
try v1.13, i have fixed something in printing\preview. 99% of changes is in the odamfc sample in the onprint method. autocad drawing store printer info. for example i create file and my printer is hp4000, i send file to you ( your printer is hp9000). autocad will change page settings of hp4000 to settings of hp9000, but ddt cannot apply it correctly. the best for you is open my file in autocad and resave it with hp9000 settings.
"this printer configuration cannot be used. the default print device has been substituted.";
look at code in the mfcapp, it was called than your printer is not equal to drawing printer.
the preview\printing in 1.12 does not support scaling, offsetting, border margins and plotstyle settings. i have fixed most of this in 1.13. please, use 1.13 for your task.
last edited by sslezkin; 20th april 2005 at 04:40 amfff">.
if you use 1.13, give me more information about problem.
odamfcapp
i use 1.13.
when i debug into the application to onprint and onprintprepare, odamfc does not recognize the printer as somebody allready told me. therefore odamfc jumps out with no recalculation of the view / zoom. i print to a a4 or a3 standard canon copyer or a hp-laserjet with no difference. what i get out of the printer or print preview is what near to the real paper coordinates (i think).
a lot og dwg and dxf files are generated in "suspicious" programs and will hold no printer. i could be nice if the odamfcapp could use the default printer in winxp to draw on.
explanation: i use the odamfcapp as a fast way for our customers to view and print a dwg/dxf drawings, before import to our cad program. the advantage to other "free" viewers are: its small, easy to use and it can print (if we are lucky today).
best regards
please, attach sample file, i will check it on my pc.
i dont understand, have you picture out of printer\preview paper or onprint draw nothing, or mfcapp skip all onprint code?
i create new drawing in autocad with one circle, set printer of model space to none, load drawing to mfcapp, call preview, message " ... ", ok, circle appears in preview, call print - circle on the paper. is it work on your pc ?
thanks.
odamfcapp nothing in preview
if i create a default drawing (circle + rectangle) in intellicad 2000 i do not need to set any "space". i can see the drawing in the odamfcapp but in preview and print the paper is white, nothing is seen.
for other dwg/dxf files from customers we will sometime see all the drawing, and sometime nothing. i attach two files to you, one "ivf samples 2.dwg" is very small but i only see part of the drawing in preview, the other testcircle.dwg nothing is seen.
thanks
attached files (293.4 kb, 17 views)
(21.4 kb, 10 views)

thanks...
files has uninitialized active layout settings. mfcapp is a sample with limited functionality. i think that user should initialize active layout if printer was changed in onprepareprinting.
as a temporary problem solve you can add next strings in onprint :
double dleftmargin = playout->getleftmargin(); // in mm
double drightmargin = playout->getrightmargin(); // in mm
double dtopmargin = playout->gettopmargin(); // in mm
double dbottommargin = playout->getbottommargin();// in mm
oddbplotsettings:lottype plottype = playout->plottype(); // added
bscaledtofit = bcentered = true; // added
plottype = oddbplotsettings::kextents; // added
// set lineweight scale factor for model space
if (bprintlw && m_pprinterdevice->iskindof(odgsmodellayouthelper::desc()))
also replace all playout->plottype() to plottype in onprint.
these changes enable centered and scaled flags and set plottype to extents. is it clear?
it is not bug, it is limitation of mfcapp sample. you should update active layout settings when you change printer or paper size or something else. it is platform depended functionality and application should fix it. read documentation about oddbplotsettings for more information.
possibly we will add it later, but it is not high priority task
odamfcapp print and preview
thanks
i will try this over the week-end.
i understand what you write and i know thats its a limitation and that odamfcapp is created for test purpose and not as a default dwg viewer, but..
best regards laurs
also there is no link between drawing zooming\rotation in mfcapp and printing\preview due to drawing zooming\rotation doesn't change stored in database acvite viewport parameters.
odamfcapp print and preview
following your instructions i managed to make print and preview do a proper picture, so thanks for the help.
i will save the information to the next update so that i do not ask again.
if it is possible continue your work on odamfcapp, as it nice to have a data viewer (and...)
with best regards
laurs
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】odamfcapp example, drawing preview yang686526 DirectDWG 0 2009-05-06 07:00 PM


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


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