Places a new element into current database.
GSErrCode ACAPI_Element_Create ( API_Element* element, API_ElementMemo* memo );
Parameters
- element
- [in/out] The desired element will be created in the pointed structure. The
element->header.type
must specify the type of the element to be created. - memo
- [in] The memo field of the desired element will be created from the pointed structure (if the memo field is needed).
Return Values
NoError
- The function has completed with success.
APIERR_BADDATABASE
- The current database is not proper for the operation.
APIERR_BADPARS
- The passed parameter is
nullptr; element
APIERR_BADID
- The element type is invalid, or
the element type is not supported by the server application APIERR_REFUSEDPAR
- The
element->header.type
parameter was incorrect. It might happen if you want to create something in a window not capable to display it, for example a wall in a section window. APIERR_INVALFLOOR
- The
element->header.floorInd
parameter is out of range. APIERR_IRREGULARPOLY
- Input polygon or polyline is irregular.
For other common API errors see the API Errors document.
Remarks
The type of the element to be created is defined by type
in the element header. On return, the guid
field of the header is filled in. Don’t forget to call ACAPI_DisposeElemMemoHdls to dispose the handles when you’re done.
The meaning of the different parameters is explained in the table below:
|
|
📝 Notes |
---|---|---|
|
optional/required |
The |
|
optional (gables, assemblySegmentProfiles) |
|
|
optional (gables, beam holes, assemblySegmentProfiles) |
|
|
required ( |
See also ACAPI_Element_CreateExt. |
|
required ( |
See also ACAPI_Element_CreateExt. |
|
required |
|
|
required/optional |
The slab polygon is required; the |
|
required/optional |
The roof polygon is required; the |
|
required/optional |
The mesh polygon is required, the |
|
required/optional |
Shell shape data is required (first record of |
|
required/optional |
The |
|
required (dimension data) |
|
|
|
|
|
|
If the |
|
required (content) optional (paragraphs) for multistyle content |
|
|
optional (content) for textual labels optional (paragraphs) for multistyle content required (parameters) for symbol labels |
The API_LabelType::parent member determines whether an independent or an associative Label will be created.
|
|
required (polygon and parameters) |
|
|
required (fill polygon) |
If the |
|
|
|
|
required (polygon) |
|
|
required/optional |
The curve point coordinates are required. If the |
|
|
|
|
required (picture content) |
|
|
optional (polygon, drawing data) |
|
|
required |
The cutplane coordinates are required. |
|
optional (polygon) |
See also ACAPI_Element_CreateExt. |
|
optional (polygon) |
See also ACAPI_Element_CreateExt. |
|
optional (linklist) |
Optional for panoramic cameras only. |
|
|
|
|
|
This type of element cannot be created. |
|
required (polyline) |
|
|
required (polyline) |
|
|
Extrusion base plane (extrusionGeometryData.frame) and owner element required. |
The creation process for elements follows the same process as the one you use for creating elements graphically in Archicad. This means for example, that you have to create a wall for windows and doors, etc. The API always checks for the presence of the necessary information, and returns with an error code if something is missing.
The created element may be redirected into the 2D binary section of a Library Part. Refer to the ACAPI_LibPart_SetUpSect_2DDrawHdl function for details. In these case no information is returned, what indices, guids were generated. In this environment only 2D drawing elements can be generated.
The element also can be clipped by a clipping region. Refer to the APIDb_StartClippingSessionID function for details. In these case no information is returned, what indices, guids were generated, since more parts may be generated.
Requirements
- Version: API 1.3 or later
- Header: ACAPinc.h
See Also
API_Element, API_ElementMemo, ACAPI_Element_CreateExt
ACAPI_LibPart_SetUpSect_2DDrawHdl, APIDb_StartClippingSessionID, ACAPI_DisposeElemMemoHdls
Element Manager, API Functions