Retrieves the actual default settings for the element of type.
GSErrCode ACAPI_Element_GetDefaults ( API_Element* element, API_ElementMemo* memo );
Parameters
- element
- [in/out] The desired element for which the defaults are needed.
- memo
- [out] This is needed only in case of library part-based elements (including zone stamps).
Return Values
NoError
- The function has completed with success.
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_REFUSEDCMD
- The element type is not a valid target for the operation;
API_SectElemID
For other common API errors see the API Errors document.
Remarks
This function is used to obtain the actual default settings for an element.
The requested type is identified by the type
field of the header. The function fills the central part of the API_Element structure with values from the Settings dialog. You have to fill in the geometric information yourself; if you need it.
The memo
parameter is used only for library part based elements (including zone stamps), where the params
field is filled with the actual parameter values of the referenced Library Part. Do not forget to call the ACAPI_DisposeElemMemoHdls function to dispose of the obtained handles.
To change the default settings use the ACAPI_Element_ChangeDefaults function.
You can use the returned values to initialize the element attributes and parameters to create a new instance. Refer to the ACAPI_Element_Create function for more details.
In order to get the default settings of markered element types (API_WindowType, API_DoorType, API_CutPlaneType, API_ChangeMarkerType, API_DetailType and API_WorksheetType) use the ACAPI_Element_GetDefaultsExt function instead.
Example
API_Element element; API_ElementMemo memo; GSErrCode err; BNZeroMemory (&element, sizeof (API_Element)); BNZeroMemory (&memo, sizeof (API_ElementMemo)); element.header.type = API_ObjectID; element.header.type.variationID = APIVarId_SymbStair; err = ACAPI_Element_GetDefaults (&element, &memo); if (err == NoError) { /* do what you want */ } ACAPI_DisposeElemMemoHdls (&memo);
Requirements
- Version: API 4.1 or later
- Header: ACAPinc.h
See Also
API_Element, API_ElementMemo
ACAPI_Element_ChangeDefaults, ACAPI_Element_Create, ACAPI_DisposeElemMemoHdls
ACAPI_Element_GetDefaultsExt, ACAPI_Element_ChangeDefaultsExt
Element Manager, API Functions