Archicad 28 C++ API
Loading...
Searching...
No Matches
Library Management

Functions to load, iterate and manipulate libraries and library parts. More...

Classes

struct  ACAPI::Library::v1::GSMSectionData
 Raw GSMObject Section representation. More...
 
class  ACAPI::Library::v1::GSMObject
 GSMObject is the representation of a loaded .gsm file. More...
 
class  ACAPI::Library::v1::LibPart
 LibPart is the representation of a file-like item in a Library (.gsm, .png, .lis, etc..) More...
 
class  ACAPI::Library::v1::Library
 Library is the representation of an item in the library list of an ArchiCAD project. More...
 
class  ACAPI::Library::v1::LibraryManager
 LibraryManager is the central point of the Library and the LibPart management. More...
 
class  ACAPI::Library::v1::LibraryTreePath
 Library tree location (E.g. folder, Library Part) More...
 
struct  API_LibraryInfo
 Describes the data of an active library of an Archicad project. More...
 

Enumerations

enum class  ACAPI::Library::v1::GSMObject::CopyMethod { GenerateNewUnID , KeepMainGuid }
 Control flags for the copy of the GSM objects. More...
 
enum class  ACAPI::Library::v1::LibPartType {
  Object , Image , Text , BinaryListCrit ,
  Other
}
 File type of a library part. More...
 
enum  API_LibraryTypeID {
  API_Undefined , API_LocalLibrary , API_UrlLibrary , API_BuiltInLibrary ,
  API_EmbeddedLibrary , API_OtherObject , API_UrlOtherObject , API_ServerLibrary
}
 Project library types. More...
 

Functions

static ACAPI::Result< GSMObjectACAPI::Library::v1::GSMObject::CreateNew (const IO::Location &fileLocation, const ACAPI::Library::v1::GSMObject &ancestorSubType)
 Creates a new empty GSM Object.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::CopyTo (const IO::Location &fileLocation, CopyMethod method=CopyMethod::KeepMainGuid)
 Creates a new copy from the GSM file to a location.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::Modify (const std::function< GSErrCode(Modifier &)> &modifierFunc, GS::UniString password=GS::EmptyUniString)
 Opens a modification scope if the object is editable. See 'IsEditable'.
 
bool ACAPI::Library::v1::GSMObject::IsEditable () const
 A GSM file is editable if it is loaded from the local file system. GSM files from Loaded Libraries should be copied into a local directory before editing.
 
ACAPI::Result< GS::UnID > ACAPI::Library::v1::GSMObject::GetUnID () const
 The UnID is a combination of the main guid and the revision guid.
 
ACAPI::Result< bool > ACAPI::Library::v1::GSMObject::IsPlaceable () const
 The object can be placed in a plan file.
 
ACAPI::Result< bool > ACAPI::Library::v1::GSMObject::IsPasswordProtected () const
 The object is password protected and encrypted.
 
ACAPI::Result< GS::UnID > ACAPI::Library::v1::GSMObject::GetSubTypeUnID () const
 The UnID of the object's direct ancestor in the subtype hierarchy.
 
ACAPI::Result< bool > ACAPI::Library::v1::GSMObject::IsSubType () const
 The object is an 'object subtype'.
 
ACAPI::Result< bool > ACAPI::Library::v1::GSMObject::IsInSubTypeOf (const GS::UnID &subTypeID) const
 The object is a subtype of the given UnID.
 
bool ACAPI::Library::v1::GSMObject::HasMasterScript () const
 Checks whether MasterScript has value or is empty.
 
bool ACAPI::Library::v1::GSMObject::Has2DScript () const
 Checks whether 2DScript section has value or is empty.
 
bool ACAPI::Library::v1::GSMObject::Has3DScript () const
 Checks whether 3DScript section has value or is empty.
 
bool ACAPI::Library::v1::GSMObject::HasPropertiesScript () const
 Checks whether PropertiesScript section has value or is empty.
 
bool ACAPI::Library::v1::GSMObject::HasParameterScript () const
 Checks whether ParameterScript section has value or is empty.
 
bool ACAPI::Library::v1::GSMObject::HasInterfaceScript () const
 Checks whether InterfaceScript section has value or is empty.
 
bool ACAPI::Library::v1::GSMObject::HasForwardMigrationScript () const
 Checks whether ForwardMigrationScript section has value or is empty.
 
bool ACAPI::Library::v1::GSMObject::HasBackwardMigrationScript () const
 Checks whether BackwardMigrationScript section has value or is empty.
 
bool ACAPI::Library::v1::GSMObject::Has2DVectorImage () const
 Checks whether 2DVectorImage section has value or is empty.
 
bool ACAPI::Library::v1::GSMObject::HasPreviewPicture () const
 Checks whether PreviewPicture section has value or is empty.
 
bool ACAPI::Library::v1::GSMObject::HasGDLPictures () const
 Checks whether GDLPictures section has value or is empty.
 
bool ACAPI::Library::v1::GSMObject::HasCustomSection (uint32_t sectionTypeID, uint16_t index) const
 Checks whether CustomSection has value or is empty.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetAuthor () const
 Author of the object.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetLicense () const
 License name of the object.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetLicenseVersion () const
 License version of the object.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetDescription () const
 Description of the object.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetKeywords () const
 Keywords of the object. Mostly used for search. Usually it is a comma separated list.
 
ACAPI::Result< GDL::Parameters > ACAPI::Library::v1::GSMObject::GetParameters () const
 Parameter list of the object.
 
ACAPI::Result< std::vector< GS::UniString > > ACAPI::Library::v1::GSMObject::GetParameterDescriptions () const
 Parameter descriptions of the object.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetMasterScript (const GS::UniString &password=GS::EmptyUniString) const
 Master script of the object.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::Get2DScript (const GS::UniString &password=GS::EmptyUniString) const
 2D script of the object.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::Get3DScript (const GS::UniString &password=GS::EmptyUniString) const
 3D script of the object.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetPropertiesScript (const GS::UniString &password=GS::EmptyUniString) const
 Properties script of the object.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetParameterScript (const GS::UniString &password=GS::EmptyUniString) const
 Parameter script of the object.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetInterfaceScript (const GS::UniString &password=GS::EmptyUniString) const
 Interface script of the object.
 
ACAPI::Result< bool > ACAPI::Library::v1::GSMObject::IsUIDefault () const
 The defined interface is set as default UI.
 
ACAPI::Result< bool > ACAPI::Library::v1::GSMObject::IsHierarchicalPagesUsed () const
 The defined interface uses hierarchical pages.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetForwardMigrationScript (const GS::UniString &password=GS::EmptyUniString) const
 Forward Migration script of the object.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetBackwardMigrationScript (const GS::UniString &password=GS::EmptyUniString) const
 Backward Migration script of the object.
 
ACAPI::Result< VectorImage > ACAPI::Library::v1::GSMObject::Get2DVectorImage () const
 2D Vector Image of the object.
 
ACAPI::Result< GX::ImageRef > ACAPI::Library::v1::GSMObject::GetPreviewPicture () const
 Preview picture of the object.
 
ACAPI::Result< std::vector< GX::ImageRef > > ACAPI::Library::v1::GSMObject::GetGDLPictures () const
 Embedded pictures of the object.
 
ACAPI::Result< GSMSectionDataACAPI::Library::v1::GSMObject::GetCustomSection (uint32_t sectionID, uint16_t index=0) const
 Custom section data of the object.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetPlaceable (bool placeable)
 Sets the placeable flag of the object. If true, the object can be placed in a plan file.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetPassword (const GS::UniString &newPassword)
 Sets the password of the object. If a password is set, it will encrypt and lock the object.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetIsSubtype (bool isSubType)
 Sets the object as a subtype.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetAuthor (const GS::UniString &author)
 Sets the author of the object.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetLicense (const GS::UniString &license)
 Sets the license code of the object.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetLicenseVersion (const GS::UniString &licVer)
 Sets the license version of the object.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetDescription (const GS::UniString &description)
 Sets the description of the object.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetKeywords (const GS::UniString &keywords)
 Sets the keywords of the object. That is used by several search tools. Usually it is a comma separated list.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetParameters (const GDL::Parameters &newParamList, const std::vector< GS::UniString > &descriptions)
 Sets the parameters of the object. This function will replace the entire parameter list.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::MergeParameters (const GDL::Parameters &newParamList, const std::vector< GS::UniString > &descriptions)
 Merges new parameters to the object. This function will add new parameters and replace the existing ones.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetMasterScript (const GS::UniString &script)
 Sets the master script. This function will replace the existing master script. If it is empty, the script will NOT be deleted but set to empty.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::Set2DScript (const GS::UniString &script)
 Sets the 2D script. This function will replace the existing 2D script. If it is empty, the script will NOT be deleted but set to empty.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::Set3DScript (const GS::UniString &script)
 Sets the 3D script. This function will replace the existing 3D script. If it is empty, the script will NOT be deleted but set to empty.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetPropertiesScript (const GS::UniString &script)
 Sets the properties script. This function will replace the existing properties script. If it is empty, the script will NOT be deleted but set to empty.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetParameterScript (const GS::UniString &script)
 Sets the parameter script. This function will replace the existing parameter script. If it is empty, the script will NOT be deleted but set to empty.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetInterfaceScript (const GS::UniString &script)
 Sets the interface script. This function will replace the existing interface script. If it is empty, the script will NOT be deleted but set to empty.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetUIDefault (bool isDefault)
 Sets the interface as default.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetHierarchicalPagesUsed (bool hierarchicalPagesUsed)
 Sets the interface uses hierarchical pages.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetForwardMigrationScript (const GS::UniString &script)
 Sets the forward migration script. This function will replace the existing forward migration script. If it is empty, the script will NOT be deleted but set to empty.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetBackwardMigrationScript (const GS::UniString &script)
 Sets the backward migration script. This function will replace the existing backward migration script. If it is empty, the script will NOT be deleted but set to empty.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::Set2DVectorImage (const VectorImage &image)
 Sets a vector image as 2D symbol. This function will replace the existing 2D symbol. If it is empty, the symbol will NOT be deleted but set to empty.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetPreviewPicture (const GX::ImageRef &image)
 Sets the preview picture.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetGDLPictures (const std::vector< GX::ImageRef > &images)
 Sets the pictures which are referred from th GDL scripts.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetCustomSection (uint32_t sectionTypeID, uint16_t index, const GSMSectionData &data)
 Sets a custom section.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeleteMasterScript ()
 Deletes the master script.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::Delete2DScript ()
 Deletes the 2D script.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::Delete3DScript ()
 Deletes the 3D script.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeletePropertiesScript ()
 Deletes the properties script.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeleteParameterScript ()
 Deletes the parameter script.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeleteInterfaceScript ()
 Deletes the interface script.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeleteForwardMigrationScript ()
 Deletes the forward migration script.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeleteBackwardMigrationScript ()
 Deletes the backward migration script.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::Delete2DVectorImage ()
 Deletes the 2D Vector image.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeletePreviewPicture ()
 Deletes the preview picture.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeleteGDLPictures ()
 Deletes GDL pictures.
 
ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeleteCustomSection (uint32_t sectionID, uint16_t index=0)
 Deletes a custom section.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::LibPart::GetName () const
 The name of the library part.
 
ACAPI::Result< IO::Location > ACAPI::Library::v1::LibPart::GetLocation () const
 The location of the library part file.
 
ACAPI::Result< LibPartTypeACAPI::Library::v1::LibPart::GetType () const
 The file type of the library part.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::Library::GetName () const
 The name of the library.
 
ACAPI::Result< IO::Location > ACAPI::Library::v1::Library::GetLocation () const
 Location of the Library. If the library is a teamwork library, the location is the local cache location.
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::Library::GetTWServerUrl () const
 The teamwork server URL is the URL of the BIMcloud where the library is located, like "http://example.com".
 
ACAPI::Result< GS::UniString > ACAPI::Library::v1::Library::GetTWServerPath () const
 The relative location of the library from the root of the BIMcloud server, like "Libraries/The shared library.lcf".
 
ACAPI::Result< bool > ACAPI::Library::v1::Library::IsLocal () const
 The library is loaded from local (or netwrork) file system.
 
ACAPI::Result< bool > ACAPI::Library::v1::Library::IsBuiltIn () const
 The library is built-in, if it is the Archicad's or any add-ons built-in library.
 
ACAPI::Result< bool > ACAPI::Library::v1::Library::IsEmbedded () const
 The library is embedded, if it is the one embedded in the plan file.
 
ACAPI::Result< bool > ACAPI::Library::v1::Library::IsServer () const
 The library is a server library, if it is loaded from a BIMcloud server.
 
ACAPI::Result< bool > ACAPI::Library::v1::Library::IsPackage () const
 The library is a library package, if it is a .libpack file.
 
ACAPI::Result< GS::Guid > ACAPI::Library::v1::Library::GetPackageID () const
 The package ID of the library package.
 
ACAPI::Result< UInt32 > ACAPI::Library::v1::Library::GetPackageMainVersion () const
 The main version of the library package. Different main versions are incompatible and have different package IDs.
 
ACAPI::Result< UInt32 > ACAPI::Library::v1::Library::GetPackageSubVersion () const
 The sub version of the library package.
 
ACAPI::Result< UInt32 > ACAPI::Library::v1::Library::GetPackageMinACVersion () const
 The minimum Archicad version of the library package.
 
ACAPI::Result< UInt32 > ACAPI::Library::v1::Library::GetPackageMinACBuildNumber () const
 The minimum Archicad build number of the library package.
 
ACAPI::Result< std::vector< std::tuple< GS::UniString, GS::Guid, UInt32 > > > ACAPI::Library::v1::Library::GetPackageDependencies () const
 The dependencies of the library package. The dependencies are a list of name, package ID, subversion tuple.
 
Result< void > ACAPI::Library::v1::LibraryManager::ModifyLibraryList (const std::function< GSErrCode(Modifier &)> &modifierFunc)
 Executed the passed modifier scope in a NotUndoable command.
 
std::vector< LibraryACAPI::Library::v1::LibraryManager::FindLibraries (const std::function< bool(const Library &)> &selector) const
 Find Libraries using a custom selector function.
 
Result< LibraryACAPI::Library::v1::LibraryManager::FindLibrary (const std::function< bool(const Library &)> &selector) const
 Find Library using a custom selector function.
 
Result< LibraryACAPI::Library::v1::LibraryManager::GetLibraryByName (const GS::UniString &name) const
 Returns the Library with the given name.
 
Result< LibraryACAPI::Library::v1::LibraryManager::GetEmbeddedLibrary () const
 A faster way to get the embedded library.
 
Result< LibraryACAPI::Library::v1::LibraryManager::GetLibraryOfLibPart (const LibPart &libPart) const
 Returns the Library containing the Library Part.
 
std::vector< LibPartACAPI::Library::v1::LibraryManager::FindLibParts (const std::function< bool(const LibPart &)> &selector) const
 Find LibParts using a custom selector function.
 
Result< LibPartACAPI::Library::v1::LibraryManager::FindLibPart (const std::function< bool(const LibPart &)> &selector) const
 Find Library Part using a custom selector function.
 
Result< LibPartACAPI::Library::v1::LibraryManager::GetLibPartByName (const GS::UniString &name) const
 Returns a library part with the filename.
 
Result< LibPartACAPI::Library::v1::LibraryManager::GetLibPartByGSMObject (const GSMObject &gsmObject) const
 Returns the Library Part of the GSMObject.
 
Result< LibraryTreePathACAPI::Library::v1::LibraryManager::GetLibraryTreePathOfLibPart (const LibPart &libPart) const
 Returns the LibraryTreePath of the LibPart.
 
Result< GS::Guid > ACAPI::Library::v1::LibraryManager::GetTWID (const LibraryTreePath &libraryTreePath) const
 Returns the Teamwork Identifier of the Library Tree location.
 
Result< GSMObjectACAPI::Library::v1::LibraryManager::GetGSMObjectOfLibPart (const LibPart &libPart) const
 Returns the .gsm object representation of the Library Part.
 
Result< GSMObjectACAPI::Library::v1::LibraryManager::LoadGSMObjectFromFile (const IO::Location &location) const
 Loads a .gsm object from a file.
 
Result< LibPartACAPI::Library::v1::LibraryManager::GetLibPartByLibInd (Int32 libPartIndex) const
 Returns a library part with the given index.
 
Result< Int32 > ACAPI::Library::v1::LibraryManager::GetLibIndOfLibPart (const LibPart &libPart) const
 Returns the index of the library part.
 
Result< LibraryManagerACAPI::Library::v1::GetLibraryManager ()
 Creates a LibraryManager instance.
 
Result< void > ACAPI::Library::v1::LibraryManager::AddLibrary (const IO::Location &libraryPath)
 Add a libary to the actual library list.
 
Result< void > ACAPI::Library::v1::LibraryManager::AddLibrary (const GS::UniString &twServerURL, const GS::UniString &twServerPath)
 Add a server libary to the actual library list.
 
Result< void > ACAPI::Library::v1::LibraryManager::RemoveLibrary (const Library &library)
 Remove a libary from the actual library list. Embedded and Built-In libraries cannot be removed.
 
bool ACAPI::Library::v1::SelectAllLibraries (const Library &)
 A selector for the FindLibraries function. It selects all libraries.
 
bool ACAPI::Library::v1::SelectLoadedLibraries (const Library &lib)
 A selector for the FindLibraries function. It selects all libraries which are not embedded and not built-in.
 
bool ACAPI::Library::v1::SelectAllLibParts (const LibPart &)
 A selector for the FindLibParts function. It selects all libparts.
 
bool ACAPI::Library::v1::SelectObjectLibParts (const LibPart &lp)
 A selector for the FindLibParts function. It selects all object libparts.
 
bool ACAPI::Library::v1::SelectTextLibParts (const LibPart &lp)
 A selector for the FindLibParts function. It selects all text libparts.
 
bool ACAPI::Library::v1::SelectImageLibParts (const LibPart &lp)
 A selector for the FindLibParts function. It selects all image libparts.
 
bool ACAPI::Library::v1::LibraryTreePath::IsRoot () const
 Root path of the library tree.
 
GS::UniString ACAPI::Library::v1::LibraryTreePath::GetLastPart () const
 The name of the current node.
 
LibraryTreePath ACAPI::Library::v1::LibraryTreePath::GetParent () const
 The parent of the represented node.
 
std::vector< GS::UniString > ACAPI::Library::v1::LibraryTreePath::GetParts () const
 The parts of the path.
 
GSErrCode ACAPI_ProjectOperation_ReloadLibraries ()
 Resets and loads the active libraries.
 
GSErrCode ACAPI_LibraryManagement_OpenLibraryPart (const API_OpenLibPartInfo *libPartToOpen)
 Opens the given library part in the Library Part Editor window.
 
GSErrCode ACAPI_LibraryManagement_GetLibraries (GS::Array< API_LibraryInfo > *activeLibs, Int32 *embeddedLibraryIndex=nullptr)
 Returns the list of loaded libraries.
 
GSErrCode ACAPI_LibraryManagement_SetLibraries (const GS::Array< API_LibraryInfo > *activeLibs)
 Changes the list of loaded libraries.
 
GSErrCode ACAPI_LibraryManagement_NewLibDial (char *defName, IO::Location *newLib)
 Instructs the user to select a new library folder in a dialog.
 
GSErrCode ACAPI_LibraryManagement_AddLibraries (IO::Location *newLib)
 Registers a new folder into the list of active libraries.
 
GSErrCode ACAPI_LibraryManagement_CheckLibraries ()
 Checks the currently loaded libraries.
 
GSErrCode ACAPI_LibraryManagement_OverwriteLibPart (bool overwriteOn)
 Sets the overwrite mode for the library part create function.
 
GSErrCode ACAPI_LibraryManagement_DeleteEmbeddedLibItem (const IO::Location *location, bool keepGSMFile=false, bool silentMode=false)
 Deletes the given embedded library item (folder or library part).
 
GSErrCode ACAPI_LibraryManagement_DeleteEmbeddedLibItems (const GS::Array< IO::Location > *location, bool keepGSMFile=false, bool silentMode=false)
 Delete embeded lib items.
 
GSErrCode ACAPI_LibraryManagement_CreateFolderInLibrary (const IO::Location *newFolderLocationInLibrary)
 Creates a new folder inside a loaded library.
 
GSErrCode 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 ACAPI_LibraryManagement_GetGDLDate (Int32 *date)
 Returns GDL environment date information (GDL_PROJECT_DATE).
 
GSErrCode ACAPI_LibraryManagement_ChangeGDLDate (Int32 *date)
 Changes GDL environment date (GDL_PROJECT_DATE).
 
GSErrCode ACAPI_LibraryManagement_CreateCopyOfGdlUserGlobalsHandle (GDL::Parameters **userGlobals)
 Returns a copy of the current GDL globals.
 
GSErrCode ACAPI_LibraryManagement_DestroyCopyOfGdlUserGlobalsHandle (GDL::Parameters **userGlobals)
 Destroys the previously copied GDL globals handle.
 
GSErrCode ACAPI_LibraryManagement_GetLibPartOrigLocation (const Int32 *libItemIndex, IO::Location *origLocation)
 Returns the original location of a library part.
 
GSErrCode ACAPI_LibraryManagement_UsableGDLString (const char *str)
 Determines whether the string is a GDL keyword or reserved symbol.
 
GSErrCode ACAPI_LibraryManagement_RunGDLParScript (const API_Elem_Head *elemHead, UInt32 mask=0)
 Run GDL parameter script.
 
GSErrCode 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 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 ACAPI_Element_GetDescriptors (const API_Elem_Head *elemHead, API_DescriptorRefType ***descRef, Int32 *nDesc)
 Returns the descriptors of an element.
 

Variables

int16_t ACAPI::Library::v1::GSMSectionData::dataVersion
 Version of the data format.
 
std::vector< std::byte > ACAPI::Library::v1::GSMSectionData::data
 Raw bites of the stored data.
 

Detailed Description

Functions to load, iterate and manipulate libraries and library parts.

Library Management Overview

Classes and functions related to library management allow add-ons to access and modify loaded libraries and library parts in the planfile, similar to how users interact with the UI. The basic concepts are similar to those known from UI: ACAPI::Library::v1::LibraryManager, ACAPI::Library::v1::Library, ACAPI::Library::v1::LibPart, ACAPI::Library::v1::GSMObject. Starting with Archicad 28, GSM file-specific operations have been separated from general library part management to more logically align with how Archicad operates. ACAPI::Library::v1::LibraryTreePath is an additional concept that helps map the library structure and provides access to Teamwork functions.

All classes and functions can be found in the ACAPI/Library/*.hpp header files and in the ACAPI::Library namespace.

For working examples, check the LibraryManagement_Test_ExampleFunctions.cpp file from the API DevKit.

The LibraryManager

The ACAPI::Library::v1::LibraryManager class is the main entry point for library-related functionalities. This class is not a one-to-one equivalent of the familiar UI dialogue, but it provides the same functionalities.

While it doesn't store data itself, it provides access to the data in the plan file. It can be instantiated anywhere the plan file already exists, and this instantiation is a low-cost operation. However, instance creation can fail, as we can't guarantee that a plan file is loaded in every context. That is why the creation is packaged in a factory:

if (lmResult.IsErr ()) {
return lmResult.UnwrapErr ();
}
ACAPI::Library::LibraryManager libraryManager = *lmResult;
LibraryManager is the central point of the Library and the LibPart management.
Definition: LibraryManager.hpp:32
Result is the standard return type of API functions.
Definition: Result.hpp:845
E UnwrapErr() const
Unwraps the error value contained in the Result. Trying to UnwrapErr the value while it contains an O...
Definition: Result.hpp:1140
bool IsErr() const
Definition: Result.hpp:945
Result< LibraryManager > GetLibraryManager()
Creates a LibraryManager instance.
Definition: LibraryManager.hpp:195

In a safe context, where the plan file definitely exists, you can instantiate it in a more compact way:

auto libraryManager = *ACAPI::Library::GetLibraryManager ();

Query Libraries and Library Parts

Library and Library Part can be searched and queried using the methods of the created LibraryManager instance. You can search and filter with unary predicates, similar to the find_if function from the C++ standard library. We provide reusable predicates for the most common searches.

auto libraryManager = *ACAPI::Library::GetLibraryManager ();
std::vector<ACAPI::Library::Library> allLibs = libraryManager.FindLibraries (ACAPI::Library::SelectAllLibraries);
std::vector<ACAPI::Library::Library> loadedLibs = libraryManager.FindLibraries (ACAPI::Library::SelectLoadedLibraries);
// custom predicate:
std::vector<ACAPI::Library::Library> localLibs = libraryManager.FindLibraries ([] (const ACAPI::Library::Library& library) { return library.IsLocal (); });
std::vector<ACAPI::Library::LibPart> allLibParts = libraryManager.FindLibParts (ACAPI::Library::SelectAllLibParts);
std::vector<ACAPI::Library::LibPart> imgLibParts = libraryManager.FindLibParts (ACAPI::Library::SelectImageLibParts);
// custom:
std::vector<ACAPI::Library::LibPart> embeddedLibParts = libraryManager.FindLibParts ([&] (const ACAPI::Library::LibPart& lp) {
return *(libraryManager.GetLibraryOfLibPart (lp)->IsEmbedded ());
});
LibPart is the representation of a file-like item in a Library (.gsm, .png, .lis, etc....
Definition: LibPart.hpp:36
Library is the representation of an item in the library list of an ArchiCAD project.
Definition: Library.hpp:31
bool SelectLoadedLibraries(const Library &lib)
A selector for the FindLibraries function. It selects all libraries which are not embedded and not bu...
Definition: LibraryManager.hpp:261
ACAPI::Result< bool > IsLocal() const
The library is loaded from local (or netwrork) file system.
Result< Library > GetLibraryOfLibPart(const LibPart &libPart) const
Returns the Library containing the Library Part.
std::vector< LibPart > FindLibParts(const std::function< bool(const LibPart &)> &selector) const
Find LibParts using a custom selector function.
std::vector< Library > FindLibraries(const std::function< bool(const Library &)> &selector) const
Find Libraries using a custom selector function.
bool SelectAllLibParts(const LibPart &)
A selector for the FindLibParts function. It selects all libparts.
Definition: LibraryManager.hpp:271
bool SelectImageLibParts(const LibPart &lp)
A selector for the FindLibParts function. It selects all image libparts.
Definition: LibraryManager.hpp:298
bool SelectAllLibraries(const Library &)
A selector for the FindLibraries function. It selects all libraries.
Definition: LibraryManager.hpp:253

If you are looking for a specific instance, the result will be of type ACAPI::Result, as the hit is not guaranteed. The LibraryManager also provide a quick solution for common queries.

auto libraryManager = *ACAPI::Library::GetLibraryManager ();
// LIBRARIES:
auto foundLibrary = libraryManager.FindLibrary ([](const ACAPI::Library::Library& library) {
return *library.GetName () == "SpecificLibraryName";
});
auto foundLibrary2 = libraryManager.GetLibraryByName ("SpecificLibraryName");
auto embeddedLibaray = libraryManager.FindLibrary ([](const ACAPI::Library::Library& library) {
return *library.IsEmbedded ();
});
auto embeddedLibaray = libraryManager.GetEmbeddedLibrary ();
// LIBPARTS:
auto specificLibPartResult = libraryManager.FindLibPart([](const ACAPI::Library::LibPart& libPart) {
return *libPart.GetName () == GS::UniString ("SpecificLibPartName.txt");
});
auto specificLibPartResult = libraryManager.GetLibPartByName ("SpecificLibPartName.txt");
Result< LibPart > GetLibPartByName(const GS::UniString &name) const
Returns a library part with the filename.
Result< LibPart > FindLibPart(const std::function< bool(const LibPart &)> &selector) const
Find Library Part using a custom selector function.
Result< Library > GetLibraryByName(const GS::UniString &name) const
Returns the Library with the given name.
Result< Library > GetEmbeddedLibrary() const
A faster way to get the embedded library.
ACAPI::Result< bool > IsEmbedded() const
The library is embedded, if it is the one embedded in the plan file.
ACAPI::Result< GS::UniString > GetName() const
The name of the library.
Result< Library > FindLibrary(const std::function< bool(const Library &)> &selector) const
Find Library using a custom selector function.
ACAPI::Result< GS::UniString > GetName() const
The name of the library part.

Modifying the library list

The modifications can be accessed within a modification scope. This allows multiple modifications to be executed at once, in one step, just like the operation of the Library Manager dialog box. Opening the scope also checks the modification rights, and returns an error if the given user does not reserve the library list in Teamwork.

GSErrCode AddLocalLibraryList (const GS::Array<IO::Location>& libraryLocations)
{
auto result = libraryManager.ModifyLibraryList ([&] (ACAPI::Library::LibraryManager::Modifier& modifier) -> GSErrCode {
// adding libraries without loading and enumerating
for (auto libraryLocation : libraryLocations) {
auto addResult = modifier.AddLibrary (libraryLocation);
if (addResult.IsErr ()) {
return addResult.UnwrapErr ().kind;
}
}
return NoError;
}); // load and enumerate is happening here
if (result.IsErr ()) {
return result.UnwrapErr ().kind;
}
return NoError;
}
Result< void > ModifyLibraryList(const std::function< GSErrCode(Modifier &)> &modifierFunc)
Executed the passed modifier scope in a NotUndoable command.

See more examples in LibraryManagement_Test_ExampleFunctions.cpp.

Library Parts and GSM Objects

Similar to the Archicad UI concept, the API also separates the functionalities of the Library Parts from those that are specific to GSM files. A Library Part is anything that is part of a loaded library. However, a GSM can also be a local file that is not a loaded Library Part, but was read from outside.

auto libraryManager = *ACAPI::Library::GetLibraryManager ();
ACAPI::Library::LibPart imgLP = *libraryManager.GetLibPartByName ("Image.jpg");
ACAPI::Result<ACAPI::Library::GSMObject> imgObj = libraryManager.GetGSMObjectOfLibPart (imgLP); // Will be Error!
ACAPI::Library::LibPart doorLP = *libraryManager.GetLibPartByName ("Door.gsm");
ACAPI::Result<ACAPI::Library::GSMObject> doorObj = libraryManager.GetGSMObjectOfLibPart (doorLP); // Will be Ok!
ACAPI::Result<ACAPI::Library::GSMObject> anotherDoorObj = libraryManager.LoadGSMObjectFromFile (IO::Location ("/path/to/door 2.gsm"));
Result< GSMObject > GetGSMObjectOfLibPart(const LibPart &libPart) const
Returns the .gsm object representation of the Library Part.
Result< GSMObject > LoadGSMObjectFromFile(const IO::Location &location) const
Loads a .gsm object from a file.

Be aware that loading the same object from a file and from a libpart can result different behaviors. If you are interested in the state that also appears in the plan file, always create a GSMObject from a LibPart. You should load GSM from a file only when you would access its raw content. If the object comes from a .libpack library, it means, it is not translated.

Creating and modifying a GSM file

You cannot directly create or modify a GSM file in a loaded library. You need an object loaded from an external file, which can optionally be copied into the library after editing.

The modification methods are available from a modification scope. This ensures that modification methods are available for objects loaded from file, and all of the modification calls will perform in an atomic step.

auto libraryManager = *ACAPI::Library::GetLibraryManager ();
ACAPI::Library::LibPart doorLP = *libraryManager.GetLibPartByName ("Door.gsm");
ACAPI::Library::GSMObject object = *libraryManager.GetGSMObjectOfLibPart (doorLP);
IO::Location targetPath ("/path/to/temp/Door 2.gsm");
object.CopyTo (targetPath, ACAPI::Library::GSMObject::CopyMethod::GenerateNewUnID);
ACAPI::Library::GSMObject copiedObject = *libraryManager.LoadGSMObjectFromFile (targetPath);
copiedObject.Modify ([&] (ACAPI::Library::GSMObject::Modifier& modifier) -> GSErrCode {
modifier.SetAuthor ("Myself");
modifier.SetMasterScript (someMasterScript);
modifier.Set2DScript (some2DScript);
modifier.Set3DScript (some3DScript);
modifier.SetParameterScript (someParameterScript);
return NoError;
});
GSMObject is the representation of a loaded .gsm file.
Definition: GSMObject.hpp:74
ACAPI::Result< void > Modify(const std::function< GSErrCode(Modifier &)> &modifierFunc, GS::UniString password=GS::EmptyUniString)
Opens a modification scope if the object is editable. See 'IsEditable'.

See more detailed examples in LibraryManagement_Test_ExampleFunctions.cpp.

Copy a GSM file to a library

Copying an external file back into an editable loaded library works in the old, traditional way. Of course, copying multiple files here also happens in one step.

IO::Location embeddedLocation = *libraryManager.GetEmbeddedLibrary ()->GetLocation ();
GS::Array<IO::Location> newFileLocations;
bool overwrite = true;
newFileLocations.Push (IO::Location ("/path/to/temp/Modified Door.gsm"));
newFileLocations.Push (IO::Location ("/path/to/Some Picture.jpg"));
ACAPI_LibraryManagement_CopyFilesIntoLibrary (&embeddedLocation, &newFileLocations, &overwrite);
GSErrCode 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.

Teamwork functionalities

A reservable component can be reserved, released or its status can be queried using with ACAPI_Teamwork_* functions. Full documentation can be found here: Teamwork

The ACAPI::Library::LibraryManager can represent a point in the library tree with the ACAPI::Library::LibraryTreePath type. With this, we can get the reservable object identifier, which can be used to call the ACAPI_Teamwork_* functions.

auto libraryManager = *ACAPI::Library::GetLibraryManager ();
auto doorLP = *libraryManager.GetLibPartByName ("Door.gsm");
ACAPI::Library::LibraryTreePath parentPath = doorPath.GetParent ();
GS::Guid guid = *libraryManager.GetTWID (parentPath);
if (lockableStatus == APILockableStatus_Free) {
}
Library tree location (E.g. folder, Library Part)
Definition: LibraryTreePath.hpp:26
API_Guid & GSGuid2APIGuid(GS::Guid &guid)
Converting from GS::Guid to API_Guid.
Definition: API_Guid.hpp:95
Result< LibraryTreePath > GetLibraryTreePathOfLibPart(const LibPart &libPart) const
Returns the LibraryTreePath of the LibPart.
LibraryTreePath GetParent() const
The parent of the represented node.
Result< GS::Guid > GetTWID(const LibraryTreePath &libraryTreePath) const
Returns the Teamwork Identifier of the Library Tree location.
API_LockableStatus
Possible Teamwork lockable status.
Definition: APIdefs_Environment.h:425
API_LockableStatus ACAPI_Teamwork_GetLockableStatus(const API_Guid &objectId, GS::PagedArray< short > *conflicts=nullptr)
Retrieves the reservation status of a lockable object set.
GSErrCode ACAPI_Teamwork_ReserveLockable(const API_Guid &objectId, GS::PagedArray< short > *conflicts=nullptr, bool enableDialogs=true)
Reserves a lockable object set in Teamwork mode.

For reserving the library list you don't need to use the LibraryManager instance:

API_Guid libListGuid = ACAPI_Teamwork_FindLockableObjectSet ("ProjectLibraryList");
if (lockableStatus == APILockableStatus_Free) {
}
API_Guid ACAPI_Teamwork_FindLockableObjectSet(const GS::UniString &objectSetName)
Retrieves the unique identifier of a lockable object set with a string identifier.
Represents a GS::Guid in the API layer.
Definition: API_Guid.hpp:46

Enumeration Type Documentation

◆ API_LibraryTypeID

Project library types.

Remarks
The libraryType data member in the API_LibraryInfo structure defines the type of the project library, which can be
  • Local Library
  • Embedded Library
  • Built-In Library
  • Library on a BIMcloud / BIM Server
  • Web Objects (addressed by URL)
  • Other local objects

◆ CopyMethod

Control flags for the copy of the GSM objects.

GenerateNewUnID: The new object gets different UnID; KeepMainGuid: Creates a new revision.

◆ LibPartType

File type of a library part.

Values can be: Object, Image, Text, BinaryListCrit, Other

Function Documentation

◆ ACAPI_Element_GetDescriptors()

GSErrCode ACAPI_Element_GetDescriptors ( const API_Elem_Head elemHead,
API_DescriptorRefType ***  descRef,
Int32 *  nDesc 
)

Returns the descriptors of an element.

Parameters
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.
Returns
  • APIERR_BADPARS - descRef is nullptr or nDesc is nullptr.
  • APIERR_BADID - Incorrect elemHead was specified.
  • APIERR_MEMFULL - Not enough memory to get the descriptors.
Remarks
This function is used to get information for every descriptor of an element. These descriptors are in the property objects of the element. This applies to all the construction elements.
Example
void GetDiscriptors (const API_Guid& guid)
{
API_Elem_Head elemHead;
API_ListData listdata;
Int32 nDesc, i;
char s[256];
GSErrCode err;
BNClear (elemHead);
elemHead.guid = guid;
err = ACAPI_Element_GetDescriptors (&elemHead, &descRefs, &nDesc);
if (err == NoError) {
for (i = 0; i < nDesc; i++) {
listdata.header.type = API_Obsolete_ComponentID;
listdata.header.index = (*descRefs)[i].index;
listdata.header.setIndex = (*descRefs)[i].setIndex;
if ((*descRefs)[i].status != APIDBRef_Deleted) {
BNZeroMemory (&listdata, sizeof (API_ListData));
listdata.header.type = API_DescriptorID;
listdata.header.setIndex = (*descRefs)[i].setIndex;
listdata.header.index = (*descRefs)[i].index;
switch ((*descRefs)[i].status) {
case APIDBRef_Normal:
err = ACAPI_OldListing_Get (&listdata);
break;
case APIDBRef_Local:
err = ACAPI_OldListing_GetLocal ((*descRefs)[i].libIndex, &listdata);
break;
}
}
if (err == NoError) {
sprintf (s, "Keycode/code: \"%s\"/\"%s\"", listdata.descriptor.keycode, listdata.descriptor.code);
ACAPI_WriteReport (s, false);
ACAPI_WriteReport (*(listdata.descriptor.name), false);
}
BMKillHandle (&listdata.descriptor.name);
}
BMKillHandle ((GSHandle *) &descRefs);
}
}
void ACAPI_WriteReport(const GS::UniString &format, bool withDial,...)
Writes a report string into the Report Windowot into a custom alert window.
GSErrCode ACAPI_Element_GetDescriptors(const API_Elem_Head *elemHead, API_DescriptorRefType ***descRef, Int32 *nDesc)
Returns the descriptors of an element.
GSErrCode ACAPI_OldListing_Get(API_ListData *listdata)
Retrieves the data of a listdata.
GSErrCode ACAPI_OldListing_GetLocal(Int32 libIndex, const API_Elem_Head *elemHead, API_ListData *listdata)
Retrieves the data of a local listing component.
The descriptor reference record.
Definition: APIdefs_Elements.h:22864
char code[API_DBCodeLen]
Descriptor code.
Definition: APIdefs_ListData.h:362
char keycode[API_DBCodeLen]
Descriptor key code.
Definition: APIdefs_ListData.h:368
char ** name
name of the descriptor
Definition: APIdefs_ListData.h:380
General element header for element types.
Definition: APIdefs_Elements.h:401
API_Guid guid
The globally unique identifier of the element. It is type-independent, and guaranteed to be globally ...
Definition: APIdefs_Elements.h:426
Int32 setIndex
index of the list data set the component is in
Definition: APIdefs_ListData.h:155
Int32 index
index of the listdata in the set
Definition: APIdefs_ListData.h:161
The representation of a listdata.
Definition: APIdefs_ListData.h:403
API_ListData_Head header
A common header for all the listdata types. It contains information which applies to all the listdata...
Definition: APIdefs_ListData.h:409
API_DescriptorType descriptor
a descriptor listdata
Definition: APIdefs_ListData.h:434

◆ ACAPI_LibraryManagement_AddLibraries()

GSErrCode ACAPI_LibraryManagement_AddLibraries ( IO::Location *  newLib)

Registers a new folder into the list of active libraries.

Parameters
newLib[in] The file system location of the folder to add.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - newLib is nullptr.
  • APIERR_NOTMINE - The project library list is not editable in Teamwork. You need to reserve it first.
Remarks
The registered folder will be the default one, which means that Library Parts created by the subsequent ACAPI_LibraryPart_Create functions automatically will go into this library, unless an other folder is specified. The modified list of active libraries will be enumerated. This function is a non-undoable data structure modifier function. See more details on this topic at Command Overview. Note that BIM Server libraries cannot be added to the project with this function.
Warning
Legacy function - to be deleted in future versions, use ACAPI::Library::LibraryManager::AddLibrary instead

◆ ACAPI_LibraryManagement_ChangeGDLDate()

GSErrCode ACAPI_LibraryManagement_ChangeGDLDate ( Int32 *  date)

Changes GDL environment date (GDL_PROJECT_DATE).

Parameters
date[in] The new GDL environment date. It must be an Int32 array with 6 size.
Returns
  • NoError - The function has completed with success.
Remarks
The input date array must contain the new date in the following format:
Date component Meaning
date[0] Year
date[1] Month
date[2] Day
date[3] Hour
date[4] Minute
date[5] Second
Example
Int32 date[6];
date[0] = 2017;
date[1] = 1;
date[2] = 17;
date[3] = 12;
date[4] = 0;
date[5] = 0;
ACAPI_Environment (APIEnv_ChangeGDLDateID
, &date);

◆ ACAPI_LibraryManagement_CheckLibraries()

GSErrCode ACAPI_LibraryManagement_CheckLibraries ( )

Checks the currently loaded libraries.

Returns
  • NoError - Always returns NoError.
Remarks
Check the active library folders for the required Library Parts. If any of them are missing, an alert is highlighted to inform the user. This function is a non-undoable data structure modifier function. See more details on this topic at Command Overview.

◆ ACAPI_LibraryManagement_CopyFilesIntoLibrary()

GSErrCode 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.

Parameters
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).
Returns
  • APIERR_BADPARS - The target folder location parameter is invalid or nullptr.
Remarks
The function copies file from the passed locations into a folder in an existing library loaded in the current project. The target folder must be writable and, in Teamwork, must be reserved.
Example
GS::Array<IO::Location> filesToCopy;
API_SpecFolderID specID = API_UserDocumentsFolderID;
IO::Location fileLocation;
ACAPI_Environment (APIEnv_GetSpecFolderID, &specID, &fileLocation);
filesToCopy.Push (IO::Location (fileLocation, IO::Name ("Test1.JPG")));
filesToCopy.Push (IO::Location (fileLocation, IO::Name ("Test2.JPG")));
GS::Array<API_LibraryInfo> libInfo;
GSErrCode err = ACAPI_Environment (APIEnv_GetLibrariesID, &libInfo);
if (err == NoError) {
for (UInt32 ii = libInfo.GetSize (); ii > 0; --ii) {
const API_LibraryInfo& libraryInfo = libInfo[ii - 1];
if (libraryInfo.libraryType == API_LocalLibrary || libraryInfo.libraryType == API_EmbeddedLibrary || libraryInfo.libraryType == API_ServerLibrary) {
IO::Location targetFolderLocation = libraryInfo.location;
bool overwriteIfExists = true;
err = ACAPI_Environment (APIEnv_CopyFilesIntoLibraryID
, &targetFolderLocation, &filesToCopy, &overwriteIfExists);
break;
}
}
}
API_SpecFolderID
The selector of special folders.
Definition: APIdefs_Environment.h:4402
Describes the data of an active library of an Archicad project.
Definition: APIdefs_Environment.h:654
API_LibraryTypeID libraryType
the type of the library (Built-In, Local, Embedded, BIM Server, Web Object, Other; see API_LibraryTyp...
Definition: APIdefs_Environment.h:672
IO::Location location
the folder specification of the library
Definition: APIdefs_Environment.h:660

◆ ACAPI_LibraryManagement_CreateCopyOfGdlUserGlobalsHandle()

GSErrCode ACAPI_LibraryManagement_CreateCopyOfGdlUserGlobalsHandle ( GDL::Parameters **  userGlobals)

Returns a copy of the current GDL globals.

Parameters
userGlobals[out] The object containing the GDL globals required by the GDL interpreter.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The userGlobals parameter is nullptr.
Remarks
You can use this function to obtain the current GDL globals. Do not forget to destroy the returned pointer using ACAPI_LibraryManagement_DestroyCopyOfGdlUserGlobalsHandle.

◆ ACAPI_LibraryManagement_CreateFolderInLibrary()

GSErrCode ACAPI_LibraryManagement_CreateFolderInLibrary ( const IO::Location *  newFolderLocationInLibrary)

Creates a new folder inside a loaded library.

Parameters
newFolderLocationInLibrary[in] The location of the folder to be created in an existing active library.
Returns
  • APIERR_BADPARS - The passed location parameter is invalid or nullptr.
Remarks
The function creates a new folder in an existing library loaded in the current project. The given location must be writable and, in Teamwork, must be reserved. If the folder already exists, the function returns NoError.
Example
GS::Array<API_LibraryInfo> libInfo;
GSErrCode err = ACAPI_Environment (APIEnv_GetLibrariesID, &libInfo);
if (err == NoError) {
for (UInt32 ii = libInfo.GetSize (); ii > 0; --ii) {
const API_LibraryInfo& libraryInfo = libInfo[ii - 1];
if (libraryInfo.libraryType == API_LocalLibrary || libraryInfo.libraryType == API_EmbeddedLibrary || libraryInfo.libraryType == API_ServerLibrary) {
IO::Location targetFolderLocation (libraryInfo.location, IO::Name ("New Folder"));
err = ACAPI_Environment (APIEnv_CreateFolderInLibraryID
, &targetFolderLocation);
break;
}
}
}

◆ ACAPI_LibraryManagement_DeleteEmbeddedLibItem()

GSErrCode ACAPI_LibraryManagement_DeleteEmbeddedLibItem ( const IO::Location *  location,
bool  keepGSMFile = false,
bool  silentMode = false 
)

Deletes the given embedded library item (folder or library part).

Parameters
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)
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The given loc parameter is nullptr.
  • APIERR_NOTMINE - The operation attempted to delete a library part that belongs to another user. Likely to occur in teamwork mode.
Remarks
This operation is not undoable.

◆ ACAPI_LibraryManagement_DeleteEmbeddedLibItems()

GSErrCode ACAPI_LibraryManagement_DeleteEmbeddedLibItems ( const GS::Array< IO::Location > *  location,
bool  keepGSMFile = false,
bool  silentMode = false 
)

Delete embeded lib items.

Parameters
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.
Returns
  • NoError - The function has completed with success.

◆ ACAPI_LibraryManagement_DestroyCopyOfGdlUserGlobalsHandle()

GSErrCode ACAPI_LibraryManagement_DestroyCopyOfGdlUserGlobalsHandle ( GDL::Parameters **  userGlobals)

Destroys the previously copied GDL globals handle.

Parameters
userGlobals[in] The object containing the GDL globals required by the GDL interpreter.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The userGlobals parameter is nullptr.
Remarks
This function destroys the object pointer returned from ACAPI_LibraryManagement_CreateCopyOfGdlUserGlobalsHandle.

◆ ACAPI_LibraryManagement_GetGDLDate()

GSErrCode ACAPI_LibraryManagement_GetGDLDate ( Int32 *  date)

Returns GDL environment date information (GDL_PROJECT_DATE).

Parameters
date[out] GDL environment date. It must be an Int32 array with 6 size.
Returns
  • NoError - The function has completed with success.
Remarks
The returned array contains the date in the following format:
Date component Meaning
date[0] Year
date[1] Month
date[2] Day
date[3] Hour
date[4] Minute
date[5] Second
Example
Int32 date[6];
ACAPI_Environment (APIEnv_GetGDLDateID
, &date);

◆ ACAPI_LibraryManagement_GetLibPartOrigLocation()

GSErrCode ACAPI_LibraryManagement_GetLibPartOrigLocation ( const Int32 *  libItemIndex,
IO::Location *  origLocation 
)

Returns the original location of a library part.

Parameters
libItemIndex[in] The index of the library part.
origLocation[out] The location of the given library part.
Returns
  • NoError - The function completed with success.
  • APIERR_BADPARS - libItemIndex or origLocation is nullptr

◆ ACAPI_LibraryManagement_GetLibraries()

GSErrCode ACAPI_LibraryManagement_GetLibraries ( GS::Array< API_LibraryInfo > *  activeLibs,
Int32 *  embeddedLibraryIndex = nullptr 
)

Returns the list of loaded libraries.

Parameters
activeLibsthe active library list
embeddedLibraryIndex[out] optional; the 0-based index of the embedded library in this list
Returns
  • NoError - The function completed with success.
  • APIERR_BADPARS - activeLibs is nullptr.
  • APIERR_MEMFULL - Low memory condition.
Remarks
This function is used to get the list of active libraries of Archicad. Refer to the API_LibraryInfo for further details. For linked BIMcloud or BIM Server Libraries the location of local library cache will be returned. To change the active libraries use the ACAPI_LibraryManagement_SetLibraries function.
Example
GS::Array<API_LibraryInfo> activeLibs;
UInt32 i;
char buffer[1024];
GS::UniString path;
GSErrCode err;
err = ACAPI_Environment (APIEnv_GetLibrariesID, &activeLibs);
if (err != NoError) {
GiveMessage_Err ("Error in APIEnv_GetLibrariesID", err);
return;
}
GiveMessage ("Active library folders", false);
for (i = 0; i < activeLibs.GetSize (); i++) {
activeLibs[i].location.ToPath (&path);
sprintf (buffer, "[%u] %s", i+1, path.ToCStr (0, MaxUSize, CC_UTF8).Get ());
GiveMessage (buffer, false);
}
Warning
Legacy function - to be deleted in future versions, use ACAPI::Library::LibraryManager::FindLibraries instead

◆ ACAPI_LibraryManagement_InterpretGDLScript3D()

GSErrCode 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.

Since
Archicad 25
Parameters
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.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Incorrect parameters were specified.
  • APIERR_GENERAL - Failed to interpret the script.

◆ ACAPI_LibraryManagement_NewLibDial()

GSErrCode ACAPI_LibraryManagement_NewLibDial ( char *  defName,
IO::Location *  newLib 
)

Instructs the user to select a new library folder in a dialog.

Parameters
defName[in] A pointer to the default name of the new library.
newLib[out] The file system location of the selected folder.
Returns
  • NoError - The function completed with success.
  • APIERR_BADPARS - any of the parameters are nullptr.
  • APIERR_CANCEL - The user canceled the operation by the cancel button in the dialog.
Remarks
If a library is created or selected, the file specification is returned in the second parameter. To add a new folder to the active libraries use either the ACAPI_LibraryManagement_AddLibraries or the ACAPI_LibraryManagement_SetLibraries functions. You may also use directly the base class DG::FolderDialog of the Dialog Manager instead of calling ACAPI_LibraryManagement_NewLibDial.

◆ ACAPI_LibraryManagement_OpenLibraryPart()

GSErrCode ACAPI_LibraryManagement_OpenLibraryPart ( const API_OpenLibPartInfo libPartToOpen)

Opens the given library part in the Library Part Editor window.

Parameters
libPartToOpen[in] Identifies the library part to open.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The passed library part information is incorrect.
Remarks
First it tries to open by the document name, then the file name (which may come from the location).

◆ ACAPI_LibraryManagement_OverwriteLibPart()

GSErrCode ACAPI_LibraryManagement_OverwriteLibPart ( bool  overwriteOn)

Sets the overwrite mode for the library part create function.

Parameters
overwriteOn[in] Switch ON or OFF the overwrite mode.
Returns
  • NoError - The function always returns NoError.
Remarks
This function is used to configure the ACAPI_LibraryPart_Create function to overwrite an existing library part instead of creating a new one with unique name. The parameter should be pass as a value, instead of a pointer. See the example.
Example
API_LibPart libPart;
GSErrCode err;
BNZeroMemory (&libPart, sizeof (API_LibPart));
libPart.typeID = APILib_ObjectID;
libPart.ownerID = APIOwnerID_ArchiCAD;
GS::ucscpy (libPart.docu_UName, L("Toilet P Dispenser 15"));
/* replace the existing the library part */
err = ACAPI_LibraryPart_Search (&libPart, false);
if (err == NoError) {
ACAPI_Environment (APIEnv_OverwriteLibPartID, (void *) (Int32) true, nullptr);
err = ACAPI_LibraryPart_Create (&libPart);
ACAPI_Environment (APIEnv_OverwriteLibPartID, (void *) (Int32) false, nullptr);
}
GSErrCode ACAPI_LibraryPart_Create(const API_LibPart *libPart)
Starts to create a new Library Part from scratch.
GSErrCode ACAPI_LibraryPart_Search(API_LibPart *ancestor, bool createIfMissing, bool onlyPlaceable=false)
Searches for a registered Library Part in the loaded libraries.
Definition of a Library Part.
Definition: APIdefs_LibraryParts.h:80
GSType ownerID
Signature of the owner; used by external objects;.
Definition: APIdefs_LibraryParts.h:132
API_LibTypeID typeID
Type of the Library Part.
Definition: APIdefs_LibraryParts.h:86
GS::uchar_t docu_UName[API_UniLongNameLen]
Unique document name of the Library Part. If more than one Library Part has the same name,...
Definition: APIdefs_LibraryParts.h:101
Warning
Legacy function - to be deleted in future versions, use ACAPI::Library::GSMObject::CopyTo instead

◆ ACAPI_LibraryManagement_RunGDLParScript()

GSErrCode ACAPI_LibraryManagement_RunGDLParScript ( const API_Elem_Head elemHead,
UInt32  mask = 0 
)

Run GDL parameter script.

Parameters
elemHead[in] Head of the element. It is identified by the guid field.
maskElement mask; can be APIElemMask_FromFloorplan (= use the element from the floor plan).
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The element doesn't exist.
Remarks
You are eble to run the GDL parameter script of an object, lamp, window or door element via this function. This function is a non-undoable data structure modifier function. See more details on this topic at Command Overview.

◆ ACAPI_LibraryManagement_SetLibraries()

GSErrCode ACAPI_LibraryManagement_SetLibraries ( const GS::Array< API_LibraryInfo > *  activeLibs)

Changes the list of loaded libraries.

Parameters
activeLibsthe active library list to set
Returns
  • NoError - The function completed with success.
  • APIERR_BADPARS - activeLibs is nullptr or size of the internal locations handle is not match to nLib
  • APIERR_NOTMINE - The project library list is not editable in Teamwork. You need to reserve it first.
Remarks
This function is used to reset the list of active libraries of Archicad. The passed library folders will be enumerated. Refer to the API_LibraryInfo for further details. To get the active libraries use the ACAPI_LibraryManagement_GetLibraries function. This function is a non-undoable data structure modifier function. See more details on this topic at Command Overview.
Example
See the example of APIEnv_GetLibrariesID
.
Warning
Legacy function - to be deleted in future versions, use ACAPI::Library::LibraryManager::AddLibrary instead

◆ ACAPI_LibraryManagement_UsableGDLString()

GSErrCode ACAPI_LibraryManagement_UsableGDLString ( const char *  str)

Determines whether the string is a GDL keyword or reserved symbol.

Parameters
str[in] a string to check as a GDL keyword or reserved symbol
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - str is nullptr
  • APIERR_GENERAL - the string is a valid GDL keyword or reserved symbol
Remarks
This function is used to check whether the given string is a reserved GDL keyword or symbol; or fulfills or not certain requirements to become one. By general the function returns NoError if the passed string can be used in a GDL script as an own identifier. For example if your creates a LibraryPart with scripts installed, and some part of the script is generated on the fly, it is a good idea to check the components for usability.
Example
GSErrCode err;
err = ACAPI_Goodies (APIAny_UsableGDLStringID, "material", nullptr);
/* returns APIERR_GENERAL, it is reserved keyword; */
/* cannot be used as a script variable */
err = ACAPI_Goodies (APIAny_UsableGDLStringID, "list", nullptr);
/* OK; returns NoError */
/* it can be used as a script variable */

◆ ACAPI_LibraryPart_RegisterSubtype()

GSErrCode 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.

Parameters
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
Returns
  • APIERR_BADPARS - templateFileResID refers to an invalid 'FILE' resource or the built-in library part cannot be accepted as subtype template.
  • NoError - The function has completed with success.
Remarks
This function registers a new library part subtype. In order to have an own element subtype the add-on must contain a built-in library part in its reource module. This library part will be loaded into the active libraries, and become a new node in the ancestry tree. The new element type will be identified with the signature identifier chosen by the add-on's writer. The signature should be unique in order to avoid collisions. You may pass 0 in the signature parameter if you do not need a new element type but a single subtype node. The subtype can appear in the toolbox as an external tool, and also on the Windows toolbar. In this case you must pass two valid icon resource IDs in the smallIconResID and the largeIconResID parameters. The size of the icons should be 16x16 and 30x21 pixels respectively. You can specify the position of the subtype item inserted into the toolbox with the toolGroupId parameter as follows:
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.

Example
Resources in the .GRC file:

◆ ACAPI_ProjectOperation_ReloadLibraries()

GSErrCode ACAPI_ProjectOperation_ReloadLibraries ( )

Resets and loads the active libraries.

Returns
  • NoError - The function has completed with success.
Remarks
This function is used to perform a Reload Libraries command in the server application. All the active libraries (included the BIMcloud and BIM Server Libraries too) will be reloaded.

◆ AddLibrary() [1/2]

Result< void > ACAPI::Library::v1::LibraryManager::AddLibrary ( const GS::UniString &  twServerURL,
const GS::UniString &  twServerPath 
)

Add a server libary to the actual library list.

Parameters
twServerURLThe teamwork server URL.
twServerPathRelative location of the library from the root of the BIM Server.
Returns
Returns an error if the process of modification fails for some reason, otherwise nothing.

◆ AddLibrary() [2/2]

Result< void > ACAPI::Library::v1::LibraryManager::AddLibrary ( const IO::Location &  libraryPath)

Add a libary to the actual library list.

Parameters
libraryPathReference of library location.
Returns
Returns an error if the process of modification fails for some reason, otherwise nothing.

◆ CopyTo()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::CopyTo ( const IO::Location &  fileLocation,
CopyMethod  method = CopyMethod::KeepMainGuid 
)

Creates a new copy from the GSM file to a location.

Parameters
fileLocationThe path of the new GSM file. It should be a non-existing gsm file in an existing folder.
methodKeepMainGuid: Creates a new revision; GenerateNewUnID: The new object gets different UnID.
Returns
The new GSMObject if succesfully created otherwise Error.

◆ CreateNew()

static ACAPI::Result< GSMObject > ACAPI::Library::v1::GSMObject::CreateNew ( const IO::Location &  fileLocation,
const ACAPI::Library::v1::GSMObject ancestorSubType 
)
static

Creates a new empty GSM Object.

Parameters
fileLocationThe path of the new GSM file. It should be a non-existing gsm file in an existing folder.
ancestorSubTypeThe ancestor subtype of the new object. It should be a valid and loaded subtype object. The new object will inherit the parameters of the ancestor subtype.
Returns
The new GSMObject if succesfully created otherwise Error.

◆ Delete2DScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::Delete2DScript ( )

Deletes the 2D script.

Returns
Returns Ok if succesful, otherwise Error.

◆ Delete2DVectorImage()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::Delete2DVectorImage ( )

Deletes the 2D Vector image.

Returns
Returns Ok if succesful, otherwise Error.

◆ Delete3DScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::Delete3DScript ( )

Deletes the 3D script.

Returns
Returns Ok if succesful, otherwise Error.

◆ DeleteBackwardMigrationScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeleteBackwardMigrationScript ( )

Deletes the backward migration script.

Returns
Returns Ok if succesful, otherwise Error.

◆ DeleteCustomSection()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeleteCustomSection ( uint32_t  sectionID,
uint16_t  index = 0 
)

Deletes a custom section.

Parameters
sectionIDA four-byte identifier of the custom section. Like 'sect'.
indexThe index of the custom sections with similar type ID.
Returns
Returns Ok if succesful, otherwise Error.

◆ DeleteForwardMigrationScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeleteForwardMigrationScript ( )

Deletes the forward migration script.

Returns
Returns Ok if succesful, otherwise Error.

◆ DeleteGDLPictures()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeleteGDLPictures ( )

Deletes GDL pictures.

Returns
Returns Ok if succesful, otherwise Error.

◆ DeleteInterfaceScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeleteInterfaceScript ( )

Deletes the interface script.

Returns
Returns Ok if succesful, otherwise Error.

◆ DeleteMasterScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeleteMasterScript ( )

Deletes the master script.

Returns
Returns Ok if succesful, otherwise Error.

◆ DeleteParameterScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeleteParameterScript ( )

Deletes the parameter script.

Returns
Returns Ok if succesful, otherwise Error.

◆ DeletePreviewPicture()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeletePreviewPicture ( )

Deletes the preview picture.

Returns
Returns Ok if succesful, otherwise Error.

◆ DeletePropertiesScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::DeletePropertiesScript ( )

Deletes the properties script.

Returns
Returns Ok if succesful, otherwise Error.

◆ FindLibPart()

Result< LibPart > ACAPI::Library::v1::LibraryManager::FindLibPart ( const std::function< bool(const LibPart &)> &  selector) const

Find Library Part using a custom selector function.

Parameters
selectorReference of the selector function.
Returns
Returns the first Library Part which meets the condition in the selector or an error if the LibPart can not be found.

◆ FindLibParts()

std::vector< LibPart > ACAPI::Library::v1::LibraryManager::FindLibParts ( const std::function< bool(const LibPart &)> &  selector) const

Find LibParts using a custom selector function.

Parameters
selectorReference of the selector function.
Returns
Returns the libparts which meet the condition in the selector.

◆ FindLibraries()

std::vector< Library > ACAPI::Library::v1::LibraryManager::FindLibraries ( const std::function< bool(const Library &)> &  selector) const

Find Libraries using a custom selector function.

Parameters
selectorReference of the selector function.
Returns
Returns the libraries which meet the condition in the selector.

◆ FindLibrary()

Result< Library > ACAPI::Library::v1::LibraryManager::FindLibrary ( const std::function< bool(const Library &)> &  selector) const

Find Library using a custom selector function.

Parameters
selectorReference of the selector function.
Returns
Returns the first Library which meets the condition in the selector or an error if the Library can not be found.

◆ Get2DScript()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::Get2DScript ( const GS::UniString &  password = GS::EmptyUniString) const

2D script of the object.

Parameters
passwordOptional parameter. Required if the object is password protected
Returns
Returns the 2D script of the gsm object. If the object's reference is not valid, it will return an error.

◆ Get2DVectorImage()

ACAPI::Result< VectorImage > ACAPI::Library::v1::GSMObject::Get2DVectorImage ( ) const

2D Vector Image of the object.

Returns
Returns the 2D Vector Image data (2D Symbol) of the gsm object. If the object's reference is not valid, it will return an error.

◆ Get3DScript()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::Get3DScript ( const GS::UniString &  password = GS::EmptyUniString) const

3D script of the object.

Parameters
passwordOptional parameter. Required if the object is password protected
Returns
Returns the 3D script of the gsm object. If the object's reference is not valid, it will return an error.

◆ GetAuthor()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetAuthor ( ) const

Author of the object.

Returns
Returns the Author of the object. If the object's reference is not valid, it will return an error.

◆ GetBackwardMigrationScript()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetBackwardMigrationScript ( const GS::UniString &  password = GS::EmptyUniString) const

Backward Migration script of the object.

Parameters
passwordOptional parameter. Required if the object is password protected
Returns
Returns the Backward Migration script of the gsm object. If the object's reference is not valid, it will return an error.

◆ GetCustomSection()

ACAPI::Result< GSMSectionData > ACAPI::Library::v1::GSMObject::GetCustomSection ( uint32_t  sectionID,
uint16_t  index = 0 
) const

Custom section data of the object.

Parameters
sectionIDThe identifier of the custom section.
indexThe index of the section data if there are stored more than one
Returns
Returns the selected custom section data of the gsm object. If the object's reference is not valid, it will return an error.

◆ GetDescription()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetDescription ( ) const

Description of the object.

Returns
Returns the description of the object. If the object's reference is not valid, it will return an error.

◆ GetEmbeddedLibrary()

Result< Library > ACAPI::Library::v1::LibraryManager::GetEmbeddedLibrary ( ) const

A faster way to get the embedded library.

Returns
Returns the Embedded Library, Error if the LibraryManager is invalid.

◆ GetForwardMigrationScript()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetForwardMigrationScript ( const GS::UniString &  password = GS::EmptyUniString) const

Forward Migration script of the object.

Parameters
passwordOptional parameter. Required if the object is password protected
Returns
Returns the Forward Migration script of the gsm object. If the object's reference is not valid, it will return an error.

◆ GetGDLPictures()

ACAPI::Result< std::vector< GX::ImageRef > > ACAPI::Library::v1::GSMObject::GetGDLPictures ( ) const

Embedded pictures of the object.

Returns
Returns the embedded pictures of the gsm object. If the object's reference is not valid, it will return an error.

◆ GetGSMObjectOfLibPart()

Result< GSMObject > ACAPI::Library::v1::LibraryManager::GetGSMObjectOfLibPart ( const LibPart libPart) const

Returns the .gsm object representation of the Library Part.

Parameters
libPartReference of the library part.
Returns
Returns the GSMObject or an error if the LibPart is not of object type, or the LibraryManager is invalid

◆ GetInterfaceScript()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetInterfaceScript ( const GS::UniString &  password = GS::EmptyUniString) const

Interface script of the object.

Parameters
passwordOptional parameter. Required if the object is password protected
Returns
Returns the Interface script of the gsm object. If the object's reference is not valid, it will return an error.

◆ GetKeywords()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetKeywords ( ) const

Keywords of the object. Mostly used for search. Usually it is a comma separated list.

Returns
Returns the keywords of the object. If the object's reference is not valid, it will return an error.

◆ GetLastPart()

GS::UniString ACAPI::Library::v1::LibraryTreePath::GetLastPart ( ) const

The name of the current node.

Returns
Returns the name of the last node/libpart of library tree path.

◆ GetLibIndOfLibPart()

Result< Int32 > ACAPI::Library::v1::LibraryManager::GetLibIndOfLibPart ( const LibPart libPart) const

Returns the index of the library part.

Parameters
libPartReference of the library part.
Returns
Returns the index or an error if the LibraryManager is invalid, or the LibPart can not be found in the libraries or does not have an index.
Remarks
This function is here for compatibility reasons. Should only be used where collaboration with old API functions is necessary. The index is not a stable identifier of the library part, it can change when the library list is modified.

◆ GetLibPartByGSMObject()

Result< LibPart > ACAPI::Library::v1::LibraryManager::GetLibPartByGSMObject ( const GSMObject gsmObject) const

Returns the Library Part of the GSMObject.

Parameters
gsmObjectReference of the GSMObject.
Returns
Returns the LibPart or an error if the LibraryManager is invalid, or the GSMObject is invalid.
Remarks
The function returns the LibPart which contains the GSMObject. The GSMObject should be loaded from a library part.

◆ GetLibPartByLibInd()

Result< LibPart > ACAPI::Library::v1::LibraryManager::GetLibPartByLibInd ( Int32  libPartIndex) const

Returns a library part with the given index.

Parameters
libPartIndexIndex of the library part.
Returns
Returns the LibPart or an error if the LibraryManager is invalid, or the LibPart can not be found in the libraries
Remarks
This function is here for compatibility reasons. Should only be used where collaboration with old API functions is necessary. The index is not a stable identifier of the library part, it can change when the library list is modified.

◆ GetLibPartByName()

Result< LibPart > ACAPI::Library::v1::LibraryManager::GetLibPartByName ( const GS::UniString &  name) const

Returns a library part with the filename.

Parameters
nameThe name of the libpart with file extension.
Returns
Returns the LibPart or an error if the LibraryManager is invalid, or the LibPart can not be found in the libraries.
Remarks
The name is the (localized) file name of the library part which is shown in the Library Manager.

◆ GetLibraryByName()

Result< Library > ACAPI::Library::v1::LibraryManager::GetLibraryByName ( const GS::UniString &  name) const

Returns the Library with the given name.

Parameters
nameName of the library.
Returns
Returns the Library or an error if the Library can not be found.

◆ GetLibraryManager()

Result< LibraryManager > ACAPI::Library::v1::GetLibraryManager ( )
inline

Creates a LibraryManager instance.

Returns
The new LibraryManager instance a plan is loaded otherwise APIERR_NOPLAN.
Remarks
This is the entry point of the Library Management on the API.

◆ GetLibraryOfLibPart()

Result< Library > ACAPI::Library::v1::LibraryManager::GetLibraryOfLibPart ( const LibPart libPart) const

Returns the Library containing the Library Part.

Parameters
libPartReference of the library part.
Returns
Returns the Library or an error if the LibPart is not loaded, or the LibraryManager is invalid

◆ GetLibraryTreePathOfLibPart()

Result< LibraryTreePath > ACAPI::Library::v1::LibraryManager::GetLibraryTreePathOfLibPart ( const LibPart libPart) const

Returns the LibraryTreePath of the LibPart.

Parameters
libPartReference of the LibPart.
Returns
Returns the LibraryTreePath or an error if the LibraryManager is invalid, or the LibPart is invalid.

◆ GetLicense()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetLicense ( ) const

License name of the object.

Returns
Returns the license of the object. If the object's reference is not valid, it will return an error.

◆ GetLicenseVersion()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetLicenseVersion ( ) const

License version of the object.

Returns
Returns the license version of the object. If the object's reference is not valid, it will return an error.

◆ GetLocation() [1/2]

ACAPI::Result< IO::Location > ACAPI::Library::v1::LibPart::GetLocation ( ) const

The location of the library part file.

Remarks
The most cases this is not the same as the LibraryTreePath of the library part. If you need the structure which is displayed in the Library Manager dialog, use the GetLibraryTreePathOfLibPart method of LibraryManager.
Returns
Returns the (physical) location of the library part file if the library part is valid, otherwise error.

◆ GetLocation() [2/2]

ACAPI::Result< IO::Location > ACAPI::Library::v1::Library::GetLocation ( ) const

Location of the Library. If the library is a teamwork library, the location is the local cache location.

Returns
Returns the location of the Library if the Library is valid, otherwise error.

◆ GetMasterScript()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetMasterScript ( const GS::UniString &  password = GS::EmptyUniString) const

Master script of the object.

Parameters
passwordOptional parameter. Required if the object is password protected
Returns
Returns the Master script (1D script) of the gsm object. If the object's reference is not valid, it will return an error.

◆ GetName() [1/2]

ACAPI::Result< GS::UniString > ACAPI::Library::v1::LibPart::GetName ( ) const

The name of the library part.

The name is the (localized) name of the library part with file extension which is displayed in the Library Manager dialog.

Returns
Returns the name if the library part is valid, otherwise error.

◆ GetName() [2/2]

ACAPI::Result< GS::UniString > ACAPI::Library::v1::Library::GetName ( ) const

The name of the library.

Returns
Returns the name of the Library if the Library is valid, otherwise error.

◆ GetPackageDependencies()

ACAPI::Result< std::vector< std::tuple< GS::UniString, GS::Guid, UInt32 > > > ACAPI::Library::v1::Library::GetPackageDependencies ( ) const

The dependencies of the library package. The dependencies are a list of name, package ID, subversion tuple.

Returns
Returns the dependencies of the library package if the library is a package, otherwise error.

◆ GetPackageID()

ACAPI::Result< GS::Guid > ACAPI::Library::v1::Library::GetPackageID ( ) const

The package ID of the library package.

Returns
Returns the package ID of the library package if the library is a package, otherwise error.

◆ GetPackageMainVersion()

ACAPI::Result< UInt32 > ACAPI::Library::v1::Library::GetPackageMainVersion ( ) const

The main version of the library package. Different main versions are incompatible and have different package IDs.

Returns
Returns the main version of the library package if the library is a package, otherwise error.

◆ GetPackageMinACBuildNumber()

ACAPI::Result< UInt32 > ACAPI::Library::v1::Library::GetPackageMinACBuildNumber ( ) const

The minimum Archicad build number of the library package.

Returns
Returns the minimum Archicad build number of the library package if the library is a package, otherwise error.

◆ GetPackageMinACVersion()

ACAPI::Result< UInt32 > ACAPI::Library::v1::Library::GetPackageMinACVersion ( ) const

The minimum Archicad version of the library package.

Returns
Returns the minimum Archicad version of the library package if the library is a package, otherwise error.

◆ GetPackageSubVersion()

ACAPI::Result< UInt32 > ACAPI::Library::v1::Library::GetPackageSubVersion ( ) const

The sub version of the library package.

Returns
Returns the subversion of the library package if the library is a package, otherwise error.

◆ GetParameterDescriptions()

ACAPI::Result< std::vector< GS::UniString > > ACAPI::Library::v1::GSMObject::GetParameterDescriptions ( ) const

Parameter descriptions of the object.

Returns
Returns the parameter descriptions. If the object's reference is not valid, it will return an error.

◆ GetParameters()

ACAPI::Result< GDL::Parameters > ACAPI::Library::v1::GSMObject::GetParameters ( ) const

Parameter list of the object.

Returns
Returns the parameter list of the object. If the object's reference is not valid, it will return an error.

◆ GetParameterScript()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetParameterScript ( const GS::UniString &  password = GS::EmptyUniString) const

Parameter script of the object.

Parameters
passwordOptional parameter. Required if the object is password protected
Returns
Returns the Parameter script of the gsm object. If the object's reference is not valid, it will return an error.

◆ GetParent()

LibraryTreePath ACAPI::Library::v1::LibraryTreePath::GetParent ( ) const

The parent of the represented node.

Returns
Returns a new LibraryTreePath without the last part of the path if it is not the root; otherwise, return a copy of itself.

◆ GetParts()

std::vector< GS::UniString > ACAPI::Library::v1::LibraryTreePath::GetParts ( ) const

The parts of the path.

Returns
Returns the names of the parts of the path in vector.

◆ GetPreviewPicture()

ACAPI::Result< GX::ImageRef > ACAPI::Library::v1::GSMObject::GetPreviewPicture ( ) const

Preview picture of the object.

Returns
Returns the Preview picture of the gsm object. If the object's reference is not valid, it will return an error.

◆ GetPropertiesScript()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::GSMObject::GetPropertiesScript ( const GS::UniString &  password = GS::EmptyUniString) const

Properties script of the object.

Parameters
passwordOptional parameter. Required if the object is password protected
Returns
Returns the Properties script of the gsm object. If the object's reference is not valid, it will return an error.

◆ GetSubTypeUnID()

ACAPI::Result< GS::UnID > ACAPI::Library::v1::GSMObject::GetSubTypeUnID ( ) const

The UnID of the object's direct ancestor in the subtype hierarchy.

Returns
Returns the UnID of the objects subtype

◆ GetTWID()

Result< GS::Guid > ACAPI::Library::v1::LibraryManager::GetTWID ( const LibraryTreePath libraryTreePath) const

Returns the Teamwork Identifier of the Library Tree location.

Parameters
libraryTreePathLibrary Tree location.
Returns
Returns the Teamwork Identifier or an error if the LibraryManager is invalid, or the libraryTreePath does not point to a Teamwork library location.

◆ GetTWServerPath()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::Library::GetTWServerPath ( ) const

The relative location of the library from the root of the BIMcloud server, like "Libraries/The shared library.lcf".

Returns
Returns the relative location of the library if the library is valid, otherwise error.

◆ GetTWServerUrl()

ACAPI::Result< GS::UniString > ACAPI::Library::v1::Library::GetTWServerUrl ( ) const

The teamwork server URL is the URL of the BIMcloud where the library is located, like "http://example.com".

Returns
Returns the teamwork server URL if the library is valid, otherwise error.

◆ GetType()

ACAPI::Result< LibPartType > ACAPI::Library::v1::LibPart::GetType ( ) const

The file type of the library part.

Returns
Returns the file type of the library part if the library part is valid, otherwise error.

◆ GetUnID()

ACAPI::Result< GS::UnID > ACAPI::Library::v1::GSMObject::GetUnID ( ) const

The UnID is a combination of the main guid and the revision guid.

Returns
Returns unique ID (main guid + rev. guid) of the gsm object

◆ Has2DScript()

bool ACAPI::Library::v1::GSMObject::Has2DScript ( ) const

Checks whether 2DScript section has value or is empty.

Returns
Returns true if the 2DScript section has value, false otherwise

◆ Has2DVectorImage()

bool ACAPI::Library::v1::GSMObject::Has2DVectorImage ( ) const

Checks whether 2DVectorImage section has value or is empty.

Returns
Returns true if the 2DVectorImage section has value, false otherwise

◆ Has3DScript()

bool ACAPI::Library::v1::GSMObject::Has3DScript ( ) const

Checks whether 3DScript section has value or is empty.

Returns
Returns true if the 3DScript section has value, false otherwise

◆ HasBackwardMigrationScript()

bool ACAPI::Library::v1::GSMObject::HasBackwardMigrationScript ( ) const

Checks whether BackwardMigrationScript section has value or is empty.

Returns
Returns true if the BackwardMigrationScript section has value, false otherwise

◆ HasCustomSection()

bool ACAPI::Library::v1::GSMObject::HasCustomSection ( uint32_t  sectionTypeID,
uint16_t  index 
) const

Checks whether CustomSection has value or is empty.

Parameters
sectionTypeIDA four-byte identifier of the custom section. Like 'sect'.
indexThe index of the custom sections with similar type ID.
Returns
Returns true if the CustomSection section has value, false otherwise

◆ HasForwardMigrationScript()

bool ACAPI::Library::v1::GSMObject::HasForwardMigrationScript ( ) const

Checks whether ForwardMigrationScript section has value or is empty.

Returns
Returns true if the ForwardMigrationScript section has value, false otherwise

◆ HasGDLPictures()

bool ACAPI::Library::v1::GSMObject::HasGDLPictures ( ) const

Checks whether GDLPictures section has value or is empty.

Returns
Returns true if the GDLPictures section has value, false otherwise

◆ HasInterfaceScript()

bool ACAPI::Library::v1::GSMObject::HasInterfaceScript ( ) const

Checks whether InterfaceScript section has value or is empty.

Returns
Returns true if the InterfaceScript section has value, false otherwise

◆ HasMasterScript()

bool ACAPI::Library::v1::GSMObject::HasMasterScript ( ) const

Checks whether MasterScript has value or is empty.

Returns
Returns true if the MasterScript section has value, false otherwise

◆ HasParameterScript()

bool ACAPI::Library::v1::GSMObject::HasParameterScript ( ) const

Checks whether ParameterScript section has value or is empty.

Returns
Returns true if the ParameterScript section has value, false otherwise

◆ HasPreviewPicture()

bool ACAPI::Library::v1::GSMObject::HasPreviewPicture ( ) const

Checks whether PreviewPicture section has value or is empty.

Returns
Returns true if the PreviewPicture section has value, false otherwise

◆ HasPropertiesScript()

bool ACAPI::Library::v1::GSMObject::HasPropertiesScript ( ) const

Checks whether PropertiesScript section has value or is empty.

Returns
Returns true if the PropertiesScript section has value, false otherwise

◆ IsBuiltIn()

ACAPI::Result< bool > ACAPI::Library::v1::Library::IsBuiltIn ( ) const

The library is built-in, if it is the Archicad's or any add-ons built-in library.

Returns
Returns true if the library is built-in, false otherwise. If the library reference is not valid, returns error.

◆ IsEditable()

bool ACAPI::Library::v1::GSMObject::IsEditable ( ) const

A GSM file is editable if it is loaded from the local file system. GSM files from Loaded Libraries should be copied into a local directory before editing.

Returns
Returns true if it is loaded from the file system or created/copied into a writable file.

◆ IsEmbedded()

ACAPI::Result< bool > ACAPI::Library::v1::Library::IsEmbedded ( ) const

The library is embedded, if it is the one embedded in the plan file.

Returns
Returns true if the library is the Embedded library, false otherwise. If the library reference is not valid, returns error.

◆ IsHierarchicalPagesUsed()

ACAPI::Result< bool > ACAPI::Library::v1::GSMObject::IsHierarchicalPagesUsed ( ) const

The defined interface uses hierarchical pages.

Returns
Returns true if the defined interface uses hierarchical pages. If the object's reference is not valid, it will return an error.

◆ IsInSubTypeOf()

ACAPI::Result< bool > ACAPI::Library::v1::GSMObject::IsInSubTypeOf ( const GS::UnID &  subTypeID) const

The object is a subtype of the given UnID.

Parameters
subTypeIDThe id of the sub type.
Returns
Returns true if the gsm object falls under the subtype noted by the given UnID, false otherwise

◆ IsLocal()

ACAPI::Result< bool > ACAPI::Library::v1::Library::IsLocal ( ) const

The library is loaded from local (or netwrork) file system.

Returns
Returns true if the library is local, false otherwise. If the library reference is not valid, returns error.

◆ IsPackage()

ACAPI::Result< bool > ACAPI::Library::v1::Library::IsPackage ( ) const

The library is a library package, if it is a .libpack file.

Returns
Returns true if the library is a library package, false otherwise. If the library reference is not valid, returns error.

◆ IsPasswordProtected()

ACAPI::Result< bool > ACAPI::Library::v1::GSMObject::IsPasswordProtected ( ) const

The object is password protected and encrypted.

Returns
Returns true if the .gsm file is password-protected

◆ IsPlaceable()

ACAPI::Result< bool > ACAPI::Library::v1::GSMObject::IsPlaceable ( ) const

The object can be placed in a plan file.

Returns
Returns true if the .gsm can be placed as an 'object' in a plan file, false otherwise

◆ IsRoot()

bool ACAPI::Library::v1::LibraryTreePath::IsRoot ( ) const

Root path of the library tree.

Returns
Returns true if the path is the library root node, false otherwise.

◆ IsServer()

ACAPI::Result< bool > ACAPI::Library::v1::Library::IsServer ( ) const

The library is a server library, if it is loaded from a BIMcloud server.

Returns
Returns true if the library is server library, false otherwise. If the library reference is not valid, returns error.

◆ IsSubType()

ACAPI::Result< bool > ACAPI::Library::v1::GSMObject::IsSubType ( ) const

The object is an 'object subtype'.

Returns
Returns true if the gsm object is an 'object subtype', false otherwise

◆ IsUIDefault()

ACAPI::Result< bool > ACAPI::Library::v1::GSMObject::IsUIDefault ( ) const

The defined interface is set as default UI.

Returns
Returns true if the defined interface is set as default UI. If the object's reference is not valid, it will return an error.

◆ LoadGSMObjectFromFile()

Result< GSMObject > ACAPI::Library::v1::LibraryManager::LoadGSMObjectFromFile ( const IO::Location &  location) const

Loads a .gsm object from a file.

Parameters
locationThe file location.
Returns
Returns the GSMObject or an error if the file cannot be loaded.
Remarks
The key difference between this function and the GetGSMObjectOfLibPart is that this function loads the object directly from a file, while the other function returns the object representation of a loaded library part which can be localized or modified.

◆ MergeParameters()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::MergeParameters ( const GDL::Parameters &  newParamList,
const std::vector< GS::UniString > &  descriptions 
)

Merges new parameters to the object. This function will add new parameters and replace the existing ones.

Parameters
newParamListParameter list with the new parameters.
descriptionsThe descriptions of the parameters stored in the newParamList parameter.
Returns
Returns Ok if succesful, otherwise Error.

◆ Modify()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::Modify ( const std::function< GSErrCode(Modifier &)> &  modifierFunc,
GS::UniString  password = GS::EmptyUniString 
)

Opens a modification scope if the object is editable. See 'IsEditable'.

Parameters
modifierFuncThe function which will be called with a 'Modifier' object. Through this object can be the GSMObject modified.
passwordIf the GSMObject is password protected, the correct password must be given. Otherwise the modifier function will not be called.
Returns
Returns Ok, if the modification was succesful otherwise Error.

◆ ModifyLibraryList()

Result< void > ACAPI::Library::v1::LibraryManager::ModifyLibraryList ( const std::function< GSErrCode(Modifier &)> &  modifierFunc)

Executed the passed modifier scope in a NotUndoable command.

Parameters
modifierFuncReference of the ModifierFunc.
Returns
Returns an error if the process of modification fails for some reason, otherwise nothing.
Remarks
In Teamwork, the project's library list should be reserved before calling this function.

◆ RemoveLibrary()

Result< void > ACAPI::Library::v1::LibraryManager::RemoveLibrary ( const Library library)

Remove a libary from the actual library list. Embedded and Built-In libraries cannot be removed.

Parameters
libraryThe library to be removed.
Returns
Returns an error if the process of modification fails for some reason, otherwise nothing.

◆ SelectAllLibParts()

bool ACAPI::Library::v1::SelectAllLibParts ( const LibPart )
inline

A selector for the FindLibParts function. It selects all libparts.

Returns
Always true.

◆ SelectAllLibraries()

bool ACAPI::Library::v1::SelectAllLibraries ( const Library )
inline

A selector for the FindLibraries function. It selects all libraries.

Returns
Always true.

◆ SelectImageLibParts()

bool ACAPI::Library::v1::SelectImageLibParts ( const LibPart lp)
inline

A selector for the FindLibParts function. It selects all image libparts.

Parameters
lpReference of the libpart.
Returns
True if the libpart is an image file, otherwise false.

◆ SelectLoadedLibraries()

bool ACAPI::Library::v1::SelectLoadedLibraries ( const Library lib)
inline

A selector for the FindLibraries function. It selects all libraries which are not embedded and not built-in.

Parameters
libReference of the library.
Returns
True if the library is not embedded and not built-in, otherwise false.

◆ SelectObjectLibParts()

bool ACAPI::Library::v1::SelectObjectLibParts ( const LibPart lp)
inline

A selector for the FindLibParts function. It selects all object libparts.

Parameters
lpReference of the libpart.
Returns
True if the libpart is a GSM object, otherwise false.

◆ SelectTextLibParts()

bool ACAPI::Library::v1::SelectTextLibParts ( const LibPart lp)
inline

A selector for the FindLibParts function. It selects all text libparts.

Parameters
lpReference of the libpart.
Returns
True if the libpart is a text file, otherwise false.

◆ Set2DScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::Set2DScript ( const GS::UniString &  script)

Sets the 2D script. This function will replace the existing 2D script. If it is empty, the script will NOT be deleted but set to empty.

Parameters
scriptA GDL script which will be set as the 2D script.
Returns
Returns Ok if succesful, otherwise Error.

◆ Set2DVectorImage()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::Set2DVectorImage ( const VectorImage &  image)

Sets a vector image as 2D symbol. This function will replace the existing 2D symbol. If it is empty, the symbol will NOT be deleted but set to empty.

Parameters
imageA VectorImage object.
Returns
Returns Ok if succesful, otherwise Error.

◆ Set3DScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::Set3DScript ( const GS::UniString &  script)

Sets the 3D script. This function will replace the existing 3D script. If it is empty, the script will NOT be deleted but set to empty.

Parameters
scriptA GDL script which will be set as the 3D script.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetAuthor()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetAuthor ( const GS::UniString &  author)

Sets the author of the object.

Parameters
authorThe new author value.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetBackwardMigrationScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetBackwardMigrationScript ( const GS::UniString &  script)

Sets the backward migration script. This function will replace the existing backward migration script. If it is empty, the script will NOT be deleted but set to empty.

Parameters
scriptA GDL script which will be set as the backward migration script.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetCustomSection()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetCustomSection ( uint32_t  sectionTypeID,
uint16_t  index,
const GSMSectionData data 
)

Sets a custom section.

Parameters
sectionTypeIDA four-byte identifier of the custom section. Like 'sect'.
indexThe index of the custom sections with similar type ID.
dataThe GSMSectionData which contains the binary serialized data.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetDescription()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetDescription ( const GS::UniString &  description)

Sets the description of the object.

Parameters
descriptionThe new description.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetForwardMigrationScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetForwardMigrationScript ( const GS::UniString &  script)

Sets the forward migration script. This function will replace the existing forward migration script. If it is empty, the script will NOT be deleted but set to empty.

Parameters
scriptA GDL script which will be set as the forward migration script.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetGDLPictures()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetGDLPictures ( const std::vector< GX::ImageRef > &  images)

Sets the pictures which are referred from th GDL scripts.

Parameters
imagesA vector of GX::ImageRef images. The most common image formats are supported.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetHierarchicalPagesUsed()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetHierarchicalPagesUsed ( bool  hierarchicalPagesUsed)

Sets the interface uses hierarchical pages.

Parameters
hierarchicalPagesUsedtrue if yes
Returns
Returns Ok if succesful, otherwise Error.

◆ SetInterfaceScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetInterfaceScript ( const GS::UniString &  script)

Sets the interface script. This function will replace the existing interface script. If it is empty, the script will NOT be deleted but set to empty.

Parameters
scriptA GDL script which will be set as the interface script.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetIsSubtype()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetIsSubtype ( bool  isSubType)

Sets the object as a subtype.

Parameters
isSubTypeIf true the object will be a subtype.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetKeywords()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetKeywords ( const GS::UniString &  keywords)

Sets the keywords of the object. That is used by several search tools. Usually it is a comma separated list.

Parameters
keywordsThe new keywords.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetLicense()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetLicense ( const GS::UniString &  license)

Sets the license code of the object.

Parameters
licenseThe new license code.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetLicenseVersion()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetLicenseVersion ( const GS::UniString &  licVer)

Sets the license version of the object.

Parameters
licVerThe new license version.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetMasterScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetMasterScript ( const GS::UniString &  script)

Sets the master script. This function will replace the existing master script. If it is empty, the script will NOT be deleted but set to empty.

Parameters
scriptA GDL script which will be set as the master script.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetParameters()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetParameters ( const GDL::Parameters &  newParamList,
const std::vector< GS::UniString > &  descriptions 
)

Sets the parameters of the object. This function will replace the entire parameter list.

Parameters
newParamListThe new parameter list.
descriptionsThe descriptions of the parameters stored in the newParamList parameter.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetParameterScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetParameterScript ( const GS::UniString &  script)

Sets the parameter script. This function will replace the existing parameter script. If it is empty, the script will NOT be deleted but set to empty.

Parameters
scriptA GDL script which will be set as the parameter script.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetPassword()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetPassword ( const GS::UniString &  newPassword)

Sets the password of the object. If a password is set, it will encrypt and lock the object.

Parameters
newPasswordThe new password. If empty, the password will be deleted.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetPlaceable()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetPlaceable ( bool  placeable)

Sets the placeable flag of the object. If true, the object can be placed in a plan file.

Parameters
placeableIf true, the object will be placeable.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetPreviewPicture()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetPreviewPicture ( const GX::ImageRef &  image)

Sets the preview picture.

Parameters
imageA GX::ImageRef image. The most common image formats are supported.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetPropertiesScript()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetPropertiesScript ( const GS::UniString &  script)

Sets the properties script. This function will replace the existing properties script. If it is empty, the script will NOT be deleted but set to empty.

Parameters
scriptA GDL script which will be set as the properties script.
Returns
Returns Ok if succesful, otherwise Error.

◆ SetUIDefault()

ACAPI::Result< void > ACAPI::Library::v1::GSMObject::SetUIDefault ( bool  isDefault)

Sets the interface as default.

Parameters
isDefaulttrue if is default
Returns
Returns Ok if succesful, otherwise Error.