高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】computing dimension blocks
computing dimension blocks
computing dimension blocks
hi,
a question on dimension block recomputor. i'm searching for a way to bypass the recomputor provided by dwgdirect, and to use my own recomputor instead.
i'm writing a converter from another cad to dxf/dwg, then i want to add an option to put in *d blocks something very close to the display of the dimensions of source cad, because in some cases it's preferable to have original display (and it's a workaround for some bugs of dwgdirect ). i just need that my code can fill the *d blocks.
the solution i designed is very simple:
- create dimensions in dwgdirect;
- modify the code of built-in recomputors in order to disable them;
- retrieve the *d block of each dimension; and
- call my block-filler code on each block.
what do you think about it? is there a better way to accomplish this task?
ciao
marco
recomputedimblock is an external module which is available with sources (extensions/recomputedimblock)
the extensions folder also contains dummyrecomputedimblock which turns off the automatic blocks recomputing.
you can provide your own implementation of this module.
if your application needs to create dimensions and their blocks only once (is used for export to dwg not for editing) you can create the blocks manually, use oddbdimension::setdimblockid() and dummyrecomputedimblock module to turn off dd standard recomputing.
sergey slezkin
many thanks. my implementation works as expected.
i prefer not do disable completely the built-in recomputor, but only for some cases. i modified the code of oddbdimrecomputepeimpl::recomputedimblock to make it dummy when it's the case, but it generates always the *d block. then, later i get the blockid and do what i need to do.
ciao
marco
|