Archicad 28 C++ API
|
Classes | |
struct | API_3D_Head |
Common header for the 3D components. More... | |
struct | API_BodyType |
Representation of a 3D body. More... | |
struct | API_PgonType |
Representation of a 3D Polygon. More... | |
struct | API_PedgType |
Representation of a 3D edge reference. More... | |
struct | API_EdgeType |
Representation of a 3D edge. More... | |
struct | API_VertType |
Representation of a 3D vertex. More... | |
struct | API_VectType |
Representation of a 3D normal vector. More... | |
struct | API_LghtType |
Representation of a 3D light source. More... | |
struct | API_UmatType |
Representation of a 3D material. More... | |
union | API_Component3D |
General representation of a 3D component. More... | |
struct | API_Texture |
Texture reference. More... | |
struct | API_MaterialType |
Description of a surface material attribute. More... | |
struct | API_UVCoord |
The local coordinate system of a texture at a given surface point. More... | |
struct | API_ElemInfo3D |
3D data of an element. More... | |
struct | API_TexCoordPars |
Identifies the surface point to get the texture coordinates for. More... | |
Enumerations | |
enum | API_3DTypeID { API_Zombie3DID = 0 , API_BodyID , API_PgonID , API_PedgID , API_EdgeID , API_VertID , API_VectID , API_UmatID , API_LghtID } |
This is the enumeration of the applicable types of 3D components. More... | |
enum | API_LghtSouID { APILght_DistantID , APILght_DirectionID , APILght_SpotID , APILght_PointID , APILght_SunID , APILght_EyeID } |
Possible types of a 3D light source. More... | |
enum | API_MaterTypeID { APIMater_GeneralID , APIMater_SimpleID , APIMater_MatteID , APIMater_MetalID , APIMater_PlasticID , APIMater_GlassID , APIMater_GlowingID , APIMater_ConstID } |
Enumeration of material types. More... | |
Functions | |
GSErrCode | ACAPI_ModelAccess_GetTextureCoord (API_TexCoordPars *texCoordPars, API_UVCoord *uvCoord) |
Returns the texture coordinates of the given surface point. | |
GSErrCode | ACAPI_ModelAccess_Get3DInfo (const API_Elem_Head &elemHead, API_ElemInfo3D *info3D) |
Retrieves information on the 3D data of an element. | |
GSErrCode | ACAPI_ModelAccess_GetConnectionTable (const GS::HashSet< API_Guid > &elementList, API_ElementConnectionTable *connectionTable) |
Returns a table of connected elements and the connecting polygons. | |
GSErrCode | ACAPI_ModelAccess_GetBuildingMaterial (const UInt32 elemIdx, const UInt32 bodyIdx, API_AttributeIndex *materialIdx) |
Returns the attribute index of the material of a specific body of an element. | |
GSErrCode | ACAPI_ModelAccess_GetNum (API_3DTypeID typeID, Int32 *count) |
Returns the number of existing 3D components. | |
GSErrCode | ACAPI_ModelAccess_GetComponent (API_Component3D *component) |
Retrieves a component from the 3D model of Archicad. | |
GSErrCode | ACAPI_ModelAccess_DecomposePgon (Int32 ipgon, Int32 ***cpoly) |
Decomposes a polygon of the 3D model into convex polygons. | |
GSErrCode | ACAPI_ModelAccess_GenerateModelWithSeparateComponents (const GS::Array< API_Guid > &elementGuids) |
Generates a model with separate components of the given elements, and switches to that model for subsequent operations. The operation will not be executed if the active sight is the sight of 3D window. | |
The ModelAccess API provides geometry-level access to the 3D model of the Virtual Building.
To have an overview what the 3D model is, and how it fits into the entire database please refer to the Element_Overview chapter.
To have an overview on the 3D model of Archicad, and how the 3D database fits into the entire database system please refer to the Element Overview chapter.
All of the 3D handler function begin with the ACAPI_ModelAccess_ prefix. This function family gives support to query the 3D database. Modifications are not supported in this version of the API; you have no possibility to change the 3D model.
enum API_3DTypeID |
This is the enumeration of the applicable types of 3D components.
enum API_LghtSouID |
Possible types of a 3D light source.
enum API_MaterTypeID |
Enumeration of material types.
GSErrCode ACAPI_ModelAccess_DecomposePgon | ( | Int32 | ipgon, |
Int32 *** | cpoly | ||
) |
Decomposes a polygon of the 3D model into convex polygons.
ipgon | [in] Index of a polygon in the 3D model. |
cpoly | [out] Points to an array which contains the vertices of subpolygons. |
Parameter | Descriptions |
---|---|
n | The number of subpolygons. Can be 0 on error, or if the polygon is degenerate. |
m i | The number of vertices of the following subpolygon |
i1 .. i(m 1 ) j1 .. j(m 2 ) | The actual VERT indices of the subpolygons. The function doesn't generate new points, so these indices refer to the original VERT indices. |
GSErrCode ACAPI_ModelAccess_GenerateModelWithSeparateComponents | ( | const GS::Array< API_Guid > & | elementGuids | ) |
Generates a model with separate components of the given elements, and switches to that model for subsequent operations. The operation will not be executed if the active sight is the sight of 3D window.
elementGuids | [in] The guids of the elements which will be part of the model. |
GSErrCode ACAPI_ModelAccess_Get3DInfo | ( | const API_Elem_Head & | elemHead, |
API_ElemInfo3D * | info3D | ||
) |
Retrieves information on the 3D data of an element.
elemHead | [in] The element to get the 3D information for. |
info3D | [out] The 3D information to be retrieved. |
API_LineID
.API_WallID
, API_ColumnID
, API_BeamID
, API_WindowID
, API_DoorID
, API_ObjectID
, API_LampID
, API_SlabID
, API_RoofID
, and API_RoomID
. The returned structure contains the first and last body (or, in case of API_LampID
, the first and last light also) indices of the element's 3D data. This index is an index to the whole 3D data structure, where all the 3D data is stored in a continuous way. The 3D data of the element doesn't need to exist; Archicad will convert the element to 3D independently of any existing 3D window data. This also means that the 3D representation doesn't contain perspective cuts and 3D cut planes! Currently, this is the only way to obtain information on holes in walls. Look for polygons which have a horizontal normal vector perpendicular to the reference line of the wall. Similarly, you can get information on the intersection of walls by looking for polygons with a vertical normal vector. You can find more information on the 3D data in the 3D Manager and at the API_ElemInfo3D page of this help. You have to be familiar with the primitive element section of the GDL Reference Manual. GSErrCode ACAPI_ModelAccess_GetBuildingMaterial | ( | const UInt32 | elemIdx, |
const UInt32 | bodyIdx, | ||
API_AttributeIndex * | materialIdx | ||
) |
Returns the attribute index of the material of a specific body of an element.
elemIdx | [in] The index of the element. |
bodyIdx | [in] The index of the body in the element. |
materialIdx | [out] API_AttributeIndex of the material. |
GSErrCode ACAPI_ModelAccess_GetComponent | ( | API_Component3D * | component | ) |
Retrieves a component from the 3D model of Archicad.
component | [in/out] The typeID and the index field of the component header must be passed. You get the desired component data in the appropriate part of the union. |
API_BodyID
, you can get this error code, meaning the body has been removed from the 3D model because it was deleted, it is shadow body instead of a model one or it was eliminated during the model creation. API_BodyID
you may get the error code APIERR_DELETED, meaning the body has been removed from the 3D model. It is very important to organize your algorithm on a loop based on the component API_BodyID
(see example below) for the following reasons:GSErrCode ACAPI_ModelAccess_GetConnectionTable | ( | const GS::HashSet< API_Guid > & | elementList, |
API_ElementConnectionTable * | connectionTable | ||
) |
Returns a table of connected elements and the connecting polygons.
elementList | [in] List of API_Guids, referencing elements from the active sight. Archicad will search connections among these elements. |
connectionTable | [out] The returned table which consists of pairs of element ids as keys, and an array of polygons representing the connecting surface between the respective pair of elements. |
GSErrCode ACAPI_ModelAccess_GetNum | ( | API_3DTypeID | typeID, |
Int32 * | count | ||
) |
Returns the number of existing 3D components.
typeID | [in] Type of the 3D component. |
count | [out] Number of component with the given type. |
API_BodyID
, API_LghtID
and API_UmatID
type components can be addressed with this function. Model dependent components (API_PgonID, API_PedgID
, API_EdgeID
, API_VertID
, API_VectID
) are body dependent; direct access is prohibited. The number of these components can be determined from the API_BodyType type. GSErrCode ACAPI_ModelAccess_GetTextureCoord | ( | API_TexCoordPars * | texCoordPars, |
API_UVCoord * | uvCoord | ||
) |
Returns the texture coordinates of the given surface point.
texCoordPars | [in] identifies the surface point |
uvCoord | [out] the local (u, v) coordinate system of the texture |