查看单个帖子
旧 2009-05-05, 10:23 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】export data in different units

export data in different units
export data in different units
hi everybody,
in my project, a user can export the same data (in millimeters) extracted from a dwg file into a dxf/dwg file in a unit that the user specifies (millimeters, meters, inchs, feet, ...).
is there a simple way to do it using the dwgdirect api?
the only solution i found is to multiply each entity using oddbentity::transformby() by a scaled matrix.
is there any interactions between oddbblocktablerecord::setblockinsertunits() and oddbdatabase::setinsunits()?
thanks
best regards
aur閘ien telmon
you can use oddbdatabase::insert() function to insert one drawing into another having specified transformation matrix.
actually each entity will be transformed.
block units and drawing insunits are used while inserting a database, blocks, while drag&draw operations etc. to perform automatic scaling.
for example: drawing is in mm and a block has cm units.
you insert a block (create block reference) with 1,1,1 scale.
actually block reference will be created with 10,10,10 scale. you can see it in dxf output for example.
but 1,1,1 scale will be displayed in properties :-)
if you have a line in drawing from (5,5,0) to (10,10,0) manipulating with drawing/block units will never change the coordinates of existing line.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)