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

layout paper size?
layout paper size?
how to set the papersize of a newly added layout eg a4 or a0, then control the size of the overall viewport?
you should use the class oddbplotsettingsvalidator to set the different properties of a oddbplotsettings class.
i'm not sure what do you mean by setting the size of the overall paperspacec viewport - is it the overall scale factor?
best regards
chudomir
i mean the size of the drawing boundry. i may have an a4 sized paper
297 x 210 mm
then i want maybe 20 mm margin, having the "overall viewport" sized
277 x 190 mm
maybe i misunderstand the term "overall viewport" ?
the overall viewport is called the oddbviewport entity that renders the wohle paperspace scene.
what do you mean actually by "drawing boundry" - is the paper (the white rect that autocad shows in the paperspace)?
best regards
chudomir
well i think i'm confused about things here, i may not even need a drawing boundry (papersize minus marginsizes), if the overall viewport is simply the view of the paperspace.
i still struggle with the paper size, i created a database in kmetric units. and now my paper is just a small rectangle in the lower left corner of the layout - as if my viewport is way too bit for the paper
i set the size of the viewport to 297 x 210, maybe acad doesn't interpret this as millimeters?
i tried to set the w/h of the overall viewport to have acad start in zoom all position, but this fails - how to achieve this?
also my modelspace starts in a weird zoom / position..
thank you for helping
so you want just to zoom to the paper extents (taking the margins into consideration too)? (sorry for asking so many times)
best regards
chudomir
no problem, i'll explain again:
problem 1:
opening my generated drawing in autocad, my paper is (9.6 x 8.04) and my drawing is (297 x 210) - so the drawing too big for the paper. i thing there is a unit problem maybe?
problem 1:
i want to zoom to paper extends (if this means zooming so that the paper is drawn in the middle of the screen at startup)
thanks again for your time!
thanks for this info, it's a little bit clearer now for me.
so first you must set the paper size, plot scale, etc.
i don't know whether this is the best code in this case, but i think it should work (i haven't compiled so it may not compile)... lets consider you have a opened oddblayout object for write.
code:
oddbplotsettingsvalidator* pvalidator = playout->database()->appservices()->plotsettingsvalidator();
// set the scale to 1:1 in mm, and the plot target to be klayout
// (i.e. the sheet of paper and not the current view or events, etc)
pvalidator->setmediasize(playout,"a4",210,297,oddbplotsettings::kmillimeters, 5,5,5,5);
pvalidator->setplotpaperunits(playout,oddbplotsettings::kmillimeters);
pvalidator->setplotrotation(playout,oddbplotsettings::k90degrees);
pvalidator->setplottype(playout,oddbplotsettings::klayout);
pvalidator->setusestandardscale(playout,true);
pvalidator->setstdscale(playout,oddbplotsettings::k1_1);
pvalidator->setstdscaletype(playout,1.0);
please try this and then the setting of the zoom in the current viewport should be easier (i think zoomextents() should be pretty enough).
by the way the margins are set manually here and probably they should be obtained from the printer in some way...
best regards
chudomir
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】given pdb, how is paper size found yang686526 DirectDWG 0 2009-05-05 11:37 AM
【转帖】getting correct text size and width factor yang686526 DirectDWG 0 2009-05-05 11:28 AM
【转帖】paper sizes yang686526 American standards 0 2009-04-29 09:07 PM
【转帖】how to set up the printer and paper size yang686526 SolidWorks二次开发 0 2009-04-13 12:02 PM


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


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