高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】how to obtain the uom for wcs units
how to obtain the uom for wcs units
how to obtain the uom for wcs units
how can i find out the unit of measure being used for wcs measurements? for example, how can i determine if the odgeextents3d value returned by getgeomextents() for an oddblayout object is in feet, yards, meters, or altogether something else? i can't find anything in the documentation that gives me this information. thanks for your help.
more details
i would like to provide details on my post. i read other posts saying that we can assume 1 wcs unit = 1" if the measurement is in english instead of metric. however, i have not seen this to be consistent. for example, in the attached .dxf file, getgeomextents() for the model layout returns the following extents with min of 0, 1284 and a max of 1920, 0, which makes the drawing 1920x1284 in size. however, the numbers don't seem to make sense. when i display the drawing after zoomextents(), there's no way that what's being displayed is 1920 inches x 1284 inches. of course, i'm assuming that what's being displayed after doing zoomextents() corresponds to the same area referred by getgeomextents() of the layout. can anyone help me understand what i'm doing wrong? thanks.
attached files (375.0 kb, 2 views)
last edited by than; 27th november 2006 at 05:05 pmfff">.
world coordinates do not have associated units other than in/cm, they may be regarded as a dimensionless quantity.
there is an insunits variable that control scaling of inserted blocks. it may be regarded as drawing units in some context.
vladimir
what about the value returned from getgeomextents?
ok. i understand that the units can be either cm or inches depending on whether it's metric or not. i guess the more important question is whether i can rely on the value being returned from getgeomextents() for the oddblayout object. when i do a zoomextents() on the view, is the view showing me the area specificed by oddblayout::getgeomextents()? if not, what is the area that zoomextents() is showing me?
oddblayout::getgeomextents() for modelspace just returns {limmin,limmax} (which may be invalid).
zoomextents() takes into account hidden layers/entities, etc. it is supposed to work exactly like corresponding acad command
vladimir
how do i get the wcs extents of zoomextents()?
ok... it's what i suspected... basically, there's no real correlation between layout extents and zoomextents(). now, what i want to do is to tell the user the width and height of what they're looking at in the view, in wcs units. how do i get that? my only guess is to do the following:
1) get the display width and height using oddbabstractviewpe::viewextents()
2) get the matrix that transforms the display to wcs using oddbabstractviewpe::eyetoworld()
3) transform the result of viewextents() using the matrix from eyetoworld(), which should give me the width and height of the view in wcs
is my assumption correct? anything i missed? thanks.
it looks like a correct way.
vladimir
|