Archicad 28 C++ API
Loading...
Searching...
No Matches
API_AddParType Struct Reference

Describes a parameter of a Library Part. More...

#include <APIdefs_LibraryParts.h>

Public Attributes

API_AddParID typeID
 The type of the additional parameter (ParT_Integer, ParT_Length, etc.)
 
short index
 The index of the additional parameter inside the additional parameter list.
 
short typeMod
 Type modifier; the variable is a simple instance or an array with the type typeID.
 
char name [API_NameLen]
 The name of the parameter — should be ASCII only.
 
GS::uchar_t uDescname [API_UAddParDescLen]
 The description of the parameter as a Unicode string.
 
GS::uchar_t valueDescription [API_UAddParNumDescLen]
 The description of the value for simple numerical parameter types as a Unicode string.
 
Int32 dim1
 The first dimension of the array; in case of array modifier.
 
Int32 dim2
 The second dimension of the array; in case of array modifier.
 
unsigned short flags
 Modifier flags.
 
GSHandle arrayDescriptions
 Unicode description string values of an array parameter in UTF-16 encoding. Values are stored immediately after each other to conserve space.
 
union { 
 
   double   real 
 Numeric parameter value.
 
   GS::uchar_t   uStr [API_UAddParStrLen] 
 String parameter (ParT_CString) value (Unicode, UTF-16 encoded).
 
   GSHandle   array 
 Array parameter values.
 
value 
 Contains numeric, string or array parameter values.
 

Detailed Description

Describes a parameter of a Library Part.

Remarks
This structure describes the additional parameters for a Library Part. It is also used for Library Part-based element (objects, windows, doors, etc.) and attribute types (zone category). For parameters with array modifier, you can change the dimensions of the array on the fly when you create or modify an element. This enables you to put just a placeholder for an array into the library part parameter, and adjust that when you actually place the library part. It is strongly advised to use the ACAPI_LibraryPart_OpenParameters, ACAPI_LibraryPart_ChangeAParameter, ACAPI_LibraryPart_GetActParameters, ACAPI_LibraryPart_CloseParameters functions to modify a parameter in the parameter list. Dictionary parameters are currently inaccessible with this structure.
Example
static void DumpOneParam (API_AddParID typeID,
const char *varname,
unsigned short flags,
double value,
const GS::uchar_t *valueStr,
Int32 dim1,
Int32 dim2)
{
char head[256], val[256];
if (dim1 == 0 && dim2 == 0)
sprintf (head, " %s 0x%02X", varname, flags);
else {
if (dim1 < 0) {
sprintf (head, " %s: [%d][%d] 0x%02X", varname, -dim1, -dim2, flags);
ACAPI_WriteReport (head, false);
return;
}
sprintf (head, " [%d][%d]", dim1, dim2);
}
switch (typeID) {
case APIParT_Integer:
case APIParT_LightSw:
case APIParT_Intens:
case APIParT_LineTyp:
case APIParT_Mater:
case APIParT_FillPat:
case APIParT_PenCol:
case APIParT_Boolean:
case APIParT_BuildingMaterial:
case APIParT_Profile:
sprintf (val, "%d", (Int32) value);
break;
case APIParT_Length:
case APIParT_Angle:
case APIParT_RealNum:
case APIParT_ColRGB:
sprintf (val, "%f", value);
break;
case APIParT_CString:
case APIParT_Title:
sprintf (val, "\"%s\"", (const char *) GS::UniString (valueStr).ToCStr ());
break;
case APIParT_Separator:
CHCopyC ("-------------------", val);
break;
default:
CHCopyC ("???????", val);
break;
}
GiveMessage_Str (head, val, false);
return;
}
API_AddParID
Possible types of a Library Part additive parameter.
Definition: APIdefs_LibraryParts.h:550
void ACAPI_WriteReport(const GS::UniString &format, bool withDial,...)
Writes a report string into the Report Windowot into a custom alert window.
unsigned short flags
Modifier flags.
Definition: APIdefs_LibraryParts.h:668
Int32 dim2
The second dimension of the array; in case of array modifier.
Definition: APIdefs_LibraryParts.h:653
union API_AddParType::@11 value
Contains numeric, string or array parameter values.
API_AddParID typeID
The type of the additional parameter (ParT_Integer, ParT_Length, etc.)
Definition: APIdefs_LibraryParts.h:610
Int32 dim1
The first dimension of the array; in case of array modifier.
Definition: APIdefs_LibraryParts.h:647

Member Data Documentation

◆ flags

API_AddParType::flags

Modifier flags.

Value Description
API_ParFlg_Child This parameter is a child of the preceding title.
API_ParFlg_BoldName Show the name of the parameter in bold.
API_ParFlg_Open Show the child parameters of this parameter.
API_ParFlg_Disabled Disable this parameter; mainly used for separator lines
API_ParFlg_Hidden Hidden parameter; does not appear in the Settings dialogs.
API_ParFlg_SHidden Hidden parameter from scripts.