Quantcast
Channel: ArchiCAD-Talk - Developer Forum
Viewing all articles
Browse latest Browse all 564

Create library (LibPart) based on an existing one

$
0
0
Author:Akos Somorjai
Posted: Fri Oct 02, 2015 12:23 pm (GMT+1)


ReignBough wrote:
I am trying to create a library from an existing one. What I did was just get all the information from the "source" library then copy (and modify) them. I am able to do this but limited to some section. Based on the documentation, ACAPI_LibPart_GetSection() will return APIERR_BADPARS for pictures, macros, etc.

I also followed the example given at the documentation of ACAPI_LibPart_GetSectionList(), modify it so that I will create a "destination" library.

When I called ACAPI_LibPart_GetSection(), I got APIERR_BADPARS and APIERR_NOLIBSECT on some of the sections. This means that the list that I got form ACAPI_LibPart_GetSectionList() have a "non-existing" section; or (as I interpret it) the section exists but the sectionHdl and sectionStr are not valid.

So how am I to copy [, create, and/or modify] these sections:

Sections with APIERR_BADPARS:
* API_SectAncestors
* API_SectCalledMacros
* API_SectInfoGIF

Sections with APIERR_NOLIBSECT:
* API_SectMigrTable
* API_SectCust_Keywords ('KWRD', this section is part of the section list but not part of the definitions, #define API_Sect...)
* API_SectCopyright

EDIT

I am also unable to find how to set/get values for the LibPart:
* Details > Author (see EDIT (2015 Aug 24))
* Details > Compatibility Options... (see EDIT (2015 Aug 19))

EDIT (2015 Aug 19)

I am now able to copy "Details > Compatibility Options..." via:
Code:
ACAPI_LibPart_GetDetails(oldLibPartIdx, &detl);
...
ACAPI_LibPart_SetDetails_ParamDef(&newLibPart, paramsHdl, &detl);


EDIT (2015 Aug 24)

Based on the binary data of the library, the "Details > Author" is part of the copyright section. But since there is an error, this is not saved. I also tried saving this binary data as GSHandle and call save section API, but still error.


Hi,

Why would you like to copy an existing library part? The copyright section is there for a reason Smile

Best, Akos


Viewing all articles
Browse latest Browse all 564

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>