高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】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
|