马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
![](source/plugin/imc_colorcode/images/loading.gif) - void AttachXref(CString xrefpath)
- {
-
- ACHAR* xrefname = NULL;
- acedXrefCreateBlockname(xrefpath,xrefname);//创建附着文件的块引用名
- assert(xrefname);
- if(!xrefname) return;
- CString strName = xrefname;
- acutDelString(xrefname);
- xrefname = NULL;
- AcDbObjectId xrefBTRid = AcDbObjectId::kNull;
- AcDbObjectId xrefRefid = AcDbObjectId::kNull;
- Acad::ErrorStatus es = acedXrefAttach(xrefpath,strName,&xrefBTRid,&xrefRefid);
- //参数:(附着文件路径,<系统分配的>块引用名,<OUT>块表记录ID,<OUT>引用ID,插入点,比例因子,旋转角)
- assert(Acad::eOk==es);
- if(Acad::eOk!=es) return;
- AcDbEntity *pEntXref = NULL;
- es = acdbOpenAcDbEntity(pEntXref, xrefRefid, AcDb::kForWrite);
- assert(Acad::eOk==es);
- if(Acad::eOk!=es) return;
- es = pEntXref->setLayer(_T("0"));// 值参照图与层
- assert(Acad::eOk==es);
- es = pEntXref->close();
- if(Acad::eOk!=es) return;
- return;
- }
|