Exemplo n.º 1
3
void Additional_Class::addXdata( AcDbObjectId entID, CString xdataStr, CString xdataNameStr )
{
	AcDbEntity * pEnt;
	struct resbuf * pRb;

	if(Acad::eOk != acdbOpenAcDbEntity(pEnt, entID, AcDb::kForWrite))
	{
		pEnt->close();
		return;
	}
	TCHAR * tempTchar = CString2TCHAR(xdataNameStr);
	//TCHAR strAppName[] = tempTchar;
	acdbRegApp(tempTchar);
	TCHAR  * typeName = CString2TCHAR(xdataStr);

	struct resbuf * pTemp;
	pTemp = pEnt->xData(tempTchar);

	pRb = acutBuildList(AcDb::kDxfRegAppName, tempTchar,
		AcDb::kDxfXdAsciiString, typeName, 
		RTNONE);
	pEnt->setXData(pRb);

	acutRelRb(pRb);
	pEnt->close();
	return;
}
Exemplo n.º 2
0
CString Additional_Class::Get_Xdata(AcDbObjectId EntID, CString Xdata_Ref )
{
	AcDbEntity *pEnt;
	acdbOpenAcDbEntity(pEnt, EntID, AcDb::kForRead);
	struct resbuf *pRb;
	pRb = pEnt->xData(Xdata_Ref);
	if (pRb != NULL)
	{
		struct resbuf *pTemp;
		pTemp = pRb;
		pTemp = pTemp->rbnext;
		pEnt->close();
		return pTemp->resval.rstring;
	}
	acutRelRb(pRb);
	pEnt->close();
	return "";
}
Exemplo n.º 3
0
	static void shYDsysXDataDel()
	{
		ads_name ssName;
		if(RTNORM == acedSSGet(":S", NULL, NULL, NULL, ssName))
		{
			AcDbObjectId tempObjId;
			ads_name ssTemp;
			long nLen=0;
			if(RTNORM != acedSSLength(ssName,&nLen)) return;
			for(int j=0; j<nLen; j++)
			{
				if(RTNORM == acedSSName(ssName,j,ssTemp)) continue;
				if(Acad::eOk != acdbGetObjectId(tempObjId, ssTemp)) continue;
				AcDbEntity* pEnt = NULL;
				if(Acad::eOk == acdbOpenObject(pEnt,tempObjId,AcDb::kForWrite))
				{
					
					resbuf* pHead = pEnt->xData(NULL);
					if(pHead == NULL)
					{
						pEnt->close(); continue;
					}
					resbuf* pNext =pHead->rbnext;
					if(pNext == NULL)
					{
						acutRelRb(pHead); pEnt->close(); continue;
					}
					while(pNext != NULL)
					{
						acutRelRb(pHead);
						pHead = pNext;
						pNext = pNext->rbnext;
					}
					pEnt->setXData(NULL);
					pEnt->close();
				}
			}
			acedSSFree(ssName);
		}
	}