Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.

Archicad C++ API
About Archicad add-on development using the C++ API.

APIERR_MEMFULL LibPart_Register

Anonymous
Not applicable
IO::Location     fileLoc ("C:\\temp\\MyLibpart.gsm"); 
API_LibPart      libPart; 
GSErrCode        err; 
 
BNZeroMemory (&libPart, sizeof (API_LibPart)); 
libPart.typeID   = APILib_ObjectID; 
libPart.location = &fileLoc; 
err = ACAPI_LibPart_Register (&libPart);


Any ideas why i'm getting MEMFULL error ?
3 REPLIES 3
Akos Somorjai
Graphisoft
Graphisoft
Rinovo wrote:
IO::Location     fileLoc ("C:\\temp\\MyLibpart.gsm"); 
API_LibPart      libPart; 
GSErrCode        err; 
 
BNZeroMemory (&libPart, sizeof (API_LibPart)); 
libPart.typeID   = APILib_ObjectID; 
libPart.location = &fileLoc; 
err = ACAPI_LibPart_Register (&libPart);


Any ideas why i'm getting MEMFULL error ?
I agree that this is a misleading error. The problem is that you are trying to register a library part which is not in the embedded library.

Best, Akos
Anonymous
Not applicable
Thanks Akos!

I was trying to add library part to embedded library.
I guess only way would be to make new one through creating new one.
Akos Somorjai
Graphisoft
Graphisoft
Rinovo wrote:
Thanks Akos!

I was trying to add library part to embedded library.
I guess only way would be to make new one through creating new one.
Yeah, you can create one directly in the embedded library:

	IO::Location file;
	GS::UniString str;
	GetIndString (str, 32552, 1);  // default name
	ACAPI_Interface (APIIo_GetLastValidEmbeddedLPNameID, &str, &file);

	// Save As dialog
	bool bff = false;
	bool retIsOk;
	ACAPI_Interface (APIIo_SaveLibPartFileDialogID, &retIsOk, &file, &bff, &str);

	if (retIsOk) {
		// Create the libpart
		API_LibPart libPart;
		CreateLibpart (libPart, file);
	}
You can skip the save dialog, just use the location from the APIIo_GetLastValidEmbeddedLPNameID call (but don't forget to replace the last local name).

Best, Akos