|
//图块坐标扩展数据
double w1 = GVI_Frame_Scale*291/2;
double h1 = GVI_Frame_Scale*176/2;
AcGePoint3d LDP = Inset_Center + AcGeVector3d(-w1,-h1,0);//图块左下点坐标
AcGePoint3d RUP = Inset_Center + AcGeVector3d(w1,h1,0); //图块右上点坐标
ads_point p1;
ads_point p2;
Copy_ads_point(p1,LDP);
Copy_ads_point(p2,RUP);
struct resbuf *McA4PointInfo = acutBuildList(AcDb::kDxfInt32,fi,
AcDb::kDxfInt32,tsi,
AcDb::kDxfXCoord,p1,
AcDb::kDxfXCoord,p2,
0);
CString Strt1,Strt2;
Strt1.Format(_T("Mcquay%d%d"), fi, tsi);
Strt2.Format(_T("McA4PointInfo%d%d"), fi, tsi);
McAcad::addXrecorder(Strt1,Strt2,McA4PointInfo);
acutRelRb(McA4PointInfo);
/*
函数名称:addXrecorder
创建日期:
功能描述:添加扩展记录
参数描述:dName:
*/
bool McAcad::addXrecorder(CString dName,CString xrName,struct resbuf* xrecord)
{
AcDbDatabase *pCurDb;
AcDbXrecord *pXrec = new AcDbXrecord;
AcDbObjectId dictObjId, xrecObjId;
AcDbDictionary *pNamedObjD, *pDict;
pCurDb = acdbHostApplicationServices()->workingDatabase();
pCurDb->getNamedObjectsDictionary(pNamedObjD, AcDb::kForWrite);
USES_CONVERSION;
char *DName = W2A(dName);
char *XrName = W2A(xrName);
ZTCHAR *ddName = A2W(DName);
ZTCHAR *xxrName = A2W(XrName);
if (pNamedObjD->getAt(ddName,(AcDbObject*&)pDict, AcDb::kForWrite) == Acad::eKeyNotFound)
{
pDict = new AcDbDictionary;
pNamedObjD->setAt(ddName, pDict, dictObjId);
}
pNamedObjD->close();
pDict->setAt(xxrName, pXrec, xrecObjId);
pDict->close();
pXrec->setFromRbChain(*xrecord);
pXrec->close();
return true;
}
<pre class="cpp" name="code">//功能描述:坐标点转换
void Copy_ads_point(ads_point point_to, AcGePoint3d& point_frm)
{
point_to[0] = point_frm[0];
point_to[1] = point_frm[1];
point_to[2] = point_frm[2];
}
|
|