查看单个帖子
旧 2009-05-06, 07:50 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】oddblayertablerecordptr color index exception

oddblayertablerecordptr color index exception
oddblayertablerecordptr color index exception
hi
i'm having problems setting the color index of a layer. the code below throws an "invalid input" exception with an input of 0 for the colorindex.
what am i doing wrong here? i have a feeling i have to set the color model, but can't see from the api docs how this is done.
thanks
peter.
/////////////////////////////////////////////////////
// add a new layer to the drawing
oddblayertableptr ptrlayers;
oddblayertablerecordptr ptrlayer;
/ptrlayers = ptrdb->getlayertableid().safeopenobject(oddb::kforwrite) ;
ptrlayer = oddblayertablerecord::createobject();
// name must be set before a table object is added to a table.
ptrlayer->setname(strlayername);
ptrlayer->setcolorindex(0); // <-- throws "invalid input" exception.
// add the object to the table.
return ptrlayers->add(ptrlayer);
///////////////////////////////////////////////
color index 0 means byblock.
layer's color can't be set to byblock or bylayer.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)