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

extend data problem with oddbleader
extend data problem with oddbleader
i cann't add a extend data into an oddbleader. the version of the librariy now i am using is 1.09. here is the code:
odresbufptr xiter;
odresbufptr pcur;
xiter = odresbuf::newrb(1005);
pcur = xiter;
pcur->sethandle( pdb->getregappacadid().gethandle() );
pcur = odresbuf::newrb(1000);
pcur = pcur->next( );
pcur->setstring( "dstyle" );
pcur->setnext( odresbuf::newrb(1002) );
pcur = pcur->next();
pcur->setstring( "{" );
pcur->setnext( odresbuf::newrb(1070) );
pcur = pcur->next();
pcur->setint16( 5 ); // dimblk
pcur->setnext( odresbuf::newrb(1000) );
pcur = pcur->next();
pcur->setstring( "_none" );
pcur->setnext( odresbuf::newrb(1002) );
pcur = pcur->next();
pcur->setstring( "}" );
pleader->setxdata( xiter ); //this will cause an exception : invalid resbuf
but before adding this extend data into this oddbleader, i have added some extend data into this oddbleader, and this did not cause an exception. an oddbleader can be added only one odresbuf ?
1. the exception is thrown because in the first resbuf application handle is stored with group code 1005 instead of 1001.
2. note that setxdata() replaces xdata of specified application (acad in your case).
3. dimstyle overrides can be added to leader and dimension by calling functions like setdimasz(), setdimclrd() etc. actually they add xdata to leader or dimension but you need not code it manually.
4. dimblk does not effect leader's arrow head. dimldrblk should be used.
so your code can be replaced with single line:
pleader->setdimldrblk("_none");
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)