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