软件架构师何志丹

针对场景:

setDimensionStyle 时,程序崩溃或实体消失或其它异常。 可以用此函数 看是那行崩的。

//  AcDbDatabase, AcDbDimstyleTableRecord,AcDbDimension 间复制所有属性
// 自定义实体子实体如果设置了标注样式且此标注样式不是当前样式,可能会引起实体不显示,直接设值,没问题。
template<class DST, class SRC>
void CopyDimStyle(DST& dst, SRC& src)
{
dst.setDimadec(src.dimadec());
dst.setDimalt(src.dimalt());
dst.setDimaltd(src.dimaltd());
dst.setDimaltf(src.dimaltf());
dst.setDimaltrnd(src.dimaltrnd());
dst.setDimalttd(src.dimalttd());
dst.setDimalttz(src.dimalttz());
dst.setDimaltu(src.dimaltu());
dst.setDimaltz(src.dimaltz());
dst.setDimapost(src.dimapost());
dst.setDimarcsym(src.dimarcsym());
dst.setDimasz(src.dimasz());
dst.setDimatfit(src.dimatfit());
dst.setDimaunit(src.dimaunit());
dst.setDimazin(src.dimazin());
dst.setDimblk(src.dimblk());
dst.setDimblk1(src.dimblk1());
dst.setDimblk2(src.dimblk2());
dst.setDimcen(src.dimcen());
dst.setDimclrd(src.dimclrd());
dst.setDimclre(src.dimclre());
dst.setDimclrt(src.dimclrt());
dst.setDimdec(src.dimdec());
dst.setDimdle(src.dimdle());
dst.setDimdli(src.dimdli());
dst.setDimdsep(src.dimdsep());
dst.setDimexe(src.dimexe());
dst.setDimexo(src.dimexo());
dst.setDimfrac(src.dimfrac());
dst.setDimgap(src.dimgap());
dst.setDimjogang(src.dimjogang());
dst.setDimjust(src.dimjust());
dst.setDimldrblk(src.dimldrblk());
dst.setDimlfac(src.dimlfac());
dst.setDimlim(src.dimlim());
dst.setDimltex1(src.dimltex1());
dst.setDimltex2(src.dimltex2());
dst.setDimltype(src.dimltype());
dst.setDimlunit(src.dimlunit());
dst.setDimlwd(src.dimlwd());
dst.setDimlwe(src.dimlwe());
dst.setDimpost(src.dimpost());
dst.setDimrnd(src.dimrnd());
dst.setDimsah(src.dimsah());
dst.setDimscale(src.dimscale());
dst.setDimsd1(src.dimsd1());
dst.setDimsd2(src.dimsd2());
dst.setDimse1(src.dimse1());
dst.setDimse2(src.dimse2());
dst.setDimsoxd(src.dimsoxd());
dst.setDimtad(src.dimtad());
dst.setDimtdec(src.dimtdec());
dst.setDimtfac(src.dimtfac());
dst.setDimtfill(src.dimtfill());
dst.setDimtfillclr(src.dimtfillclr());
dst.setDimtih(src.dimtih());
dst.setDimtix(src.dimtix());
dst.setDimtm(src.dimtm());
dst.setDimtmove(src.dimtmove());
dst.setDimtofl(src.dimtofl());
dst.setDimtoh(src.dimtoh());
dst.setDimtol(src.dimtol());
dst.setDimtolj(src.dimtolj());
dst.setDimtp(src.dimtp());
dst.setDimtsz(src.dimtsz());
dst.setDimtvp(src.dimtvp());
dst.setDimtxsty(src.dimtxsty());
dst.setDimtxt(src.dimtxt());
dst.setDimtzin(src.dimtzin());
dst.setDimupt(src.dimupt());
dst.setDimzin(src.dimzin());
dst.setDimfxlenOn(src.dimfxlenOn());
dst.setDimfxlen(src.dimfxlen());
dst.setDimtxtdirection(src.dimtxtdirection());
dst.setDimmzf(src.dimmzf());
dst.setDimmzs(src.dimmzs());
dst.setDimaltmzf(src.dimaltmzf());
dst.setDimaltmzs(src.dimaltmzs()); }