高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】how to set dimstyle reactor id
how to set dimstyle reactor id?
how to set dimstyle reactor id?
first write the dimstlyletablerecord as :
oddbobjectid id = pdimtbl->getat(psysitem->name);
oddbdimstyletablerecordptr pdimrcd;
if(id.isnull())
{
pdimrcd = oddbdimstyletablerecord::createobject();
pdimrcd->setname(psysitem->name);
pdimrcd->setdimtxsty(m_styletableindexid[0]);
id = pdimtbl->add(pdimrcd);
}
else
pdimrcd = id.safeopenobject(oddb::kforwrite);
pdimrcd->setdimscale(tdimstyle.dimscale);
pdimrcd->setdimasz(tdimstyle.dimasz);
pdimrcd->setdimexo(tdimstyle.dimexo);
pdimrcd->setdimdli(tdimstyle.dimdli);
pdimrcd->setdimexe(tdimstyle.dimexe);
pdimrcd->setdimrnd(tdimstyle.dimrnd);
pdimrcd->setdimdle(tdimstyle.dimdle);
pdimrcd->setdimtp(tdimstyle.dimtp);
pdimrcd->setdimtm(tdimstyle.dimtm);
pdimrcd->setdimtxt(tdimstyle.dimtxt);
pdimrcd->setdimcen(tdimstyle.dimcen);
pdimrcd->setdimtsz(tdimstyle.dimtsz);
pdimrcd->setdimaltf(tdimstyle.dimaltf);
pdimrcd->setdimlfac(tdimstyle.dimlfac);
pdimrcd->setdimtvp(tdimstyle.dimtvp);
pdimrcd->setdimtol(tdimstyle.dimtol ? true: false);
pdimrcd->setdimlim(tdimstyle.dimlim ? true: false);
pdimrcd->setdimtih(tdimstyle.dimtih ? true: false);
pdimrcd->setdimtoh(tdimstyle.dimtoh ? true: false);
pdimrcd->setdimse1(tdimstyle.dimse1 ? true: false);
pdimrcd->setdimse2(tdimstyle.dimse2 ? true: false);
pdimrcd->setdimtad(tdimstyle.dimtad ? true: false);
pdimrcd->setdimzin(tdimstyle.dimzin);
pdimrcd->setdimalt(tdimstyle.dimalt ? true: false);
pdimrcd->setdimaltd(tdimstyle.dimaltd);
pdimrcd->setdimtofl(tdimstyle.dimtofl ? true: false);
pdimrcd->setdimsah(tdimstyle.dimsah ? true: false);
pdimrcd->setdimtix(tdimstyle.dimtix ? true: false);
pdimrcd->setdimsoxd(tdimstyle.dimsoxd ? true: false);
odcmcolor tempcolor;
tempcolor.setcolorindex(tdimstyle.dimclrd);
pdimrcd->setdimclrd(tempcolor);
tempcolor.setcolorindex(tdimstyle.dimclre);
pdimrcd->setdimclre(tempcolor);
tempcolor.setcolorindex(tdimstyle.dimclrt);
pdimrcd->setdimclrt(tempcolor);
pdimrcd->setdimtfac(tdimstyle.dimtfac);
pdimrcd->setdimgap(tdimstyle.dimgap);
pdimrcd->setdimpost(tdimstyle.dimpost);
pdimrcd->setdimapost(tdimstyle.dimapost);
pdimrcd->setdimblk(tdimstyle.dimblk);
pdimrcd->setdimblk1(tdimstyle.dimblk1);
pdimrcd->setdimblk2(tdimstyle.dimblk2);
m_dimstyletableindexid[index] = id;
// save the index's id of this dimstyletablerecord
second, when writing the dimesnion entity.
pdim->setdatabasedefaults(m_pdwgdatabase.get());
pdim->setnormal(odgevector3d::kzaxis);
pdim->sethorizontalrotation(edim.angle1);
pdim->settextrotation(edim.angle3);
pdim->setdimblockposition(dimblkposition);
and setting dimension's blockid and dimstyleid as :
pdim->setdimensionstyle(m_dimstyletableindexid[edim.dimstyle]);
pdim->setdimblockid(m_blocktableindexid[edim.blockno]);
pdim->recordgraphicsmodified(false);
then the reators of dimstyle will be built by the dd1.1 or not?
because the result error's report by oddbauditinfo as:
acdbdimstyletablerecord(8d0) reactor id (0) is invalid invalid remove.
who can help me ? thanks verymuch!
cadrd
# 26th february 2004, 07:03 am
moderator join date: mar 2002
posts: 2,994
dd will take care about adding reactor to dimstyle if dimension is database resident by the moment setdimensionstyle() is called.
if dimension is not database resident it has no object id and zero object id is added as reactor to dimstyle. this (adding zero reactor) is dd bug.
sergey slezkin
sslezkin
# 26th february 2004, 06:46 pm
junior member join date: dec 2003
location: beijing p. r. china.
posts: 14
how about the text and textstyle?
and then how about the text and textstyle, and about the hatch and boundary's entities?
cadrd
# 27th february 2004, 01:23 am
moderator join date: mar 2002
posts: 2,994
unlike dimension styles text styles do not store reactors (references to text, mtext etc.)
hatch functions take care about adding reactors.
sergey slezkin
sslezkin
none
? | ?
thread tools
display modes
linear mode
search this thread
rate this thread
excellent
good
average
bad
terrible
posting rules
you may post new threads
you may post replies
you may post attachments
you may edit your posts
is on
are on
code is off
html code is off
forum jump
user control panel private messages subscriptions who's online search forums forums home general topics news questions and remarks business issues industry commentary general software issues documentation issues future directions dwg libraries dwgdirect.net dwgdirect, c++ version dwgdirectx, activex version adtdirect/c3ddirect opendwg toolkit/viewkit dgn libraries dgndirect, c++ version (2.x+) dgndirect libraries (legacy 0.99xx)
all times are gmt -7. the time now is 01:32 amfff">.
- - -
copyright ?2000 - 2009, jelsoft enterprises ltd.
copyright 1998-2008 open design alliance inc.
dd will take care about adding reactor to dimstyle if dimension is database resident by the moment setdimensionstyle() is called.
if dimension is not database resident it has no object id and zero object id is added as reactor to dimstyle. this (adding zero reactor) is dd bug.
sergey slezkin
how about the text and textstyle?
and then how about the text and textstyle, and about the hatch and boundary's entities?
unlike dimension styles text styles do not store reactors (references to text, mtext etc.)
hatch functions take care about adding reactors.
sergey slezkin
|