2019-04-24 11:06 AM - last edited on 2022-10-05 01:27 PM by Daniel Kassai
DoOpen() { //Based on DO_OPEN form API API_FileOpenPars fop; GSErrCode err; BNZeroMemory(&fop, sizeof(API_FileOpenPars)); fop.fileTypeID = APIFType_PlanFile; fop.useStoredLib = true; IO::Location appFolderLoc; GSErrCode errorCode = IO::fileSystem.GetSpecialLocation(IO::FileSystem::Desktop, &appFolderLoc); GS::UniString myPath = GS::UniString("empty"); IO::Name myName = IO::Name(Name); // Name pased in Constructor from GS::UniString myName.AppendExtension("pln");//Problem 1: Need to apend because passed name is up to dot for example test.pln -> test fop.file = new IO::Location(appFolderLoc, myName); err = ACAPI_Automate(APIDo_OpenID, &fop); // Problem 2: returns error :APIERR_REFUSEDCMD -2130312312 81060388 The passed identifier is not subject to the operation. if (err != NoError) ACAPI_WriteReport("Error in APIDo_OpenID:", true); delete fop.file; return; } // Do_Open
Solved! Go to Solution.
2019-04-26 03:55 PM
2019-04-26 11:41 AM
2019-04-26 03:55 PM
2019-04-27 10:52 AM
Tibor wrote:This was my case. I didn't realize that I was using menu registration form Properties example and there are actually called as undoable commands. Thanks a lot now it's 'working.
You use this code inside an undoable scope (ACAPI_CallUndoableCommand).
2019-07-22 03:42 PM
2019-07-22 04:37 PM
kzaremba wrote:Please check the DGEnableAutoClose/DGDisableAutoClose functions. You can find them in the DG.h header file.
I was thinking about a method that clicks OK or ESC on each appearing UI element. Is it possible with DG library?
2019-07-23 09:03 AM
Tibor wrote:Thanks a lot for suggestion Tibor. It works perfectly and its only one line of code to make it work.. Cool
If you call DGEnableAutoClose then each dialog will be automatically closed by ARCHICAD.