Archicad 29 C++ API
|
Old functionalities to iterate and manipulate Library Parts. Most of these structures and functions are deprecated since AC 28. It's recommended to use Library Management components instead. More...
Classes | |
struct | API_OpenLibPartInfo |
The information of a library part required for opening the library part with ACAPI_LibraryManagement_OpenLibraryPart. More... | |
struct | API_ESYMParams |
Describes the current external symbol your add-on can work on. More... | |
struct | API_Prim_Head |
Header information for primitive elements. More... | |
struct | API_PrimHotspot |
A primitive hotspot. More... | |
struct | API_ParamOwnerType |
Parameters to specify the target parameter list to change. More... | |
struct | API_VLNumType |
The possible values for a numeric parameter. More... | |
struct | API_GetParamValuesType |
The possible parameter values of a non-array Library Part parameter. More... | |
struct | API_ChangeParamType |
Parameters to change a value in a Library Part parameter list. More... | |
struct | API_GetParamsType |
The changed parameter values of a Library Part. More... | |
struct | API_LibPart |
Definition of a Library Part. More... | |
struct | API_LibPartObjectDetails |
Library part's details of object, light, label and zone. Used in API_LibPartDetails. More... | |
struct | API_LibPartDoorWindowDetails |
Library part's details of window and door. Used in API_LibPartDetails. More... | |
union | API_LibPartDetails |
Detail parameters of a Library Part. More... | |
struct | API_LibPartSection |
Definition of a Library Part section. More... | |
Typedefs | |
typedef GSErrCode | APIESYMCommandProc(const API_ESYMParams *esymParams) |
User supplied callback function for handling external symbols. | |
Enumerations | |
enum | API_PrimTypeID { API_ZombiePrimID = 0 , API_PrimPointID , API_PrimLineID , API_PrimArcID , API_PrimTextID , API_PrimPLineID , API_PrimTriID , API_PrimPolyID , API_PrimPictID , API_PrimCtrl_BegID , API_PrimCtrl_HatchBorderBegID , API_PrimCtrl_HatchBorderEndID , API_PrimCtrl_HatchLinesBegID , API_PrimCtrl_HatchLinesEndID , API_PrimCtrl_HoledimLinesBegID , API_PrimCtrl_HoledimLinesEndID , API_PrimCtrl_ArrowBegID , API_PrimCtrl_ArrowEndID , API_PrimCtrl_ElementRefID , API_PrimCtrl_EndID , API_PrimCtrl_PlacedBorderBegID , API_PrimCtrl_PlacedBorderEndID , API_PrimCtrl_TextBegID , API_PrimCtrl_TextEndID , API_PrimCtrl_CWallPanelBegID , API_PrimCtrl_CWallPanelEndID , API_PrimCtrl_BackgroundFillBegID , API_PrimCtrl_BackgroundFillEndID , API_PrimCtrl_FrameBegID , API_PrimCtrl_FrameEndID } |
Various primitive element types and control codes. More... | |
enum | API_LockableStatus { APILockableStatus_NotExist , APILockableStatus_Free , APILockableStatus_Editable , APILockableStatus_Locked , APILockableStatus_NotAvailable } |
Possible Teamwork lockable status. More... | |
enum | API_LibTypeID { API_ZombieLibID = 0 , APILib_SpecID = 1 , APILib_WindowID = 2 , APILib_DoorID = 3 , APILib_ObjectID = 4 , APILib_LampID = 5 , APILib_RoomID = 6 , APILib_PropertyID = 7 , APILib_PlanSignID = 8 , APILib_LabelID = 9 , APILib_MacroID = 10 , APILib_PictID = 11 , APILib_ListSchemeID = 12 , APILib_SkylightID = 13 , APILib_OpeningSymbolID = 14 } |
Library Part types. From Archicad 8 these categories are obsolete due to the introduction of library part subtypes. More... | |
Functions | |
GSErrCode | ACAPI_LibraryPart_GetLibPartRefGuid (const IO::Location *location, API_Guid *guid) |
This function is used to obtain the reference guid of a library part. | |
GSErrCode | ACAPI_LibraryPart_GetLibPartUnIDStr (const IO::Location *location, char *libPartUnId) |
This function is used to obtain the given library part's own unique ID. | |
GSErrCode | ACAPI_LibraryPart_GetLibPartLockStatus (const IO::Location *location, API_LockableStatus *status, IO::Location *userCacheLibPartLocation=nullptr) |
Returns the current lock status of the given library part. | |
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_LibraryPart_OpenParameters (API_ParamOwnerType *paramOwner) |
Opens a Library Part parameter list to edit. | |
GSErrCode | ACAPI_LibraryPart_GetParamValues (API_GetParamValuesType *getValues) |
Returns the possible values defined for a Library Part parameter. | |
GSErrCode | ACAPI_LibraryPart_ChangeAParameter (API_ChangeParamType *changeParamType) |
Changes a value in an opened Library Part parameter list. | |
GSErrCode | ACAPI_LibraryPart_GetActParameters (API_GetParamsType *theParams) |
Returns the actual (edited) values of a Library Part parameter list opened to edit. | |
GSErrCode | ACAPI_LibraryPart_CloseParameters () |
Closes the Library Part parameter list opened for editing. | |
GSErrCode | ACAPI_LibraryPart_GetBuiltInLibpartUnId (short templateFileResID, char *lpfUnId) |
Retrieves the GUID of a built-in library part. | |
GSErrCode | ACAPI_LibraryPart_GetUnloadedLibpartName (const API_Guid *guid, GS::UniString *name) |
Retrieves the name of a Libpart, even if the library is unloaded. | |
GSErrCode | ACAPI_LibraryPart_CheckLibPartSubtypeOf (const char *successorUnIDStr, const char *predecessorUnIDStr) |
Checks whether a library part unique ID refers to a subtype of another. | |
GSErrCode | ACAPI_LibraryPart_CheckLibPartSubtypeOfbyMain (const char *successorUnIDStr, const char *predecessorUnIDStr) |
Checks whether a library part unique ID refers to a subtype of another. | |
GSErrCode | ACAPI_LibraryPart_CompareLibPartUnIds (const char *unIDStr1, const char *unIDStr2) |
Compares two library part unique IDs. | |
GSErrCode | ACAPI_LibraryPart_GetElemLibPartUnId (API_Elem_Head *elemHead, char *lpfUnId) |
Returns the library part unique identifier of the GDL based element (object/lamp/window/door). | |
GSErrCode | ACAPI_LibraryPart_GetLibPartToolVariation (API_LibPart *libPart, API_ToolBoxItem *toolboxItem) |
Returns the library part's creator element type and variation ID. | |
GSErrCode | ACAPI_LibraryPart_GetMarkerParent (const API_ElemType &elemType, API_LibPart &libPart) |
Returns the parent ID of the marker, in the parentUnID member of the libPart structure. | |
GSErrCode | ACAPI_LibraryPart_GetLastValidEmbeddedLPName (GS::UniString *name, IO::Location *location) |
Retrieves the last valid embedded library location. | |
GSErrCode | ACAPI_LibraryPart_RegisterESYM (GSType signature, API_LibTypeID typeID, short stringResID) |
Registers an external symbol type with Archicad. | |
GSErrCode | ACAPI_LibraryPart_InstallESYMHandler (GSType signature, APIESYMCommandProc *handlerProc) |
Installs a callback for handling external symbols. | |
GSErrCode | ACAPI_DisposeAddParHdl (API_AddParType ***addPars) |
Frees the memory occupied by a handle to an array of API_AddParType. | |
GSErrCode | ACAPI_LibraryPart_GetNum (Int32 *count) |
Returns the number of registered library parts. | |
GSErrCode | ACAPI_LibraryPart_Search (API_LibPart *ancestor, bool createIfMissing, bool onlyPlaceable=false) |
Searches for a registered Library Part in the loaded libraries. | |
GSErrCode | ACAPI_LibraryPart_PatternSearch (const API_LibPart *ancestor, const GS::UniString &pattern, API_LibPart result[50], Int32 *numFound) |
Searches for registered Library Parts in the loaded libraries. | |
GSErrCode | ACAPI_LibraryPart_Get (API_LibPart *libPart) |
Returns the data of a registered Library Part. | |
GSErrCode | ACAPI_LibraryPart_GetParams (Int32 libInd, double *a, double *b, Int32 *addParNum, API_AddParType ***addPars) |
Returns the default parameters of a registered Library Part. | |
GSErrCode | ACAPI_LibraryPart_GetSection (Int32 libInd, API_LibPartSection *section, GSHandle *sectionHdl, GS::UniString *sectionStr, GS::UniString *password=nullptr) |
Returns an existing section of a registered Library Part. | |
GSErrCode | ACAPI_LibraryPart_UpdateSection (Int32 libInd, const API_LibPartSection *section, GSHandle sectionHdl, GS::UniString *sectionStr, GS::UniString *password=nullptr) |
Updates a section of a registered Library Part. | |
GSErrCode | ACAPI_LibraryPart_SetUpSect_2DDrawHdl (void) |
Sets up an empty 2D binary (drawing) section to fill up from API elements. | |
GSErrCode | ACAPI_LibraryPart_GetSect_2DDrawHdl (GSHandle *sectionHdl) |
Returns the 2D binary (drawing) section data created from API elements. | |
GSErrCode | ACAPI_LibraryPart_GetSect_ParamDef (const API_LibPart *libPart, API_AddParType **addPars, double *a, double *b, GSHandle sect2DDrawHdl, GSHandle *sectionHdl, GS::UniString *password=nullptr) |
Prepares the parameter section data to save into a Library Part. | |
GSErrCode | ACAPI_LibraryPart_Create (const API_LibPart *libPart) |
Starts to create a new Library Part from scratch. | |
GSErrCode | ACAPI_LibraryPart_AddSection (const API_LibPartSection *section, GSHandle sectionHdl, GS::UniString *sectionStr) |
Adds a new section to the Library Part under creation. | |
GSErrCode | ACAPI_LibraryPart_NewSection (const API_LibPartSection *section) |
Opens a new section to write into the Library Part under creation. | |
GSErrCode | ACAPI_LibraryPart_WriteSection (Int32 nByte, GSConstPtr data) |
Writes data into an opened section of the Library Part under creation. | |
GSErrCode | ACAPI_LibraryPart_EndSection (void) |
Closes the last opened section of the Library Part under creation. | |
GSErrCode | ACAPI_LibraryPart_Save (API_LibPart *libPart) |
Saves the Library Part has been created and registers it. | |
GSErrCode | ACAPI_LibraryPart_ShapePrims (Int32 libInd, const API_Guid &instanceElemGuid, short gdlContext, ShapePrimsProc *shapePrimsProc) |
Virtually draws the shape of a registered Library Part. | |
GSErrCode | ACAPI_LibraryPart_GetHotspots (Int32 libInd, const API_Guid &instanceElemGuid, Int32 *nHotspots, API_PrimHotspot ***hotspots) |
Retrieves the hotspots of a registered Library Part. | |
GSErrCode | ACAPI_LibraryPart_Register (API_LibPart *libPart) |
Registers a Library Part. | |
GSErrCode | ACAPI_LibraryPart_RegisterAll (GS::Array< API_LibPart > *libParts) |
Registers an array of Library Parts. | |
GSErrCode | ACAPI_LibraryPart_GetSectionList (Int32 libInd, Int32 *nSection, API_LibPartSection ***sections) |
Returns the list of sections contained by a registered Library. | |
GSErrCode | ACAPI_LibraryPart_GetDetails (Int32 libInd, API_LibPartDetails *details) |
Returns the detail parameters of a registered Library Part. | |
GSErrCode | ACAPI_LibraryPart_SetDetails_ParamDef (const API_LibPart *libPart, GSHandle paramHdl, const API_LibPartDetails *details) |
Sets the detail parameters of a Library Part parameter section handle. | |
Old functionalities to iterate and manipulate Library Parts. Most of these structures and functions are deprecated since AC 28. It's recommended to use Library Management components instead.
Library Parts are collected into library folders, like the default Archicad Library. The active library folders themselves can be manipulated. With the ACAPI_LibraryManagement_ResetLibraries function you can reset the installed libraries, also you can add a new folder, or even to give a complete list of folders.
From Archicad 8 libraries can be packed in and loaded from archive files and module resources as well. This capability lets the add-ons store their library parts in their own resources and use them as a read-only library added to the active libraries (ACAPI_AddOnIntegration_RegisterBuiltInLibrary).
The active library folders are enumerated and the Library Part files are registered in Archicad. The Library Part Manager functions can work only on registered Library Parts.
The drawing elements (objects, doors, windows, lamps, and zone definitions) which require a Library Part to reference, do it with indices. The index is the index of the Library Part in the library part pool, which contains the parts from all the active libraries.
Up to Archicad 8 applicable types of Library Parts were enumerated in the API_LibTypeID structure. From Archicad 8 a new kind of library part hierarchy was introduced: every library part is derived from a subtype parent library part. This tree structure gives much more flexible classification of library parts. For a detailed description see the Library Part Subtypes section.
The definition of a Library Part is described in the API_LibPart structure.
Some kind of Library Parts do not contain any Archicad specific information. For example macros are simple text files, pictures are standard TIFF, GIF etc. files. They become Library Parts, just because they are located in the active library folders. There are no any API functions to give support to work on their content.
A real Library Part is built from several sections, as you can see and also edit in the Library Part dialog of Archicad. Each section has an identifier and a subcode which allows implementation of more than one section with the very same type, as can be seen in the API_LibPartSection structure.
The sectType field is the identifier of the section, which is implemented as a four byte code. Predefined identifiers are also listed, and Archicad can work on these sections only. Of course you can insert sections with custom identifiers to save your own data into the Library Part. Archicad never modifies or deletes custom sections.
The subIdent field gives a sub-identifier. There are sections which may have more instances in the same Library Part, like the 3D binary section. Sections which can have only one instance always have the value zero. For custom sections, this value is not checked for validity and you can use it for any purpose, like version controlling.
The API functions related to Library Parts give all of the necessary support to build a new Library Part from scratch, and provide the possibility to modify, delete or append any section in existing ones. If you create a new library part, it is automatically registered into the internal database, so it can be referred by any element. Refer to the ACAPI_LibraryPart_Create function for details.
The API functions hide the internal structure of a Library Part, however there is some public documentation available on these topics, which allows you to build them on your own. It is highly recommended to use the API functions for this purpose, because of compatibility issues.
Textual sections like the 2D script, 3D script or property script etc. can be generated without any problem. You just have to allocate some memory which can hold the necessary text. From API 11, these sections contain Unicode text, which you can also manipulate through the API.
Producing or interpreting binary sections like the 3D binary or 2D drawing sections are more complicated to manage. You have two ways to work on them.
The list of sections of a Library Part can be get by the ACAPI_LibraryPart_GetSectionList function.
If you are interested in the data of any section, you can get it by simply calling the ACAPI_LibraryPart_GetSection function. In case of binary sections, you will get binary data which does not correspond to any API structure. For textual sections, the returned sectionHdl contains the required text.
The 2D drawing section describes the shape of the Library Part which can be drawn with the applicable 2D toolbar elements.
At this time, the only way to get this data in API form is to use the ACAPI_LibraryPart_ShapePrims function. This function call explodes the shape of the library part into drawing primitives.
In order to build this binary section, you should redirect the element creation procedure. In this case, the subsequent calls to the ACAPI_Element_Create function place the given elements into a temporary pool, instead of the project database. When you have finished the drawing creation procedure you can convert these elements to the required binary form.
The parameters section describes the default parameters of the Library Part.
All real Library Parts contain two predefined parameters; named A and B. The different kind of Library Parts may contain additional required parameters. You can check these by creating a new library part of that kind in Archicad. The parameters appearing in the dialog are the required ones. Beside these, you may define or retrieve additional parameters (maximum 64). The parameter manipulating functions all refer to these additional (required and/or optional) parameters, but not to the A and B parameters, which are separate parameters where needed.
Applicable additional parameter types are enumerated in the API_AddParID structure. The definition of an additional parameter is described in the API_AddParType structure:
If you want to get the parameter list of a Library Part in an API based form you should use the following template:
In this case, Archicad translates the binary data into an array of API_AddParType structure. This function also returns the a and b parameter in separate variables, because the addParHdl will contain the additional parameters only.
The creation of the parameter section is also very simple. First you have to allocate the required size of array based on the API_AddParType structure and fill with the data of the parameters. In the next step, this API data should be converted to binary data. To do that you also need the 2D binary section data, because the binary parameter handle is a full description which owns the a and b parameters. These parameters are calculated automatically and the built binary section is returned to you through the paramsHdl argument. You also get back the calculated a and b parameter.
In the present version of the API, there is no support to process the internal data of the 3D binary sections. If you are interested to work with these sections please contact Graphisoft to get the necessary documentation on the binary format.
A Library Part can own more than one 3D binary section up to 16 fragments. In order to get the right fragment, you need to set up the subIdent field of the API_LibPartSection structure correctly.
A preview picture can be embedded into Library Parts either in PICT or GIF format. They are public formats, so they do not need any explanation.
typedef GSErrCode APIESYMCommandProc(const API_ESYMParams *esymParams) |
User supplied callback function for handling external symbols.
esymParams | [in] This structure contains the various parameters identifying the external symbol (type, index) and the type of operation (new/edit). |
enum API_LibTypeID |
Library Part types. From Archicad 8 these categories are obsolete due to the introduction of library part subtypes.
enum API_LockableStatus |
Possible Teamwork lockable status.
enum API_PrimTypeID |
Various primitive element types and control codes.
Enumerator | |
---|---|
API_ZombiePrimID | Dummy primitive. |
API_PrimPointID | Primitive point. |
API_PrimLineID | Primitive line. |
API_PrimArcID | Primitive arc. |
API_PrimTextID | Primitive text. |
API_PrimPLineID | Primitive polyline. |
API_PrimTriID | Primitive triangle. |
API_PrimPolyID | Primitive polygon. |
API_PrimPictID | Picture on placed drawing in PlotMaker. |
API_PrimCtrl_BegID | Begin drawing the element. |
API_PrimCtrl_HatchBorderBegID | Begin exporting hatch border ( |
API_PrimCtrl_HatchBorderEndID | Finished exporting hatch border. |
API_PrimCtrl_HatchLinesBegID | Begin exporting hatch lines. |
API_PrimCtrl_HatchLinesEndID | Finished exporting hatch lines. |
API_PrimCtrl_HoledimLinesBegID | Begin exporting window/door dimension lines (obsolete, not used from Archicad 8). |
API_PrimCtrl_HoledimLinesEndID | Finished exporting window/door dimension lines (obsolete, not used from Archicad 8). |
API_PrimCtrl_ArrowBegID | Begin exporting arrow primitives. |
API_PrimCtrl_ArrowEndID | Finished exporting arrow primitives. |
API_PrimCtrl_ElementRefID | Reference to another element ( |
API_PrimCtrl_EndID | Finished element drawing. |
API_PrimCtrl_PlacedBorderBegID | Begin exporting placed drawing border. |
API_PrimCtrl_PlacedBorderEndID | Finished exporting placed drawing border. |
API_PrimCtrl_TextBegID | Begin exporting text block. |
API_PrimCtrl_TextEndID | Finished exporting text block. |
API_PrimCtrl_CWallPanelBegID | Begin exporting a curtain wall panel. |
API_PrimCtrl_CWallPanelEndID | Finished exporting a curtain wall panel. |
API_PrimCtrl_BackgroundFillBegID | Begin exporting drawing background fill. |
API_PrimCtrl_BackgroundFillEndID | End exporting drawing background fill. |
API_PrimCtrl_FrameBegID | Begin exporting text frame primitives. |
API_PrimCtrl_FrameEndID | End exporting text frame primitives. |
GSErrCode ACAPI_DisposeAddParHdl | ( | API_AddParType *** | addPars | ) |
Frees the memory occupied by a handle to an array of API_AddParType.
addPars | [in] A handle to an array of API_AddParType. |
GSErrCode ACAPI_LibraryManagement_DeleteEmbeddedLibItem | ( | const IO::Location * | location, |
bool | keepGSMFile = false, | ||
bool | silentMode = false ) |
Deletes the given embedded library item (folder or library part).
location | [in] The location of the embedded library item. |
keepGSMFile | [in] If this parameter is true, then the operation deletes libpart only from the embedded library, but keeps the.gsm file in the filesystem. (optional parameter, by default it's false) |
silentMode | [in] If this parameter is true, then the missing libpart window won't open in case of any warning. (optional parameter, by default it's false) |
GSErrCode ACAPI_LibraryManagement_DeleteEmbeddedLibItems | ( | const GS::Array< IO::Location > * | location, |
bool | keepGSMFile = false, | ||
bool | silentMode = false ) |
Delete embeded lib items.
location | [in] Array of locations of the library items. |
keepGSMFile | [in] Keep the GSM file. |
silentMode | [in] Missing library parts dialog window should pop up. |
GSErrCode ACAPI_LibraryPart_AddSection | ( | const API_LibPartSection * | section, |
GSHandle | sectionHdl, | ||
GS::UniString * | sectionStr ) |
Adds a new section to the Library Part under creation.
section | [in] Parameters of the new section. |
sectionHdl | [in] Section data. |
sectionStr | [in] Content of any textual section as a Unicode string. |
GSErrCode ACAPI_LibraryPart_ChangeAParameter | ( | API_ChangeParamType * | changeParamType | ) |
Changes a value in an opened Library Part parameter list.
changeParamType | [in] The Library Part parameter (variable) to change the value of it. |
GSErrCode ACAPI_LibraryPart_CheckLibPartSubtypeOf | ( | const char * | successorUnIDStr, |
const char * | predecessorUnIDStr ) |
Checks whether a library part unique ID refers to a subtype of another.
successorUnIDStr | [in] the unique ID of the subtype. |
predecessorUnIDStr | [in] the unique ID of the expected ancestor. |
GSErrCode ACAPI_LibraryPart_CheckLibPartSubtypeOfbyMain | ( | const char * | successorUnIDStr, |
const char * | predecessorUnIDStr ) |
Checks whether a library part unique ID refers to a subtype of another.
successorUnIDStr | [in] the unique ID of the subtype. |
predecessorUnIDStr | [in] the unique ID of the expected ancestor. |
GSErrCode ACAPI_LibraryPart_CloseParameters | ( | ) |
Closes the Library Part parameter list opened for editing.
GSErrCode ACAPI_LibraryPart_CompareLibPartUnIds | ( | const char * | unIDStr1, |
const char * | unIDStr2 ) |
Compares two library part unique IDs.
unIDStr1 | [in] the first library part unique ID. |
unIDStr2 | [out] the second library part unuique ID. |
GSErrCode ACAPI_LibraryPart_Create | ( | const API_LibPart * | libPart | ) |
Starts to create a new Library Part from scratch.
libPart | [in] Parameters of the Library Part to create |
GSErrCode ACAPI_LibraryPart_EndSection | ( | void | ) |
Closes the last opened section of the Library Part under creation.
GSErrCode ACAPI_LibraryPart_Get | ( | API_LibPart * | libPart | ) |
Returns the data of a registered Library Part.
libPart | [in/out] Definition of the library part. |
GSErrCode ACAPI_LibraryPart_GetActParameters | ( | API_GetParamsType * | theParams | ) |
Returns the actual (edited) values of a Library Part parameter list opened to edit.
theParams | [out] the modified parameter list |
GSErrCode ACAPI_LibraryPart_GetBuiltInLibpartUnId | ( | short | templateFileResID, |
char * | lpfUnId ) |
Retrieves the GUID of a built-in library part.
templateFileResID | [in] the library part template 'FILE' resource ID |
lpfUnId | [out] the required unique ID in string format |
GSErrCode ACAPI_LibraryPart_GetDetails | ( | Int32 | libInd, |
API_LibPartDetails * | details ) |
Returns the detail parameters of a registered Library Part.
libInd | [in] Index of the Library Part |
details | [out] Detail parameter of the Library Part |
APILib_WindowID
APILib_DoorID
APILib_ObjectID
APILib_LampID
APILib_RoomID
APILib_LabelID
To change the parameters refer to the ACAPI_LibraryPart_SetDetails_ParamDef function. GSErrCode ACAPI_LibraryPart_GetElemLibPartUnId | ( | API_Elem_Head * | elemHead, |
char * | lpfUnId ) |
Returns the library part unique identifier of the GDL based element (object/lamp/window/door).
elemHead | [in] Head of the element. It is identified by the guid field. |
lpfUnId | [out] The required unique ID in string format. |
GSErrCode ACAPI_LibraryPart_GetHotspots | ( | Int32 | libInd, |
const API_Guid & | instanceElemGuid, | ||
Int32 * | nHotspots, | ||
API_PrimHotspot *** | hotspots ) |
Retrieves the hotspots of a registered Library Part.
libInd | [in] Index of the library part |
instanceElemGuid | [in] Instance element GUID; if APINULLGuid, then the drawing parameters will be the default parameters of the library part (with no transformation, etc.), otherwise they are taken from the instance of the library part defined by this GUID. |
nHotspots | [out] Numbers of hotspots. |
hotspots | [out] Handle that contains the hotspot data on return. |
APILib_WindowID
APILib_DoorID
APILib_ObjectID
APILib_LampID
APILib_RoomID
(zone stamp)APILib_LabelID
(symbol label) GSErrCode ACAPI_LibraryPart_GetLastValidEmbeddedLPName | ( | GS::UniString * | name, |
IO::Location * | location ) |
Retrieves the last valid embedded library location.
name | [in] Library part name. |
location | [out] The location of the last valid embedded libpart for the given libpart name. |
GSErrCode ACAPI_LibraryPart_GetLibPartLockStatus | ( | const IO::Location * | location, |
API_LockableStatus * | status, | ||
IO::Location * | userCacheLibPartLocation = nullptr ) |
Returns the current lock status of the given library part.
location | [in] The location of the library part. |
status | [out] The Teamwork lock status of the library part. |
userCacheLibPartLocation | [out] Location of the server library part file in the user cache (optional parameter). |
GSErrCode ACAPI_LibraryPart_GetLibPartRefGuid | ( | const IO::Location * | location, |
API_Guid * | guid ) |
This function is used to obtain the reference guid of a library part.
location | [in] The location of the library part. |
guid | [out] The reference guid of the library part. |
GSErrCode ACAPI_LibraryPart_GetLibPartToolVariation | ( | API_LibPart * | libPart, |
API_ToolBoxItem * | toolboxItem ) |
Returns the library part's creator element type and variation ID.
libPart | [in] Identifies the library part. A basic ACAPI_LibraryPart_Search is performed to extract the internal library part identifier. |
toolboxItem | [out] The requested creator element type and variation ID. |
GSErrCode ACAPI_LibraryPart_GetLibPartUnIDStr | ( | const IO::Location * | location, |
char * | libPartUnId ) |
This function is used to obtain the given library part's own unique ID.
location | [in] The location of the library part. |
libPartUnId | [out] The unique ID of the library part. |
GSErrCode ACAPI_LibraryPart_GetMarkerParent | ( | const API_ElemType & | elemType, |
API_LibPart & | libPart ) |
Returns the parent ID of the marker, in the parentUnID member of the libPart structure.
elemType | [in] The element type. |
libPart | [in] The library part. |
GSErrCode ACAPI_LibraryPart_GetNum | ( | Int32 * | count | ) |
Returns the number of registered library parts.
count | [out] number of Library Parts. |
GSErrCode ACAPI_LibraryPart_GetParams | ( | Int32 | libInd, |
double * | a, | ||
double * | b, | ||
Int32 * | addParNum, | ||
API_AddParType *** | addPars ) |
Returns the default parameters of a registered Library Part.
libInd | Index of the library part. |
a | The A parameter of the the Library Part |
b | The B parameter of the the Library Part |
addParNum | The number of additive parameters; others than A and B |
addPars | The additive parameters |
API_SectParamDef
argument. The function works only on real Library Parts. In the case the type of the target Library Part is not listed below, the function returns an error code. This is since other type of Library Parts are just simple picture or text files which are enumerated and registered from the active library folders; such a picture or macro. Applicable type of Library Parts which have parameter list are:APILib_WindowID
,APILib_DoorID
,APILib_ObjectID
,APILib_LampID
,APILib_RoomID
,APILib_LabelID
,APILib_MacroObjID
,APILib_PropertyID
Do not forget to dispose the additive parameter handle if it is not needed any more. Use the ACAPI_DisposeAddParHdl function for this purpose. GSErrCode ACAPI_LibraryPart_GetParamValues | ( | API_GetParamValuesType * | getValues | ) |
Returns the possible values defined for a Library Part parameter.
getValues | [out] the value list for the given parameter |
GSErrCode ACAPI_LibraryPart_GetSect_2DDrawHdl | ( | GSHandle * | sectionHdl | ) |
Returns the 2D binary (drawing) section data created from API elements.
sectionHdl | [out] 2D binary section data |
GSErrCode ACAPI_LibraryPart_GetSect_ParamDef | ( | const API_LibPart * | libPart, |
API_AddParType ** | addPars, | ||
double * | a, | ||
double * | b, | ||
GSHandle | sect2DDrawHdl, | ||
GSHandle * | sectionHdl, | ||
GS::UniString * | password = nullptr ) |
Prepares the parameter section data to save into a Library Part.
libPart | [in] The library part to work on |
addPars | [in] Additive parameters of the Library Part |
a | [in] the value of the A parameter |
b | [in] the value of the B parameter |
sect2DDrawHdl | [in] 2D binary section data |
sectionHdl | [out] the prepared parameter section data |
password | [in] The (optional) password that encrypted the section. |
GSErrCode ACAPI_LibraryPart_GetSection | ( | Int32 | libInd, |
API_LibPartSection * | section, | ||
GSHandle * | sectionHdl, | ||
GS::UniString * | sectionStr, | ||
GS::UniString * | password = nullptr ) |
Returns an existing section of a registered Library Part.
libInd | [in] Index of the library part |
section | [in/out] Definition of the section. The section is defined by the sectType an the subIdent fields of the API_LibPartSection structure. |
sectionHdl | [out] Section data. |
sectionStr | [out] The content of textual sections as a Unicode string. Pass the address of an existing Unicode string if you need this data. |
password | [in] The (optional) password that encrypted the section. |
APILib_WindowID
,APILib_DoorID
,APILib_ObjectID
,APILib_LampID
,APILib_RoomID
,APILib_LabelID
,APILib_MacroObjID
,APILib_PropertyID
Do not forget to dispose the data if it is not needed any more. From API 11, the textual section data is now stored as a GS::UniString in the library parts. You can also obtain the text in this format in the sectionStr parameter. GSErrCode ACAPI_LibraryPart_GetSectionList | ( | Int32 | libInd, |
Int32 * | nSection, | ||
API_LibPartSection *** | sections ) |
Returns the list of sections contained by a registered Library.
libInd | [in] Index of the library part |
nSection | [out] Number of the sections found |
sections | [out] section data returned |
APILib_WindowID
, APILib_DoorID
, APILib_ObjectID
, APILib_LampID
, APILib_RoomID
, APILib_LabelID
, APILib_MacroObjID
, APILib_PropertyID
Do not forget to dispose the returned handle if it is not needed any more. Note, that it cannot be used between ACAPI_LibraryPart_Create and ACAPI_LibraryPart_Save functions. GSErrCode ACAPI_LibraryPart_GetUnloadedLibpartName | ( | const API_Guid * | guid, |
GS::UniString * | name ) |
Retrieves the name of a Libpart, even if the library is unloaded.
guid | [in] the guid of the Object, Lamp, Window or Door element. |
name | [out] the name of the Libpart |
GSErrCode ACAPI_LibraryPart_InstallESYMHandler | ( | GSType | signature, |
APIESYMCommandProc * | handlerProc ) |
Installs a callback for handling external symbols.
signature | [in] A four-character identifier of the external symbol. |
handlerProc | [in] The callback function to handle the creation and the editing of the external symbol. |
GSErrCode ACAPI_LibraryPart_NewSection | ( | const API_LibPartSection * | section | ) |
Opens a new section to write into the Library Part under creation.
section | [in] Parameters of the new section. |
GSErrCode ACAPI_LibraryPart_OpenParameters | ( | API_ParamOwnerType * | paramOwner | ) |
Opens a Library Part parameter list to edit.
paramOwner | [in] Reference to the owner of the parameter handle which should be edited |
GSErrCode ACAPI_LibraryPart_PatternSearch | ( | const API_LibPart * | ancestor, |
const GS::UniString & | pattern, | ||
API_LibPart | result[50], | ||
Int32 * | numFound ) |
Searches for registered Library Parts in the loaded libraries.
ancestor | [in] The library part type to search for |
pattern | [in] Pattern to search for in the loaded librairies. |
result | [out] Array to store the first 50 found library parts. |
numFound | [out] Number of found library parts. |
APILib_ObjectID
corresponds to Model Elements, and API_ZombieLibID
marks the General Object subtype). GSErrCode ACAPI_LibraryPart_Register | ( | API_LibPart * | libPart | ) |
Registers a Library Part.
libPart | [in/out] Parameters of the library part; |
GSErrCode ACAPI_LibraryPart_RegisterAll | ( | GS::Array< API_LibPart > * | libParts | ) |
Registers an array of Library Parts.
libParts | [in/out] Parameters of the library parts; the type, the owner signature and the location of the library parts must be initialized, by setting the typeID, ownerID and the location fields respectively. Other values will be filled and returned by Archicad. |
GSErrCode ACAPI_LibraryPart_RegisterESYM | ( | GSType | signature, |
API_LibTypeID | typeID, | ||
short | stringResID ) |
Registers an external symbol type with Archicad.
signature | [in] Unique identifier of the new symbol type (a four-character ID). |
typeID | [in] Type of the new symbol (can be API_ObjectID , API_LampID , API_WindowID , or API_DoorID ). |
stringResID | [in] Resource containing the description of the new symbol type. |
GSErrCode ACAPI_LibraryPart_Save | ( | API_LibPart * | libPart | ) |
Saves the Library Part has been created and registers it.
libPart | [in/out] Parameters of the library part to create |
GSErrCode ACAPI_LibraryPart_Search | ( | API_LibPart * | ancestor, |
bool | createIfMissing, | ||
bool | onlyPlaceable = false ) |
Searches for a registered Library Part in the loaded libraries.
ancestor | [in/out] The library part to search for |
createIfMissing | [in] Set to true to create a reference if it is missing. |
onlyPlaceable | [in] The search is limited to placeable library parts only. Optional parameter, can be omitted. |
APILib_ObjectID
API_ZombieLibID
ACAPI_LibraryPart_Search can also create a virtual reference to a none existing library part (i.e. an index which can be referred to) if the library part has not found in the active libraries and createIfMissing was set true). Same effect appears when an opened plan refers to a library part which is not in the active libraries. In this case Archicad places a filled circle on the plan where a missing library part is referenced. On success ACAPI_LibraryPart_Search fills out all the fields of the API_LibPart structure, therefore remember to free the location pointer allocated by the function if you do not not need it any more. GSErrCode ACAPI_LibraryPart_SetDetails_ParamDef | ( | const API_LibPart * | libPart, |
GSHandle | paramHdl, | ||
const API_LibPartDetails * | details ) |
Sets the detail parameters of a Library Part parameter section handle.
libPart | [in] The library part to work on. |
paramHdl | [in/out] Parameter section data |
details | [in] Detail parameters |
APILib_WindowID
APILib_DoorID
APILib_ObjectID
APILib_LampID
APILib_RoomID
APILib_LabelID
To get the detail parameters of a registered Library Part refer to the ACAPI_LibraryPart_GetDetails function. Note, that the ACAPI_LibraryPart_GetDetails and ACAPI_LibraryPart_SetDetails_ParamDef functions are not symmetrical; it is shown in the function names too. Since the detail parameters are stored in the parameter section of the Library Part, this implementation interface is the most effective. GSErrCode ACAPI_LibraryPart_SetUpSect_2DDrawHdl | ( | void | ) |
Sets up an empty 2D binary (drawing) section to fill up from API elements.
GSErrCode ACAPI_LibraryPart_ShapePrims | ( | Int32 | libInd, |
const API_Guid & | instanceElemGuid, | ||
short | gdlContext, | ||
ShapePrimsProc * | shapePrimsProc ) |
Virtually draws the shape of a registered Library Part.
libInd | [in] Index of the library part | ||||||||||||||||||||
instanceElemGuid | [in] Instance element GUID; if APINULLGuid, then the drawing parameters will be the default parameters of the library part (with no transformation, etc.), otherwise they are taken from the instance of the library part defined by this GUID. | ||||||||||||||||||||
gdlContext | [in] The environment of the GDL object (sets GLOB_CONTEXT GDL Global parameter).
| ||||||||||||||||||||
shapePrimsProc | [in] Callback function for catching the drawing primitives of the Libpart Part shape. |
ACAPI_LibraryPart_ShapePrims
function again. The function works only on Library Parts can be placed onto the floor plan. Applicable type of Library Parts are: APILib_WindowID
, APILib_DoorID
, APILib_ObjectID
, APILib_LampID
, APILib_RoomID
(zone stamp), APILib_LabelID
(symbol label). In order to get the hotspots of a library part or an object instance use the ACAPI_LibraryPart_GetHotspots function. GSErrCode ACAPI_LibraryPart_UpdateSection | ( | Int32 | libInd, |
const API_LibPartSection * | section, | ||
GSHandle | sectionHdl, | ||
GS::UniString * | sectionStr, | ||
GS::UniString * | password = nullptr ) |
Updates a section of a registered Library Part.
libInd | [in] Index of the Library Part |
section | [in] Identifier of the section. |
sectionHdl | [in] Section data. |
sectionStr | [in] Optional Unicode content of any textual section. |
password | [in] The (optional) password that encrypted the section. |
GSErrCode ACAPI_LibraryPart_WriteSection | ( | Int32 | nByte, |
GSConstPtr | data ) |
Writes data into an opened section of the Library Part under creation.
nByte | [in] Number of bytes. |
data | [in] Data to be written. |