For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

XCAFApp_Application SaveAs failed

Mimosa Olive's picture
Forums: 

Hi, I'm trying to save a document with some data in it and it fails.

Handle(XCAFApp_Application) anApp = wxGetApp().GetOCCApp();
Handle(TDocStd_Document) aDoc;
anApp->GetDocument(1,aDoc);
TCollection_ExtendedString theStatusMessage;
aDoc->ChangeStorageFormat(TCollection_ExtendedString("XmlXCAF"));
PCDM_StoreStatus status = anApp->SaveAs(aDoc,"C:\Documents\file.XmlXCAF",theStatusMessage);

Error message is:
driver failed; reason:Could not found the resource definition:XmlXCAF.StoragePlugin

Mimosa Olive's picture

I got it, I had to load the drivers for it:

BinXCAFDrivers::DefineFormat (occApp);
XmlXCAFDrivers::DefineFormat (occApp);