could not find the resource:a148e300-5740-11d1-a904-080036aaa103.Location

Hi
When have used the following code to save a .std file

void occ_save_document(
void *pApp,
char *ps_file
)
{
//Cast pointer to the application
AppStd_Application *app=static_cast<AppStd_Application *>(pApp);

TCollection_ExtendedString fName(ps_file),err;
Handle(TDocStd_Document) doc;
app->GetDocument(1,doc);
app->SaveAs(doc,fName,err);
}

but got the following message:

could not find the resource:a148e300-5740-11d1-a904-080036aaa103.Location

Thread 1 "aui" received signal SIGSEGV, Segmentation fault.
0x00007ffff481e341 in CDF_Application::DefaultFolder() () from /home/......./bin/libTKCDF.so.0

When I tried to trace back, I got the followings:

(gdb) up
#1 0x00007ffff48239d9 in CDF_Store::FindDefault() () from /home/......../bin/libTKCDF.so.0
(gdb) up
#2 0x00007ffff4823b3d in CDF_Store::Init() () from /home/......./bin/libTKCDF.so.0
(gdb) up
#3 0x00007ffff4823c94 in CDF_Store::CDF_Store(Handle_CDM_Document const&) ()
from /home/......./bin/libTKCDF.so.0
(gdb) up
#4 0x00007ffff51aad1f in TDocStd_Application::SaveAs(Handle_TDocStd_Document const&, TCollection_ExtendedString const&, TCollection_ExtendedString&) () from /home/......./bin/libTKLCAF.so.0
(gdb) up
#5 0x000000000b3dd857 in occ_save_document (pApp=0x20008698, ps_file=0x7fffffff48c0 "/home/.../test/occ/test.std")
at /home/...../occmodel/occ_save_document.cc:17
17 app->SaveAs(doc,fName,err);

Any advices are appreciated.

Shang-Sheng

Dmitrii Pasukhin's picture

Hello, can you say type of your document? It is BinXCAF? According a type chose a driver.

Best regards, Dmirii.

Shang-Sheng Liu's picture

Hi Dmitrii:
Thank you for your reply. I am trying to write .std file. Not sure what type is that. How to check? Thanks.

Shang-Sheng

Dmitrii Pasukhin's picture

Type is a string value of parameter in app->NewDocument(...);

Best regards, Dmitrii.

Dmitrii Pasukhin's picture

For more information I need to known OCCT version or branch (and document format, you can just call method TDocStd_Document::StorageFormat.

I very recommended to use BinXCAF document (saved as xbf).OCAF is a very old format and some features are not supported.

Best regards, Dmitrii.