高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】a ordinate dimension problem when exploding
a ordinate dimension problem when exploding
a ordinate dimension problem when exploding
hi,
i have an ordinate problem when exploding. now i use dd 1.10 update 1. the following is my code to export the ordinate dimension:
oddbordinatedimensionptr porddim = oddbordinatedimension::createobject();
porddim->setdimblockid( dimblockid );
porddim->setorigin( odgepoint3d( dimlinest[0],dimlinest[1],dimlinest[2] )); //dxf 10
porddim->setdefiningpoint( odgepoint3d( planept1[0],planept1[1],planept1[2] ));
porddim->setleaderendpoint(odgepoint3d(planept0[0],planept0[1],planept0[2]));
porddim->settextposition( odgepoint3d(textpt[0],textpt[1],textpt[2]) );
opening the attachment file in autocad and inserting the block named "front". comparing with this block, we can see that after exploding, the looks of ordinate dimension chang: the dimension lines disappear. if we modify the textmovement option in fit, the dimension lines appear but not are right.
i don't know what causes this difference when exploding. maybe i set some points or positions member error.
best regards
attached files
quote:
originally posted by enigma
opening the attachment file in autocad and inserting the block named "front". comparing with this block, we can see that after exploding, the looks of ordinate dimension chang: the dimension lines disappear. if we modify the textmovement option in fit, the dimension lines appear but not are right.
difference due to bug of recomputedimblock functionality of ordinate dimension. thank you for bugreport.
sincerely yours,
george udov
a ordinate dimension problem when exploding
quote:
originally posted by george udov
difference due to bug of recomputedimblock functionality of ordinate dimension. thank you for bugreport.
hi,
i think that you must have noticed that if exploding the insert block in autocad, the look is different from the insert. i think at least that when exploding an insert in autocad( not exploding with dd)fff">, the look is still the same as before. because the look will be changed when exploding the insert in autocad, so there must have some errors in my attachment file .e.g setting some point members error value. i have done several tests to fix this, but i haven't found it. would you like to tell me which point members are wrong?
also, i wrote my dwgdirect code by referring to my opendwg code. the following is my original opendwg code to export the ordinate dimension:
pent->dim.dimflag |= ad_dimtype_ordinate; //ordinate dimension
pent->dim.defpt2[0] = planept1[0];
pent->dim.defpt2[1] = planept1[1];
pent->dim.defpt2[2] = planept1[2];
pent->dim.defpt3[0] = planept0[0];
pent->dim.defpt3[1] = planept0[1];
pent->dim.defpt3[2] = planept0[2];
pent->dim.defpt4[0] = extline1end[0];
pent->dim.defpt4[1] = extline1end[1];
pent->dim.defpt4[2] = extline1end[2];
i don't know the corresponding functions to set these point members in dwgdirect . would you like to tell me which they are?
best regards
quote:
originally posted by enigma
hi,
i think that you must have noticed that if exploding the insert block in autocad, the look is different from the insert. i think at least that when exploding an insert in autocad( not exploding with dd)fff">, the look is still the same as before. because the look will be changed when exploding the insert in autocad, so there must have some errors in my attachment file .e.g setting some point members error value.
when you insert block in autocad, autocad doesn't recompute dimesion blocks. it shows them as they was computed by dd. but when you explode block containing dimension, autocad calls transformby() method of dimension to apply block transform. this sets the dimension's flag "modifiedgraphics", so dimension block is recomputed. so the look of dimensions changes after explode because dd's and autocad's recomputedimensionblock functionality works differently on such input data. differences in work of recomputedimensionblock functionality are dd's bugs, without relation to input data correctness. but such differences often appear on incorrect data - here you are right.
quote:
originally posted by enigma
i have done several tests to fix this, but i haven't found it. would you like to tell me which point members are wrong?
also, i wrote my dwgdirect code by referring to my opendwg code. the following is my original opendwg code to export the ordinate dimension:
pent->dim.dimflag |= ad_dimtype_ordinate; //ordinate dimension
pent->dim.defpt2[0] = planept1[0];
pent->dim.defpt2[1] = planept1[1];
pent->dim.defpt2[2] = planept1[2];
pent->dim.defpt3[0] = planept0[0];
pent->dim.defpt3[1] = planept0[1];
pent->dim.defpt3[2] = planept0[2];
pent->dim.defpt4[0] = extline1end[0];
pent->dim.defpt4[1] = extline1end[1];
pent->dim.defpt4[2] = extline1end[2];
first, opendwg doesn't write to file pent->dim.defpt4 for ordinate dimensions. pent->dim.defpt2 is for groupcode 13, pent->dim.defpt3 is for groupcode 14. so to be equal with opendwg code you should set points like this:
code:
porddim->setdefiningpoint( odgepoint3d( planept1[0],planept1[1],planept1[2] ));
porddim->setleaderendpoint(odgepoint3d(planept0[0],planept0[1],planept0[2]));
text is positioned automatically by default. also you shouldn't set origin.
sincerely yours,
george udov
|