几何尺寸与公差论坛------致力于产品几何量公差标准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-05, 08:01 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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().
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】drawing a layout and getting the same coordinates as autocad yang686526 DirectDWG 0 2009-05-04 08:06 PM
【转帖】bounding box system coordinates yang686526 DirectDWG 0 2009-05-04 04:59 PM
【转帖】asme - where to star yang686526 American standards 0 2009-04-29 07:28 PM
【转帖】ransform face coordinates to assembly9global0 coordinates yang686526 SolidWorks二次开发 0 2009-04-12 10:40 PM


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


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