2014-03-14 02:11 PM - last edited on 2023-08-01 04:27 PM by Doreena Deng
2019-10-24 05:23 PM
2019-10-24 07:34 PM
static void Do_Save_ObjFile (void) { IO::Location folderLoc; API_SpecFolderID specID = API_UserDocumentsFolderID; ACAPI_Environment (APIEnv_GetSpecFolderID, &specID, &folderLoc); IO::Name objName ("ObjTest.obj"); IO::Location objFile (folderLoc, objName); if (!objFile.IsEmpty ()) { API_IOParams ioParams; ioParams.method = IO_SAVEAS3D; ioParams.refCon = 1; ioParams.fileLoc = &objFile; ioParams.saveFileIOName = &objName; ioParams.noDialog = true; GSHandle parhdl = nullptr; GSErrCode err = ACAPI_Goodies (APIAny_InitMDCLParameterListID, &parhdl); if (err == NoError) { if (AddParameterToCommandCall (parhdl, "ioParams", &ioParams)) { API_ModulID mdid; BNZeroMemory (&mdid, sizeof (mdid)); mdid.developerID = 1198731108; mdid.localID = 1142057562; ACAPI_Command_Call (&mdid, 'OBJO', 1, parhdl, nullptr, false); } ACAPI_Goodies (APIAny_FreeMDCLParameterListID, &parhdl); } } return; } // Do_Save_ObjFileBest, Akos
2019-10-28 12:12 PM
2019-11-07 10:02 AM
2019-11-08 03:11 PM
bool AddParameterToCommandCall (GSHandle& parhdl, const char* parname, API_IOParams* ptr) { API_MDCLParameter par; BNZeroMemory (&par, sizeof (par)); par.name = parname; par.type = MDCLPar_pointer; par.ptr_par = (void*) ptr; return ACAPI_Goodies (APIAny_AddMDCLParameterID, parhdl, &par) == NoError; }
2019-11-10 03:28 PM
2019-11-17 08:18 AM
Ziv wrote:I also get this message
Hi,
I’m running the code and the archicad is crashing every time, says it’s ucrtbase.pdb error
Any ideas how to solve?
2019-12-02 04:07 PM
2019-12-02 06:07 PM
Akos wrote:Yep I know, but it still crashes..
Hi,
The 3D window has to be active when you call this function.
Hope this helps, Akos