Archicad 27 C++ API
|
Functions to load, iterate and manipulate Libraries. More...
Classes | |
struct | API_LibraryInfo |
Describes the data of an active library of an Archicad project. More... | |
Enumerations | |
enum | API_LibraryTypeID { API_Undefined , API_LocalLibrary , API_UrlLibrary , API_BuiltInLibrary , API_EmbeddedLibrary , API_OtherObject , API_UrlOtherObject , API_ServerLibrary } |
Project library types. More... | |
Functions | |
GSErrCode __ACENV_CALL | ACAPI_ProjectOperation_ReloadLibraries () |
Resets and loads the active libraries. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_OpenLibraryPart (const API_OpenLibPartInfo *libPartToOpen) |
Opens the given library part in the Library Part Editor window. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_GetLibraries (GS::Array< API_LibraryInfo > *activeLibs, Int32 *embeddedLibraryIndex=nullptr) |
Returns the list of loaded libraries. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_SetLibraries (const GS::Array< API_LibraryInfo > *activeLibs) |
Changes the list of loaded libraries. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_NewLibDial (char *defName, IO::Location *newLib) |
Instructs the user to select a new library folder in a dialog. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_AddLibraries (IO::Location *newLib) |
Registers a new folder into the list of active libraries. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_CheckLibraries () |
Checks the currently loaded libraries. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_OverwriteLibPart (bool overwriteOn) |
Sets the overwrite mode for the library part create function. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_DeleteEmbeddedLibItem (const IO::Location *location, bool keepGSMFile=false, bool silentMode=false) |
Deletes the given embedded library item (folder or library part). | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_DeleteEmbeddedLibItems (const GS::Array< IO::Location > *location, bool keepGSMFile=false, bool silentMode=false) |
Delete embeded lib items. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_CreateFolderInLibrary (const IO::Location *newFolderLocationInLibrary) |
Creates a new folder inside a loaded library. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_CopyFilesIntoLibrary (const IO::Location *targetFolderLocationInLibrary, const GS::Array< IO::Location > *filesToCopy, const bool *overwriteIfExists) |
Copies files into a folder inside a loaded library. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_GetGDLDate (Int32 *date) |
Returns GDL environment date information (GDL_PROJECT_DATE). | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_ChangeGDLDate (Int32 *date) |
Changes GDL environment date (GDL_PROJECT_DATE). | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_CreateCopyOfGdlUserGlobalsHandle (GDL::Parameters **userGlobals) |
Returns a copy of the current GDL globals. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_DestroyCopyOfGdlUserGlobalsHandle (GDL::Parameters **userGlobals) |
Destroys the previously copied GDL globals handle. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_GetLibPartOrigLocation (const Int32 *libItemIndex, IO::Location *origLocation) |
Returns the original location of a library part. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_UsableGDLString (const char *str) |
Determines whether the string is a GDL keyword or reserved symbol. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_RunGDLParScript (const API_Elem_Head *elemHead, UInt32 mask=0) |
Run GDL parameter script. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryManagement_InterpretGDLScript3D (const GS::UniString *script, API_AddParType **addPars, void *modelerAPIModel=nullptr, void *modelerModel=nullptr) |
Interprets a 3D GDL script with the same settings as GDL Editor. | |
GSErrCode __ACENV_CALL | ACAPI_LibraryPart_RegisterSubtype (GSType signature, short templateFileResID, bool transparentNode, short stringResID, short smallIconResID, short largeIconResID, API_TBoxGroup toolGroupId, API_TBoxEnabled enableFlags, short defaultsResID) |
Registers a new library part subtype. | |
GSErrCode __ACENV_CALL | ACAPI_Element_GetDescriptors (const API_Elem_Head *elemHead, API_DescriptorRefType ***descRef, Int32 *nDesc) |
Returns the descriptors of an element. | |
Functions to load, iterate and manipulate Libraries.
enum API_LibraryTypeID |
Project library types.
libraryType
data member in the API_LibraryInfo structure defines the type of the project library, which can beGSErrCode __ACENV_CALL ACAPI_Element_GetDescriptors | ( | const API_Elem_Head * | elemHead, |
API_DescriptorRefType *** | descRef, | ||
Int32 * | nDesc | ||
) |
Returns the descriptors of an element.
elemHead | [in] The element you want to get the descriptors for. |
descRef | [out] List of the descriptors. |
nDesc | [out] Number of the descriptors in the list. |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_AddLibraries | ( | IO::Location * | newLib | ) |
Registers a new folder into the list of active libraries.
newLib | [in] The file system location of the folder to add. |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_ChangeGDLDate | ( | Int32 * | date | ) |
Changes GDL environment date (GDL_PROJECT_DATE).
date | [in] The new GDL environment date. It must be an Int32 array with 6 size. |
Date component | Meaning |
---|---|
date[0] | Year |
date[1] | Month |
date[2] | Day |
date[3] | Hour |
date[4] | Minute |
date[5] | Second |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_CheckLibraries | ( | ) |
Checks the currently loaded libraries.
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_CopyFilesIntoLibrary | ( | const IO::Location * | targetFolderLocationInLibrary, |
const GS::Array< IO::Location > * | filesToCopy, | ||
const bool * | overwriteIfExists | ||
) |
Copies files into a folder inside a loaded library.
targetFolderLocationInLibrary | [in] The target folder location. |
filesToCopy | [in] The list of files to be copied. |
overwriteIfExists | [in] Overwrite existing files found on the target location (optional parameter; if omitted, the value is considered false, resulting existing files to be skipped). |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_CreateCopyOfGdlUserGlobalsHandle | ( | GDL::Parameters ** | userGlobals | ) |
Returns a copy of the current GDL globals.
userGlobals | [out] The object containing the GDL globals required by the GDL interpreter. |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_CreateFolderInLibrary | ( | const IO::Location * | newFolderLocationInLibrary | ) |
Creates a new folder inside a loaded library.
newFolderLocationInLibrary | [in] The location of the folder to be created in an existing active library. |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_DeleteEmbeddedLibItem | ( | const IO::Location * | location, |
bool | keepGSMFile = false , |
||
bool | silentMode = false |
||
) |
Deletes the given embedded library item (folder or library part).
location | [in] The location of the embedded library item. |
keepGSMFile | [in] If this parameter is true, then the operation deletes libpart only from the embedded library, but keeps the.gsm file in the filesystem. (optional parameter, by default it's false) |
silentMode | [in] If this parameter is true, then the missing libpart window won't open in case of any warning. (optional parameter, by default it's false) |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_DeleteEmbeddedLibItems | ( | const GS::Array< IO::Location > * | location, |
bool | keepGSMFile = false , |
||
bool | silentMode = false |
||
) |
Delete embeded lib items.
location | [in] Array of locations of the library items. |
keepGSMFile | [in] Keep the GSM file. |
silentMode | [in] Missing library parts dialog window should pop up. |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_DestroyCopyOfGdlUserGlobalsHandle | ( | GDL::Parameters ** | userGlobals | ) |
Destroys the previously copied GDL globals handle.
userGlobals | [in] The object containing the GDL globals required by the GDL interpreter. |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_GetGDLDate | ( | Int32 * | date | ) |
Returns GDL environment date information (GDL_PROJECT_DATE).
date | [out] GDL environment date. It must be an Int32 array with 6 size. |
Date component | Meaning |
---|---|
date[0] | Year |
date[1] | Month |
date[2] | Day |
date[3] | Hour |
date[4] | Minute |
date[5] | Second |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_GetLibPartOrigLocation | ( | const Int32 * | libItemIndex, |
IO::Location * | origLocation | ||
) |
Returns the original location of a library part.
libItemIndex | [in] The index of the library part. |
origLocation | [out] The location of the given library part. |
libItemIndex
or origLocation
is nullptr GSErrCode __ACENV_CALL ACAPI_LibraryManagement_GetLibraries | ( | GS::Array< API_LibraryInfo > * | activeLibs, |
Int32 * | embeddedLibraryIndex = nullptr |
||
) |
Returns the list of loaded libraries.
activeLibs | the active library list |
embeddedLibraryIndex | [out] optional; the 0-based index of the embedded library in this list |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_InterpretGDLScript3D | ( | const GS::UniString * | script, |
API_AddParType ** | addPars, | ||
void * | modelerAPIModel = nullptr , |
||
void * | modelerModel = nullptr |
||
) |
Interprets a 3D GDL script with the same settings as GDL Editor.
script | [in] The 3D GDL Script. |
addPars | [in] Parameters for script running. Can be NULL, in this case the script will run with empty parameter list. |
modelerAPIModel | [out] The generated 3D model as ModelerAPI::Model. Use either this or the modelerModel, but only one at the same time. |
modelerModel | [out] The generated 3D model as Modeler::ConstModel3DPtr. Use either this or the modelerAPIModel, but only one at the same time. |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_NewLibDial | ( | char * | defName, |
IO::Location * | newLib | ||
) |
Instructs the user to select a new library folder in a dialog.
defName | [in] A pointer to the default name of the new library. |
newLib | [out] The file system location of the selected folder. |
DG::FolderDialog
of the Dialog Manager instead of calling ACAPI_LibraryManagement_NewLibDial. GSErrCode __ACENV_CALL ACAPI_LibraryManagement_OpenLibraryPart | ( | const API_OpenLibPartInfo * | libPartToOpen | ) |
Opens the given library part in the Library Part Editor window.
libPartToOpen | [in] Identifies the library part to open. |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_OverwriteLibPart | ( | bool | overwriteOn | ) |
Sets the overwrite mode for the library part create function.
overwriteOn | [in] Switch ON or OFF the overwrite mode. |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_RunGDLParScript | ( | const API_Elem_Head * | elemHead, |
UInt32 | mask = 0 |
||
) |
Run GDL parameter script.
elemHead | [in] Head of the element. It is identified by the guid field. |
mask | Element mask; can be APIElemMask_FromFloorplan (= use the element from the floor plan). |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_SetLibraries | ( | const GS::Array< API_LibraryInfo > * | activeLibs | ) |
Changes the list of loaded libraries.
activeLibs | the active library list to set |
GSErrCode __ACENV_CALL ACAPI_LibraryManagement_UsableGDLString | ( | const char * | str | ) |
Determines whether the string is a GDL keyword or reserved symbol.
str | [in] a string to check as a GDL keyword or reserved symbol |
GSErrCode __ACENV_CALL ACAPI_LibraryPart_RegisterSubtype | ( | GSType | signature, |
short | templateFileResID, | ||
bool | transparentNode, | ||
short | stringResID, | ||
short | smallIconResID, | ||
short | largeIconResID, | ||
API_TBoxGroup | toolGroupId, | ||
API_TBoxEnabled | enableFlags, | ||
short | defaultsResID | ||
) |
Registers a new library part subtype.
signature | [in] A four-character identifier of this library part subtype |
templateFileResID | [in] 'FILE' resource ID of the subtype template library part compiled into the add-on |
transparentNode | [in] Objects of this subtype can be shown on higher ancestry levels as well |
stringResID | [in] Resource ID of the library part subtype description string |
smallIconResID | [in] Resource ID of the small-sized toolbox (toolbar) item icon |
largeIconResID | [in] Resource ID of the large-sized toolbox item icon |
toolGroupId | [in] Toolbox item position |
enableFlags | [in] Enable or disable the subtype tool depending on the active window |
defaultsResID | [in] ID of the 'ACP0' resource that contains the element default values for this subtype |
API_TBoxGroup | Meaning |
---|---|
TBoxGroup_Root | The subtype tool item will be appended to the group of model element tools |
TBoxGroup_Objects | The subtype tool item will be added to the object tools |
TBoxGroup_Openings | The subtype tool item will be added to the window/door tools |
You can control the availability of the subtype tool in the toolbox by setting the enableFlags
bits:
API_TBoxEnabled | The subtype tool is enabled |
---|---|
API_TBoxEnabled_FloorPlan | on floor plan window |
API_TBoxEnabled_ModelSection | on model type section and elevation windows |
API_TBoxEnabled_DrawingSection | on drawing type section and elevation windows |
API_TBoxEnabled_3D | on 3D model window |
API_TBoxEnabled_Detail | on detail window |
API_TBoxEnabled_Layout | on layout and master layout windows |
API_TBoxEnabled_Worksheet | on worksheet window |
API_TBoxEnabled_ModelInteriorElevation | on model type interior elevation windows |
API_TBoxEnabled_DrawingInteriorElevation | on drawing type interior elevation windows |
If you want to register your subtype tool without appearing in the toolbox, pass 0 for both the smallIconResID
and the largeIconResID
parameters. If you register a subtype tool you should define the factory default values for this element type in an 'ACP0' resource. The element default will be initialized with these parameters when no preferences data is stored. The structure of this resource is shown at the example below. The resource ID should be passed in the defaultsResID parameter. Learn more about this topic at the general description of Library Part Subtypes.
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_ReloadLibraries | ( | ) |
Resets and loads the active libraries.