高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】dwg extension in world coordinates
dwg extension in world coordinates
dwg extension in world coordinates
hi,
i need to know the dimension of the dwg drawing area in "world coordinate system".
i need to read them directly from dwg file, not getting them from drawing properties (i.e. viewmatrix(), ...).
are there information of this kind in db or do i need to make a fusion of all the bounding box of every object composing the dwg?
thank you in advance for help.
sincerely
walter
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============
myzhar
# 9th february 2006, 10:41 am
moderator join date: mar 2002
posts: 2,994
drawing contains system variables extmin/extmax - extents in model space. (pdb->getextmin())
layouts also have getextmin()/getextmax() functions.
sergey slezkin
sslezkin
# 10th february 2006, 12:39 am
registered user join date: feb 2006
location: pisa
posts: 69
ok,
i tried to use them and i'm getting wrong results...
i explain better:
i need to draw n dwg files on an existing georeferenced image.
to make so i calculate "bounding box" of every dwg and i plot them setting the position on my hdc using "onsize( calculatedbounds )".
i think that the problem is just in "onsize": as i noticed with onsize i set the bounds of the view where dwg is rendered, not the hdc size of the dwg and it results smaller than wanted.
is there a way to set size of the view such to have correct size?
i hope to have been clear
thank you for help,
walter
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============
myzhar
# 10th february 2006, 04:17 am
registered user join date: feb 2006
location: pisa
posts: 69
quote:
originally posted by sergey slezkin
drawing contains system variables extmin/extmax - extents in model space. (pdb->getextmin())
layouts also have getextmin()/getextmax() functions.
pdb->getextmin() does not exist, but i can make it for layouts.
at this point how do i convert coordinates from model space to wcs?
excuse all my doubt, but forum is the best way to undestand
thank you again and more
walter
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============
myzhar
# 12th february 2006, 12:47 am
founding member join date: jun 2002
location: bulgaria
posts: 377
i think for the active layout it was pdb->getpextmin() and pdb->getpextmax()? sorry if i'm wrong.
best regards
chudomir
chudo
# 12th february 2006, 02:11 am
moderator join date: mar 2002
posts: 2,994
oddbdatabase::getextmin() returns model space extents.
oddbdatabase::getpextmin() returns active paper space extents.
sergey slezkin
sslezkin
# 12th february 2006, 10:24 am
registered user join date: feb 2006
location: pisa
posts: 69
is it possible that this kind of information are not included in database?
sometimes i get (0.0, 0.0) for min and (0.0, 0.0) for max, also when the dwg has its extensions...
is there a way to force the library to calculate them?!?
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============
myzhar
# 13th february 2006, 01:03 am
registered user join date: feb 2006
location: pisa
posts: 69
quote:
originally posted by sergey slezkin
oddbdatabase::getextmin() returns model space extents.
oddbdatabase::getpextmin() returns active paper space extents.
are you sure that these functions exist for oddbdatabase class?
i tried to search them, but i cannot find. they seem to exist only for oddblayout class.
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============
myzhar
# 13th february 2006, 04:02 am
softdev join date: oct 2002
location: russian federation, spb
posts: 332
hi,
oddbdatabase::getextmin() and getextmax() exist (they are declared using macros that's why you failed to find they). they return system variables saved in drawing but variables may differ from actual extents. to calculate actual extents call odgidrawable::getgeomextents() on desired block record (*model_space).
oddbobjectptr pmsblock = pdb->getmodelspaceid().safeopenobject();
odgeextents3d extents;
odresult err = pmsblock->getgeomextents(extents);
dmitry a. novikov
# 13th february 2006, 04:23 am
registered user join date: feb 2006
location: pisa
posts: 69
quote:
originally posted by dmitry a. novikov
.....
to calculate actual extents call odgidrawable::getgeomextents() on desired block record (*model_space).
oddbobjectptr pmsblock = pdb->getmodelspaceid().safeopenobject();
odgeextents3d extents;
odresult err = pmsblock->getgeomextents(extents);
then to know the extension of whole dwg i have to calculate the union of all extents of all the objects of all the blocks?
this is just what i want to avoid if there is a clever way one.....
thank you
walter
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============
myzhar
# 13th february 2006, 04:30 am
softdev join date: oct 2002
location: russian federation, spb
posts: 332
hi,
no, you have not. dd will do this for you inside getgeomextents().
dmitry a. novikov
none
? | ?
thread tools
display modes
linear mode
search this thread
rate this thread
excellent
good
average
bad
terrible
posting rules
you may post new threads
you may post replies
you may post attachments
you may edit your posts
is on
are on
code is off
html code is off
forum jump
user control panel private messages subscriptions who's online search forums forums home general topics news questions and remarks business issues industry commentary general software issues documentation issues future directions dwg libraries dwgdirect.net dwgdirect, c++ version dwgdirectx, activex version adtdirect/c3ddirect opendwg toolkit/viewkit dgn libraries dgndirect, c++ version (2.x+) dgndirect libraries (legacy 0.99xx)
all times are gmt -7. the time now is 11:34 pmfff">.
- - -
copyright ?2000 - 2009, jelsoft enterprises ltd.
copyright 1998-2008 open design alliance inc.
drawing contains system variables extmin/extmax - extents in model space. (pdb->getextmin())
layouts also have getextmin()/getextmax() functions.
sergey slezkin
ok,
i tried to use them and i'm getting wrong results...
i explain better:
i need to draw n dwg files on an existing georeferenced image.
to make so i calculate "bounding box" of every dwg and i plot them setting the position on my hdc using "onsize( calculatedbounds )".
i think that the problem is just in "onsize": as i noticed with onsize i set the bounds of the view where dwg is rendered, not the hdc size of the dwg and it results smaller than wanted.
is there a way to set size of the view such to have correct size?
i hope to have been clear
thank you for help,
walter
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============
quote:
originally posted by sergey slezkin
drawing contains system variables extmin/extmax - extents in model space. (pdb->getextmin())
layouts also have getextmin()/getextmax() functions.
pdb->getextmin() does not exist, but i can make it for layouts.
at this point how do i convert coordinates from model space to wcs?
excuse all my doubt, but forum is the best way to undestand
thank you again and more
walter
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============
i think for the active layout it was pdb->getpextmin() and pdb->getpextmax()? sorry if i'm wrong.
best regards
chudomir
oddbdatabase::getextmin() returns model space extents.
oddbdatabase::getpextmin() returns active paper space extents.
sergey slezkin
is it possible that this kind of information are not included in database?
sometimes i get (0.0, 0.0) for min and (0.0, 0.0) for max, also when the dwg has its extensions...
is there a way to force the library to calculate them?!?
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============
quote:
originally posted by sergey slezkin
oddbdatabase::getextmin() returns model space extents.
oddbdatabase::getpextmin() returns active paper space extents.
are you sure that these functions exist for oddbdatabase class?
i tried to search them, but i cannot find. they seem to exist only for oddblayout class.
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============
hi,
oddbdatabase::getextmin() and getextmax() exist (they are declared using macros that's why you failed to find they). they return system variables saved in drawing but variables may differ from actual extents. to calculate actual extents call odgidrawable::getgeomextents() on desired block record (*model_space).
oddbobjectptr pmsblock = pdb->getmodelspaceid().safeopenobject();
odgeextents3d extents;
odresult err = pmsblock->getgeomextents(extents);
quote:
originally posted by dmitry a. novikov
.....
to calculate actual extents call odgidrawable::getgeomextents() on desired block record (*model_space).
oddbobjectptr pmsblock = pdb->getmodelspaceid().safeopenobject();
odgeextents3d extents;
odresult err = pmsblock->getgeomextents(extents);
then to know the extension of whole dwg i have to calculate the union of all extents of all the objects of all the blocks?
this is just what i want to avoid if there is a clever way one.....
thank you
walter
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============
hi,
no, you have not. dd will do this for you inside getgeomextents().
|