Hi @Alexander.Rivilis now it's working, thank you.
I'm trying to set an Xdata with the theta calculated by the matrix as you mentioned before.
static void setLayoutAttribute(AcDbEntity* pSubject,double theta) // brefCar must be open for write
{
AcDbObjectId objId = pSubject->objectId();
AcDbObjectPointer<AcDbBlockReference> brefWheel(objId, AcDb::kForWrite);
if (brefWheel.openStatus() == Acad::eOk)
{
LPCWSTR myAppName = L"LAYOUT";
acdbRegApp(myAppName); // Make sure your XData appname is registered
resbuf *rb = acutBuildList(
AcDb::kDxfRegAppName, myAppName,
AcDb::kDxfXdReal, theta,
0
);
brefWheel->setXData(rb);
acutRelRb(rb); // release the list.
}
}
But calling this function from transorfmBy() the blockreference is nevere in openStatus() == eOk.
ACDBCORE2D_PORT virtual Acad::ErrorStatus transformBy(AcDbEntity* pSubject, const AcGeMatrix3d& xform)
{
AcString pGlobalCmdName;
acedGetCommandForDocument(curDoc(), pGlobalCmdName);
acutPrintf(L"\nTransformBy Command name: %s", pGlobalCmdName.kTCharPtr());
if (pGlobalCmdName.compareNoCase(L"ROTATE") == 0) {
double theta;
AcGeVector3d vectors;
getAngleAndAxis(theta, vectors,xform);
acutPrintf(L"Rotazione di : %f radianti", theta);
setLayoutAttribute(pSubject, theta);
}
I'm missing something ?
B.R.
Marco