高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】invalid input exception
invalid input exception
invalid input exception
hi,
i'm having problems while writing a rotated dimension with size 0 and without text. app raises a "invalid input" exception.
i'm using dwgdirect 1.11 update version and c++ builder 6 compiler.
using code bellow is possible reproduce error in exwriter example. function dbfiller::adddimensions was changed.
is there anything wrong in the code bellow? or error is in library?
regards,
regina keller.
code:
void dbfiller::adddimensions(oddbdatabase* pdb, const oddbobjectid& styleid, const oddbobjectid& layerid)
{
// some code
...
// my test code begins here
oddbrotateddimensionptr rotateddimension = oddbrotateddimension::createobject();
rotateddimension->setdatabasedefaults(pdb);
pblock->appendoddbentity(rotateddimension);
xline1pt.x = 10;
xline1pt.y = 10;
xline2pt.x = xline1pt.x;
xline2pt.y = xline1pt.y + 10;
dimlinept.x = 15;
dimlinept.y = 30;
// if line bellow is commented exception isn't raised.
rotateddimension->setdimensiontext(" ");
// extended data
odresbufptr xiter = odresbuf::newrb(odresbuf::kdxfregappname);
odresbufptr temp = xiter;
temp->setstring("acad");
temp->setnext( odresbuf::newrb( odresbuf::kdxfxdinteger16 ) );
temp = temp->next();
temp->setint16(279);
temp->setnext( odresbuf::newrb( odresbuf::kdxfxdinteger16 ) );
temp = temp->next();
temp->setint16(2);
rotateddimension->setxdata( xiter );
rotateddimension->setxline1point(xline1pt);
rotateddimension->setxline2point(xline2pt);
rotateddimension->setdimlinepoint(dimlinept);
rotateddimension->setrotation(m_pi);
}
regina,
this is a bug of dwgdirect, bug will be fixed in 1.12.
btw, this
code:
// extended data
odresbufptr xiter = odresbuf::newrb(odresbuf::kdxfregappname);
odresbufptr temp = xiter;
temp->setstring("acad");
temp->setnext( odresbuf::newrb( odresbuf::kdxfxdinteger16 ) );
temp = temp->next();
temp->setint16(279);
temp->setnext( odresbuf::newrb( odresbuf::kdxfxdinteger16 ) );
temp = temp->next();
temp->setint16(2);
rotateddimension->setxdata( xiter );
is not best way for setting up dimension style overrides. you can use functions
rotateddimension->setdimtmove(2);
such functions are generated by macro in compile time, see dbdimension.h, lines 288-294.
sincerely yours,
george udov
hi george,
thanks for tip!
can you tell me, when the 1.12 version will be released?
regards,
regina.
regina, 1.12 expected to be released in nearest 3 or 4 weeks.
sincerely yours,
george udov
|