Archicad 27 C++ API
Loading...
Searching...
No Matches
Element Manager

To have an overview what the elements are, and how they fit into the entire database please refer to the Element Overview chapter. In these papers only the handler functions are explained in full details. More...

Classes

class  ACAPI::v1::ElementBase
 A base class for all elements. More...
 
class  ACAPI::v1::ElementDefault
 A base class for all element defaults. More...
 
class  API_ElementDecomposerInterface
 Interface class for the element decomposition process. More...
 
struct  API_InteriorElevationType
 An iterior elevation element. More...
 
struct  API_AnalyticalNode
 Describes an Structural Analytical Node. More...
 
struct  API_AnalyticalCurve
 Describes an Structural Analytical Model Curve that is either a line segment between two Structural Analytical Model Nodes, or an arc segment with a specified intermediate point. More...
 
struct  API_SurfaceLoadCustomData
 Describes Custom Surface Coordinates for Surface Load. More...
 
struct  API_Sector
 Describes the geometry of a 2D line. More...
 
struct  API_Box3D
 Rectangular region of the model with Z extent. More...
 
struct  API_GridMeshHead
 General header for Grid Mesh type. More...
 
struct  API_GridMeshVertex
 Describes a Grid Mesh vertex. More...
 
struct  API_GridMeshEdge
 Describes a Grid Mesh edge. More...
 
struct  API_GridEdgeInfo
 Contains extended information of a API_GridMeshEdge. More...
 
struct  API_GridMeshLine
 Describes a grid line of the mesh. More...
 
struct  API_GridMeshPolygon
 A 3D mesh polygon with four edge indices. More...
 
struct  API_GridMesh
 Describes a Curtain Wall segment geometry. More...
 
struct  API_Interval
 Describes an interval with handling possible periodicity. More...
 
struct  API_NotifyElementType
 Describes the element the notification is coming for, and the type of the notification. More...
 
struct  API_ComponentID
 Identifies a component. More...
 
struct  API_ElemComponentID
 Identifies a component of an element. More...
 
struct  API_RoomReductionPolyType
 Parameters to get room reduction data. More...
 
struct  API_ElemURLRef
 URL reference to be stored into elements. More...
 
struct  API_ElemType
 The type of an element. More...
 
struct  std::hash< API_ElemType >
 std::hash specialization for API_ElemType. More...
 
struct  API_Elem_Head
 General element header for element types. More...
 
struct  API_ElemPartId
 Identify a part of an element. It's valid for PolyRoof and Morph only. More...
 
struct  API_HatchOrientation
 Fill orientation and distortion parameters. More...
 
struct  API_CoverFillTransformation
 Fill orientation and distortion parameters. More...
 
struct  API_SyTran
 Symbol transformation parameters. More...
 
struct  API_StoryVisibility
 Determines the appearance of model elements on different stories. More...
 
struct  API_LinkToSettings
 Option for linking model elements to their home stories. More...
 
struct  API_EdgeTrim
 Describes the parameters of a roof or slab edge. In previous API versions this structure used to be called API_RoofSide. More...
 
struct  API_ArrowData
 Describes the arrows at line ends. More...
 
struct  API_NoteType
 Describes a general note, used in dimensioning and hatch text. More...
 
struct  API_Gable
 Defines a cutting plane applied to spatial elements. More...
 
struct  API_WallType
 Represents a wall element. More...
 
struct  API_CWSegmentPatternCellData
 Represents a curtain wall segment cell. More...
 
struct  API_CWSegmentPatternData
 Represents the horizontal (primary) or vertical (secondary) pattern of a Curtain Wall segment. More...
 
struct  API_CWSegmentType
 Represents a curtain wall segment element. More...
 
struct  API_CWFrameType
 Represents a Curtain Wall Frame element. More...
 
struct  API_CWPanelType
 Represents a Curtain Wall Panel element. More...
 
struct  API_CWJunctionType
 Represents a curtain wall junction element. More...
 
struct  API_CWAccessoryType
 Represents a curtain wall accessory element. More...
 
struct  API_CurtainWallType
 Represents a Curtain Wall element. More...
 
struct  API_AssemblySegmentData
 Represents an general segment. More...
 
struct  API_AssemblySegmentSchemeData
 Represents a segment scheme. More...
 
struct  API_AssemblySegmentProfileData
 Represents an segment of the beam element. More...
 
struct  API_AssemblySegmentCutData
 Represents a cut on segment. More...
 
struct  API_ColumnSegmentType
 Represents an segment of the column element. More...
 
struct  API_ColumnType
 Represents a column element. More...
 
struct  API_BeamSegmentType
 Represents an segment of the beam element. More...
 
struct  API_Beam_Hole
 Describes a beam hole. More...
 
struct  API_BeamType
 Represents a beam element. More...
 
struct  API_VerticalLink
 Option for anchoring the vertical position of an opening within the wall or the roof. More...
 
struct  API_OpeningBaseType
 Represents the common part of window, door and skylight elements. More...
 
struct  API_WindowType
 Represents a window element. More...
 
struct  API_SkylightType
 Represents a skylight element. More...
 
struct  API_ObjectType
 Represents an object or a lamp, or a symbol label. More...
 
struct  API_SlabType
 Represents a slab element. More...
 
struct  API_ShellBaseType
 The common parameters of roof (API_RoofType) and shell (API_ShellType) elements. More...
 
struct  API_RoofLevelData
 Defines a level of a polyroof plane. This structure is used in API_PolyRoofData. More...
 
struct  API_Wrapping
 Texture wrapping parameters. This structure is used in API_LocalCoordsType. More...
 
struct  API_LocalCoordsType
 Texture applying parameters. This structure is used in API_LocalCoordsData. More...
 
struct  API_LocalCoordsData
 Dynamic array of API_LocalCoordsType items. This structure is used in API_RoofSegmentData. More...
 
struct  API_RoofSegmentData
 Describes various properties/parameters of a roof segment that can be separately adjusted. This structure is used in API_PivotPolyEdgeData. More...
 
struct  API_PivotPolyEdgeData
 Complete polygon descriptor for polyroofs and shells. This structure is used in API_ElementMemo. More...
 
struct  API_PlaneRoofData
 This structure holds the Single-plane Roof specific data of API_RoofType. More...
 
struct  API_PolyRoofData
 This structure holds the Multi-plane Roof specific data of API_RoofType. More...
 
struct  API_RoofType
 Represents a roof element. More...
 
struct  API_ContourEdgeData
 Parameters of a shell contour edge. More...
 
struct  API_ShellShapeData
 Contains the profile data of the Shell element. This structure is used in API_ElementMemo. More...
 
struct  API_ShellContourData
 Shell contour or shell hole contour definition. This structure is used in API_ElementMemo. More...
 
struct  API_ExtrudedShellData
 This structure holds the Extruded Shell specific data of API_ShellType. More...
 
struct  API_RevolvedShellData
 This structure holds the Revolved Shell specific data of API_ShellType. More...
 
struct  API_RuledShellData
 This structure holds the Ruled Shell specific data of API_ShellType. More...
 
struct  API_ShellType
 Represents a shell element. More...
 
struct  API_MorphType
 Represents a morph element. More...
 
struct  API_MeshLevelCoord
 Describes one coordinate of a mesh level line. More...
 
struct  API_MeshLevel
 Defines the level lines of a mesh. More...
 
struct  API_MeshType
 Represents a mesh. More...
 
struct  API_MarkerData
 Describes the various parameters of dimension markers. More...
 
struct  API_Base
 The base of a non-static linear, angle or radial dimension element. More...
 
struct  API_DimBase
 Describes the base element for dimensioning. More...
 
struct  API_DimElem
 Describes a dimension element. More...
 
struct  API_DimensionType
 Describes a (linear) dimension. More...
 
struct  API_RadialDimensionType
 Represents a radial dimension. More...
 
struct  API_LevelDimensionType
 Represents a level dimension. More...
 
struct  API_AngleDimensionType
 Represents an angle dimension. More...
 
struct  API_TabType
 Describes a tabulator of a paragraph. More...
 
struct  API_RunType
 Describes a continous monostyle piece - called run - of a paragraph. More...
 
struct  API_ParagraphType
 Describes a paragraph of a text. More...
 
struct  API_TextType
 Represents a text, or a textual label. More...
 
struct  API_LabelType
 Represents a textual or a symbol label. More...
 
struct  API_ZoneType
 Represents a zone stamp. More...
 
struct  API_ExtendedPenType
 Describes the optionally overridden pen used for hatches. More...
 
struct  API_HatchType
 Represents a hatch element. More...
 
struct  API_LineType
 Represents a 2D line. More...
 
struct  API_PolyLineType
 Represents a 2D polyline. More...
 
struct  API_ArcType
 Represents an elliptical or circular arc. More...
 
struct  API_SplineDir
 Describes the control handles for Bezier-splines. More...
 
struct  API_SplineType
 Represents a cubic or Bezier-spline. More...
 
struct  API_HotspotType
 Represents a hotspot. More...
 
struct  API_PictureType
 Represents a figure (picture) element. More...
 
struct  API_SectionSegment
 Represents one segment of a section/elevation/interior elevation. More...
 
struct  API_MarkerLinkDataType
 This type manifestates as a "linkedMarker" named variable in the detail/worksheet, section and elevation API types, and used to set the referring properties of the marker. More...
 
struct  API_CutPlaneType
 Represents a section element. More...
 
struct  API_PerspCamPars
 Parameters of a perspective camera. More...
 
struct  API_LinkType
 Describes a link for cameras. More...
 
struct  API_CameraType
 Represents a single camera. More...
 
struct  API_PersCamSetPars
 Represents a perspective camera set. More...
 
struct  API_CamSetType
 Represents a camera set. More...
 
struct  API_DrawingTitle
 Specifies the drawing's title object. More...
 
struct  API_DrawingType
 Represents a drawing element. More...
 
struct  API_SectElemType
 Describes an element in the section window. More...
 
struct  API_DetailType
 Represents a detail/worksheet (detail/worksheet mark). More...
 
struct  API_HotlinkType
 Represents a Hotlink Module type or XRef type hotlink instance element. More...
 
struct  API_ChangeMarkerType
 Represents a ChangeMarker (a placeable element, not to be confused with the Change from the Change Manager palette). More...
 
struct  API_StairPolylineEdgeData
 Stores data of a stair polyline edge. More...
 
struct  API_StairPolylineVertexData
 Stores data of a stair polyline vertex. More...
 
struct  API_StairPolylineData
 Represents a Stair polyline (baseline or walking line). More...
 
struct  API_StairBoundaryVertexData
 Stores data of a stair boundary vertex. More...
 
struct  API_StairBoundaryEdgeData
 Stores data of a stair boundary edge. More...
 
struct  API_StairBoundaryData
 Represents a Stair boundary. More...
 
struct  API_StairLayoutData
 Represents the layout of a Stair element. More...
 
struct  API_StairRulesData
 Represents a the Rules and Standards of a Stair element. More...
 
struct  API_StairHeadroomData
 Description of the Stair Headroom. More...
 
struct  API_StairStructureDrainingData
 Represents the draining of a monolithic Stair Structure element. More...
 
struct  API_SideStairStructData
 Represents the data of a side supported Stair Structure element. More...
 
struct  API_MonolithStairStructData
 Represents the data of a monolithic Stair Structure element. More...
 
struct  API_StairStructureSymbolData
 Represents the data of a 2D symbol a Stair's Structure elements. More...
 
struct  API_StairMonolithStructureSymbolData
 >Represents the data of a monolith Stair's Structure elements. More...
 
struct  API_MonolithPartsVisibilityData
 Describes which types of monolith parts are visible. More...
 
struct  API_StairStructureComponentSettingsVisibilityOnStory
 Describes story's stair structure component visibility settings. More...
 
struct  API_StairStructureComponentSettingsVisibility
 Settings for visibility of the stair component strucutre. More...
 
struct  API_StairRiserType
 Represents a Riser element. More...
 
struct  API_StairTreadType
 Represents a Tread element. More...
 
struct  API_StairStructureType
 Represents a Stair Structure element. More...
 
struct  API_RailingHorizontalPosData
 Represents the horizontal alignment of a Railing subelement. More...
 
struct  API_RailingVerticalPosData
 Represents the vertical position of a Railing subelement. More...
 
struct  API_RailingFrameData
 Represents the boundaries of a Railing subelement. More...
 
struct  API_RailingDistributionData
 Represents the distribution of some Railing subelements. More...
 
struct  API_RailingPostType
 Represents a Railing Post element. More...
 
struct  API_RailingBalusterType
 Represents a Baluster element. More...
 
struct  API_RailingBalusterSetType
 Represents a Baluster Set element. More...
 
struct  API_RailingFinishType
 Represents the finish of a Rail End element. More...
 
struct  API_RailingRailEndType
 Represents a Rail/Handrail/Toprail End element. More...
 
struct  API_RailingRailConnectionType
 Represents a connection between two Rail/Handrail/Toprail elements. More...
 
struct  API_RailingNodeType
 Represents a Railing Node element. More...
 
struct  API_RailingToprailType
 Represents a Toprail element. More...
 
struct  API_RailingHandrailType
 Represents a Handrail element. More...
 
struct  API_RailingRailType
 Represents a Rail element. More...
 
struct  API_RailingInnerPostType
 Represents an Inner Post element. More...
 
struct  API_RailingPanelType
 Represents a Railing Panel element. More...
 
struct  API_RailingPatternType
 Represents a Railing Pattern element. More...
 
struct  API_RailingSegmentType
 Represents a Railing Segment element. More...
 
struct  API_RailingType
 Represents a Railing element. More...
 
struct  API_OpeningCutSurfacesParameters
 Cut surface parameters. More...
 
struct  API_OpeningOutlinesParameters
 Opening outlines parameters. More...
 
struct  API_OpeningCoverFillsParameters
 Opening cover fills parameters. More...
 
struct  API_OpeningReferenceAxisParameters
 Opening floor plan and section reference axis parameters. More...
 
struct  API_OpeningFloorPlanParameters
 Parameters of floor plan and section representation. More...
 
struct  API_OpeningExtrusionParameters
 Opening extrusion parameters. More...
 
struct  API_OpeningExtrusionGeometryData
 Extrusion geometry parameters. More...
 
struct  API_OpeningType
 Represents an opening element. More...
 
struct  API_ExternalElemType
 A struct containing the header and data of an external element type (see API_AnalyticalLinkType). More...
 
union  API_Element
 A union collecting all known element types. More...
 
struct  API_ElementMemo
 Describes the variable length additional data of elements. More...
 
struct  API_SubElement
 Helper structure to create / modify / get markers for window, door, section, elevation, interior elevation, detail, worksheet elements and curtain wall parts. More...
 
struct  API_WallPart
 Section of a wall segment that neighbours a border line of the room. More...
 
struct  API_Niche
 Structure describing a niche in a room. More...
 
struct  API_BeamPart
 Section of a beam that crosses the room. More...
 
struct  API_RoomRelation
 Structure for retrieving data related to a room. More...
 
struct  API_ConnectionGuidItem
 Represents a wall or beam connection. More...
 
struct  API_WallRelation
 Structure for retrieving connection data of a wall. More...
 
struct  API_BeamSegmentRelation
 Structure for retrieving connection data of a beam segment. More...
 
struct  API_BeamRelation
 Structure for retrieving connection data of a beam. More...
 
struct  API_CWPanelRelation
 Structure for retrieving connection data of a curtain wall panel, skylight, window or a door element. More...
 
struct  API_RoofRelation
 Structure for retrieving connection data of a roof or a shell element. More...
 
struct  API_WallQuantity
 Describes the different calculated values for walls. More...
 
struct  API_ColumnQuantity
 Describes the different calculated values for columns. More...
 
struct  API_ColumnSegmentQuantity
 Describes the different calculated values for column segments. More...
 
struct  API_BeamQuantity
 Describes the different calculated values for beams. More...
 
struct  API_BeamSegmentQuantity
 Describes the different calculated values for beam segments. More...
 
struct  API_WindowQuantity
 Describes the different calculated values for windows. More...
 
struct  API_SkylightQuantity
 Describes the different calculated values for skylight. More...
 
struct  API_ObjectQuantity
 Describes the different calculated values for objects. More...
 
struct  API_MorphQuantity
 Returns the morph quantity values. More...
 
struct  API_SlabQuantity
 Describes the different calculated values for slabs. More...
 
struct  API_MeshQuantity
 Describes the different calculated values for meshes. More...
 
struct  API_RoofQuantity
 Gives the different calculated values for roofs. More...
 
struct  API_ShellQuantity
 Returns the shell quantity values. More...
 
struct  API_HatchQuantity
 Describes the different calculated values for fills. More...
 
struct  API_ZoneAllQuantity
 Describes the different calculated values for zones. More...
 
struct  API_CurtainWallQuantity
 Describes the different calculated values for curtain walls. More...
 
struct  API_CWFrameQuantity
 Describes the different calculated values for curtain wall frames. More...
 
struct  API_CWPanelQuantity
 Describes the different calculated values for curtain wall panels. More...
 
struct  API_CWJunctionQuantity
 Describes the different calculated values for curtain wall junctions. More...
 
struct  API_CWAccessoryQuantity
 Describes the different calculated values for curtain wall accessories. More...
 
struct  API_StairQuantity
 Calculates values for stairs. More...
 
struct  API_StairTreadQuantity
 Calculated values for a stair tread. More...
 
struct  API_StairRiserQuantity
 Calculated values for the stair riser. More...
 
struct  API_StairStructureQuantity
 Calculated values for the stair structure. More...
 
struct  API_RailingQuantity
 Calculated values for a railing. More...
 
struct  API_RailingToprailQuantity
 Calculated values for a top rail. More...
 
struct  API_RailingHandrailQuantity
 Calculated values for a handrail. More...
 
struct  API_RailingRailQuantity
 Calculated values for the rails of the railing. More...
 
struct  API_RailingToprailEndQuantity
 Calculated values for the top rail end of the railing. More...
 
struct  API_RailingHandrailEndQuantity
 Calculated values for the handrail end of the railing. More...
 
struct  API_RailingRailEndQuantity
 Calculated values for the rail end of the railing. More...
 
struct  API_RailingToprailConnectionQuantity
 Calculated values for the top rail connection. More...
 
struct  API_RailingHandrailConnectionQuantity
 Calculated values for the handrail connection. More...
 
struct  API_RailingRailConnectionQuantity
 Calculated values for the rail connection. More...
 
struct  API_RailingPostQuantity
 Calculated values for the railing posts. More...
 
struct  API_RailingInnerPostQuantity
 Calculated values for the railing inner posts. More...
 
struct  API_RailingBalusterQuantity
 Calculated values for the balusters. More...
 
struct  API_RailingPanelQuantity
 Calculated values for railing panels. More...
 
struct  API_RailingSegmentQuantity
 Calculated values for the railing segments. More...
 
union  API_ElementQuantity
 Describes the different calculated values. More...
 
struct  API_QuantityPar
 Supplies extra information for some element quantity calculations. More...
 
struct  API_CompositeId
 Identifies the composite skin and sub-element. More...
 
struct  API_CompositeQuantity
 Describes the different calculated values for skins of composite or complex elements. More...
 
struct  API_ElemPartQuantity
 Describes the different calculated values for parts of an element. More...
 
struct  API_ElemPartCompositeQuantity
 Describes the different calculated values for skins of composite or complex elements. More...
 
struct  API_ElemPartSurfaceQuantity
 Describes the different calculated values for surfaces of elements. More...
 
class  API_Quantities
 Describes the different calculated values for skins of composite or complex elements. More...
 
struct  API_ElementQuantityMask
 Describes the filter for the different calculated values for elements. More...
 
class  API_QuantitiesMask
 Describes the filter for the different calculated values for skins and elements. More...
 
struct  API_PropertyObjectRefType
 The property object reference record. More...
 
struct  API_Obsolete_ComponentRefType
 The component reference record. More...
 
struct  API_DescriptorRefType
 The descriptor reference record. More...
 
struct  API_EditPars
 Transformation parameters for elements. More...
 
struct  API_CWallPanel
 A primitive triangle. More...
 
struct  API_ToolBoxItem
 Data of the active toolbox mode. More...
 
struct  API_OverrideStyle
 Specifies what is overridden and how, for an API_Element. More...
 
struct  API_RoomImage
 Structure for retrieving data related to a room. More...
 
struct  API_ElemSearchPars
 Structure to search for an element by coordinate. More...
 
struct  API_TextLinePars
 Represents some text to measure its length. More...
 
struct  API_ContentPars
 It is used at the ACAPI_Element_Change goodie function. More...
 
struct  API_CollisionElem
 A container for storing a collision element created by ACAPI_Element_GetCollisions. More...
 
struct  API_CollisionDetectionSettings
 Collision detection settings used by ACAPI_Element_GetCollisions. More...
 
struct  API_IFCPropertyHead
 IFC property header structure. More...
 
struct  API_IFCPropertyAnyValue
 IFC property base value data container. More...
 
struct  API_IFCPropertyValue
 IFC property value data container. More...
 
struct  API_IFCPropertySingleValue
 IFC property with a single value. More...
 
struct  API_IFCPropertyBoundedValue
 IFC property with a lowerbound and an upperbound value. More...
 
struct  API_IFCPropertyListValue
 IFC property with a list of values. More...
 
struct  API_IFCPropertyEnumeratedValue
 IFC property with a list of possible and selected value. More...
 
struct  API_IFCPropertyTableValue
 IFC property with a list of value pairs. More...
 
struct  API_IFCProperty
 IFC property container structure. More...
 
struct  API_IFCAttribute
 IFC attribute structure. More...
 
struct  API_IFCClassification
 IFC classification structure. More...
 
struct  API_IFCClassificationReference
 IFC classificationreference structure. More...
 

Typedefs

typedef GSErrCode __ACENV_CALL APIDefaultsChangeHandlerProc(const API_ToolBoxItem *defElemType)
 Callback procedure to receive notifications on changes in element defaults.
 
typedef GSErrCode __ACENV_CALL APIElementEventHandlerProc(const API_NotifyElementType *elemType)
 User supplied callback function for handling changes in elements.
 
typedef void __ACENV_CALL RoomReductionPolyProc(const API_RoomReductionPolyType *roomRed)
 Callback function to get reduction polygons of a room.
 
using API_DoorType = API_WindowType
 Represents a door element.
 
using API_LampType = API_ObjectType
 Represents an object or a lamp, or a symbol label.
 
using API_ElevationType = API_CutPlaneType
 Represents a elevation element.
 
using API_WorksheetType = API_DetailType
 Represents a worksheet (worksheet mark).
 
using API_ElementUserData = API_UserData
 A UserData attached to an Element.
 
using API_CWSegmentPart = API_WallPart
 Section of a curtain wall segment that neighbours a border line of the room.
 
using API_SkylightRelation = API_CWPanelRelation
 Structure for retrieving connection data of a curtain wall panel, skylight, window or a door element.
 
using API_WindowRelation = API_CWPanelRelation
 Structure for retrieving connection data of a curtain wall panel, skylight, window or a door element.
 
using API_DoorRelation = API_CWPanelRelation
 Structure for retrieving connection data of a curtain wall panel, skylight, window or a door element.
 
using API_ShellRelation = API_RoofRelation
 Structure for retrieving connection data of a roof or a shell element.
 
using API_DoorQuantity = API_WindowQuantity
 Describes the different calculated values for doors.
 
using API_LightQuantity = API_ObjectQuantity
 Describes the different calculated values for lights.
 
typedef bool API_ElemFilter[API_LastElemType+1]
 Array for filtering elements.
 
typedef GS::HashTable< API_Guid, GS::Array< API_GridElemID > > API_CWPanelGridIDTable
 This table contains the grid mesh identifiers for each Curtain Wall panel instance (these grid mesh cells are partly or fully covered by the panel).
 
using API_CircleType = API_ArcType
 Represents a circle (derived from the circular arc).
 
typedef API_CompositeQuantity API_CompositeQuantityMask
 Describes the filter for the different calculated values for skins.
 

Enumerations

enum  API_AnalyticalCurveType {
  API_AnalyticalCurve_LineType , API_AnalyticalCurve_ArcType , API_AnalyticalCurve_SplineType , API_AnalyticalCurve_BezierType ,
  API_AnalyticalCurve_EllipseType
}
 Describes the type of the Structural Analytical Model Curve. More...
 
enum  API_ElementDBEventID {
  APINotifyElement_BeginEvents = -1 , APINotifyElement_EndEvents = -2 , APINotifyElement_New = 1 , APINotifyElement_Copy = 2 ,
  APINotifyElement_Change = 3 , APINotifyElement_Edit = 4 , APINotifyElement_Delete = 5 , APINotifyElement_Undo_Created = 11 ,
  APINotifyElement_Undo_Modified = 12 , APINotifyElement_Undo_Deleted = 13 , APINotifyElement_Redo_Created = 14 , APINotifyElement_Redo_Modified = 15 ,
  APINotifyElement_Redo_Deleted = 16 , APINotifyElement_PropertyValueChange = 17 , APINotifyElement_ClassificationChange = 18
}
 Describes the cause of the element notification. More...
 
enum  API_ElemTypeID {
  API_ZombieElemID = 0 , API_WallID = 1 , API_ColumnID = 2 , API_BeamID = 3 ,
  API_WindowID = 4 , API_DoorID = 5 , API_ObjectID = 6 , API_LampID = 7 ,
  API_SlabID = 8 , API_RoofID = 9 , API_MeshID = 10 , API_DimensionID = 11 ,
  API_RadialDimensionID = 12 , API_LevelDimensionID = 13 , API_AngleDimensionID = 14 , API_TextID = 15 ,
  API_LabelID = 16 , API_ZoneID = 17 , API_HatchID = 18 , API_LineID = 19 ,
  API_PolyLineID = 20 , API_ArcID = 21 , API_CircleID = 22 , API_SplineID = 23 ,
  API_HotspotID = 24 , API_CutPlaneID = 25 , API_CameraID = 26 , API_CamSetID = 27 ,
  API_GroupID = 28 , API_SectElemID = 29 , API_DrawingID = 30 , API_PictureID = 31 ,
  API_DetailID = 32 , API_ElevationID = 33 , API_InteriorElevationID = 34 , API_WorksheetID = 35 ,
  API_HotlinkID = 36 , API_CurtainWallID = 37 , API_CurtainWallSegmentID = 38 , API_CurtainWallFrameID = 39 ,
  API_CurtainWallPanelID = 40 , API_CurtainWallJunctionID = 41 , API_CurtainWallAccessoryID = 42 , API_ShellID = 43 ,
  API_SkylightID = 44 , API_MorphID = 45 , API_ChangeMarkerID = 46 , API_StairID = 47 ,
  API_RiserID = 48 , API_TreadID = 49 , API_StairStructureID = 50 , API_RailingID = 51 ,
  API_RailingToprailID = 52 , API_RailingHandrailID = 53 , API_RailingRailID = 54 , API_RailingPostID = 55 ,
  API_RailingInnerPostID = 56 , API_RailingBalusterID = 57 , API_RailingPanelID = 58 , API_RailingSegmentID = 59 ,
  API_RailingNodeID = 60 , API_RailingBalusterSetID = 61 , API_RailingPatternID = 62 , API_RailingToprailEndID = 63 ,
  API_RailingHandrailEndID = 64 , API_RailingRailEndID = 65 , API_RailingToprailConnectionID = 66 , API_RailingHandrailConnectionID = 67 ,
  API_RailingRailConnectionID = 68 , API_RailingEndFinishID = 69 , API_BeamSegmentID = 70 , API_ColumnSegmentID = 71 ,
  API_OpeningID = 72 , API_ExternalElemID = 150
}
 The type of an element.API_ElemType variationID APIVarId_Generic. More...
 
enum  API_ElemVariationID {
  APIVarId_Generic = 0 , APIVarId_SymbStair = 'SYST' , APIVarId_WallEnd = 'WAEN' , APIVarId_Door = 'DOOR' ,
  APIVarId_Skylight = 'SKYL' , APIVarId_Object = 'SYMB' , APIVarId_GridElement = 'GREL' , APIVarId_Light = 'LIGH' ,
  APIVarId_CornerWindow = 'CRWD'
}
 Describes the subcategory of an element. More...
 
enum  API_CoverFillTransformationTypeID { API_CoverFillTransformationType_Global = 0 , API_CoverFillTransformationType_Rotated = 1 , API_CoverFillTransformationType_Distorted = 2 }
 Type of cover fill transformation. More...
 
enum  API_ElemDisplayOptionsID {
  API_Standard = 0 , API_StandardWithAbstract = 1 , API_CutOnly = 2 , API_OutLinesOnly = 3 ,
  API_AbstractAll = 4 , API_CutAll = 5
}
 Floor plan display options of construction elements. More...
 
enum  API_ElemProjectionModesID { API_Symbolic = 0 , API_Projected = 1 , API_Hybrid = 2 }
 Floor plan projection modes of construction elements. More...
 
enum  API_ElemViewDepthLimitationsID { API_ToFloorPlanRange = 0 , API_ToAbsoluteLimit = 1 , API_EntireElement = 2 }
 Depth limitation for the appearance of complex elements on the floor plan. More...
 
enum  API_EdgeTrimID {
  APIEdgeTrim_Vertical , APIEdgeTrim_Perpendicular , APIEdgeTrim_Horizontal , APIEdgeTrim_CustomAngle ,
  APIEdgeTrim_AlignWithCut
}
 Determines the type of the roof or slab edge trim. In previous API versions this enum type used to be called @ref API_RsideID. More...
 
enum  API_ArrowID {
  APIArr_EmptyCirc , APIArr_CrossCircIs , APIArr_FullCirc , APIArr_SlashLine15 ,
  APIArr_OpenArrow15 , APIArr_ClosArrow15 , APIArr_FullArrow15 , APIArr_SlashLine30 ,
  APIArr_OpenArrow30 , APIArr_ClosArrow30 , APIArr_FullArrow30 , APIArr_SlashLine45 ,
  APIArr_OpenArrow45 , APIArr_ClosArrow45 , APIArr_FullArrow45 , APIArr_SlashLine60 ,
  APIArr_OpenArrow60 , APIArr_ClosArrow60 , APIArr_FullArrow60 , APIArr_SlashLine90 ,
  APIArr_PepitaCirc , APIArr_BandArrow , APIArr_HalfArrowCcw15 , APIArr_HalfArrowCw15 ,
  APIArr_HalfArrowCcw30 , APIArr_HalfArrowCw30 , APIArr_HalfArrowCcw45 , APIArr_HalfArrowCw45 ,
  APIArr_HalfArrowCcw60 , APIArr_HalfArrowCw60 , APIArr_SlashLine75
}
 Describes the different arrow types.
 
enum  API_NoteContentType { API_NoteContent_Measured , API_NoteContent_Custom }
 Describes the type of the content. More...
 
enum  API_LblAnchorID { APILbl_MiddleAnchor = 0 , APILbl_TopAnchor = 1 , APILbl_BottomAnchor = 2 , APILbl_Underlined = 3 }
 Describes how the pointer line is connected to the Label text (in case of Text Labels).
 
enum  API_LeaderLineShapeID { API_Segmented = 0 , API_Splinear = 1 , API_SquareRoot = 2 }
 Describes the shape of the pointer line of Note text or Label. More...
 
enum  API_JustID { APIJust_Left = 0 , APIJust_Center , APIJust_Right , APIJust_Full }
 Describes the various justification options.
 
enum  API_ModelElemStructureType { API_BasicStructure , API_CompositeStructure , API_ProfileStructure }
 Determines the structure type of the element. More...
 
enum  API_WallReferenceLineLocationID {
  APIWallRefLine_Outside = 0 , APIWallRefLine_Center , APIWallRefLine_Inside , APIWallRefLine_CoreOutside ,
  APIWallRefLine_CoreCenter , APIWallRefLine_CoreInside
}
 Distinguishes among the different wall reference line locations. More...
 
enum  API_WallTypeID { APIWtyp_Normal , APIWtyp_Trapez , APIWtyp_Poly }
 Represents the different wall types.
 
enum  API_ZoneRelID { APIZRel_Boundary , APIZRel_ReduceArea , APIZRel_None , APIZRel_SubtractFromZone }
 Describes the relation of an element to a zone.
 
enum  API_CWSegmentTypeID { APICWSeT_Invalid = 0 , APICWSeT_Line , APICWSeT_Arc }
 Curtain wall segment type. More...
 
enum  API_CWSegmentCategoryID { APICWSeC_System = 0 , APICWSeC_Custom }
 Curtain wall segment type. More...
 
enum  API_CWSegmentGridOrigPosTypeID { APICWSeGridOrigin_StartWithPattern , APICWSeGridOrigin_StartFromCenter , APICWSeGridOrigin_AlignToCenter , APICWSeGridOrigin_EndWithPattern }
 Curtain wall segment grid origin pos type. More...
 
enum  API_CWFrameObjectTypeID { APICWFrObjectType_Invisible = 0 , APICWFrObjectType_GDL , APICWFrObjectType_InvisibleConnectedTurning , APICWFrObjectType_InvisibleConnectedStill }
 Curtain wall frame object type. More...
 
enum  API_CWPanelObjectTypeID { APICWPaObjectType_Generic = 0 , APICWPaObjectType_GDL }
 Curtain wall panel object type. More...
 
enum  API_CWJunctionCategoryID { APICWJunC_System = 0 , APICWJunC_Custom }
 Curtain wall junction category type. More...
 
enum  API_CWAccessoryCategoryID { APICWAccC_System = 0 , APICWAccC_Custom }
 Curtain wall accessory category type. More...
 
enum  API_CWBoundaryFramePosID { APICW_Boundary_Unknown = 0 , APICW_Boundary_OutSide , APICW_Boundary_Center , APICW_Boundary_Inside }
 Define curtain wall boundary frame position. More...
 
enum  API_CWPlacementID { APICW_Placement_AllGridPoints = 0 , APICW_Placement_Manual }
 Curtain wall junction placement type. More...
 
enum  API_AssemblySegmentLengthTypeID { APIAssemblySegment_Fixed = 0 , APIAssemblySegment_Proportional = 1 }
 The type of segment length.
 
enum  API_AssemblySegmentCutTypeID { APIAssemblySegmentCut_Horizontal = 0 , APIAssemblySegmentCut_Vertical = 1 , APIAssemblySegmentCut_Custom = 2 }
 The type of cut.
 
enum  API_VeneerTypeID { APIVeneer_Core = 0 , APIVeneer_Finish = 1 , APIVeneer_Other = 2 }
 Describes the veneer type of a column.
 
enum  API_BHoleTypeID { APIBHole_Rectangular , APIBHole_Circular }
 Determines the shape of the holes in the beam.
 
enum  API_BeamShapeTypeID { API_StraightBeam = 0 , API_HorizontallyCurvedBeam = 1 , API_VerticallyCurvedBeam = 2 }
 The type of segment length.
 
enum  API_SkylightFixModeID { APISkylightFixMode_Horizontal , APISkylightFixMode_Vertical }
 Skylight constrain in the Roof element.
 
enum  API_SkylightAnchorID {
  APISkylightAnchor_BC = 0 , APISkylightAnchor_BL = 1 , APISkylightAnchor_BR = 2 , APISkylightAnchor_TC = 3 ,
  APISkylightAnchor_TL = 4 , APISkylightAnchor_TR = 5
}
 Anchor point of the Skylight object.
 
enum  API_SlabReferencePlaneLocationID { APISlabRefPlane_Top = 0 , APISlabRefPlane_CoreTop , APISlabRefPlane_CoreBottom , APISlabRefPlane_Bottom }
 Location of slab's reference plane. More...
 
enum  API_ShellBaseCutBodyTypeID {
  APIShellBaseCutBody_Editable , APIShellBaseCutBody_ContoursDown , APIShellBaseCutBody_PivotLinesDown , APIShellBaseCutBody_UpwardsExtrusion ,
  APIShellBaseCutBody_DownwardsExtrusion
}
 These values affect the connection type of Roof and Shell elements (see on the Model tab page of the Roof/Shell Settings dialog). More...
 
enum  API_ShellBaseSegmentTypeID { APIShellBase_SegmentsByCircle , APIShellBase_SegmentsByArc }
 Arc decomposition method for polyroof pivot edges or revolved shells. An N integral number tells how many segments to generate and this enum determines how to use the number N.
 
enum  API_RoofEdgeTypeID {
  APIRoofEdgeType_Undefined = 0 , APIRoofEdgeType_Ridge , APIRoofEdgeType_Valley , APIRoofEdgeType_Gable ,
  APIRoofEdgeType_Hip , APIRoofEdgeType_Eaves , APIRoofEdgeType_Peak , APIRoofEdgeType_SideWall ,
  APIRoofEdgeType_EndWall , APIRoofEdgeType_RTDome , APIRoofEdgeType_RTHollow
}
 Determines the type of the roof edges. This type is used just for listing purposes. It can be set individualy for each edge of the roof, the default value is Undefined.
 
enum  API_RoofOverHangTypeID { API_OffsetOverhang = 1 , API_ManualOverhang = 2 }
 Type of the eaves overhang of Multi-plane Roofs.
 
enum  API_PolyRoofSegmentAngleTypeID { APIPolyRoof_SegmentAngleTypeSloped , APIPolyRoof_SegmentAngleTypeGable }
 Type of the segment of Multi-plane Roofs.
 
enum  API_ShellBaseContourEdgeTypeID {
  APIShellBaseContour_Undefined = 0 , APIShellBaseContour_Ridge , APIShellBaseContour_Valley , APIShellBaseContour_Gable ,
  APIShellBaseContour_Hip , APIShellBaseContour_Eaves , APIShellBaseContour_Peak , APIShellBaseContour_SideWall ,
  APIShellBaseContour_EndWall , APIShellBaseContour_RTDome , APIShellBaseContour_RTHollow
}
 Determines the type of the shell contour edge.
 
enum  API_MorphingRuleID { APIMorphingRule_Paired , APIMorphingRule_Smooth }
 Type of the morphing rule applied by the Ruled Shell.
 
enum  API_TextureProjectionTypeID {
  APITextureProjectionType_Invalid = 0 , APITextureProjectionType_Planar = 1 , APITextureProjectionType_Default = 2 , APITextureProjectionType_Cylindric = 3 ,
  APITextureProjectionType_Spheric = 4 , APITextureProjectionType_Box = 5
}
 Determines the type of the texture projection.
 
enum  API_MorphBodyTypeID { APIMorphBodyType_SurfaceBody , APIMorphBodyType_SolidBody }
 Determines the type of the morph body.
 
enum  API_MorphEdgeTypeID { APIMorphEdgeType_SoftHiddenEdge , APIMorphEdgeType_HardHiddenEdge , APIMorphEdgeType_HardVisibleEdge }
 Determines the type of the morph edge.
 
enum  API_WitnessID { APIWtn_None , APIWtn_Small , APIWtn_Large , APIWtn_Fix }
 Describes the various appearance options for witness lines.
 
enum  API_TextPosID { APIPos_Above , APIPos_In , APIPos_Below }
 Describes the various options for dimension text positioning.
 
enum  API_DirID {
  APIDir_Parallel , APIDir_Horizontal , APIDir_Vertical , APIDir_General ,
  APIDir_Radial , APIDir_ArcDim , APIDir_Perpendicular
}
 Defines various orientations for dimension and label texts.
 
enum  API_MarkerID {
  APIMark_CrossLine , APIMark_EmptyCirc , APIMark_SlashLine , APIMark_OpenArrow30 ,
  APIMark_ClosArrow30 , APIMark_FullArrow30 , APIMark_SlashLine45 , APIMark_CrossCirc ,
  APIMark_OpenArrow90 , APIMark_ClosArrow90 , APIMark_FullArrow90 , APIMark_FullCirc ,
  APIMark_PepitaCirc , APIMark_BandArrow , APIMark_OpenArrow60 , APIMark_ClosArrow60 ,
  APIMark_FullArrow60 , APIMark_SlashLine75
}
 Describes the various types of dimension markers.
 
enum  API_DimOriginID {
  APIDimOrigin_ProjectZero , APIDimOrigin_RefLevel1 , APIDimOrigin_RefLevel2 , APIDimOrigin_StoredOrigin ,
  APIDimOrigin_Altitude
}
 Describes the elevation dimension origin.
 
enum  API_DimLayoutID { API_Legacy = 0 , API_Flexible , API_Centered , API_LayoutOff }
 Describes the layouting algorithm of the dimension.
 
enum  API_CircleLevelDimensionFillID { API_EmptyFill , API_NorthwestBlack , API_NortheastBlack }
 Describe the circle style marker fill type of elevation dimension.
 
enum class  API_DimTextFillOrderID { FillAndContourUnderDimLine , FillAndContourAboveDimLine }
 Describes the drawing order of the text's fill and contour relative to the dimension line. More...
 
enum  API_AnchorID {
  APIAnc_LT , APIAnc_MT , APIAnc_RT , APIAnc_LM ,
  APIAnc_MM , APIAnc_RM , APIAnc_LB , APIAnc_MB ,
  APIAnc_RB
}
 Various options for anchor points.
 
enum  API_TabID { APITab_Left , APITab_Center , APITab_Right , APITab_Decimalpoint }
 Types of the tab. More...
 
enum  API_LblClassID { APILblClass_Text = 'TEXT' , APILblClass_Symbol = 'SYMB' }
 Describes the various types for a label.
 
enum  API_HatchSubType { API_FillHatch , API_BuildingMaterialHatch }
 Determines the subtype type of the hatch.
 
enum  API_PictureFormat {
  APIPictForm_Default , APIPictForm_Bitmap , APIPictForm_GIF , APIPictForm_TIFF ,
  APIPictForm_JPEG , APIPictForm_PNG
}
 Storage format of a picture. More...
 
enum  API_NameTypeValues { APIName_ViewOrSrcFileName = 0 , APIName_ViewIdAndName = 1 , APIName_CustomName = 2 }
 Specifies how the name of the drawing is assembled. More...
 
enum  API_NumberingTypeValues { APINumbering_ByLayout = 0 , APINumbering_ByViewId = 1 , APINumbering_CustomNum = 2 }
 Numbering method options of a drawing element. More...
 
enum  API_ColorModeValues { APIColorMode_OriginalColors = 0 , APIColorMode_BlackAndWhite = 1 , APIColorMode_GrayScale = 2 }
 Specifies output color transformation for drawing elements.
 
enum  API_PenTableUsageModeValues { APIPenTableUsageMode_UseOwnPenTable = 0 , APIPenTableUsageMode_UseModelPenTable = 1 , APIPenTableUsageMode_UsePenTableIndex = 2 }
 Specifies which pen table a drawing element uses.
 
enum  API_TitlePreviewModes { APITitlePreviewMode_DrawingWithTitle = 0 , APITitlePreviewMode_TitleOnly = 1 }
 Determines what is shown on the preview the drawing title. More...
 
enum  API_ChangeMarkerLinkType { APICMLT_CreateNewChange , APICMLT_Linked , APICMLT_Unlinked }
 Specifies the linkage type of a ChangeMarker, or the ChangeMarker Default.
 
enum  API_ChangeMarkerComponentType { APICMCT_HeadOnly , APICMCT_CloudOnly , APICMCT_HeadAndCloud }
 Specifies which parts of the Change Marker are visible.
 
enum  API_StairPolyTypeID {
  APISP_Undefined , APISP_BaseLine , APISP_LeftBoundary , APISP_RightBoundary ,
  APISP_Tread , APISP_Riser , APISP_WalkingLine , APISP_FloorPlanSymb ,
  APISP_BreakMark , APISP_DummyTreadLeading , APISP_DummyTreadTrailing
}
 Determines the type of a Stair boundary edge or vertex.
 
enum  API_StairPolyGeometryTypeID { APISG_Vertex , APISG_Edge , APISG_Surface }
 Determines the type of a Stair boundary edge or vertex.
 
enum  API_StairDLWinderNumTypeID { APIDWN_Max , APIDWN_Optimal , APIDWN_Fix , APIDWN_Uniform }
 Describes the mode for deciding the amount of winders in a divided landing.
 
enum  API_StairPartRoleID { APISR_Run = 0 , APISR_Landing = 1 }
 Represents the role of a stair subelement.
 
enum  API_OpeningFloorPlanDisplayModeTypeID { API_OpeningSymbolic , API_OpeningSymbolicCut , API_OpeningSymbolicOverhead }
 Floor plan display mode type of openings.
 
enum  API_OpeningFloorPlanConnectionModeTypeID { API_OpeningDisconnected , API_OpeningConnected }
 Representation type of openings divided by air space.
 
enum  API_OpeningFloorPlanOutlinesStyleTypeID { API_OpeningHideBorder , API_OpeningShowUncutBorder , API_OpeningShowOverheadBorder }
 Type of contours on open edges of outlines.
 
enum  API_OpeningBasePolygonTypeTypeID { API_OpeningBasePolygonRectangular , API_OpeningBasePolygonCircular , API_OpeningBasePolygonCustom }
 Opening base polygon type.
 
enum  API_OpeningConstraintTypeID { API_OpeningForcedVertical , API_OpeningForcedHorizontal , API_OpeningAligned , API_OpeningFree }
 Opening constraint.
 
enum  API_OpeningLimitTypeTypeID { API_OpeningLimitInfinite , API_OpeningLimitFinite , API_OpeningLimitHalfInfinite }
 Opening limit type.
 
enum  API_OpeningLinkedStatusTypeID { API_OpeningLinked , API_OpeningNotLinked }
 Linked dimensions type for rectangular and circular openings.
 
enum  API_SubElementType : UInt64 {
  APISubElement_MainMarker = 0x0000000000000001 , APISubElement_SHMarker = 0x0000000000000002 , APISubElement_CommonMarker = 0x0000000000000004 , APISubElement_CWFrameClass = 0x0000000000000008 ,
  APISubElement_CWPanelClass = 0x0000000000000010 , APISubElement_CWJunction = 0x0000000000000020 , APISubElement_CWAccessory = 0x0000000000000040 , APISubElement_StairRiser = 0x0000000000000080 ,
  APISubElement_StairTread = 0x0000000000000100 , APISubElement_StairStructure = 0x0000000000000200 , APISubElement_StairFPDMarker = 0x0000000000000400 , APISubElement_StairRCPDMarker = 0x0000000000000800 ,
  APISubElement_RailingNode = 0x0000000000001000 , APISubElement_RailingSegment = 0x0000000000002000 , APISubElement_RailingPost = 0x0000000000004000 , APISubElement_RailingInnerPost = 0x0000000000008000 ,
  APISubElement_RailingRail = 0x0000000000010000 , APISubElement_RailingHandrail = 0x0000000000020000 , APISubElement_RailingToprail = 0x0000000000040000 , APISubElement_RailingPanel = 0x0000000000080000 ,
  APISubElement_RailingBaluster = 0x0000000000100000 , APISubElement_RailingPattern = 0x0000000000200000 , APISubElement_RailingBalusterSet = 0x0000000000400000 , APISubElement_RailingRailEnd = 0x0000000000800000 ,
  APISubElement_RailingHandrailEnd = 0x0000000001000000 , APISubElement_RailingToprailEnd = 0x0000000002000000 , APISubElement_RailingRailConnection = 0x0000000004000000 , APISubElement_RailingHandrailConnection = 0x0000000008000000 ,
  APISubElement_RailingToprailConnection = 0x0000000010000000 , APISubElement_RailingFinish = 0x0000000020000000 , APISubElement_CWTag = 0x1000000000000000 , APISubElement_NoElem = 0x2000000000000000 ,
  APISubElement_NoParams = 0x4000000000000000
}
 Describes the filter for the different subtypes of elements. More...
 
enum  API_EditCmdID {
  APIEdit_Drag = 'DRAG' , APIEdit_Rotate = 'ROTZ' , APIEdit_Mirror = 'MIRR' , APIEdit_Elevate = 'ELEV' ,
  APIEdit_Stretch = 'STRE' , APIEdit_VertStretch = 'VSTR' , APIEdit_Resize = 'RSIZ' , APIEdit_General = 'GENE' ,
  APIEdit_PHeightStretch = 'PHST' , APIEdit_PDirStretch = 'PDST'
}
 Possible element transformations. More...
 
enum  API_SolidOperationID {
  APISolid_Substract = 'SSUB' , APISolid_SubstUp = 'SSUU' , APISolid_SubstDown = 'SSUD' , APISolid_Intersect = 'SINT' ,
  APISolid_Add = 'SADD'
}
 The type of the solid operation link between two construction elements. More...
 
enum  API_TrimTypeID { APITrim_No = 'TRNO' , APITrim_KeepInside = 'TRIN' , APITrim_KeepOutside = 'TROU' , APITrim_KeepAll = 'TRAL' }
 The type of the trim connection link between two construction elements. More...
 
enum  API_NeigID {
  APINeig_None = 0 , APINeig_Wall = 1 , APINeig_WallPl = 2 , APINeig_WallOn = 3 ,
  APINeig_WallPlOn = 4 , APINeig_Colu = 5 , APINeig_Beam = 6 , APINeig_BeamOn = 7 ,
  APINeig_BeamHole = 8 , APINeig_Wind = 9 , APINeig_WindHole = 10 , APINeig_Door = 11 ,
  APINeig_DoorHole = 12 , APINeig_Symb = 13 , APINeig_Light = 14 , APINeig_Ceil = 15 ,
  APINeig_CeilOn = 16 , APINeig_Roof = 17 , APINeig_RoofOn = 18 , APINeig_RBL = 19 ,
  APINeig_RBLOn = 20 , APINeig_Mesh = 21 , APINeig_MeshOn = 22 , APINeig_MeshRidge = 23 ,
  APINeig_MeshRidgeOn = 24 , APINeig_DimInt = 25 , APINeig_DimPt = 26 , APINeig_DimOn = 27 ,
  APINeig_RadDim = 28 , APINeig_LevDim = 29 , APINeig_AngDim = 30 , APINeig_AngDimOn = 31 ,
  APINeig_Word = 32 , APINeig_Label = 33 , APINeig_Room = 34 , APINeig_RoomStamp = 35 ,
  APINeig_RoomOn = 36 , APINeig_RoomRefPt = 37 , APINeig_Hatch = 38 , APINeig_HatchOn = 39 ,
  APINeig_Line = 40 , APINeig_LineOn = 41 , APINeig_PolyLine = 42 , APINeig_PolyLineOn = 43 ,
  APINeig_Arc = 44 , APINeig_ArcOn = 45 , APINeig_Circ = 46 , APINeig_CircOn = 47 ,
  APINeig_Spline = 48 , APINeig_SplineOn = 49 , APINeig_Hot = 50 , APINeig_CutPlane = 51 ,
  APINeig_CutPlOn = 52 , APINeig_Camera = 53 , APINeig_CamSet = 54 , APINeig_VirtSy = 55 ,
  APINeig_VirtSyOn = 56 , APINeig_PictObj = 57 , APINeig_Detail = 58 , APINeig_DetailPoly = 59 ,
  APINeig_DetailPolyOn = 60 , APINeig_DetailMarker = 61 , APINeig_Symb3D = 62 , APINeig_Light3D = 63 ,
  APINeig_Wind3D = 64 , APINeig_Door3D = 65 , APINeig_WindMark = 66 , APINeig_DoorMark = 67 ,
  APINeig_CutPlMarker = 68 , APINeig_WallPlClOff = 69 , APINeig_WallPlOnClOff = 70 , APINeig_SymbOn = 71 ,
  APINeig_WindOn = 72 , APINeig_DoorOn = 73 , APINeig_LightOn = 74 , APINeig_Note = 75 ,
  APINeig_SplineDir = 76 , APINeig_DrawingCenter = 77 , APINeig_DrawingFrame = 78 , APINeig_DrawingFrameOn = 79 ,
  APINeig_DrawingIDF = 80 , APINeig_DrawingIDFOn = 81 , APINeig_DrawingTitle = 82 , APINeig_DrawingTitleOn = 83 ,
  APINeig_Worksheet = 84 , APINeig_WorksheetPoly = 85 , APINeig_WorksheetPolyOn = 86 , APINeig_WorksheetMarker = 87 ,
  APINeig_Elevation = 88 , APINeig_ElevationOn = 89 , APINeig_ElevationMarker = 90 , APINeig_InteriorElevation = 91 ,
  APINeig_InteriorElevationOn = 92 , APINeig_InteriorElevationMarker = 93 , APINeig_SectionSegment = 94 , APINeig_SectionSegmentOn = 95 ,
  APINeig_SectionSegmentMarker = 96 , APINeig_CurtainWall = 97 , APINeig_CurtainWallOn = 98 , APINeig_CurtainWallCut = 99 ,
  APINeig_CurtainWallCutOn = 100 , APINeig_CWSegment = 101 , APINeig_CWSegmentOn = 102 , APINeig_CWSegmentBaseLine = 103 ,
  APINeig_CWSegmentBaseLineOn = 104 , APINeig_CWFrame = 105 , APINeig_CWFrameOn = 106 , APINeig_CWFrame3D = 107 ,
  APINeig_CWPanel = 108 , APINeig_CWPanel3D = 109 , APINeig_CWJunction = 110 , APINeig_CWJunction3D = 111 ,
  APINeig_CWAccessory = 112 , APINeig_CWAccessory3D = 113 , APINeig_Shell = 114 , APINeig_ShellOn = 115 ,
  APINeig_Skylight = 116 , APINeig_SkylightHole = 117 , APINeig_Skylight3D = 118 , APINeig_SkylightOn3D = 119 ,
  APINeig_SkylightOn = 120 , APINeig_SkylightMark = 121 , APINeig_Morph = 122 , APINeig_MorphOn = 123 ,
  APINeig_ChangeMarker = 124 , APINeig_ChangeMarkerPoly = 125 , APINeig_ChangeMarkerPolyOn = 126 , APINeig_ChangeMarkerMarker = 127 ,
  APINeig_ColuOn = 128 , APINeig_WordOn = 129 , APINeig_CurtainWallBaseLine = 130 , APINeig_CurtainWallBaseLineOn = 131 ,
  APINeig_StairOn = 132 , APINeig_Tread = 133 , APINeig_TreadOn = 134 , APINeig_Riser = 135 ,
  APINeig_RiserOn = 136 , APINeig_Stair = 137 , APINeig_StairStructure = 138 , APINeig_StairStructureOn = 139 ,
  APINeig_Railing = 140 , APINeig_RailingOn = 141 , APINeig_RailingToprail = 142 , APINeig_RailingToprailOn = 143 ,
  APINeig_RailingHandrail = 144 , APINeig_RailingHandrailOn = 145 , APINeig_RailingRail = 146 , APINeig_RailingRailOn = 147 ,
  APINeig_RailingPost = 148 , APINeig_RailingPostOn = 149 , APINeig_RailingInnerPost = 150 , APINeig_RailingInnerPostOn = 151 ,
  APINeig_RailingBaluster = 152 , APINeig_RailingBalusterOn = 153 , APINeig_RailingPanel = 154 , APINeig_RailingPanelOn = 155 ,
  APINeig_RailingToprailEnd = 156 , APINeig_RailingToprailEndOn = 157 , APINeig_RailingHandrailEnd = 158 , APINeig_RailingHandrailEndOn = 159 ,
  APINeig_RailingRailEnd = 160 , APINeig_RailingRailEndOn = 161 , APINeig_RailingToprailConnection = 162 , APINeig_RailingToprailConnectionOn = 163 ,
  APINeig_RailingHandrailConnection = 164 , APINeig_RailingHandrailConnectionOn = 165 , APINeig_RailingRailConnection = 166 , APINeig_RailingRailConnectionOn = 167 ,
  APINeig_RailingEndFinish = 168 , APINeig_RailingEndFinishOn = 169 , APINeig_BeamSegment = 170 , APINeig_BeamSegmentOn = 171 ,
  APINeig_ColumnSegment = 172 , APINeig_ColumnSegmentOn = 173
}
 Describes the various special points of elements. More...
 
enum  API_StructureDisplay { API_EntireStructure , API_CoreOnly , API_WithoutFinishes , API_StructureOnly }
 This is the enumeration of the Partial Structure Display. More...
 
enum  API_ImageViewID { APIImage_Model2D = 0 , APIImage_Model3D = 1 , APIImage_Section = 2 }
 View type identifier. More...
 

Functions

GSErrCode __ACENV_CALL ACAPI_Element_GetExtent (API_Box *extent, API_DatabaseUnId *databaseUnId=nullptr)
 Returns the drawing extent of the current database.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetExtent3D (API_Box3D *extent3D)
 Returns the model extent of the current database.
 
GSErrCode __ACENV_CALL ACAPI_Element_CalcBounds (const API_Elem_Head *elemHead, API_Box3D *extent3D)
 Returns the model extent of an element of the current database.
 
GSErrCode __ACENV_CALL ACAPI_Element_RoomReductions (const API_Guid *guid, RoomReductionPolyProc *roomReductionPolyProc)
 Returns reduction data assigned to a room of the current database.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetElementURLRef (API_Elem_Head *elem_Head, API_ElemURLRef *elemURLRef)
 Retrieves the URL reference assigned to an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_SetElementURLRef (API_Elem_Head *elemHead, API_ElemURLRef *elemURLRef)
 Assigns a URL reference to an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_RefreshElement (API_Elem_Head *elemHead, bool *force)
 Rebuilds (refreshes) a library part instance.
 
GSErrCode __ACENV_CALL ACAPI_Element_DrawElement (API_Elem_Head *elem_Head, UInt32 mask)
 Shows/draws an existing element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetCompoundInfoString (const API_Guid *elementGuid, GS::UniString *infoString)
 Returns the compound info string of the given element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetElementFromAnywhere (const API_Guid *guid, API_Element *element)
 Returns the element referred by guid irrespectively of the current database.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetElementInfoString (const API_Guid *elementGuid, GS::UniString *infoString)
 Returns the compound info string of the given element.
 
GSErrCode __ACENV_CALL ACAPI_Element_ChangeElementInfoString (const API_Guid *elementGuid, const GS::UniString *infoString)
 Changes the compound info string of the given element.
 
GSErrCode __ACENV_CALL ACAPI_Element_SearchElementByCoord (const API_ElemSearchPars *elemSearchPars, API_Guid *foundElement)
 Searches an element by a coordinate.
 
GSErrCode __ACENV_CALL ACAPI_Element_NeigToCoord (API_Neig *neig, API_Coord3D *coord3D, API_Coord3D *coord3DDocument=nullptr)
 Returns the coordinate of a neig.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetTextLineLength (API_TextLinePars *textLinePars, double *length)
 Returns the length of a line of text in mms.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetTextSizeFactor (short *api_fontID, double *textSizeFactor)
 Returns the ratio of the font capital size and typography size.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetElemCreatorToolUnId (API_Elem_Head *elemHead, char *unIDStr)
 Returns the unique ID of the creator tool of the specified object.
 
GSErrCode __ACENV_CALL ACAPI_Element_SetEmptyHoleUnId (GSType *signature, const char *emptyHoleUnIdStr, const char *emptyOpeningSubtypeUnIDStr)
 Sets the unique ID of the empty hole.
 
GSErrCode __ACENV_CALL ACAPI_Element_ChangeContent (API_ContentPars *contentPars)
 Change the content of a text or a textual label element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetSkylightHolePolygon (const API_Guid *skylightGuid, Geometry::Polygon2D *holePoly)
 Returns the polygon data of a Skylight hole contour.
 
GSErrCode __ACENV_CALL ACAPI_Element_UI2ElemPriority (GS::Int32 *uiPriority, GS::Int32 *elemPriority)
 Returns user building material connection priority for a interface priority.
 
GSErrCode __ACENV_CALL ACAPI_Element_Elem2UIPriority (GS::Int32 *elemPriority, GS::Int32 *uiPriority)
 Returns user interface priority for a building material connection priority.
 
GSErrCode __ACENV_CALL ACAPI_Element_CalcSideOffsetToCoreOffset (const API_Guid *wallOpeningGuid, const double *sideOffset, double *coreOffset)
 Converts the reveal depth offset from wall side to core skin for wall openings.
 
GSErrCode __ACENV_CALL ACAPI_Element_CalcCoreOffsetToSideOffset (const API_Guid *wallOpeningGuid, const double *coreOffset, double *sideOffset)
 Converts the reveal depth offset from core skin to wall side for wall openings.
 
GSErrCode __ACENV_CALL ACAPI_Element_ElemHasVisibleSkin (const API_Guid *elemGuid, const API_StructureDisplay *structure, bool *result)
 Returns if elem has visible skin depending on Partial Structure Display.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetOpeningTransformation (const API_Guid *elemGuid, API_Tranmat *openingTranMat)
 Returns the position and the normal vector of the given opening.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetRoomImage (API_RoomImage *roomImage)
 Returns the image of the given room.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetElemTypeName (const API_ElemType &elemType, GS::UniString &elemName)
 Returns the localized name of the built-in element types.
 
GSErrCode __ACENV_CALL ACAPI_Element_NeigIDToElemType (API_NeigID neigID, API_ElemType &elemType)
 Returns the element type assigned to a neig.
 
GSErrCode __ACENV_CALL ACAPI_Element_ElemTypeToNeigID (const API_ElemType &elemType, API_NeigID &neigID)
 Returns a neig for the given element type.
 
GSErrCode __ACENV_CALL ACAPI_DisposeParagraphsHdl (API_ParagraphType ***paragraphs)
 Frees the memory occupied by a handle to an array of API_ParagraphType.
 
GSErrCode __ACENV_CALL ACAPI_DisposeElemMemoHdls (API_ElementMemo *memo)
 Frees the memory occupied by all of the allocated memo handles.
 
GSErrCode __ACENV_CALL ACAPI_DisposeRoomRelationHdls (API_RoomRelation *roomInfo)
 Frees the memory occupied by all of the allocated room relation handles.
 
void __ACENV_CALL ACAPI_DisposeWallRelationHdls (API_WallRelation *wallInfo)
 Frees the memory occupied by all of the allocated wall relation handles.
 
void __ACENV_CALL ACAPI_DisposeBeamSegmentRelationHdls (API_BeamSegmentRelation *segmentInfo)
 Frees the memory occupied by all of the allocated beam segment relation handles.
 
void __ACENV_CALL ACAPI_DisposeBeamRelationHdls (API_BeamRelation *beamInfo)
 Frees the memory occupied by all of the allocated beam relation handles.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetDefaults (API_Element *element, API_ElementMemo *memo)
 Retrieves the actual default settings for the element of type.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetDefaultsExt (API_Element *element, API_ElementMemo *memo, UInt32 nSubElems, API_SubElement *subElems)
 Retrieves the actual default settings for the Window, Door, Section, Elevation, Interior Elevation, ChangeMarker, Detail, Worksheet, or Stair element with its marker(s). You are able to obtain Curtain Wall and its subelem default settings also via this function.
 
GSErrCode __ACENV_CALL ACAPI_Element_ChangeDefaults (API_Element *element, API_ElementMemo *memo, const API_Element *mask)
 Changes the default parameters of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_ChangeDefaultsExt (API_Element *element, API_ElementMemo *memo, const API_Element *mask, UInt32 nSubElems, API_SubElement *subElems)
 Changes the default parameters of the Window, Door, Section, Elevation, Interior Elevation, ChangeMarker, Detail, Worksheet, or Stair default element and its marker(s). You are able to change Curtain Wall and its subelem default settings also via this function.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetElemList (const API_ElemType &type, GS::Array< API_Guid > *elemList, API_ElemFilterFlags filterBits=APIFilt_None, const API_Guid &renovationFilterGuid=APINULLGuid)
 Returns an array of guids of the elements of the given type.
 
bool __ACENV_CALL ACAPI_Element_Filter (const API_Guid &guid, API_ElemFilterFlags filterBits, API_ElemVariationID variationID=APIVarId_Generic, const API_Guid &renovationFilterGuid=APINULLGuid)
 Tests an element by some given criteria.
 
GSErrCode __ACENV_CALL ACAPI_Element_Get (API_Element *element, UInt32 mask=0)
 Returns information on the main parameters of a given element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetHeader (API_Elem_Head *elementHead, UInt32 mask=0)
 Returns general information on the given element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetMemo (const API_Guid &guid, API_ElementMemo *memo, UInt64 mask=APIMemoMask_All)
 Retrieves all additional information attached to elements.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetMemo_ExternalHierarchical (const API_Guid &guid, UInt32 nSubElems, API_SubElement *subElems, UInt64 mask=APIMemoMask_All)
 Retrieves all additional information of the sub elements of an external hierarchical element.
 
GSErrCode __ACENV_CALL ACAPI_Element_ChangeMemo (API_Guid &guid, UInt64 mask, const API_ElementMemo *memo)
 Changes the memo part of certain element types.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetRelations (const API_Guid &guid, const API_ElemType &otherType, void *relData, UInt32 mask=0)
 Returns information on objects connected to walls, beams, beam segments, rooms, shells, roofs, curtain wall panels, skylights, windows and doors.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetSyTran (const API_Elem_Head *elemHead, API_SyTran *syTran)
 Obtains the transformation parameters of an actual instance of a library part.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetHotspots (const API_Guid &guid, GS::Array< API_ElementHotspot > *hotspotArray)
 Retrieves the hotspots of the given element.
 
GSErrCode __ACENV_CALL ACAPI_Element_Create (API_Element *element, API_ElementMemo *memo)
 Places a new element into current database.
 
GSErrCode __ACENV_CALL ACAPI_Element_CreateExt (API_Element *element, API_ElementMemo *memo, UInt32 nSubElems, API_SubElement *subElems)
 Places a new Window, Door, Skylight, Section, Elevation, Interior Elevation, ChangeMarker, Detail, or Worksheet element with the specified marker into the current database.
 
GSErrCode __ACENV_CALL ACAPI_Element_ChangeParameters (const GS::Array< API_Guid > &elemGuids, const API_Element *defPars, const API_ElementMemo *defMemo, const API_Element *mask)
 Changes the parameters of a number of elements.
 
GSErrCode __ACENV_CALL ACAPI_Element_Change (API_Element *element, const API_Element *mask, const API_ElementMemo *memo, UInt64 memoMask, bool withdel)
 Modifies an element in the current database.
 
GSErrCode __ACENV_CALL ACAPI_Element_ChangeMore (GS::Array< API_Guid > &elemGuids, const API_Element *defPars, const API_ElementMemo *defMemo, const API_Element *mask, UInt64 memoMask, bool withdel)
 Modifies a number of elements in the current database.
 
GSErrCode __ACENV_CALL ACAPI_Element_ChangeExt (API_Element *element, const API_Element *mask, API_ElementMemo *memo, UInt64 memoMask, UInt32 nSubElems, API_SubElement *subElems, bool withdel, Int32 subIndex)
 Modifies a Window, Door, Section, Elevation, Interior Elevation, ChangeMarker, Detail, Worksheet, Stair or External element in the current database.
 
GSErrCode __ACENV_CALL ACAPI_Element_Delete (const GS::Array< API_Guid > &elemGuids)
 Deletes a number of elements.
 
GSErrCode __ACENV_CALL ACAPI_Element_DeleteSelected ()
 Deletes the selected elements.
 
GSErrCode __ACENV_CALL ACAPI_Element_Edit (GS::Array< API_Neig > *elemNeigs, const API_EditPars &pars)
 Transforms a set of elements.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetUserData (API_Elem_Head *elemHead, API_ElementUserData *userData, UInt32 mask=0)
 Obtains the user data attached to an element or an element default.
 
GSErrCode __ACENV_CALL ACAPI_Element_SetUserData (API_Elem_Head *elemHead, const API_ElementUserData *userData)
 Attaches the user data to an element or an element default.
 
GSErrCode __ACENV_CALL ACAPI_Element_AttachObserver (const API_Guid &elemGuid, GSFlags notifyFlags=0)
 Attaches an observer to the given element.
 
GSErrCode __ACENV_CALL ACAPI_Element_DetachObserver (const API_Guid &elemGuid)
 Detaches the observer from the given element.
 
GSErrCode __ACENV_CALL ACAPI_Element_SolidOperation_Create (API_Guid guid_Target, API_Guid guid_Operator, API_SolidOperationID operation, GS::Array< API_Guid > *guid_Results=nullptr)
 Creates a new Solid Operation.
 
GSErrCode __ACENV_CALL ACAPI_Element_SolidLink_Create (API_Guid guid_Target, API_Guid guid_Operator, API_SolidOperationID operation, GSFlags linkFlags)
 Defines a new Solid Operation Link.
 
GSErrCode __ACENV_CALL ACAPI_Element_SolidLink_Remove (API_Guid guid_Target, API_Guid guid_Operator)
 Discontinues a Solid Operation Link.
 
GSErrCode __ACENV_CALL ACAPI_Element_SolidLink_GetTime (API_Guid guid_Target, API_Guid guid_Operator, GSTime *linkTime, UInt32 *linkSubTime)
 Retrieves the creation time of a Solid Operation Link.
 
GSErrCode __ACENV_CALL ACAPI_Element_SolidLink_GetOperation (API_Guid guid_Target, API_Guid guid_Operator, API_SolidOperationID *operation)
 Retrieves the operation code of a Solid Operation Link.
 
GSErrCode __ACENV_CALL ACAPI_Element_SolidLink_GetFlags (API_Guid guid_Target, API_Guid guid_Operator, GSFlags *linkFlags)
 Retrieves the flag of a Solid Operation Link.
 
GSErrCode __ACENV_CALL ACAPI_Element_SolidLink_GetTargets (API_Guid guid_Operator, GS::Array< API_Guid > *guid_Targets)
 Retrieves the target elements linked to an operator element.
 
GSErrCode __ACENV_CALL ACAPI_Element_SolidLink_GetOperators (API_Guid guid_Target, GS::Array< API_Guid > *guid_Operators)
 Retrieves the operator elements linked to a target element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetQuantities (API_Guid elemGuid, const API_QuantityPar *params, API_Quantities *quantities, const API_QuantitiesMask *mask=nullptr)
 Returns information on the quantities parameters of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetMoreQuantities (const GS::Array< API_Guid > *elemGuids, const API_QuantityPar *params, GS::Array< API_Quantities > *quantities, const API_QuantitiesMask *mask=nullptr)
 Returns information on the quantities parameters of multiple elements of the same type.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetSurfaceQuantities (const GS::Array< API_Guid > *elemGuids, const GS::Array< API_Guid > *coverElemGuids, GS::Array< API_ElemPartSurfaceQuantity > *quantities)
 Returns information of the given elements surfaces.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyObjects (const API_Elem_Head *elemHead, API_PropertyObjectRefType ***propRefs, Int32 *nProp)
 Returns property objects of the element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetComponents_Obsolete (const API_Elem_Head *elemHead, API_Obsolete_ComponentRefType ***compRefs, Int32 *nComp)
 Returns the components of the element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetDescriptors (const API_Elem_Head *elemHead, API_DescriptorRefType ***descRef, Int32 *nDesc)
 Returns the descriptors of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_Trim_Elements (const GS::Array< API_Guid > &guid_ElementsToTrim)
 Trim elements given in the array with Roof(s) and/or Shell(s) are contained in the array.
 
GSErrCode __ACENV_CALL ACAPI_Element_Trim_ElementsWith (const GS::Array< API_Guid > &guid_ElementsToTrim, const API_Guid &guid_Element, API_TrimTypeID trimType)
 Trim elements given in the array with the given Roof or Shell with the type of trim.
 
GSErrCode __ACENV_CALL ACAPI_Element_Trim_Remove (const API_Guid &guid_Element1, const API_Guid &guid_Element2)
 Remove the trimming connection from the given elements.
 
GSErrCode __ACENV_CALL ACAPI_Element_Trim_GetTrimType (const API_Guid &guid_Element1, const API_Guid &guid_Element2, API_TrimTypeID *trimType)
 Get the type of trimming connection between the given elements.
 
GSErrCode __ACENV_CALL ACAPI_Element_Trim_GetTrimmedElements (const API_Guid &guid_Element, GS::Array< API_Guid > *guid_TrimmedElements)
 Get the trimmed elements with the given Roof or Shell in the array.
 
GSErrCode __ACENV_CALL ACAPI_Element_Trim_GetTrimmingElements (const API_Guid &guid_Element, GS::Array< API_Guid > *guid_TrimmingElements)
 Get the trimming elements of the given element in the array.
 
GSErrCode __ACENV_CALL ACAPI_Element_Merge_Elements (const GS::Array< API_Guid > &guid_ElementsToMerge)
 Merge elements given in the array.
 
GSErrCode __ACENV_CALL ACAPI_Element_Merge_GetMergedElements (const API_Guid &guid_Element, GS::Array< API_Guid > *guid_MergedElements)
 Get the merged elements of the given element in the array.
 
GSErrCode __ACENV_CALL ACAPI_Element_Merge_Remove (const API_Guid &guid_Element1, const API_Guid &guid_Element2)
 Remove the merge connection from the given elements.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetIFCIdentifier (const API_Guid &elementID, API_Guid &archicadIFCID, API_Guid &externalIFCID)
 Get IFC Identifier of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetElemListByIFCIdentifier (const API_Guid *archicadIFCID, const API_Guid *externalIFCID, GS::Array< API_Guid > &elements)
 Get elements having a certain IFC identifier.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetIFCType (const API_Guid &elementID, GS::UniString *ifcType, GS::UniString *typeObjectIFCType)
 Get IFC type and IfcTypeObject IFC type of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetIFCProperties (const API_Guid &guid_Element, bool storedOnly, GS::Array< API_IFCProperty > *properties)
 Get IFC properties of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_SetIFCProperty (const API_Guid &guid_Element, const API_IFCProperty &property)
 Set IFC property of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_RemoveIFCProperty (const API_Guid &guid_Element, const API_IFCProperty &property)
 Remove IFC property of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetIFCAttributes (const API_Guid &guid_Element, bool storedOnly, GS::Array< API_IFCAttribute > *attributes)
 Get IFC attributes of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_SetIFCAttribute (const API_Guid &guid_Element, const API_IFCAttribute &attribute)
 Set IFC attribute of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetIFCClassificationReferences (const API_Guid &guid_Element, bool storedOnly, GS::Array< API_IFCClassificationReference > *classificationReferences)
 Get IFC classificationreferences of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_SetIFCClassificationReference (const API_Guid &guid_Element, const API_IFCClassificationReference &classificationReference)
 Set IFC classificationreference of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_RemoveIFCClassificationReference (const API_Guid &guid_Element, const API_IFCClassificationReference &classificationReference)
 Remove IFC classificationreference of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetIFCPropertyValuePrimitiveType (const GS::UniString &valueType, API_IFCPropertyValuePrimitiveType *primitiveType)
 Get the primitive type of an IFC type.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetClassificationItems (const API_Guid &elemGuid, GS::Array< GS::Pair< API_Guid, API_Guid > > &systemItemPairs)
 Retrieves all of the classifications of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetClassificationItemsDefault (const API_ElemType &type, GS::Array< GS::Pair< API_Guid, API_Guid > > &systemItemPairs)
 Retrieves all of the classifications of a default elem.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetClassificationInSystem (const API_Guid &elemGuid, const API_Guid &systemGuid, API_ClassificationItem &item)
 Retrieves a classification of an elem in a given classification system.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetClassificationInSystemDefault (const API_ElemType &type, const API_Guid &systemGuid, API_ClassificationItem &item)
 Retrieves a classification of a default elem in a given classification system.
 
GSErrCode __ACENV_CALL ACAPI_Element_AddClassificationItem (const API_Guid &elemGuid, const API_Guid &itemGuid)
 Classifies an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_AddClassificationItemDefault (const API_ElemType &type, const API_Guid &itemGuid)
 Classifies an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_RemoveClassificationItem (const API_Guid &elemGuid, const API_Guid &itemGuid)
 Removes a classification from an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_RemoveClassificationItemDefault (const API_ElemType &type, const API_Guid &itemGuid)
 Removes a classification from an element.
 
bool __ACENV_CALL ACAPI_Element_IsClassificationItemVisible (const API_Guid &elemGuid, const API_Guid &classificationGuid)
 Tells whether a classification item is visible for an element.
 
bool __ACENV_CALL ACAPI_Element_IsClassificationItemVisibleDefault (const API_ElemType &type, const API_Guid &classificationGuid)
 Tells whether a classification item is visible for an element default.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetElementsWithClassification (const API_Guid &classificationItemGuid, GS::Array< API_Guid > &elemGuids)
 Query elements with the given classification.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyDefinitions (const API_Guid &elemGuid, API_PropertyDefinitionFilter filter, GS::Array< API_PropertyDefinition > &propertyDefinitions)
 Retrieves all of the property definitions that are available for an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValue (const API_Guid &elemGuid, const API_Guid &propertyDefinitionGuid, API_Property &property)
 Retrieves the specified property definition's value from the element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValues (const API_Guid &elemGuid, const GS::Array< API_PropertyDefinition > &propertyDefinitions, GS::Array< API_Property > &properties)
 Retrieves the specified property definitions with values.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValuesByGuid (const API_Guid &elemGuid, const GS::Array< API_Guid > &propertyDefinitions, GS::Array< API_Property > &properties)
 Retrieves the specified property definitions (defined by their GUIDs) with values.
 
GSErrCode __ACENV_CALL ACAPI_Element_SetProperty (const API_Guid &elemGuid, const API_Property &property)
 Sets the specified property for the given values on an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_SetProperties (const API_Guid &elemGuid, const GS::Array< API_Property > &properties)
 Sets the specified properties for the given values on an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyDefinitionsOfDefaultElem (const API_ElemType &type, API_PropertyDefinitionFilter filter, GS::Array< API_PropertyDefinition > &definitions)
 Retrieves all of the property definitions that are available for an element default.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValueOfDefaultElem (const API_ElemType &type, const API_Guid &propertyDefinitionGuid, API_Property &property)
 Retrieves the value of the specified property definition.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValuesOfDefaultElem (const API_ElemType &type, const GS::Array< API_PropertyDefinition > &propertyDefinitions, GS::Array< API_Property > &properties)
 Retrieves the values of the specified property definitions.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValuesOfDefaultElemByGuid (const API_ElemType &type, const GS::Array< API_Guid > &propertyDefinitionGuids, GS::Array< API_Property > &properties)
 Retrieves the values of the specified property definitions.
 
GSErrCode __ACENV_CALL ACAPI_Element_SetPropertyOfDefaultElem (const API_ElemType &type, const API_Property &property)
 Sets the specified property to the given value on an element default.
 
GSErrCode __ACENV_CALL ACAPI_Element_SetPropertiesOfDefaultElem (const API_ElemType &type, const GS::Array< API_Property > &properties)
 Sets the specified properties for the given values on an element default.
 
bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionValueEditable (const API_Guid &elemGuid, const API_Guid &propertyGuid)
 Tells whether the value of the property can be modified for the specified element. If the elemGuid argument is APINULLGuid, it tells whether the property definition's default value is editable.
 
bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionValueEditableDefault (const API_ElemType &type, const API_Guid &propertyGuid)
 Tells whether the value of the property can be modified for the specified tool default.
 
bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionAvailable (const API_Guid &elemGuid, const API_Guid &propertyGuid)
 Tells whether a property definition is available for an element.
 
bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionAvailableDefault (const API_ElemType &type, const API_Guid &propertyGuid)
 Tells whether a property definition is available for an element default.
 
bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionVisible (const API_Guid &elemGuid, const API_Guid &propertyGuid)
 Tells whether a property definition is visible for an element.
 
bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionVisibleDefault (const API_ElemType &type, const API_Guid &propertyGuid)
 Tells whether a property definition is visible for an element default.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetCollisions (const GS::Array< API_Guid > &guidSet1, const GS::Array< API_Guid > &guidSet2, GS::Array< GS::Pair< API_CollisionElem, API_CollisionElem > > &resultArray, const API_CollisionDetectionSettings &apiColDetSettings)
 Returns the collisions between two groups.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetComponents (const API_Guid &elemGuid, GS::Array< API_ElemComponentID > &elemComponents)
 Retrieves the components of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyDefinitions (const API_ElemComponentID &elemComponent, API_PropertyDefinitionFilter filter, GS::Array< API_PropertyDefinition > &propertyDefinitions)
 Retrieves all of the property definitions that are available for a component of an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValue (const API_ElemComponentID &elemComponent, const API_Guid &propertyDefinitionGuid, API_Property &property)
 Retrieves the specified property definition's value from the component.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValues (const API_ElemComponentID &elemComponent, const GS::Array< API_PropertyDefinition > &propertyDefinitions, GS::Array< API_Property > &properties)
 Retrieves the values of the specified property definitions from the component.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValuesByGuid (const API_ElemComponentID &elemComponent, const GS::Array< API_Guid > &propertyDefinitions, GS::Array< API_Property > &properties)
 Retrieves the specified property definitions (defined by their GUIDs) with values from the component.
 
GSErrCode __ACENV_CALL ACAPI_Element_GetActualOverrideStyle (const API_Guid &guid_Element, API_OverrideStyle &elemOverrideStyle)
 Get actual (merged) visual override style for an element.
 
GSErrCode __ACENV_CALL ACAPI_Element_Decompose (const API_Guid &elemGuid, API_ElementDecomposerInterface *elementDecomposer)
 Enumerates the planes of a Multi-plane Roof.
 
GSErrCode __ACENV_CALL ACAPI_Element_CatchChangeDefaults (const API_ToolBoxItem *elemType, APIDefaultsChangeHandlerProc *handlerProc)
 Register or unregister your add-on to be notified if the default settings of a given element type is modified.
 
GSErrCode __ACENV_CALL ACAPI_Element_CatchNewElement (const API_ToolBoxItem *elemType, APIElementEventHandlerProc *handlerProc)
 Register or unregister your add-on to be notified if the given type of element is created.
 
GSErrCode __ACENV_CALL ACAPI_Element_InstallElementObserver (APIElementEventHandlerProc *handlerProc)
 Installs an element observer function which receives notifications on elements' changes.
 
void ACAPI_ELEMENT_QUANTITIES_MASK_CLEAR (API_QuantitiesMask &mask)
 Clears the mask for querying quantities.
 
void ACAPI_ELEMENT_QUANTITIES_MASK_SETFULL (API_QuantitiesMask &mask)
 Set the mask to full (return all quantities) for querying quantities.
 
void ACAPI_ELEMENT_QUANTITY_MASK_CLEAR (API_QuantitiesMask &mask)
 Clears the element part of the mask for querying element quantities.
 
void ACAPI_ELEMENT_QUANTITY_MASK_SETFULL (API_QuantitiesMask &mask)
 Set the element part of the mask to full (return all quantities) for querying element quantities.
 
void ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_CLEAR (API_QuantitiesMask &mask)
 Clears the composites part of the mask for querying composite quantities.
 
void ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_SETFULL (API_QuantitiesMask &mask)
 Set the composites part of the mask to full (return all quantities) for querying composite quantities.
 

Detailed Description

To have an overview what the elements are, and how they fit into the entire database please refer to the Element Overview chapter. In these papers only the handler functions are explained in full details.

Element Overview

Applicable types of elements are enumerated in the API_ElemTypeID structure. The definition of an element is described in the API_Element structure, which is a union of all element types. All of the definitions begin with a common header structure named API_Elem_Head.

Every structure which describes a particular type of element (like API_WallType, API_LineType etc.) are logically separated into different parts.

Many element related functions use the API_Element structure on the parameter list. As a general rule, you have to fill the required fields in the union. Archicad parses the request based on the values, and passes the return parameters in the same structure. This is why most of the functions do not have the const directive in their prototypes.


Retrieving an element from the database

Please note that from API 11 we start to move away from the typeID/index identification towards a GUID-based identification. In API 12 the GUID way has precedence. From API 18 the GUID way is only available, typeID/index identification was removed.

Let's look at a simple example. Assume you are interested in getting the data of a given element of the database. In this case you should use a variable of type API_Element.

API_Element element = {};
GSErrCode err;
element.header.guid = GSGuid2APIGuid (GS::Guid ("EF7A21F7-F841-4030-B6DC-C1DC8DA2F1E6"));
err = ACAPI_Element_Get (&element);
API_Guid & GSGuid2APIGuid(GS::Guid &guid)
Definition: API_Guid.hpp:75
GSErrCode __ACENV_CALL ACAPI_Element_Get(API_Element *element, UInt32 mask=0)
Returns information on the main parameters of a given element.
API_Guid guid
The globally unique identifier of the element. It is type-independent, and guaranteed to be globally ...
Definition: APIdefs_Elements.h:375
A union collecting all known element types.
Definition: APIdefs_Elements.h:13390
API_Elem_Head header
General element header.
Definition: APIdefs_Elements.h:13395

The data of the wall is returned in the element.wall part of the union. You should check the hasMemo field in the returned header. If it is set you are informed that additional data is available for the element, such as gables and polygon nodes. Since producing this data may be a relatively a long conversion process, this information can be obtained with an additional function call.

GSErrCode err;
API_ElementMemo memo = {};
err = ACAPI_Element_GetMemo (element.header.guid, &memo, APIMemoMask_All);
GSErrCode __ACENV_CALL ACAPI_Element_GetMemo(const API_Guid &guid, API_ElementMemo *memo, UInt64 mask=APIMemoMask_All)
Retrieves all additional information attached to elements.
Describes the variable length additional data of elements.
Definition: APIdefs_Elements.h:13856

In this case, you have got all of the additional data related to the particular element. The memo structure is a collection of several handles and pointer (dynamic memory). If any is allocated (i.e. its value is not nullptr it contains data. If you do not need the data any more you are required to free the allocated memory blocks. The suggested way is the following:

GSErrCode __ACENV_CALL ACAPI_DisposeElemMemoHdls(API_ElementMemo *memo)
Frees the memory occupied by all of the allocated memo handles.

If you use this function, it is ensured that all of the dynamic data will be freed, and also there will be no compatibility problems if your add-on is installed to a newer version of Archicad.

It is very important to examine the error codes returned by the API functions, and interpret the returned value.

It is usual that you want to go through the instances of a particular type of element in the database. The following example gives a good template to do that:

GS::Array<API_Guid> elemList;
GSErrCode err = ACAPI_Element_GetElemList (API_WallID, &elemList);
for (Int32 i = 0; i < elemList.GetSize () && err == NoError; ++i) {
API_Element element = {};
element.header.guid = elemList[i];
if (ACAPI_Element_Get (&element) == NoError) {
/* do what you want */
}
}
GSErrCode __ACENV_CALL ACAPI_Element_GetElemList(const API_ElemType &type, GS::Array< API_Guid > *elemList, API_ElemFilterFlags filterBits=APIFilt_None, const API_Guid &renovationFilterGuid=APINULLGuid)
Returns an array of guids of the elements of the given type.

A better and suggested way to set up such a loop is to use the element filter service of the API. It is common that you are interested in elements being on the active story only or being on a visible layer, or just for editable elements, and so on. If you call the ACAPI_Element_Get function in a loop, Archicad is requested to convert all of the elements to API form, even if you do not need them. This algorithm can be very slow.

In the next example you see a very effective, fast way to get the elements only you are interested in:

GS::Array<API_Guid> elemList;
ACAPI_Element_GetElemList (API_WallID, &elemList, APIFilt_OnActFloor);
for (GS::Array<API_Guid>::ConstIterator it = elemList.Enumerate (); it != nullptr; ++it) {
API_Element element = {};
element.header.guid = *it;
if (ACAPI_Element_Get (&element) == NoError) {
/* do what you want */
}
}

You now see that the APIERR_DELETED return code is not checked, since all elements are filtered which do not meet your needs as well as the deleted ones.

You can also enumerate elements by drawing order and creation order with the [ACAPI_DrawOrder_DrawOrderGetNext and [AACAPI_DrawOrder_CreationOrderGetNext database functions respectively.


Creating an element

The element creation procedure is also fairly simple. All you have to do is to fill the appropriate part of the API_Element and optionally, the API_ElementMemo structure. The [ACAPIACAPI_Element_Create function does the following:

It is very important that Archicad does not free any dynamic data structure you have allocated and passed to Archicad. They must be freed by your code.

An other important note is the following. Every data structure filled by you must be initialized to zero, because of forward compatibility. Fillers may be used in the later versions of the API, so if they are not initialized to zero the result may be unpredictable.

The template to create an element should be the following:

API_Element element = {};
API_ElementMemo memo = {};
API_Guid wallGuid;
GSErrCode err;
element.header.type = API_WallID;
/* fill element.wall */
/* fill memo for polygonal walls */
err = ACAPI_Element_Create (&element, &memo);
wallGuid = element.header.guid;
GSErrCode __ACENV_CALL ACAPI_Element_Create(API_Element *element, API_ElementMemo *memo)
Places a new element into current database.
API_ElemType type
The type of the element.
Definition: APIdefs_Elements.h:367
Represents a GS::Guid in the API layer.
Definition: API_Guid.hpp:45

Many elements refer to each other and these cross-references can be set up very easily. You just have to follow the general logic of Archicad, which means that referred elements must exist. For example first you create a wall, then windows are placed in it, and also you can assign associated labels.

You also have to do the same using the API functions. The [ACAPI_Element_Create function returns the guid of the created element, which can be used in references. If you want to place a window in the created wall, and assign a label do the following:

element = {};
element.header.type = API_WindowID;
element.window.owner = wallGuid;
/* set other parameters... */
err = ACAPI_Element_Create (&element, nullptr);
element = {};
element.header.type = API_LabelID;
element.label.parent = wallGuid;
/* set other parameters... */
err = ACAPI_Element_Create (&element, nullptr);
API_Guid parent
Contains the type of the parent element, or API_ZombieElemID if the Label is independent....
Definition: APIdefs_Elements.h:7296
API_Guid owner
Reference to the container wall (see API_Guid).
Definition: APIdefs_Elements.h:3958
API_LabelType label
Represents a label.
Definition: APIdefs_Elements.h:13478
API_WindowType window
Represents a window.
Definition: APIdefs_Elements.h:13416

Controlling the selection

You can control the active selection also.

There are two basic type of selection methods in Archicad:

Both of them are supported by the API. The possible values of the active selection method are enumerated in the API_SelTypeID structure. The API_SelEmpty identifier means that nothing is selected in the current database in Archicad. The API_SelElems identifier corresponds to the first method when elements are individually selected. Other values identify that the selection is done by some kind of marquee shape.

In case of individually selected elements, Archicad returns all the elements which are selected. In the case of marquee based selection, only those elements will be returned which have an intersection with, or are within the marquee area.

The element selection procedure is very easy. You just have to call the ACAPI_Selection_Select function to select an individual element, or a group of elements. You have the possibility either to open a new selection, or append one more element to the actual selection.


Internal parts of an element: the API_Neig structure

Both the ACAPI_Selection_Select and ACAPI_Selection_Get functions use the API_Neig structure. This data structure makes possible to distinguish the internal parts of the elements.

You can see how smart the cursor is, when you touch one of the element's nodes or edges while moving it through the shape of a given element. All of these points or edges can be described by an API_Neig structure.

Let's see an example. According to the roofs the special interests are organized into three subclasses. They are:

neigID inIndex range Description
APINeig_Roof [1...n] Identifies one of the vertices of the roof polygon. The inIndex value corresponds to the position of the vertex in the vertex array. The holeSel bit in the flags is not set if the point belongs to the main contour of the roof polygon.
APINeig_RoofOn [1...n] Identifies one of the edges of the roof polygon. The inIndex value corresponds to the position of the starting vertex in the vertex array. The holeSel bit in the flags is set if the edge belongs to a subcontour of the roof polygon.
APINeig_RBL [1...2] Identifies the reference line of the roof. The inIndex value 1 and 2 means the start and end point of it, respectively.

When you go through the selected elements, you get the information which point or edge was clicked by the mouse when the selection was made. The only useful information according to the selection is whether a whole polygonal element is selected or just one of its sub-contours.

If you search the API_Neig structure in the APIdefs_Elements.h file, you will see that it is used in many places.

It is used to give you information on which point was clicked in the input functions; see the [AACAPI_UserInput_GetPoint function.


The 3D model

Warning
Obsolete. The recommended way of accessing the 3D Model is now illustrated in the ModelAccess example.

The 3D representation of the actual database can be accessed through the API_Component3D structure.

Applicable types of elements are enumerated in the API_3DTypeID structure. The definition of a 3D component is described in the API_Component3D structure, which is in fact a union of all component types. All of the definitions begins with a common header structure, API_3D_Head.

Before you try to understand how the 3D model corresponds to the API structures, please read carefully the Primitive Elements chapter in the GDL Reference Manual.

The 3D representation of a particular element is based on the API_BodyType structure. One element may hold one or more bodies to describe the 3D geometry. Generally a body is built up from a number of vertices, edges, polygons and normal vectors. This data structure gives you the number of the internal components as well as some status bits, surface properties and a global transformation matrix. You also get a reference to the parent element through an API_Elem_Head structure.

The 3D geometry itself is described by the API_PgonType, API_PedgType, API_EdgeType, API_VertType and API_VectType structures. They are documented in the GDL Reference Manual.

The 3D representation also owns a common pool of the surface materials. The polygon instances of the geometry description refer to these materials by indices. One surface definition is described by the API_UmatType structure. Surface materials may come from two sources. The list of materials contains all the global material attributes which are referenced by any polygon of the 3D geometry. Materials may be defined in GDL scripts also.

Elements placed with the light tool on the floor plan may contain light emissions, defined via GDL scripts. All of the light sources present in the 3D geometry are described with the API_LghtType structure.


Getting the whole 3D model

Warning
Obsolete. The recommended way of accessing the 3D Model is now illustrated in the ModelAccess example.

If you are interested in the whole 3D model that actually exists, you should use the following template:

API_Component3D comp3D = {};
Int32 nBody, i;
GSErrCode err;
err = ACAPI_3D_GetNum (API_BodyID, &nBody);
comp3D.header.typeID = API_BodyID;
for (i = 1; i <= nBody && err == NoError; i++) {
comp3D.header.index = i;
err = ACAPI_3D_GetComponent (&comp3D);
if (err == NoError) {
/* explode the body into pgon, vert etc... */
}
if (err == APIERR_DELETED)
err = NoError;
}
API_3DTypeID typeID
Identifies the type of the component.
Definition: APIdefs_3D.h:71
Int32 index
The index field gives the current database index of the given component. Note that this number is not...
Definition: APIdefs_3D.h:76
General representation of a 3D component.
Definition: APIdefs_3D.h:631
API_3D_Head header
The common header which specify the type and database index of the given component.
Definition: APIdefs_3D.h:636

It is very important to organize your algorithm on a loop based on the component API_BodyType for the following reasons:

Once you have the definition of a body, you can set up inner loops to go through the primitives you are interested in. In the API_BodyType record you get the number of all internal components. Indices should start from 1.

The light and material components can be obtained in their own loops, because they are global (not body relative) components of the 3D model.

It is very important, that you get the data of the 3D model of Archicad that actually exists. This data is often not consistent with the floor plan elements. The update mechanism of the 3D window depends on many things, such as the switches in the preferences dialogs. As a general rule, you get the model which can be seen in the 3D window, if you use the above template.


Getting the 3D representation of a particular element

You also have the possibility to get the 3D representation of any particular floor plan element you are interested for. The basic mechanism is the same as in the previous example. The only difference is that you need the information which bodies belong to the given element.

Bodies assigned to a specific floor plan element can be obtained with the function ACAPI_ModelAccess_Get3DInfo. This function fills an API_ElemInfo3D structure to pass the index range of the main 3D data containers.

Important note: in this way the data you get is independent from the actually existing 3D model of Archicad. If the existing data is not consistent, Archicad converts the given element to 3D again to ensure the right result. As a general rule, you get the model which is fully synchronized to the actual floor plan data.

You should choose between the above mentioned ways to get the 3D model very carefully.

If you need consistent data you should choose the second way, setting up a loop which goes through the floor plan elements you are interested for. In this case you can get the 3D model element by element.

You often have to choose the first method. For example, if your add-on is called from the "Save As 3D" dialog, the data user wants to save is the data actually can be seen in the 3D window.

Typedef Documentation

◆ API_CWSegmentPart

Section of a curtain wall segment that neighbours a border line of the room.

Remarks
The API_WallPart structure is a member of API_RoomRelation. The following example shows how to interpret this data.
See also
API_WallPart

◆ API_DoorQuantity

Describes the different calculated values for doors.

Remarks
See also the window parameters in Appendix A of the GDL Reference manual. See also API_WindowQuantity.

◆ API_DoorRelation

Structure for retrieving connection data of a curtain wall panel, skylight, window or a door element.

Remarks
To learn more about the usage of this relation structure please refer to the ACAPI_Element_GetRelations function. See also API_CWPanelRelation.

◆ API_DoorType

Represents a door element.

Remarks
For door related memo data see the ACAPI_Element_GetMemo function.
See also
API_WindowType

◆ API_ElemFilter

API_ElemFilter

Array for filtering elements.

Remarks
This type is used in the API_GhostStoryType structure. The indices of this array correspond to the API_ElemTypeID enum values.

◆ API_ElevationType

Represents a elevation element.

Remarks
Most of the original structure members are now in API_SectionSegment. See also API_CutPlaneType.

◆ API_LampType

Represents an object or a lamp, or a symbol label.

Since
Archicad 26
Remarks
For beam related memo data see the ACAPI_Element_GetMemo function. See also API_ObjectType.

◆ API_LightQuantity

Describes the different calculated values for lights.

Remarks
These parameters are calculated from the 3D model of the light. See also API_ObjectQuantity.

◆ API_ShellRelation

Structure for retrieving connection data of a roof or a shell element.

Remarks
To learn more about the usage of this relation structure please refer to the ACAPI_Element_GetRelations function. See also API_RoofRelation.

◆ API_SkylightRelation

Structure for retrieving connection data of a curtain wall panel, skylight, window or a door element.

Remarks
To learn more about the usage of this relation structure please refer to the ACAPI_Element_GetRelations function. See also API_CWPanelRelation.

◆ API_WindowRelation

Structure for retrieving connection data of a curtain wall panel, skylight, window or a door element.

Remarks
To learn more about the usage of this relation structure please refer to the ACAPI_Element_GetRelations function. See also API_CWPanelRelation.

◆ API_WorksheetType

Represents a worksheet (worksheet mark).

Remarks
Refer to the ACAPI_Database_ChangeCurrentDatabase function to access and operate on the corresponding Detail/Worksheet database. For detail related memo data see the ACAPI_Element_GetMemo function.
See also
API_DetailType

◆ APIDefaultsChangeHandlerProc

typedef GSErrCode __ACENV_CALL APIDefaultsChangeHandlerProc(const API_ToolBoxItem *defElemType)

Callback procedure to receive notifications on changes in element defaults.

Parameters
defElemType[in] The element type the notification is coming for.
Returns
  • NoError - The function has completed with success.
Remarks
This is the function which will be called when your add-on requested notifications on element default chnages with ACAPI_Element_CatchChangeDefaults.

◆ APIElementEventHandlerProc

typedef GSErrCode __ACENV_CALL APIElementEventHandlerProc(const API_NotifyElementType *elemType)

User supplied callback function for handling changes in elements.

Parameters
elemType[in] This structure contains the various parameters identifying the element the notification is for.
Returns
  • NoError - The function has completed with success.
Remarks
This is the function which will be called when your add-on attached an observer to an element with ACAPI_Element_AttachObserver, i.e. you are interested in changes to an element. This is a common entry point to your add-on for all observed elements; the element in question is passed in the elemType parameter. The meaning of the notification parameters are desrcribed at the API_NotifyElementType structure.
Example
// -----------------------------------------------------------------------------
// Element event handler function
// -----------------------------------------------------------------------------
GSErrCode __ACENV_CALL ElementEventHandler (const API_NotifyElementType *elemType)
{
GSErrCode err = NoError;
char msgStr[256];
char elemStr[32];
API_Elem_Head elemHead;
API_Element parentElement;
BNZeroMemory (&parentElement, sizeof (API_Element));
ACAPI_Notification_GetParentElement (&parentElement, nullptr, 0, nullptr);
switch (elemType->notifID) {
case APINotifyElement_New:
BNZeroMemory (&elemHead, sizeof (API_Elem_Head));
if (GetElementTypeString (elemType->type, elemStr)) {
if (parentElement.header.guid != APINULLGuid)
sprintf (msgStr, "### API Notify Test: %s #%d created as a copy of #%d",
elemStr, APIGuidToString (elemType->guid).ToCStr ().Get (),
APIGuidToString (parentElement.header.guid).ToCStr ().Get ());
else
sprintf (msgStr, "### API Notify Test: %s #%d created", elemStr,
APIGuidToString (elemType->guid).ToCStr ().Get ());
elemHead.guid = elemType->guid;
err = ACAPI_Element_AttachObserver (&elemHead, 0);
} else
sprintf (msgStr, "### API Notify Test: Unknown element type created");
break;
default:
err = APIERR_NOTSUPPORTED;
break;
}
if (err == NoError)
ACAPI_WriteReport (msgStr, false);
return NoError;
} // ElementEventHandler
// -----------------------------------------------------------------------------
// Called after the Add-On has been loaded into memory
// -----------------------------------------------------------------------------
GSErrCode __ACENV_CALL Initialize (void)
{
API_ToolBoxItem elemType_Wall = { API_WallID, 0, 0, 0 };
// catch changes in defaults for all element types
GSErrCode err = ACAPI_Element_CatchNewElement (&elemType_Wall, ElementEventHandler);
return err;
} // Initialize
constexpr API_Guid APINULLGuid({})
Represents an empty API guid.
GSErrCode __ACDLL_CALL Initialize(void)
The main entry point of the add-on.
GS::UniString APIGuidToString(const API_Guid &guid)
Definition: API_Guid.hpp:96
void __ACENV_CALL ACAPI_WriteReport(const GS::UniString &format, bool withDial,...)
Writes a report string into the Report Windowot into a custom alert window.
GSErrCode __ACENV_CALL ACAPI_Element_CatchNewElement(const API_ToolBoxItem *elemType, APIElementEventHandlerProc *handlerProc)
Register or unregister your add-on to be notified if the given type of element is created.
GSErrCode __ACENV_CALL ACAPI_Element_AttachObserver(const API_Guid &elemGuid, GSFlags notifyFlags=0)
Attaches an observer to the given element.
GSErrCode __ACENV_CALL ACAPI_Notification_GetParentElement(API_Element *element, API_ElementMemo *memo, UInt64 mask, API_ElementUserData *userData)
Returns the parent of the actual element your addon received notification for.
General element header for element types.
Definition: APIdefs_Elements.h:362
Describes the element the notification is coming for, and the type of the notification.
Definition: APIdefs_Callback.h:390
API_ElementDBEventID notifID
The type of the notification.
Definition: APIdefs_Callback.h:395
Data of the active toolbox mode.
Definition: APIdefs_Environment.h:654

◆ RoomReductionPolyProc

typedef void __ACENV_CALL RoomReductionPolyProc(const API_RoomReductionPolyType *roomRed)

Callback function to get reduction polygons of a room.

Parameters
roomRed[out] Data of a room reduction polygon.
Remarks
You should implement this function and pass its address to the ACAPI_Element_RoomReductions function as a callback function if you want Archicad to send the polygons which reduce a room area. Archicad will send you all the area (polygon) which reduce the room area. Many information is provided, the polygon itself, the area, the reduction percent, and the type of the parent element. See API_RoomReductionPolyType for more details. Since Archicad 18, the first dummy element has been removed.

Enumeration Type Documentation

◆ API_AnalyticalCurveType

Describes the type of the Structural Analytical Model Curve.

Since
Archicad 25

◆ API_CoverFillTransformationTypeID

Type of cover fill transformation.

Remarks
This structure holds the API_CoverFillTransformation type of the cover fills of API_BeamType and API_ColumnType elements.

◆ API_CWAccessoryCategoryID

Curtain wall accessory category type.

Remarks
The API_CWAccessoryCategoryID type is used in the API_CWAccessoryType structure.

◆ API_CWBoundaryFramePosID

Define curtain wall boundary frame position.

Remarks
The API_CWBoundaryFramePosID type is used in the API_CWSegmentType structure.

◆ API_CWFrameObjectTypeID

Curtain wall frame object type.

Remarks
The API_CWFrameObjectTypeID type is used in the API_CWFrameType structure. The APICWFrObjectType_Generic and APICWFrObjectType_ButtGlazed types have been removed in Archicad 22.

◆ API_CWJunctionCategoryID

Curtain wall junction category type.

Remarks
The API_CWJunctionCategoryID type is used in the API_CWJunctionType structure.

◆ API_CWPanelObjectTypeID

Curtain wall panel object type.

Remarks
The API_CWPanelObjectTypeID type is used in the API_CWPanelType structure.

◆ API_CWPlacementID

Curtain wall junction placement type.

Remarks
The API_CWPlacementID type is used in the API_CWSegmentType structure.

◆ API_CWSegmentCategoryID

Curtain wall segment type.

Remarks
The API_CWSegmentCategoryID type is used in the API_CWSegmentType structure.

◆ API_CWSegmentGridOrigPosTypeID

Curtain wall segment grid origin pos type.

Remarks
The API_CWSegmentGridOrigPosTypeID type is used in the API_CWSegmentPatternData structure.

◆ API_CWSegmentTypeID

Curtain wall segment type.

Remarks
The API_CWSegmentTypeID type is used in the API_CWSegmentType structure.

◆ API_DimTextFillOrderID

enum class API_DimTextFillOrderID
strong

Describes the drawing order of the text's fill and contour relative to the dimension line.

Since
Archicad 26

◆ API_EdgeTrimID

Determines the type of the roof or slab edge trim. In previous API versions this enum type used to be called @ref API_RsideID.

Vertical roof side
Perpendicular roof side
Custom roof side

◆ API_EditCmdID

Possible element transformations.

Remarks
Refer to the API_EditPars structure for parametrization; or to the ACAPI_Element_Edit function to transform database elements.

◆ API_ElemDisplayOptionsID

Floor plan display options of construction elements.

Remarks
Element display option defines how a construction element appears on the floor plan.

◆ API_ElementDBEventID

Describes the cause of the element notification.

Remarks
This enumeration type is used in the API_NotifyElementType structure.

◆ API_ElemProjectionModesID

Floor plan projection modes of construction elements.

Remarks
Element projection mode defines how a construction element appears on the floor plan.

◆ API_ElemTypeID

The type of an element.API_ElemType variationID APIVarId_Generic.

Since
Archicad 26
Remarks
This is general constant which describes the different element types, and is used in most element-related operations. Use the API_FirstElemType and API_LastElemType defines in loops that enumerate all element types. With the ACAPI_Element_GetElemTypeName goody function you can retrieve the localized name of the element types.

◆ API_ElemVariationID

Describes the subcategory of an element.

Since
Archicad 25
Remarks
API_ElemVariationID is an extension of typeID (see API_Elem_Head). These are built in subcategories. But if you register an own subtype with ACAPI_LibraryPart_RegisterSubtype function you have to pass at first a four-character identifier the variationID (your signature). This is an arbitrary long value wherewith you can identify your own subtype. It is used only in case of library elems (object, lamp, window, door).

◆ API_ElemViewDepthLimitationsID

Depth limitation for the appearance of complex elements on the floor plan.

Remarks
For a display option, view depth limitation defines how much of an element appears on the floor plan. You can retrieve the current floor plan cut plane settings using the ACAPI_ProjectSetting_GetPreferences function with the API_FloorPlanCutDefinition structure.

◆ API_ImageViewID

View type identifier.

Remarks
This structure is used in API_VisualOverriddenImage.

◆ API_LeaderLineShapeID

Describes the shape of the pointer line of Note text or Label.

Remarks
API_SquareRoot type applies to Labels only.

◆ API_ModelElemStructureType

Determines the structure type of the element.

Remarks
Valid structure types of an element type are shown in the table below:
Element Type Basic Structure Composite Structure Profile Structure
API_WallID x x x
API_ColumnID, API_BeamID x x
API_SlabID, API_RoofID, API_ShellID x x

API_MeshType, API_MorphType and API_CurtainWallType always contain Building Materials, so they don't have this structure.

◆ API_NameTypeValues

Specifies how the name of the drawing is assembled.

Remarks
The options correspond to the different values in the Drawing Name popup on the Identification tabpage of the Drawing Settings dialog.

◆ API_NeigID

enum API_NeigID

Describes the various special points of elements.

Remarks
Here are the neigIDs with their inIndex in brackets for walls : Here are the neigIDs with their inIndex in brackets for columns : Here are the neigIDs with their inIndex in brackets for windows (and very similar for doors): Here are the neigIDs with their inIndex in brackets for objects (and very similar for lamps): Here are the neigIDs with their inIndex in brackets for slabs : Here are the neigIDs with their inIndex in brackets for roofs : Here are the neigIDs with their inIndex in brackets for meshes : Here are the neigIDs with their inIndex in brackets for dimensions : Here are the neigIDs with their inIndex in brackets for radial dimensions : Here are the neigIDs with their inIndex in brackets for level dimensions : Here are the neigIDs with their inIndex in brackets for angle dimensions : Here are the neigIDs with their inIndex in brackets for texts : Here are the neigIDs with their inIndex in brackets for labels : Here are the neigIDs with their inIndex in brackets for zones : Here are the neigIDs with their inIndex in brackets for hatches : Here are the neigIDs with their inIndex in brackets for lines : Here are the neigIDs with their inIndex in brackets for arcs : Here are the neigIDs with their inIndex in brackets for circles : Here are the neigIDs with their inIndex in brackets for splines : Here are the neigIDs with their inIndex in brackets for hotspots : Here are the neigIDs with their inIndex in brackets for cutplanes : Here are the neigIDs with their inIndex in brackets for cameras : Here are the neigIDs with their inIndex in brackets for virtual symbols : Here are the neigIDs with their inIndex in brackets for pictures : Here are the neigIDs with their inIndex in brackets for camera sets : Here are the neigIDs with their inIndex in brackets for beams : Here are the neigIDs with their inIndex in brackets for drawings :

◆ API_NoteContentType

Describes the type of the content.

Remarks
API_NoteContent_Auto has been removed in API 14.

◆ API_NumberingTypeValues

Numbering method options of a drawing element.

Remarks
The options correspond to the different values in the Drawing ID popup on the Identification tabpage of the Drawing Settings dialog.

◆ API_PictureFormat

Storage format of a picture.

Remarks
This enum is used when you convert a picture from a given format to another with the ACAPI_Conversion_ConvertPicture goody function. API_PictureFormat is also a part of the API_PictureType structure. You might also use MIME types for identifying the standard image formats instead of API_PictureFormat. See the ACAPI_Conversion_ConvertMimePicture goody function.

◆ API_ShellBaseCutBodyTypeID

These values affect the connection type of Roof and Shell elements (see on the Model tab page of the Roof/Shell Settings dialog).

Remarks
This enumeration type is used in the API_ShellBaseType structure.

◆ API_SlabReferencePlaneLocationID

Location of slab's reference plane.

Remarks
The API_SlabReferencePlaneLocationID enum is used in the API_SlabType structure. The following picture illustrates the different values:
Slab reference line
For a basic (homogenous) slab the possible values are APISlabRefPlane_Top or APISlabRefPlane_Bottom. For composite slabs all values are valid. It determines the reference position: so during input the level member in API_SlabType will refer to this position. The new offsetFromTop [output only] member tells you the distance of the reference position (level) from the top of the slab.

◆ API_SolidOperationID

The type of the solid operation link between two construction elements.

Remarks
These enumerators are used with the ACAPI_Element_SolidLink_Create, ACAPI_Element_SolidLink_GetOperation and ACAPI_Element_SolidOperation_Create functions.

◆ API_StructureDisplay

This is the enumeration of the Partial Structure Display.

Remarks
You are able to get and change the Partial Structure Display via ACAPI_Navigator_GetStructureDisplay and ACAPI_Navigator_ChangeStructureDisplay functions. This function allows you to display and output composite and complex elements in simplified form.

◆ API_SubElementType

enum API_SubElementType : UInt64

Describes the filter for the different subtypes of elements.

Since
Archicad 26
Remarks
This enumeration was renamed in Archicad 25, the previous name was API_SubElemMemoMaskType.

◆ API_TabID

enum API_TabID

Types of the tab.

Remarks
This enum is used in API_TabType structure. The only available value is APITab_Left because the other options are not implemented yet.

◆ API_TitlePreviewModes

Determines what is shown on the preview the drawing title.

Remarks
The values correspond to the different settings on the Title tabpage of the Drawing Settings dialog. Can be APITitlePreviewMode_DrawingWithTitle or APITitlePreviewMode_TitleOnly

◆ API_TrimTypeID

The type of the trim connection link between two construction elements.

Remarks
These enumerators are used with the ACAPI_Element_Trim_ElementsWith and ACAPI_Element_Trim_GetTrimType functions.

◆ API_WallReferenceLineLocationID

Distinguishes among the different wall reference line locations.

Remarks
These constants determine the location of the reference line in the wall. This - along with the new flipped member in API_WallType - replace the old API_WallDirID, and allow you to exactly position the reference line, instead of coding both this position and the 'flippedness' of the wall into one member. Imagine a horizontal unflipped composite wall drawn from left to right (as shown in the Composite Settings dialog): outside is the top, inside is the bottom.
Wall reference line location
Only composite walls may have a core-related reference line location; polygonal and complex walls always use @ref APIWallRefLine_Outside. Profiled walls don't use this member; their reference line always goes through their origin. When its value is APIWallRefLine_Center or @ref APIWallRefLine_CoreCenter, you cannot specify an offset in the API_WallType structure. The new offsetFromOutside output only member in API_WallType tells you the distance between the 'top' of the wall (as shown in the Composite Settings dialog) and the reference line's position.

Function Documentation

◆ ACAPI_DisposeBeamRelationHdls()

void __ACENV_CALL ACAPI_DisposeBeamRelationHdls ( API_BeamRelation beamInfo)

Frees the memory occupied by all of the allocated beam relation handles.

Parameters
beamInfo[in] Points to an API_BeamRelation structure which contains handles used for previous operations and not needed any more.
Returns
Remarks
This is the recommended way of disposing the beam relation handles for compatibility reasons, as in a later version of the API the API_BeamRelation structure might change.

◆ ACAPI_DisposeBeamSegmentRelationHdls()

void __ACENV_CALL ACAPI_DisposeBeamSegmentRelationHdls ( API_BeamSegmentRelation segmentInfo)

Frees the memory occupied by all of the allocated beam segment relation handles.

Parameters
segmentInfo[in] Points to an API_BeamSegmentRelation structure which contains handles used for previous operations and not needed any more.
Returns
Remarks
This is the recommended way of disposing the beam segment relation handles for compatibility reasons, as in a later version of the API the API_BeamSegmentRelation structure might change.

◆ ACAPI_DisposeElemMemoHdls()

GSErrCode __ACENV_CALL ACAPI_DisposeElemMemoHdls ( API_ElementMemo memo)

Frees the memory occupied by all of the allocated memo handles.

Parameters
memo[in] Points to an API_ElementMemo structure which contains handles used for previous operations and not needed any more.
Returns
Remarks
This is the recommended way of disposing the memo handles for compatibility reasons, as in a later version of the API the API_ElementMemo structure might change.

◆ ACAPI_DisposeParagraphsHdl()

GSErrCode __ACENV_CALL ACAPI_DisposeParagraphsHdl ( API_ParagraphType ***  paragraphs)

Frees the memory occupied by a handle to an array of API_ParagraphType.

Parameters
paragraphs[in] A handle to an array of API_ParagraphType.
Returns
Remarks
This is the recommended way of disposing the paragraph handles for compatibility reasons, as in a later version of the API the API_ParagraphType structure might change.

◆ ACAPI_DisposeRoomRelationHdls()

GSErrCode __ACENV_CALL ACAPI_DisposeRoomRelationHdls ( API_RoomRelation roomInfo)

Frees the memory occupied by all of the allocated room relation handles.

Since
Archicad 26
Parameters
roomInfo[in] Points to an API_RoomRelation structure which contains handles used for previous operations and not needed any more.
Returns
  • NoError - The function has completed with success.
Remarks
This is the recommended way of disposing the room relation handles for compatibility reasons, as in a later version of the API the API_RoomRelation structure might change.

◆ ACAPI_DisposeWallRelationHdls()

void __ACENV_CALL ACAPI_DisposeWallRelationHdls ( API_WallRelation wallInfo)

Frees the memory occupied by all of the allocated wall relation handles.

Parameters
wallInfo[in] Points to an API_WallRelation structure which contains handles used for previous operations and not needed any more.
Returns
Remarks
This is the recommended way of disposing the wall relation handles for compatibility reasons, as in a later version of the API the API_WallRelation structure might change.

◆ ACAPI_Element_AddClassificationItem()

GSErrCode __ACENV_CALL ACAPI_Element_AddClassificationItem ( const API_Guid elemGuid,
const API_Guid itemGuid 
)

Classifies an element.

Parameters
elemGuid[in] The identifier of the element which should receive the new classification.
itemGuid[in] The guid of the classification item, that should be added to the element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The elemGuid did not refer to a valid element or itemGuid did not refer to a valid classification item.
  • APIERR_READONLY - The element can not be modified (i.e. from a hotlink) or you do not have the right to classify elements in the current teamwork plan.
  • APIERR_BADCLASSIFICATION - The classification item is not available for the given element.

◆ ACAPI_Element_AddClassificationItemDefault()

GSErrCode __ACENV_CALL ACAPI_Element_AddClassificationItemDefault ( const API_ElemType type,
const API_Guid itemGuid 
)

Classifies an element.

Since
Archicad 26
Parameters
type[in] Type of the default element.
itemGuid[in] The guid of the classification item, that should be added to the element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The type did not refer to a valid default element or itemGuid did not refer to a valid classification item.
  • APIERR_READONLY - The element can not be modified (i.e. from a hotlink) or you do not have the right to classify elements in the current teamwork plan.
  • APIERR_BADCLASSIFICATION - The classification item is not available for the given element.
Remarks
From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.

◆ ACAPI_Element_AttachObserver()

GSErrCode __ACENV_CALL ACAPI_Element_AttachObserver ( const API_Guid elemGuid,
GSFlags  notifyFlags = 0 
)

Attaches an observer to the given element.

Parameters
elemGuid[in] Identifies the element to attach the observer to.
notifyFlags[in] Defines the behavior of the attached observer in certain database operations.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The referenced element cannot be found in the database.
Remarks
This function can be used to track changes in an element. After attaching the observer, the installed APIElementEventHandlerProc will be called with the appropriate notifications.

◆ ACAPI_Element_CalcBounds()

GSErrCode __ACENV_CALL ACAPI_Element_CalcBounds ( const API_Elem_Head elemHead,
API_Box3D extent3D 
)

Returns the model extent of an element of the current database.

Parameters
elemHead[in] the element reference
extent3D[out] the 3D enclose box of the element
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Any of the parameters are nullptr.
  • APIERR_BADID - elemHead->guid is invalid.
  • APIERR_DELETED - The element is deleted.
Remarks
This function is used to determine the model extent of an element. It can be used either to construction or 2D element. In the second case the vertical information will be not filled.

◆ ACAPI_Element_CalcCoreOffsetToSideOffset()

GSErrCode __ACENV_CALL ACAPI_Element_CalcCoreOffsetToSideOffset ( const API_Guid wallOpeningGuid,
const double *  coreOffset,
double *  sideOffset 
)

Converts the reveal depth offset from core skin to wall side for wall openings.

Parameters
wallOpeningGuid[in] Unique ID of the WallOpening element.
coreOffset[in] Reveal depth offset from core skin.
sideOffset[out] Reveal depth offset from wall side.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - wallOpeningGuid or coreOffset or sideOffset is nullptr.
  • APIERR_BADID - wallOpeningGuid does not refer to a valid element in the database.
  • APIERR_REFUSEDPAR - The element specified with wallOpeningGuid is not WallOpening type, or owner wall of opening is not exist.
Remarks
This function can be used for wall openings in composite walls (side offset and core offset is equal in walls with basic structure).

◆ ACAPI_Element_CalcSideOffsetToCoreOffset()

GSErrCode __ACENV_CALL ACAPI_Element_CalcSideOffsetToCoreOffset ( const API_Guid wallOpeningGuid,
const double *  sideOffset,
double *  coreOffset 
)

Converts the reveal depth offset from wall side to core skin for wall openings.

Parameters
wallOpeningGuid[in] Unique ID of the WallOpening element.
sideOffset[in] Reveal depth offset from wall side.
coreOffset[out] Reveal depth offset from core skin.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - wallOpeningGuid or sideOffset or coreOffset is nullptr.
  • APIERR_BADID - wallOpeningGuid does not refer to a valid element in the database.
  • APIERR_REFUSEDPAR - The element specified with wallOpeningGuid is not WallOpening type, or owner wall of opening is not exist.
Remarks
This function can be used for wall openings in composite walls (side offset and core offset is equal in walls with basic structure).

◆ ACAPI_Element_CatchChangeDefaults()

GSErrCode __ACENV_CALL ACAPI_Element_CatchChangeDefaults ( const API_ToolBoxItem elemType,
APIDefaultsChangeHandlerProc handlerProc 
)

Register or unregister your add-on to be notified if the default settings of a given element type is modified.

Parameters
elemType[in] Specifies the type of element for which your add-on should be notified. In order to receive notification on changing the default settings of any type of element, you simply pass nullptr as this parameter.
handlerProc[in] The callback procedure to call when notifications are sent out on changing the default settings of this element type. Specifying nullptr here means you don't need the notifications any more.
Returns
  • NoError - The required operation finished successfully.
  • APIERR_BADID - The elemType parameter contains an invalid type.
Remarks
This function enables the API tool add-on catch the modification of the default settings of a certain element type. Each time when one of the default parameters of the element type is modified the server application calls the supplied callback procedure of the add-on provided that it has been registered for this event previously. If you do not need to catch the changes of default settings any longer, please remember to unregister by calling ACAPI_Element_CatchChangeDefaults for the required element type with nullptr in the handlerProc parameter.
Example
// -----------------------------------------------------------------------------
// Defaults change handler function
// -----------------------------------------------------------------------------
GSErrCode __ACENV_CALL ChangeDefaultsHandler (const API_ToolBoxItem *defElemType)
{
char msgStr[256];
char elemStr[32];
if (GetElementTypeString (defElemType->type, elemStr))
sprintf (msgStr, "%s element type defaults changed", elemStr);
else
sprintf (msgStr, "Unknown element type defaults changed");
ACAPI_WriteReport (msgStr, false);
return NoError;
} // ChangeDefaultsHandler
// -----------------------------------------------------------------------------
// Called after the Add-On has been loaded into memory
// -----------------------------------------------------------------------------
GSErrCode __ACENV_CALL Initialize (void)
{
// catch changes in defaults for all element types
GSErrCode err = ACAPI_Element_CatchChangeDefaults (nullptr, ChangeDefaultsHandler);
return err;
} // Initialize
GSErrCode __ACENV_CALL ACAPI_Element_CatchChangeDefaults(const API_ToolBoxItem *elemType, APIDefaultsChangeHandlerProc *handlerProc)
Register or unregister your add-on to be notified if the default settings of a given element type is ...
API_ElemType type
Toolbox item element type.
Definition: APIdefs_Environment.h:659

◆ ACAPI_Element_CatchNewElement()

GSErrCode __ACENV_CALL ACAPI_Element_CatchNewElement ( const API_ToolBoxItem elemType,
APIElementEventHandlerProc handlerProc 
)

Register or unregister your add-on to be notified if the given type of element is created.

Parameters
elemType[in] Specifies the type of element for which your add-on should be notified. In order to receive notification on the creation of any type of elements, you simply pass nullptr as this parameter.
handlerProc[in] The callback procedure to call when notifications are sent out on creating this type of element. Specifying nullptr here means you don't need the notifications any more.
Returns
  • NoError - The requested operation finished successfully.
  • APIERR_BADID - The elemType parameter contains an invalid type.
Remarks
This function enables the API tool add-on catch the event of creating a certain type of element. Each time when an element of this type is created the server application calls the supplied handlerProc of your those add-ons which have been registered for this event previously. If you do not need to catch the creation of new elements any longer, please remember to unregister by calling ACAPI_Element_CatchNewElement for the required element type with nullptr in the handlerProc parameter.
Example
// -----------------------------------------------------------------------------
// Element event handler function
// -----------------------------------------------------------------------------
GSErrCode __ACENV_CALL ElementEventHandler (const API_NotifyElementType *elemType)
{
GSErrCode err = NoError;
char msgStr[256];
char elemStr[32];
API_Elem_Head elemHead;
API_Element parentElement;
BNZeroMemory (&parentElement, sizeof (API_Element));
ACAPI_Notification_GetParentElement (&parentElement, nullptr, 0, nullptr);
switch (elemType->notifID) {
case APINotifyElement_New:
BNZeroMemory (&elemHead, sizeof (API_Elem_Head));
if (GetElementTypeString (elemType->type, elemStr)) {
if (parentElement.header.guid != APINULLGuid)
sprintf (msgStr, "### API Notify Test: %s #%d created as a copy of #%d",
elemStr, APIGuidToString (elemType->guid).ToCStr ().Get (),
APIGuidToString (parentElement.header.guid).ToCStr ().Get ());
else
sprintf (msgStr, "### API Notify Test: %s #%d created", elemStr,
APIGuidToString (elemType->guid).ToCStr ().Get ());
elemHead.guid = elemType->guid;
err = ACAPI_Element_AttachObserver (&elemHead, 0);
} else
sprintf (msgStr, "### API Notify Test: Unknown element type created");
break;
default:
err = APIERR_NOTSUPPORTED;
break;
}
if (err == NoError)
ACAPI_WriteReport (msgStr, false);
return NoError;
} // ElementEventHandler
// -----------------------------------------------------------------------------
// Called after the Add-On has been loaded into memory
// -----------------------------------------------------------------------------
GSErrCode __ACENV_CALL Initialize (void)
{
API_ToolBoxItem elemType_Wall = { API_WallID, 0, 0, 0 };
// catch changes in defaults for all element types
GSErrCode err = ACAPI_Element_CatchNewElement (&elemType_Wall, ElementEventHandler);
return err;
} // Initialize

◆ ACAPI_Element_Change()

GSErrCode __ACENV_CALL ACAPI_Element_Change ( API_Element element,
const API_Element mask,
const API_ElementMemo memo,
UInt64  memoMask,
bool  withdel 
)

Modifies an element in the current database.

Parameters
element[in/out] Reference to the element to be modified, filled with the appropriate new parameters
mask[in] Optional parameter for masking the relevant fields of element
memo[in] The memo data to be changed. Optional parameter, can be nullptr
memoMask[in] Specifies the relevant parts of the memo parameter
withdel[in] Delete the original instance of the element, or keep it and create a new one
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE - The current database should be the floor plan, a section/elevation, a detail or a worksheet
  • APIERR_BADPARS - The passed element parameter is nullptr,
Remarks
With this function not only the setting type parameters of an element can be modified, but geometry data too. Unlike ACAPI_Element_ChangeParameters and ACAPI_Element_Edit, it works only on one element at a time. On return the guid field of the element header is filled in. Element connections and dimension chains are updated automatically. To change elements having associated markers use the ACAPI_Element_ChangeExt function instead. ACAPI_DisposeElemMemoHdls The following element types are supported:
Element type Notes
API_WallID cannot switch between polygon-based and non-polygon-based wall types; type, begC, endC and angle fields can be modified for non-polygonal walls only; the gables of the wall can be changed
API_ColumnID beside the setting parameters the origoPos, axisRotationAngle fields can be accessed directly; the gables, columnSegments, assemblySegmentCuts, assemblySegmentSchemes and assemblySegmentProfiles memos can be modified
API_BeamID beside the setting parameters the begC, endC fields can be accessed directly; the beamHoles, gables, beamSegments, assemblySegmentCuts, assemblySegmentSchemes and assemblySegmentProfiles memos can be modified
API_WindowID
API_DoorID
beside the setting parameters the following fields can be edited: objLoc, reflected, oSide, refSide, wallCutUsing, libInd; the gables and params memos can also be modified
API_ObjectID
API_LampID
beside the setting parameters the following fields can be edited: pos, libInd; the gables and params memos can also be modified
API_SlabID beside the setting parameters the polygon of the slab can be modified directly (coords, pends, parcs and vertexIDs memo handles)
API_RoofID beside the setting parameters the baseLine field, the polygon of the roof and the roof sides can be modified directly (coords, pends, parcs, vertexIDs and roofSides memo handles)
API_MeshID beside the setting parameters the polygon and ridge levels of the mesh can be modified directly (coords, pends, parcs vertexIDs, meshPolyZ, meshLevelCoords and meshLevelEndsmemo handles)
API_DimensionID beside the setting parameters the dimElems memo handle can be modified
API_RadialDimensionID beside the setting parameters the following fields can be edited: base, note
API_LevelDimensionID beside the setting parameters the following fields can be edited: loc, note1, note2, parentType, parentGuid
API_AngleDimensionID beside the setting parameters the note and base fields can be modified
API_TextID beside the setting parameters the following fields can be edited: loc, width, nonBreaking; the content and the style of the text can also be modified (textContent, paragraphs memo)
API_LabelID beside the setting parameters the following fields can be edited: begC, midC, endC, u.text (the same as API_TextID), u.symbol (the same as API_ObjectID); for textual label the content and the style of the text can also be modified (textContent, paragraphs memo); an associative Label cannot be made independent, and an independent Label cannot be made associative.
API_ZoneID beside the setting parameters the following fields can be edited: libInd, pos and the polygon of the zone (coords, pends, parcs, vertexIDs memo handles)
API_HatchID beside the setting parameters the following fields can be edited: note and the polygon of the hatch (coords, pends, parcs, vertexIDs memo handles)
API_LineID beside the setting parameters the begC, endC fields can be accessed directly
API_ArcID
API_CircleID
both the setting and geometry parameters can be modified with ACAPI_Element_Change
API_PolyLineID beside the setting parameters the the polygon data (coords, pends, parcs, vertexIDs memo handles) can be accessed directly
API_SplineID only the setting parameters can be modified with ACAPI_Element_Change in this version; geometry data, autoSmooth and closed fields cannot be accessed
API_HotspotID beside the setting parameters the following fields can be edited: pos, height
API_CutPlaneID beside the setting parameters the following fields can be edited: depth, leftDir
API_ChangeMarkerID beside the setting parameters the following fields can be edited: pos. It has effect only when the changed ChangeMarker has no polygon, i.e. it points to a single coordinate marked by pos.
API_DetailID
API_WorksheetID
beside the setting parameters the pos field and the polygon of the detail or worksheet (coords, pends, parcs, vertexIDs memo handles) can be accessed directly
API_SectElemID after modifying the parent element on the floor plan database, calling ACAPI_Element_Change for the section symbol element on the section database rebuilds the image of the modified element in the section window (use this to avoid unnecessary ACAPI_View_Rebuild and ACAPI_Database_RebuildCurrentDatabase calls). The function returns APIERR_DELETED if the parent element has been deleted or got out of the scope of the section; otherwise it gives back the new index of the refreshed section element.
API_MorphID in some cases changing the tranmat field effects the body points themselves and vice versa; the resulting body will be correct, but getting the tranmat field after setting might result different values inside
API_HotlinkID the type, and hotlinkGroupGuid fields can not be changed.
API_OpeningID Connected elements can not be removed or added.
API_ExternalElemID beside the setting parameters in case of non-hierarchical external elements params memos can also be modified
You can modify more elements at once with a single call of the ACAPI_Element_ChangeMore function.
Example
GSErrCode FlipWall (const API_Guid& wallGuid)
{
API_Element element, mask;
API_Coord c1, c2;
GSErrCode err = NoError;
BNZeroMemory (&element, sizeof (API_Element));
element.header.guid = wallGuid;
err = ACAPI_Element_Get (&element);
if (err != NoError)
return err;
c1 = element.wall.begC;
c2 = element.wall.endC;
if (err == NoError) {
ACAPI_ELEMENT_MASK_CLEAR (mask);
ACAPI_ELEMENT_MASK_SET (mask, API_WallType, begC);
ACAPI_ELEMENT_MASK_SET (mask, API_WallType, endC);
element.wall.begC = c2;
element.wall.endC = c1;
err = ACAPI_Element_Change (&element, &mask, nullptr, 0, true);
}
return err;
}
GSErrCode __ACENV_CALL ACAPI_Element_Change(API_Element *element, const API_Element *mask, const API_ElementMemo *memo, UInt64 memoMask, bool withdel)
Modifies an element in the current database.
A pair of Cartesian (real) coordinates.
Definition: APIdefs_Base.h:78
Represents a wall element.
Definition: APIdefs_Elements.h:1330
API_Coord begC
The start (beginning) coordinate of the wall.
Definition: APIdefs_Elements.h:1544
API_Coord endC
The end coordinate of the wall.
Definition: APIdefs_Elements.h:1549
API_WallType wall
Represents a wall.
Definition: APIdefs_Elements.h:13401

◆ ACAPI_Element_ChangeContent()

GSErrCode __ACENV_CALL ACAPI_Element_ChangeContent ( API_ContentPars contentPars)

Change the content of a text or a textual label element.

Parameters
contentPars[in/out] Parameters of the element and contents.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The input parameters are not given correctly.
  • APIERR_REFUSEDPAR - The passed element is not a text or a textual label.
  • APIERR_PAROVERLAP - The range overlaps two or more paragraphs.
  • APIERR_PAROVERFLOW - The beginning position (from) run over the content length.
  • APIERR_MEMFULL - Not enough memory.
Remarks
This function is used to modify the content of a multistyle text or textual label. The styles of the runs won't be lost. The new content piece will pick up the style (font, size, faceBits...) of the character on the from position in the original content. The content member of API_ContentPars should not contain line end characters and ranges may not overlap paragraphs. The another way to change the content is using ACAPI_Element_Change function. With it you can set the style of the text also by passing textContent and paragraphs handles in API_ElementMemo structure. Don't forget to free the allocated memory blocks. This function is a non-undoable data structure modifier function. See more details on this topic at Command Overview.
Example
Changing the content of a text element:

◆ ACAPI_Element_ChangeDefaults()

GSErrCode __ACENV_CALL ACAPI_Element_ChangeDefaults ( API_Element element,
API_ElementMemo memo,
const API_Element mask 
)

Changes the default parameters of an element.

Parameters
element[in] Contains the general parameters to which you would like to change the defaults.
memo[in][ Contains the special parameters to which you would like to change the defaults.
mask[in] Contains a mask that specifies which parameters you would like to change. The memo fields are always used when they contain valid data.
Returns
  • 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
  • APIERR_MEMFULL - Not enough memory to complete the operation
Remarks
This function is used to change the actual default settings for an element type. Only those parameters are changed where the corresponding field in the mask is not 0. The requested type is identified by the type field of the header. The memo parameter is used only in the case of API_WindowID, API_DoorID, API_ObjectID, API_LampID, API_RoomID, API_LabelID, API_PictureID and API_ExternalElemID. For library part-based elements, if memo is set to nullptr, the default parameters of the originating library part are used, otherwise the values are taken from the params field of memo. To retrieve the actual settings defaults use the ACAPI_Element_GetDefaults function. Only those parameters are required to fill in the element argument, which are marked to be changed. There are macros to set up the mask values correctly. They are:
Example
API_Element element, mask;
GSErrCode err;
BNZeroMemory (&element, sizeof (API_Element));
element.header.type = API_WallID;
err = ACAPI_Element_GetDefaults (&element, nullptr);
if (err == NoError) {
ACAPI_ELEMENT_MASK_CLEAR (mask);
ACAPI_ELEMENT_MASK_SET (mask, API_Elem_Head, layer);
element.header.layer = 27;
err = ACAPI_Element_ChangeDefaults (&element, nullptr, &mask);
}
GSErrCode __ACENV_CALL ACAPI_Element_ChangeDefaults(API_Element *element, API_ElementMemo *memo, const API_Element *mask)
Changes the default parameters of an element.
GSErrCode __ACENV_CALL ACAPI_Element_GetDefaults(API_Element *element, API_ElementMemo *memo)
Retrieves the actual default settings for the element of type.
API_AttributeIndex layer
The layer attribute index of the element.
Definition: APIdefs_Elements.h:401

◆ ACAPI_Element_ChangeDefaultsExt()

GSErrCode __ACENV_CALL ACAPI_Element_ChangeDefaultsExt ( API_Element element,
API_ElementMemo memo,
const API_Element mask,
UInt32  nSubElems,
API_SubElement subElems 
)

Changes the default parameters of the Window, Door, Section, Elevation, Interior Elevation, ChangeMarker, Detail, Worksheet, or Stair default element and its marker(s). You are able to change Curtain Wall and its subelem default settings also via this function.

Since
Archicad 25
Parameters
element[in] Contains the general parameters to which you would like to change the defaults. The element->header.type can be API_WindowID, API_DoorID, API_CutPlaneID, API_ElevationID, API_InteriorElevationID, API_ChangeMarkerID, API_DetailID, API_WorksheetID, API_CurtainWallID, API_CurtainWallPanelID, API_CurtainWallFrameID, API_CurtainWallJunctionID, API_CurtainWallAccessoryID, API_StairID or API_ExternalElemID.
memo[in][ Contains the special parameters to which you would like to change the defaults.
mask[in] Contains a mask that specifies which parameters you would like to change. The memo fields are always used when they contain valid data.
nSubElems[in] The number of subelems passed (0-3)
subElems[in] Usually the first marker contains the general marker parameters to which you would like to change the defaults. If this parameter is not nullptr then the header.type must be API_ObjectID. The mask specifies which parameters of the marker you would like to change. These fields are always used when they contain valid data. The second marker element is the Story Handle Marker where applicable. The third marker element is the common marker of the interior elevation element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The passed element parameter is nullptr.
  • APIERR_BADID - The element type should be API_WindowID, API_DoorID, API_CutPlaneID, API_ElevationID, API_InteriorElevationID, API_ChangeMarkerID, API_DetailID, API_WorksheetID, API_CurtainWallID, API_CurtainWallPanelID, API_CurtainWallFrameID, API_CurtainWallJunctionID, API_CurtainWallAccessoryID, API_StairID or API_ExternalElemID.
  • APIERR_MEMFULL - Not enough memory to complete the operation.
Remarks
This function is used to change the actual default settings for a Window, Door, Section, Elevation, Interior elevation, ChangeMarker, Detail or Worksheet element type, as an alternative of ACAPI_Element_ChangeDefaults. The marker parameters are optional, pass nullptr to keep them unchanged. For the detailed interpretation of the parameters refer to the ACAPI_Element_ChangeExt function. Only those parameters are changed where the corresponding field in the mask is not 0. The requested type is identified by the type field of the header. The memo parameter is used only in the case of API_WindowID and API_DoorID. For library part-based elements, if memo is set to nullptr, the default parameters of the originating library part are used, otherwise the values are taken from the params field of memo. To retrieve the actual settings defaults use the ACAPI_Element_GetDefaultsExt function. Only those parameters are required to fill in the element argument, which are marked to be changed. There are macros to set up the mask values correctly. They are:
Mask function Behavior
ACAPI_ELEMENT_MASK_CLEAR Clear all the flags in the mask
ACAPI_ELEMENT_MASK_SETFULL Set all the flags in the mask
ACAPI_ELEMENT_MASK_SET Set only one flag in the mask according to one element parameter
ACAPI_ELEMENT_MASK_CHECK Check the mask for one element parameter
Remember to call ACAPI_DisposeElemMemoHdls to dispose of the passed handles.

◆ ACAPI_Element_ChangeElementInfoString()

GSErrCode __ACENV_CALL ACAPI_Element_ChangeElementInfoString ( const API_Guid elementGuid,
const GS::UniString *  infoString 
)

Changes the compound info string of the given element.

Parameters
elementGuid[in] the Guid of the element
infoString[in] the info string of the element
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - any of the parameters is nullptr
  • APIERR_BADID - no element found by the specified Guid
  • APIERR_BADELEMENTTYPE - element has no info string

◆ ACAPI_Element_ChangeExt()

GSErrCode __ACENV_CALL ACAPI_Element_ChangeExt ( API_Element element,
const API_Element mask,
API_ElementMemo memo,
UInt64  memoMask,
UInt32  nSubElems,
API_SubElement subElems,
bool  withdel,
Int32  subIndex 
)

Modifies a Window, Door, Section, Elevation, Interior Elevation, ChangeMarker, Detail, Worksheet, Stair or External element in the current database.

Since
Archicad 25
Parameters
element[in/out] Reference to the element to be modified, filled with the appropriate new parameters
mask[in] Optional parameter for masking the relevant fields of element
memo[in] The memo data to be changed. Optional parameter, can be nullptr
memoMask[in] Specifies the relevant parts of the memo parameter. You can use a special mask value (ACAPI_ELEMENT_CHANGEEXT_ALLSEGMENTS) to change all segment of an interior elevation element.
nSubElems[in] The number of subelems (markers) passed (0-3).
subElems[in] Contains the markers (default marker, story handle marker, interior elevation common marker) to be modified.
withdel[in] Delete the original instance of the element, or keep it and create a new one
subIndex[in] The index of the section segment to be modified (for interior elevations only). The value is between 0 and the (number of segments - 1).
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE - The current database should be floor plan, section/elevation, detail or worksheet.
  • APIERR_BADPARS - The passed element parameter is nullptr,
Remarks
This function is an extension of ACAPI_Element_Change to modify elements with their linked sub-elements. With this function not only the setting type parameters of an element can be modified, but geometry data too. Unlike ACAPI_Element_ChangeParameters and ACAPI_Element_Edit, it works only on one element at a time. On return the guid field of the element and elementMarker header is filled in. Element connections and dimension chains are updated automatically. Do not forget to call ACAPI_DisposeElemMemoHdls to dispose the memo handles when they are not needed any more. The following element types are supported:
element memo elementMarker memoMarker elementMarker2 memoMarker2
API_WindowType
API_DoorType
addpar window/door marker object marker object parameters - -
API_CutPlaneType cutplane coordinates section marker object on floorplan section marker object parameters story handle marker object on section story handle marker object parameters
API_ElevationType elevation coordinates elevation marker object on floorplan elevation marker object parameters story handle marker object on section story handle marker object parameters
API_ChangeMarkerType polygon data (optional) ChangeMarker marker object marker object parameters - -
API_WindowType
API_DoorType
addpar window/door marker object marker object parameters - -
|API_ExternalElemType | - | hierarchical subelement 1 | addpar | hierarchical subelement 2 | addpar | etc.

◆ ACAPI_Element_ChangeMemo()

GSErrCode __ACENV_CALL ACAPI_Element_ChangeMemo ( API_Guid guid,
UInt64  mask,
const API_ElementMemo memo 
)

Changes the memo part of certain element types.

Parameters
guid[in] Guid of the element.
mask[in] Specifies which part of a memo should be changed. Currently only APIMemoMask_Polygon is supported.
memo[in] The replacement memo. Don't forget to dispose of it with ACAPI_DisposeElemMemoHdls when you are done.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - You called the function for element types other then slabs or roofs.
  • APIERR_BADPARS - You called the function with a mask value other than APIMemoMask_Polygon, or you specified wrong parameters.
Remarks
This function is used to change the memo part of certain element types. Currently you can change only the polygon data of polygonal elements. It is recommended to use the ACAPI_Element_Change function instead.

◆ ACAPI_Element_ChangeMore()

GSErrCode __ACENV_CALL ACAPI_Element_ChangeMore ( GS::Array< API_Guid > &  elemGuids,
const API_Element defPars,
const API_ElementMemo defMemo,
const API_Element mask,
UInt64  memoMask,
bool  withdel 
)

Modifies a number of elements in the current database.

Parameters
elemGuids[in/out] This parameter identifies the elements to be modified.
defPars[in] The parameters of the new element.
defMemo[in] The memo of the new element. (Only if needed.)
mask[in] The mask of the new element.
memoMask[in] The memo mask of the new element. (Only if needed.)
withdel[in] Delete the original instances of elements, or keep them and create new ones
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE - The current database should be the floor plan a section/elevation a detail a layout or a master layout.
  • APIERR_BADPARS - The passed defParams parameter is nullptr,
Remarks
This function is an extension of ACAPI_Element_Change to modify more elements at the same time.

◆ ACAPI_Element_ChangeParameters()

GSErrCode __ACENV_CALL ACAPI_Element_ChangeParameters ( const GS::Array< API_Guid > &  elemGuids,
const API_Element defPars,
const API_ElementMemo defMemo,
const API_Element mask 
)

Changes the parameters of a number of elements.

Parameters
elemGuids[in] Identifies the element(s).
defPars[in] The parameters of the new element.
defMemo[in] The memo of the new element. (Only if needed.)
mask[in] The mask of the new element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - defPars is nullptr
  • APIERR_BADDATABASE - The current database is not proper for the operation
  • APIERR_MEMFULL - Not enough memory to complete the operation
Remarks
You can use this function to change the settings parameters of a number of elements, identified by elemGuids. If elemGuids is empty, then this function works on the selection. Only those elements are affected whose type is the same that passed in the defPars argument. Elements which are not allowed for edit for some reason, are ignored. Such cases can be:
  • it is locked,
  • it is on a locked layer,
  • it is part of a group, and suspend group is OFF
  • it is not in the users workspace, etc. This function can only be used to change the settings-type parameters of elements, but not their geometric parameters. Only those parameters are affected which are marked in the mask argument. Such elements which refer to Library Parts, the params handle from the memo is interpreted. If it is nullptr, nothing will happen. If it is passed, the actual parameter list will be changed. Refer to the ACAPI_Element_Change and the ACAPI_Element_ChangeDefaults functions, which work similarly. The following notes are absolutely important:
  • the list of target elements will be automatically extended by the other group members; if there are a group member in the set, and suspend group is OFF
  • all the edited elements keep their unique ID
  • all the inter-element links will be adjusted; including dimensioning also, Do not forget to call ACAPI_DisposeElemMemoHdls to dispose of the handles when you're finished.

◆ ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_CLEAR()

void ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_CLEAR ( API_QuantitiesMask mask)
inline

Clears the composites part of the mask for querying composite quantities.

Parameters
maskthe quantity mask to clear

◆ ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_SETFULL()

void ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_SETFULL ( API_QuantitiesMask mask)
inline

Set the composites part of the mask to full (return all quantities) for querying composite quantities.

Parameters
maskthe quantity mask to fill the composite part fully

◆ ACAPI_Element_Create()

GSErrCode __ACENV_CALL ACAPI_Element_Create ( API_Element element,
API_ElementMemo memo 
)

Places a new element into current database.

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).
Returns
  • 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.
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:
element->header.type memo fields Notes
API_WallID optional/required The gables are optional, the coords, pends, and parcs are required only for walls of type APIWtyp_Poly (polygon-based walls)
API_ColumnID optional (gables, assemblySegmentProfiles) required (columnSegments, assemblySegmentCuts, assemblySegmentSchemes)
API_BeamID optional (gables, beam holes, assemblySegmentProfiles) required (beamSegments, assemblySegmentCuts, assemblySegmentSchemes)
API_WindowID API_DoorID required (params) See also ACAPI_Element_CreateExt.
API_SkylightID required (params) See also ACAPI_Element_CreateExt.
API_ObjectID API_LampID required
API_SlabID required/optional The slab polygon is required; the edgeTrims and sideMaterials are optional.
API_RoofID required/optional The roof polygon is required; the edgeTrims, roofEdgeTypes and sideMaterials are optional. Besides these parameters for Multi-plane roofs the pivotPolyCoords, pivotPolyPends and pivotPolyParcs are also required; the pivotPolyEdges are optional.
API_MeshID required/optional The mesh polygon is required, the meshPolyZ (mesh points' Z coordinates), the meshLevelCoords (level line coordinates), and the meshLevelEnds (level lines' endpoints) fields are optional.
API_ShellID required/optional Shell shape data is required (first record of shellShapes for extruded and revolved shells, both records for ruled shells ; shellContours are optional.
API_MorphID required/optional The morphBody field is required and the morphMaterialMapTable field is optional.
API_DimensionID required (dimension data)
API_RadialDimensionID
API_AngleDimensionID
API_LevelDimensionID If the ceilNum is set to 0, the level dimension's reference is the floor, otherwise the given ceiling.
API_TextID required (content)
optional (paragraphs)
for multistyle content
API_LabelID optional (content) for textual labels
optional (paragraphs) for multistyle content
required (parameters) for symbol labels
API_ZoneID required (polygon and parameters)
API_HatchID required (fill polygon) If the hatchGlobal field is set to false (the fill is linked to an element), the refPos and refAngle fields are used to calculate the orientation, otherwise the global origin is used for this. If the showArea field is set to true, the note and the noteC fields are used for the appearance of the area, otherwise these fields are ignored.
API_LineID
API_ArcID
API_CircleID
API_PolyLineID required (polygon)
API_SplineID required/optional The curve point coordinates are required. If the bezierDirs field is nullptr (autoSmooth is true), the direction parameters are automatically calculated from the first two points' relative position (the autoSmooth field must be set to true in this case).
API_HotspotID
API_PictureID required (picture content)
API_DrawingID optional (polygon, drawing data)
API_CutPlaneID required The cutplane coordinates are required. See also ACAPI_Element_CreateExt.
API_ChangeMarkerID optional (polygon) See also ACAPI_Element_CreateExt.
API_DetailID API_WorksheetID optional (polygon) See also ACAPI_Element_CreateExt.
API_CameraID optional (linklist) Optional for panoramic cameras only.
API_CamSetID
API_SectElemID This type of element cannot be created.
API_StairID required (polyline)
API_RailingID required (polyline)
API_OpeningID 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_LibraryPart_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 ACAPI_Database_StartClippingSession function for details. In these case no information is returned, what indices, guids were generated, since more parts may be generated.

◆ ACAPI_Element_CreateExt()

GSErrCode __ACENV_CALL ACAPI_Element_CreateExt ( API_Element element,
API_ElementMemo memo,
UInt32  nSubElems,
API_SubElement subElems 
)

Places a new Window, Door, Skylight, Section, Elevation, Interior Elevation, ChangeMarker, Detail, or Worksheet element with the specified marker into the current database.

Since
Archicad 25
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. It can be API_WindowID, API_DoorID, API_CutPlaneID, API_ElevationID, API_InteriorElevationID, API_ChangeMarkerID, API_DetailID, API_WorksheetID, API_CurtainWallID or API_StairID.
memo[in] The memo field of the desired element will be created from the pointed structure (if the memo field is needed).
nSubElems[in] The number of subelems passed.
subElems[in] Subelem / marker related information.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE - The current database is not proper for the operation.
  • APIERR_BADPARS - The element parameter is nullptr, or the element type is invalid, or the element type is not supported by the server application. The elementMarker->header.type is not API_ObjectID.
  • 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 cut plane in a section window.
  • APIERR_INVALFLOOR - The element->header.floorInd parameter is out of range.
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 don't need them any more. The meaning of the different parameters is explained in the table below:
element memo elementMarker memoMarker elementMarker2 memoMarker2
API_WindowType
API_DoorType
addpar window/door marker object marker object parameters - -
API_SkylightType addpar window/door marker object marker object parameters - -
API_CutPlaneType cutplane coordinates section marker object on floorplan section marker object parameters story handle marker object on section story handle marker object parameters
API_ChangeMarkerType polygon data (optional) ChangeMarker marker object marker object parameters - -
API_DetailType
API_WorksheetType
polygon data (optional) detail drawing/worksheet marker object marker object parameters - -
For more details and instructions see the description of ACAPI_Element_Create.

◆ ACAPI_Element_Decompose()

GSErrCode __ACENV_CALL ACAPI_Element_Decompose ( const API_Guid elemGuid,
API_ElementDecomposerInterface elementDecomposer 
)

Enumerates the planes of a Multi-plane Roof.

Parameters
elemGuid[in] Identifier of the element to be decomposed. Currently this must be a PolyRoof element.
elementDecomposer[in] Interface pointer to an object implemented by the caller to be used during the decomposition.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The elementDecomposer pointer is nullptr or the element specified with elemGuid is not PolyRoof type.
  • APIERR_BADID - The elemGuid parameter does not identify a valid element.
Remarks
Use this function to enumerate the planes of a Multi-plane Roof as a set of Single-plane API_RoofType elements. First you need to implement a derived class of API_ElementDecomposerInterface. An object instance of this class should be passed to ACAPI_Element_Decompose to be called back by its GeneratePartElement method.
Example
Declaration of a class of
type:
class PolyRoofConverter : public API_ElementDecomposerInterface {
public:
PolyRoofConverter (const API_Guid& polyRoofGuid);
virtual GSErrCode GeneratePartElement (const API_Guid& guid, const API_ElemPartId& partId,
const API_Element& partElem, const API_ElementMemo& partMemo);
};
Call decomposition for a given Roof element:
void DecomposeRoof (const API_Guid& roofGuid)
{
API_Element element;
BNZeroMemory (&element, sizeof (API_Element));
element.header.guid = roofGuid;
GSErrCode err = ACAPI_Element_Get (&element);
if (err == NoError && element.roof.roofClass == API_PolyRoofID) {
PolyRoofConverter polyRoofConverter (element.header.guid);
err = ACAPI_Element_Decompose (element.header.guid, &polyRoofConverter);
}
}
See also the snippet functions of the Element
Test
example add-on.
Requirements
Version:
API 15 or later
Header:
ACAPinc.h
See Also
Element Manager
,
API Functions
Modified on December 17, 2012
Identify a part of an element. It's valid for PolyRoof and Morph only.
Definition: APIdefs_Elements.h:474
Interface class for the element decomposition process.
Definition: APIdefs_Callback.h:1104
virtual GSErrCode GeneratePartElement(const API_Guid &guid, const API_ElemPartId &partId, const API_Element &partElem, const API_ElementMemo &partMemo)=0
GSErrCode __ACENV_CALL ACAPI_Element_Decompose(const API_Guid &elemGuid, API_ElementDecomposerInterface *elementDecomposer)
Enumerates the planes of a Multi-plane Roof.
Represents a roof element.
Definition: APIdefs_Elements.h:5036
API_RoofClassID roofClass
Roof class:
Definition: APIdefs_Elements.h:5051
API_RoofType roof
Represents a roof.
Definition: APIdefs_Elements.h:13441

◆ ACAPI_Element_Delete()

GSErrCode __ACENV_CALL ACAPI_Element_Delete ( const GS::Array< API_Guid > &  elemGuids)

Deletes a number of elements.

Parameters
elemGuids[in] This parameter identifies the elements to be deleted.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE - The current database is not proper for the operation.
  • APIERR_MEMFULL - not enough memory to complete the operation
  • APIERR_NOTMINE - The operation attempted to delete an element that belongs to another user. Likely to occur in teamwork mode.
Remarks
You can use this function to delete elements identified by elemGuids. To delete the selected elements use ACAPI_Element_DeleteSelected function. In the case there is at least one element which are not allowed to delete for some reason, the whole command is terminated. Such cases can be:
  • it is locked,
  • it is on a locked layer,
  • it is part of a group, and suspend group is OFF
  • it is a subelement of a composite element (Curtain Wall, Stair, or Railing)
  • it is not in the users workspace, etc. The following notes are absolutely important:
  • the list of target elements will be automatically extended by the other group members; if there are a group member in the set, and suspend group is OFF
  • all the linked elements will be deleted; associative labels, dimensions etc. Note that this function is working on the Section/Elevation databases also, which may have references to the plan database; they called virtual symbols identified by the API_SectElemID element type. From Archicad 6.50 R2/V2 these elements can be deleted directly from the section database, with the limitation that the section window must be the front window.
Example
GSErrCode Do_DeleteSelectedWalls (void)
{
return ACAPI_CallUndoableCommand ("Delete selected walls",
[&] () -> GSErrCode {
GSErrCode err;
API_SelectionInfo selectionInfo;
GS::Array<API_Neig> selNeigs;
err = ACAPI_Selection_Get (&selectionInfo, &selNeigs, true);
BMKillHandle ((GSHandle *)&selectionInfo.marquee.coords);
GS::Array<API_Guid> wallGuids;
for (const API_Neig& neig : selNeigs) {
API_Elem_Head head = {};
head.guid = neig.guid;
if (ACAPI_Element_GetHeader (&head) == NoError && head.type == API_WallID)
wallGuids.Push (head.guid);
}
return ACAPI_Element_Delete (wallGuids);
});
}
GSErrCode Do_DeleteSelectedElements (void)
{
return ACAPI_CallUndoableCommand ("Delete selected elements",
[&] () -> GSErrCode {
GSErrCode err = ACAPI_Element_DeleteSelected ();
if (err != NoError)
ErrorBeep ("ACAPI_Element_DeleteSelected", err);
return err;
});
}
GSErrCode __ACENV_CALL ACAPI_CallUndoableCommand(const GS::UniString &undoString, const std::function< GSErrCode()> &command)
Performs an undoable operation.
GSErrCode __ACENV_CALL ACAPI_Element_GetHeader(API_Elem_Head *elementHead, UInt32 mask=0)
Returns general information on the given element.
GSErrCode __ACENV_CALL ACAPI_Element_DeleteSelected()
Deletes the selected elements.
GSErrCode __ACENV_CALL ACAPI_Element_Delete(const GS::Array< API_Guid > &elemGuids)
Deletes a number of elements.
GSErrCode __ACENV_CALL ACAPI_Selection_Get(API_SelectionInfo *selectionInfo, GS::Array< API_Neig > *selNeigs, bool onlyEditable, bool ignorePartialSelection=true, API_SelRelativePosID relativePosToMarquee=API_InsidePartially)
Returns information on the selection, and the selected elements.
Describes a neig point of an element.
Definition: APIdefs_Elements.h:18836
API_Coord ** coords
the coordinate handle (in case of polygonal representation)
Definition: APIdefs_Base.h:292
Information about the current selection.
Definition: APIdefs_Elements.h:18516
API_Region marquee
The parameters of the marquee selection region.
Definition: APIdefs_Elements.h:18547

◆ ACAPI_Element_DeleteSelected()

GSErrCode __ACENV_CALL ACAPI_Element_DeleteSelected ( )

Deletes the selected elements.

Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE - The current database is not proper for the operation.
  • APIERR_MEMFULL - not enough memory to complete the operation
  • APIERR_NOTMINE - The operation attempted to delete an element that belongs to another user. Likely to occur in teamwork mode.
Remarks
You can use this function to delete selected elements. To delete specific elements use ACAPI_Element_Delete function. In the case there is at least one element which are not allowed to delete for some reason, the whole command is terminated. Such cases can be:
  • it is locked,
  • it is on a locked layer,
  • it is part of a group, and suspend group is OFF
  • it is a subelement of a composite element (Curtain Wall, Stair, or Railing)
  • it is not in the users workspace, etc. The following notes are absolutely important:
  • the list of target elements will be automatically extended by the other group members; if there are a group member in the set, and suspend group is OFF
  • all the linked elements will be deleted; associative labels, dimensions etc. Note that this function is working on the Section/Elevation databases also, which may have references to the plan database; they called virtual symbols identified by the API_SectElemID element type. From Archicad 6.50 R2/V2 these elements can be deleted directly from the section database, with the limitation that the section window must be the front window.
Example
GSErrCode Do_DeleteSelectedElements (void)
{
return ACAPI_CallUndoableCommand ("Delete selected elements",
[&] () -> GSErrCode {
GSErrCode err = ACAPI_Element_DeleteSelected ();
if (err != NoError)
ErrorBeep ("ACAPI_Element_DeleteSelected", err);
return err;
});
}
GSErrCode Do_DeleteSelectedWalls (void)
{
return ACAPI_CallUndoableCommand ("Delete selected walls",
[&] () -> GSErrCode {
GSErrCode err;
API_SelectionInfo selectionInfo;
GS::Array<API_Neig> selNeigs;
err = ACAPI_Selection_Get (&selectionInfo, &selNeigs, true);
BMKillHandle ((GSHandle *)&selectionInfo.marquee.coords);
GS::Array<API_Guid> wallGuids;
for (const API_Neig& neig : selNeigs) {
API_Elem_Head head = {};
head.guid = neig.guid;
if (ACAPI_Element_GetHeader (&head) == NoError && head.type == API_WallID)
wallGuids.Push (head.guid);
}
return ACAPI_Element_Delete (wallGuids);
});
}

◆ ACAPI_Element_DetachObserver()

GSErrCode __ACENV_CALL ACAPI_Element_DetachObserver ( const API_Guid elemGuid)

Detaches the observer from the given element.

Parameters
elemGuid[in] Identifies the element to detach the observer from.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The referenced element cannot be found in the database.

◆ ACAPI_Element_DrawElement()

GSErrCode __ACENV_CALL ACAPI_Element_DrawElement ( API_Elem_Head elem_Head,
UInt32  mask 
)

Shows/draws an existing element.

Parameters
elem_Headidentifies the element to draw/show
mask[in] Element mask (from floor plan).
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - elemHead is nullptr
  • APIERR_BADID - The element is not present in the Archicad database.
  • APIERR_DELETED - The element is deleted.
Remarks
This function is used to draw/show an element identified by its element header on the floor plan or in the section or detail window. You should fill the guid field.

◆ ACAPI_Element_Edit()

GSErrCode __ACENV_CALL ACAPI_Element_Edit ( GS::Array< API_Neig > *  elemNeigs,
const API_EditPars pars 
)

Transforms a set of elements.

Parameters
elemNeigs[in-out] An Array of API_Neig objects which enables you to work not only on an element as a whole, but on its internal parts too.
pars[in] The details of the editing operation.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE - The current database is not proper for the operation.
  • APIERR_BADID - The element guid is invalid.
  • APIERR_DELETED - The element does not exist in the database
  • APIERR_MEMFULL - Not enough memory to complete the operation
  • APIERR_REFUSEDPAR - The edit parameters are incorrect.
  • APIERR_BADPARS - The edit parameters are incorrect.
Remarks
This function transforms a set of elements with the parameters passed in the API_EditPars structure. These parameters identify both the operation code (drag, rotate, mirror...) and the transformation parameters. If elemNeigs is nullptr or empty, then this function works on the selection; otherwise the set of elements passed will be the target. What elements are transformed in the last case? The elemNeigs array is an API_Neig list which enables you to work on not just a whole element, but on its internal parts as well. If you pass for example a neig to a slab hole, only the given hole will be transformed, without touching the base contour of the element. Elements which cannot be edited for some reason are ignored. Such causes can be:
  • it is locked,
  • it is on a locked layer,
  • it is part of a group, and suspend groups is OFF
  • it is not in the users workspace, etc. The following notes are absolutely important:
  • the list of target elements will be automatically extended with the other group members; if there is a group member in the set and suspend groups is OFF
  • all the edited elements keep their unique ID
  • all the inter-element links will be adjusted; including dimensioning also The new element's GUID will be returned for each edited element in the guid field. Note that this function is working on Section/Elevation databases also, which may have references to the plan database; they called virtual symbols identified by the API_SectElemID element type. From Archicad 6.50 R2/V2 these elements can be edited directly in the section database, with the limitation that the section window must be the front window. You can also change the geometry data of an element with the ACAPI_Element_Change function.

◆ ACAPI_Element_Elem2UIPriority()

GSErrCode __ACENV_CALL ACAPI_Element_Elem2UIPriority ( GS::Int32 *  elemPriority,
GS::Int32 *  uiPriority 
)

Returns user interface priority for a building material connection priority.

Parameters
elemPriority[in] The building material's connection priority.
uiPriority[out] The priority as it appers on the user interface.
Returns
  • NoError - The function has completed with success.

◆ ACAPI_Element_ElemHasVisibleSkin()

GSErrCode __ACENV_CALL ACAPI_Element_ElemHasVisibleSkin ( const API_Guid elemGuid,
const API_StructureDisplay structure,
bool *  result 
)

Returns if elem has visible skin depending on Partial Structure Display.

Parameters
elemGuid[in] Unique ID of the element.
structure[in] The partial structure display.
result[out] Returns if elem has visible skin.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - elemGuid does not refer to a valid element in the database.
  • APIERR_BADPARS - elemGuid or structure or result is nullptr.
Remarks
This function tells if the element has any visible skin when the given partial structure display is in effect.

◆ ACAPI_Element_ElemTypeToNeigID()

GSErrCode __ACENV_CALL ACAPI_Element_ElemTypeToNeigID ( const API_ElemType elemType,
API_NeigID neigID 
)

Returns a neig for the given element type.

Since
Archicad 26
Parameters
elemTypeThe element type.
neigIDOne neig ID for that element type.
Returns
  • NoError - The function has completed with success.
Remarks
This function return a neig ID (a special point) for the given element type. This is useful in some situations, for example element selection, where you have to pass the array of neig IDs of the elements you want to select, but it is not important, which point of the element is given. Note that the element type? neig ID mapping is not a one-to-one, but a one-to-many mapping.

◆ ACAPI_Element_Filter()

bool __ACENV_CALL ACAPI_Element_Filter ( const API_Guid guid,
API_ElemFilterFlags  filterBits,
API_ElemVariationID  variationID = APIVarId_Generic,
const API_Guid renovationFilterGuid = APINULLGuid 
)

Tests an element by some given criteria.

Parameters
guid[in] Global unique identifier of the element to be tested
filterBits[in] The flags used for filtering (see the table below)
variationID[in] Optional variation ID for objects. Used in combination with APIFilt_IsOfVariation. The default value is APIVarId_Generic.
renovationFilterGuid[in] Optional global unique identifier of the renovation filter. Used in combination with APIFilt_IsVisibleByRenovation. The default value is APINULLGuid.
Returns
  • true - The given element (defined by guid) matches the criteria defined by filterbits
  • false - The referenced element does not pass the criteria
Remarks
Note that the 3D visibility of GDL-based elements can also be modified through GDL parameters which work independently from the element settings. Due to this there may be cases where the ACAPI_Element_Filter function shows that an elem is visible on 3D, but its GDL script hides it on 3D-based views. Returns true, if the given element matches the criteria defined by filterbits :
filterbits value Checks whether the element Concerned elements
APIFilt_None not filtered
APIFilt_IsEditable is not on a locked/deleted/invisible layer all (for windows, doors and skylights this tests the layer of the owner element)
APIFilt_OnVisLayer is on a visible layer all (for windows, doors and skylights this tests the layer of the owner element)
APIFilt_OnActFloor is on the active floor all (always true for cut planes and groups)
APIFilt_In3D has 3D representation API_WallID, API_ColumnID, API_BeamID, API_WindowID, API_DoorID, API_SkylightID, API_ObjectID, API_LampID, API_SlabID, API_RoofID, API_MeshID, API_ShellID, API_CurtainWallID, API_MorphID
APIFilt_InMyWorkspace is in my workspace (in Teamwork mode) all element types
APIFilt_IsIndependent is independent (not a sub elem) API_ObjectID, API_TextID
APIFilt_OnActLayout is on the active layout drawing type elements
APIFilt_InCroppedView is visible inside the cropped part of a drawing database drawing type elements
APIFilt_IsOfVariation tells if the given element has the variation ID passed in the variationID parameter. object type elements
APIFilt_FromFloorplan additional flag; instructs the function to take the element from the floor plan database all element types
APIFilt_HasAccessRight additional flag; checks if the element is accessible for the current user all element types
APIFilt_IsVisibleByRenovation additional flag; checks if the element is visible by the renovation filter passed in the renovationFilterGuid parameter, default by the current renovation filter. all element types
APIFilt_IsOverriddenByRenovation additional flag; checks if the attributes of the element are overridden by current renovation filter all element types
APIFilt_IsInStructureDisplay additional flag; checks if the element is visible taking into account the current structure display setting all element types
If the value of filterBits is 0, only the existence of the element is checked. This routine helps you quickly test different attributes without converting the whole model, for example when you walk through all the elements, and test for the existence of the 3D representation of an element.
Example
GS::Array<API_Guid> elemList;
ACAPI_Element_GetElemList (API_LineID, &elemList);
DBPrintf ("number of lines = %ld,", elemList.GetSize ());
short visible = 0;
short onStory = 0;
short inView = 0;
for (GS::Array<API_Guid>::ConstIterator it = elemList.Enumerate (); it != nullptr; ++it) {
if (ACAPI_Element_Filter (*it, APIFilt_OnVisLayer))
++visible;
if (ACAPI_Element_Filter (*it, APIFilt_OnActFloor))
++onStory;
if (ACAPI_Element_Filter (*it, APIFilt_InCroppedView))
++inView;
}
DBPrintf ("%d visible, %d on the view\'s floor, %d in the cropped view\n", visible, onStory, inView);
bool __ACENV_CALL ACAPI_Element_Filter(const API_Guid &guid, API_ElemFilterFlags filterBits, API_ElemVariationID variationID=APIVarId_Generic, const API_Guid &renovationFilterGuid=APINULLGuid)
Tests an element by some given criteria.

◆ ACAPI_Element_Get()

GSErrCode __ACENV_CALL ACAPI_Element_Get ( API_Element element,
UInt32  mask = 0 
)

Returns information on the main parameters of a given element.

Parameters
element[in/out] The element participating in the operation.
mask[in] Optional mask. Currently valid values are 0 and APIElemMask_FloorPlan. In the latter case, the elements in the floor plan database are counted directly, without changing the database first.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The passed parameter is nullptr; element
  • APIERR_BADID - The element reference is invalid (guid). The element type is invalid, or the element type is not supported by the server application
  • APIERR_DELETED - The element does not exist in the database
Remarks
This function returns information on the main parameters of a given element in the API_Element structure, which is a union of the different element structures. There is only one way (from API 18 or later) to identify the element:
  • pass the guid of the element in the element header. The information returned is the main data of the element; further information can be obtained with the ACAPI_Element_GetMemo function, where applicable; the hasMemo field of the header indicates the existence of the extra information. Please use filtering with the ACAPI_Element_Filter function before calling this function; in this case you can spare the conversion time in certain cases. Please note that the attributes referenced by the element may be invalid. The layer attribute is the only one, which must exist. Other type of attributes my be deleted without editing the element database, it results that elements may refer missing attributes. In this case the ACAPI_Attribute_Get function returns an error code.
Example
GSErrCode lastErr;
API_Element element;
GS::Array<API_Guid> columnList;
lastErr = ACAPI_Element_GetElemList (API_ColumnID, &columnList, APIFilt_OnVisLayer | APIFilt_OnActFloor);
if (lastErr != NoError)
return lastErr;
for (GS::Array<API_Guid>::ConstIterator it = columnList.Enumerate (); it != nullptr; ++it) {
BNZeroMemory (&element, sizeof (API_Element));
element.header.guid = *it;
lastErr = ACAPI_Element_Get (&element);
if (lastErr == NoError) {
/* Custom element processing */
}
}

◆ ACAPI_Element_GetActualOverrideStyle()

GSErrCode __ACENV_CALL ACAPI_Element_GetActualOverrideStyle ( const API_Guid guid_Element,
API_OverrideStyle elemOverrideStyle 
)

Get actual (merged) visual override style for an element.

Parameters
guid_Element[in] GUID of the element
elemOverrideStyle[out] Returned actual (merged) visual override style
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The element reference is invalid (guid).

◆ ACAPI_Element_GetClassificationInSystem()

GSErrCode __ACENV_CALL ACAPI_Element_GetClassificationInSystem ( const API_Guid elemGuid,
const API_Guid systemGuid,
API_ClassificationItem item 
)

Retrieves a classification of an elem in a given classification system.

Parameters
elemGuid[in] The guid of the element.
systemGuid[in] The guid of the classification system in which the classification item should be retrieved.
item[out] The retrieved classification item (empty with null guid if the elem doesn't have a classification in the given system).
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The elemGuid did not refer to a valid element or systemGuid did not refer to a valid classification system.

◆ ACAPI_Element_GetClassificationInSystemDefault()

GSErrCode __ACENV_CALL ACAPI_Element_GetClassificationInSystemDefault ( const API_ElemType type,
const API_Guid systemGuid,
API_ClassificationItem item 
)

Retrieves a classification of a default elem in a given classification system.

Since
Archicad 26
Parameters
type[in] Type of the default element.
systemGuid[in] The guid of the classification system in which the classification item should be retrieved.
item[out] The retrieved classification item (empty with null guid if the elem doesn't have a classification in the given system).
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The type did not refer to a valid default element or systemGuid did not refer to a valid classification system.
Remarks
From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.

◆ ACAPI_Element_GetClassificationItems()

GSErrCode __ACENV_CALL ACAPI_Element_GetClassificationItems ( const API_Guid elemGuid,
GS::Array< GS::Pair< API_Guid, API_Guid > > &  systemItemPairs 
)

Retrieves all of the classifications of an element.

Parameters
elemGuid[in] The guid of the element.
systemItemPairs[out] A list of classification system and classification item guid pairs, that represent the element's classifications.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The elemGuid did not refer to a valid element.

◆ ACAPI_Element_GetClassificationItemsDefault()

GSErrCode __ACENV_CALL ACAPI_Element_GetClassificationItemsDefault ( const API_ElemType type,
GS::Array< GS::Pair< API_Guid, API_Guid > > &  systemItemPairs 
)

Retrieves all of the classifications of a default elem.

Since
Archicad 26
Parameters
type[in] Type of the default element.
systemItemPairs[out] A list of classification system and classification item guid pairs, that represent the element's classifications.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The type did not refer to a valid default element.
Remarks
From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.

◆ ACAPI_Element_GetCollisions()

GSErrCode __ACENV_CALL ACAPI_Element_GetCollisions ( const GS::Array< API_Guid > &  guidSet1,
const GS::Array< API_Guid > &  guidSet2,
GS::Array< GS::Pair< API_CollisionElem, API_CollisionElem > > &  resultArray,
const API_CollisionDetectionSettings apiColDetSettings 
)

Returns the collisions between two groups.

Parameters
guidSet1[in] The first group of the comparison.
guidSet2[in] The second group of the comparison.
resultArray[out] The result array of the detected collisions.
apiColDetSettings[in] Collisions detection settings.
Returns
  • APIERR_GENERAL - Couldn't get the collisions.
Remarks
This function is used to detect collisions between two groups. You can find an example for this function in the Element_Test addon.

◆ ACAPI_Element_GetComponents()

GSErrCode __ACENV_CALL ACAPI_Element_GetComponents ( const API_Guid elemGuid,
GS::Array< API_ElemComponentID > &  elemComponents 
)

Retrieves the components of an element.

Parameters
elemGuid[in] Guid of the element whose components have to be retrieved.
elemComponents[out] The components of the specified element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The elemGuid did not refer to a valid element.
Example
GSErrCode GetElemCompnentCount (const API_Guid& elemGuid, USize& componentCount)
{
GS::Array<API_ElemComponentID> components;
const GSErrCode error = ACAPI_Element_GetComponents (elemGuid, components);
if (error == NoError) {
componentCount = components.GetSize ();
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_Element_GetComponents(const API_Guid &elemGuid, GS::Array< API_ElemComponentID > &elemComponents)
Retrieves the components of an element.

◆ ACAPI_Element_GetComponents_Obsolete()

GSErrCode __ACENV_CALL ACAPI_Element_GetComponents_Obsolete ( const API_Elem_Head elemHead,
API_Obsolete_ComponentRefType ***  compRefs,
Int32 *  nComp 
)

Returns the components of the element.

Parameters
elemHead[in] The element whose components you want to obtain.
compRefs[out] List of the components.
nComp[out] Number of the components.
Returns
  • APIERR_BADPARS - compRefs is nullptr or nComp is nullptr.
  • APIERR_BADID - Incorrect elemHead was specified.
  • APIERR_MEMFULL - Not enough memory to get the components.
Remarks
This function is obsolete. Use the new component API instead. This function is used to get information for every component of an element. These components are in the property objects of the element. This applies to all the construction elements.
Example
void GetComponents (const API_Guid& guid)
{
API_Elem_Head elemHead;
API_ListData listdata;
Int32 nComp, i;
char s[256];
GSErrCode err;
BNZeroMemory (&elemHead, sizeof (API_Elem_Head));
elemHead.guid = guid;
err = ACAPI_Element_GetComponents_Obsolete (&elemHead, &compRefs, &nComp);
if (err == NoError) {
for (i = 0; i < nComp; i++) {
if ((*compRefs)[i].status != APIDBRef_Deleted) {
BNZeroMemory (&listdata, sizeof (API_ListData));
listdata.header.type = API_Obsolete_ComponentID;
listdata.header.index = (*compRefs)[i].index;
listdata.header.setIndex = (*compRefs)[i].setIndex;
switch ((*compRefs)[i].status) {
case APIDBRef_Normal:
err = ACAPI_OldListing_Get (&listdata);
break;
case APIDBRef_Local:
err = ACAPI_OldListing_GetLocal ((*compRefs)[i].libIndex, &listdata);
break;
}
if (err != NoError)
break;
sprintf (s, "Keycode/code: \"%s\"/\"%s\" quantity: %.2f", listdata.component.keycode,
listdata.component.code, (*compRefs)[i].quantity);
ACAPI_WriteReport (s, false);
}
}
BMKillHandle ((GSHandle *) &compRefs);
}
}
GSErrCode __ACENV_CALL ACAPI_Element_GetComponents_Obsolete(const API_Elem_Head *elemHead, API_Obsolete_ComponentRefType ***compRefs, Int32 *nComp)
Returns the components of the element.
GSErrCode __ACENV_CALL ACAPI_OldListing_GetLocal(Int32 libIndex, const API_Elem_Head *elemHead, API_ListData *listdata)
Retrieves the data of a local listing component.
GSErrCode __ACENV_CALL ACAPI_OldListing_Get(API_ListData *listdata)
Retrieves the data of a listdata.
Int32 setIndex
index of the list data set the component is in
Definition: APIdefs_ListData.h:132
Int32 index
index of the listdata in the set
Definition: APIdefs_ListData.h:137
The component reference record.
Definition: APIdefs_Elements.h:18058
char code[API_DBCodeLen]
Component code.
Definition: APIdefs_ListData.h:235
char keycode[API_DBCodeLen]
Component key code.
Definition: APIdefs_ListData.h:240
The representation of a listdata.
Definition: APIdefs_ListData.h:325
API_ListData_Head header
A common header for all the listdata types. It contains information which applies to all the listdata...
Definition: APIdefs_ListData.h:330
API_Obsolete_ComponentType component
a component listdata
Definition: APIdefs_ListData.h:346

◆ ACAPI_Element_GetCompoundInfoString()

GSErrCode __ACENV_CALL ACAPI_Element_GetCompoundInfoString ( const API_Guid elementGuid,
GS::UniString *  infoString 
)

Returns the compound info string of the given element.

Parameters
elementGuid[in] the Guid of the element
infoString[out] the composite info string of the element
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - any of the parameters is nullptr
  • APIERR_BADID - no element found by the specified Guid
  • APIERR_BADELEMENTTYPE - element has no info string
Remarks
For hotlinked elements the info string is composed of the element's own info string and the hotlink element's info strings it placed via.

◆ ACAPI_Element_GetDefaults()

GSErrCode __ACENV_CALL ACAPI_Element_GetDefaults ( API_Element element,
API_ElementMemo memo 
)

Retrieves the actual default settings for the element of type.

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).
Returns
  • 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
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;
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 */
}
API_ElemVariationID variationID
Subcategory of the element (see API_ElemVariationID).
Definition: APIdefs_Elements.h:212

◆ ACAPI_Element_GetDefaultsExt()

GSErrCode __ACENV_CALL ACAPI_Element_GetDefaultsExt ( API_Element element,
API_ElementMemo memo,
UInt32  nSubElems,
API_SubElement subElems 
)

Retrieves the actual default settings for the Window, Door, Section, Elevation, Interior Elevation, ChangeMarker, Detail, Worksheet, or Stair element with its marker(s). You are able to obtain Curtain Wall and its subelem default settings also via this function.

Since
Archicad 25
Parameters
element[in/out] The desired element for which the defaults are needed. The element->header.type can be API_WindowID, API_DoorID, API_CutPlaneID, API_ElevationID, API_InteriorElevationID, API_ChangeMarkerID, API_DetailID, API_WorksheetID, API_CurtainWallID, API_CurtainWallPanelID, API_CurtainWallFrameID, API_CurtainWallJunctionID, API_CurtainWallAccessoryID, API_StairID or API_ExternalElemID.
memo[out] This is needed only in case of library part-based elements (including zone stamps).
nSubElems[out] The subelem of the desired element for which the defaults are needed.
subElems[out] The subelem(s) (normal, story handle, interior elevation common marker) of the desired element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The passed element parameter is nullptr.
  • APIERR_BADID - The element type should be API_WindowID, API_DoorID, API_CutPlaneID, API_ElevationID, API_InteriorElevationID, API_ChangeMarkerID, API_DetailID, API_WorksheetID, API_CurtainWallID, API_CurtainWallFrameID, API_CurtainWallPanelID, API_CurtainWallJunctionID, API_CurtainWallAccessoryID, API_StairID or API_ExternalElemID.
    • In case of API_ExternalElemID, when an external handler does not exist for the specified classID, APIERR_BADID is returned.
Remarks
This function is used to obtain the actual default settings for a Window, Door, Section, Elevation, Interior Elevation, ChangeMarker, Detail or Worksheet element, as an alternative of ACAPI_Element_GetDefaults. 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_ChangeDefaultsExt function. You can use the returned values to initialize the element attributes and parameters to create a new instance. Refer to the ACAPI_Element_CreateExt function for more details.
Example
API_Element element;
API_MarkerMemoMask markers[2];
GSErrCode err;
BNZeroMemory (&element, sizeof (API_Element));
BNZeroMemory (&memo, sizeof (API_ElementMemo));
BNZeroMemory (&markers, sizeof (markers));
element.header.type = API_CutPlaneID;
markers[0].markType = (API_MarkerMemoMaskType) (APIMarkerMemoMask_MainMarker | APIMarkerMemoMask_NoParams); // only the element is needed
markers[1].markType = (API_MarkerMemoMaskType) (APIMarkerMemoMask_SHMarker | APIMarkerMemoMask_NoElem); // only the memo is needed
err = ACAPI_Element_GetDefaultsExt (&element, &memo, 2UL, &markers);
if (err == NoError) {
if (markers[1].memo.params != nullptr) {
DBPrintf ("Cut Plane Default: Show Story Level Marker head is %s\n",
((*markers[1].memo.params)[3].value.real > 0.0) ? "ON" : "OFF"); // "marker_head" parameter
}
API_LibPart libPart;
BNZeroMemory (&libPart, sizeof (API_LibPart));
libPart.index = markers[0].markElem.object.libInd;
if (ACAPI_LibraryPart_Get (&libPart) == NoError) {
DBPrintf ("Section Marker currently selected for Cut Plane Default: \"%s\"\n", (const char *) GS::UniString (libPart.docu_UName).ToCStr ());
}
if (libPart.location != nullptr)
delete libPart.location;
}
ACAPI_DisposeElemMemoHdls (&markers[1].memo);
GSErrCode __ACENV_CALL ACAPI_Element_GetDefaultsExt(API_Element *element, API_ElementMemo *memo, UInt32 nSubElems, API_SubElement *subElems)
Retrieves the actual default settings for the Window, Door, Section, Elevation, Interior Elevation,...
GSErrCode __ACENV_CALL ACAPI_LibraryPart_Get(API_LibPart *libPart)
Returns the data of a registered Library Part.
API_AddParType ** params
Additional parameters for library part-based elements.
Definition: APIdefs_Elements.h:13891
Definition of a Library Part.
Definition: APIdefs_LibraryParts.h:77
Int32 index
Index of the Library Part, contains the current database index of the given Library Part....
Definition: APIdefs_LibraryParts.h:88
GS::uchar_t docu_UName[API_UniLongNameLen]
Unique document name of the Library Part. If more than one Library Part has the same name,...
Definition: APIdefs_LibraryParts.h:95
IO::Location * location
Location of the library part (GSM) file in the file system.
Definition: APIdefs_LibraryParts.h:137

◆ ACAPI_Element_GetDescriptors()

GSErrCode __ACENV_CALL ACAPI_Element_GetDescriptors ( const API_Elem_Head elemHead,
API_DescriptorRefType ***  descRef,
Int32 *  nDesc 
)

Returns the descriptors of an element.

Parameters
elemHead[in] The element you want to get the descriptors for.
descRef[out] List of the descriptors.
nDesc[out] Number of the descriptors in the list.
Returns
  • APIERR_BADPARS - descRef is nullptr or nDesc is nullptr.
  • APIERR_BADID - Incorrect elemHead was specified.
  • APIERR_MEMFULL - Not enough memory to get the descriptors.
Remarks
This function is used to get information for every descriptor of an element. These descriptors are in the property objects of the element. This applies to all the construction elements.
Example
void GetDiscriptors (const API_Guid& guid)
{
API_Elem_Head elemHead;
API_ListData listdata;
Int32 nDesc, i;
char s[256];
GSErrCode err;
BNClear (elemHead);
elemHead.guid = guid;
err = ACAPI_Element_GetDescriptors (&elemHead, &descRefs, &nDesc);
if (err == NoError) {
for (i = 0; i < nDesc; i++) {
listdata.header.type = API_Obsolete_ComponentID;
listdata.header.index = (*descRefs)[i].index;
listdata.header.setIndex = (*descRefs)[i].setIndex;
if ((*descRefs)[i].status != APIDBRef_Deleted) {
BNZeroMemory (&listdata, sizeof (API_ListData));
listdata.header.type = API_DescriptorID;
listdata.header.setIndex = (*descRefs)[i].setIndex;
listdata.header.index = (*descRefs)[i].index;
switch ((*descRefs)[i].status) {
case APIDBRef_Normal:
err = ACAPI_OldListing_Get (&listdata);
break;
case APIDBRef_Local:
err = ACAPI_OldListing_GetLocal ((*descRefs)[i].libIndex, &listdata);
break;
}
}
if (err == NoError) {
sprintf (s, "Keycode/code: \"%s\"/\"%s\"", listdata.descriptor.keycode, listdata.descriptor.code);
ACAPI_WriteReport (s, false);
ACAPI_WriteReport (*(listdata.descriptor.name), false);
}
BMKillHandle (&listdata.descriptor.name);
}
BMKillHandle ((GSHandle *) &descRefs);
}
}
GSErrCode __ACENV_CALL ACAPI_Element_GetDescriptors(const API_Elem_Head *elemHead, API_DescriptorRefType ***descRef, Int32 *nDesc)
Returns the descriptors of an element.
The descriptor reference record.
Definition: APIdefs_Elements.h:18093
char code[API_DBCodeLen]
Descriptor code.
Definition: APIdefs_ListData.h:293
char keycode[API_DBCodeLen]
Descriptor key code.
Definition: APIdefs_ListData.h:298
char ** name
name of the descriptor
Definition: APIdefs_ListData.h:308
API_DescriptorType descriptor
a descriptor listdata
Definition: APIdefs_ListData.h:351

◆ ACAPI_Element_GetElemCreatorToolUnId()

GSErrCode __ACENV_CALL ACAPI_Element_GetElemCreatorToolUnId ( API_Elem_Head elemHead,
char *  unIDStr 
)

Returns the unique ID of the creator tool of the specified object.

Parameters
elemHead[in] the header or the element (only the guid field is required).
unIDStr[out] the unique ID of the creator tool subtype.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - any of the parameters are nullptr, or the passed handles have wrong sizes.
  • APIERR_BADID - Not a Window, Door, Light or Symbol header was passed, or no element with the specified guid was found.
Remarks
This function is used to get the creator tool of an element. Only elements of type window, door, symbol or light are accepted. The returned string is the unique ID of the template object of the creator tool.

◆ ACAPI_Element_GetElementFromAnywhere()

GSErrCode __ACENV_CALL ACAPI_Element_GetElementFromAnywhere ( const API_Guid guid,
API_Element element 
)

Returns the element referred by guid irrespectively of the current database.

Parameters
guid[in] The referred element.
element[out] The element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The guid or element parameter is nullptr.
  • APIERR_NOPLAN - There is no open project.
Remarks
This function is used to get an element irrespectively of the current database. This is a useful function because you don't have to enumerate all database to find the element, switch to it and get the element.

◆ ACAPI_Element_GetElementInfoString()

GSErrCode __ACENV_CALL ACAPI_Element_GetElementInfoString ( const API_Guid elementGuid,
GS::UniString *  infoString 
)

Returns the compound info string of the given element.

Parameters
elementGuid[in] the Guid of the element
infoString[out] the info string of the element
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - any of the parameters is nullptr
  • APIERR_BADID - no element found by the specified Guid
  • APIERR_BADELEMENTTYPE - element has no info string

◆ ACAPI_Element_GetElementsWithClassification()

GSErrCode __ACENV_CALL ACAPI_Element_GetElementsWithClassification ( const API_Guid classificationItemGuid,
GS::Array< API_Guid > &  elemGuids 
)

Query elements with the given classification.

Parameters
classificationItemGuid[in] The identifier of the classification item.
elemGuids[out] The identifiers of the elements with the given classification.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The classificationItemGuid did not refer to a valid classification item.

◆ ACAPI_Element_GetElementURLRef()

GSErrCode __ACENV_CALL ACAPI_Element_GetElementURLRef ( API_Elem_Head elem_Head,
API_ElemURLRef elemURLRef 
)

Retrieves the URL reference assigned to an element.

Parameters
elem_Head[in] The element the URL was assigned to.
elemURLRef[out] The URL reference of the element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Any of the parameters are nullptr.
  • APIERR_BADINDEX - The element is not present in the Archicad database.
  • APIERR_BADID - The element cannot hold a URL reference.
  • APIERR_DELETED - The element is deleted.
  • APIERR_NOUSERDATA - The element didn't hold a URL reference.
Remarks
This function is used to retrieve the URL reference assigned to an element. The same group of elements can hold a URL reference as userdata.

◆ ACAPI_Element_GetElemList()

GSErrCode __ACENV_CALL ACAPI_Element_GetElemList ( const API_ElemType type,
GS::Array< API_Guid > *  elemList,
API_ElemFilterFlags  filterBits = APIFilt_None,
const API_Guid renovationFilterGuid = APINULLGuid 
)

Returns an array of guids of the elements of the given type.

Since
Archicad 26
Parameters
type[in] Element type identifier
elemList[out] List of element Guids collected by the function
filterBits[in] The flags used for filtering (see ACAPI_Element_Filter). The default value is APIFilt_None.
renovationFilterGuid[in] Optional global unique identifier of the renovation filter. Used in combination with APIFilt_IsVisibleByRenovation. The default value is APINULLGuid.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The elemList pointer is nullptr.
Remarks
This function can be used to iterate through elements of the given type and variation, that match the criteria defined by filterbits (see the filterbits flag values described in the table of ACAPI_Element_Filter). You may pass API_ZombieElemID as type in order to retrieve all the elements regardless of type. The variationID member in type is used in combination with APIFilt_IsOfVariation From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.
Example
GS::Array<API_Guid> elemList;
ACAPI_Element_GetElemList (API_LineID, &elemList, APIFilt_OnActFloor);
DBPrintf ("number of lines on the active floor: %ld", elemList.GetSize ());

◆ ACAPI_Element_GetElemListByIFCIdentifier()

GSErrCode __ACENV_CALL ACAPI_Element_GetElemListByIFCIdentifier ( const API_Guid archicadIFCID,
const API_Guid externalIFCID,
GS::Array< API_Guid > &  elements 
)

Get elements having a certain IFC identifier.

Since
Archicad 26
Parameters
archicadIFCID[in] Archicad IFC ID - it can be nullptr
externalIFCID[in] External IFC ID - it can be nullptr
elements[out] GUID of the elements
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Both archicadIFCID and externalIFCID are nullptr or elements parameter is nullptr.
  • APIERR_MODULNOTINSTALLED - IFC add-on is not present.
Remarks
This function searches for elements having the indicated IFC Guid.
  • only archicadIFCID contains value - it searches for an element having the indicated Archicad IFC ID. The elements can have maximum 1 element. only externalIFCID contains value - it searches for elements having the indicated External IFC ID. The elements can have more then one element. both archicadIFCID and externalIFCID contains value - it searches for an element having the indicated Archicad IFC ID and External IFC ID. The elements can have maximum 1 element. both input parameters are nullptr - it returns APIERR_BADPARS.
  • only externalIFCID contains value - it searches for elements having the indicated External IFC ID. The elements can have more then one element. both archicadIFCID and externalIFCID contains value - it searches for an element having the indicated Archicad IFC ID and External IFC ID. The elements can have maximum 1 element. both input parameters are nullptr - it returns APIERR_BADPARS.
  • both archicadIFCID and externalIFCID contains value - it searches for an element having the indicated Archicad IFC ID and External IFC ID. The elements can have maximum 1 element. both input parameters are nullptr - it returns APIERR_BADPARS.
  • both input parameters are nullptr - it returns APIERR_BADPARS. Conversion from IFC Guid string (IfcGloballyUniqueId) to API_Guid can be done with ACAPI_IFC_IFCGuidToAPIGuid.

◆ ACAPI_Element_GetElemTypeName()

GSErrCode __ACENV_CALL ACAPI_Element_GetElemTypeName ( const API_ElemType elemType,
GS::UniString &  elemName 
)

Returns the localized name of the built-in element types.

Since
Archicad 26
Parameters
elemType[in] The element type
elemName[out] The name of the element type in the language of the Archicad version currently running
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - Invalid element type value.
Remarks
This function retrieves the name of the specified element type in the language the currently running program is localized for.
Example
API_ElemType elemType = API_AngleDimensionID;
GS::UniString elemName;
if (ACAPI_Element_GetElemTypeName (elemType, elemName) == NoError)
DBPrintf ("Angle Dimension is called \"%s\"\n", (const char*) elemName.ToCStr ());
GSErrCode __ACENV_CALL ACAPI_Element_GetElemTypeName(const API_ElemType &elemType, GS::UniString &elemName)
Returns the localized name of the built-in element types.
The type of an element.
Definition: APIdefs_Elements.h:202

◆ ACAPI_Element_GetExtent()

GSErrCode __ACENV_CALL ACAPI_Element_GetExtent ( API_Box extent,
API_DatabaseUnId databaseUnId = nullptr 
)

Returns the drawing extent of the current database.

Parameters
extentthe extent box
databaseUnIdoptional parameter; if nullptr then the extent box is returned for the current database taking into consideration only the visible elements. If a valid database unique ID is given, then the bounding box of that database is returned, including hidden elements.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - extent is nullptr
  • APIERR_NOPLAN - no open project
Remarks
This function is used to get the drawing extent of the actual database. The extent depends on different settings (hidden layers, actual story etc.), always returns the region would be shown in case of a "Fit in Window" command.

◆ ACAPI_Element_GetExtent3D()

GSErrCode __ACENV_CALL ACAPI_Element_GetExtent3D ( API_Box3D extent3D)

Returns the model extent of the current database.

Parameters
extent3Dthe extent box
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - extent3D is nullptr
  • APIERR_NOPLAN - no open project
Remarks
This function is used to get the drawing extent of the actual database, as well as in vertical range. The extent depends on different settings (hidden layers, actual story etc.), always returns the region would be shown in case of a "Fit in Window" command.

◆ ACAPI_Element_GetHeader()

GSErrCode __ACENV_CALL ACAPI_Element_GetHeader ( API_Elem_Head elementHead,
UInt32  mask = 0 
)

Returns general information on the given element.

Parameters
elementHead[in/out] On input, it identifies the element based on its GUID. On return, the other fields are filled.
mask[in] Optional mask. Currently valid values are 0 and APIElemMask_FloorPlan. In the latter case, the elements in the floor plan database are counted directly, without changing the database first.
Returns
  • NoError - The function has completed with success.
Remarks
This is a fast version of ACAPI_Element_Get, where only the fields of the header are returned. There are many cases when you only need information (e.g. layer, story) contained in the element header, but in the past the server application had to convert the whole element.

◆ ACAPI_Element_GetHotspots()

GSErrCode __ACENV_CALL ACAPI_Element_GetHotspots ( const API_Guid guid,
GS::Array< API_ElementHotspot > *  hotspotArray 
)

Retrieves the hotspots of the given element.

Parameters
guid[in] Identifier of the element.
hotspotArray[out] Array that contains hotspots (neig and coordinate pairs).
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - hotspotArray parameter is nullptr.
  • APIERR_BADID - Invalid guid.
Remarks
This function is used to retrieve the hotspots of the given element. The hotspots return in an array of API_ElementHotspot objects which contain neig and coordinate pairs (GS::Pair < API_Neig, API_Coord3D >).
Example
GS::Array<API_ElementHotspot> hotspotArray;
API_Guid guid = element.header.guid; /* GUID of an element placed on the floorplan */
GSErrCode err = ACAPI_Element_GetHotspots (guid, &nHotspots, &hotspots);
if (err == NoError && !hotspotArray.IsEmpty ()) {
BNZeroMemory (&element, sizeof (API_Element));
element.header.type = API_HotspotID;
err = ACAPI_Element_GetDefaults (&element, nullptr);
if (err != NoError)
return;
short ind;
for (ind = 0; ind < (short) hotspotArray.GetSize (); ind++) {
API_Neig neig;
API_Coord3D coord;
hotspotArray[ind].Get (neig, coord);
element.hotspot.pen = ind;
element.hotspot.pos.x = coord.x;
element.hotspot.pos.y = coord.y;
ACAPI_Element_Create (&element, nullptr);
}
}
BMKillHandle ((GSHandle*) &hotspots);
GSErrCode __ACENV_CALL ACAPI_Element_GetHotspots(const API_Guid &guid, GS::Array< API_ElementHotspot > *hotspotArray)
Retrieves the hotspots of the given element.
Real (Cartesian) 3D coordinates of a three-dimensional space.
Definition: APIdefs_Base.h:100
double x
The x factor.
Definition: APIdefs_Base.h:104
double y
The y factor.
Definition: APIdefs_Base.h:109

◆ ACAPI_Element_GetIFCAttributes()

GSErrCode __ACENV_CALL ACAPI_Element_GetIFCAttributes ( const API_Guid guid_Element,
bool  storedOnly,
GS::Array< API_IFCAttribute > *  attributes 
)

Get IFC attributes of an element.

Parameters
guid_Element[in] GUID of the element
storedOnly[in] Get only the core data without the derived content, must be false is most cases
attributes[out] IFC attributes of the element
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Invalid value passed in the guid_Element parameter or attributes is nullptr.
  • APIERR_MODULNOTINSTALLED - IFC add-on is not present.
Remarks
This function returns the IFC attributes of an element.

◆ ACAPI_Element_GetIFCClassificationReferences()

GSErrCode __ACENV_CALL ACAPI_Element_GetIFCClassificationReferences ( const API_Guid guid_Element,
bool  storedOnly,
GS::Array< API_IFCClassificationReference > *  classificationReferences 
)

Get IFC classificationreferences of an element.

Parameters
guid_Element[in] GUID of the element
storedOnly[in] Get only the core data without the derived content, must be false is most cases
classificationReferences[out] IFC classificationreferences of the element
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Invalid value passed in the guid_Element parameter or classificationReferences is nullptr.
  • APIERR_MODULNOTINSTALLED - IFC add-on is not present.
Remarks
This function returns the IFC classificationreferences of an element.

◆ ACAPI_Element_GetIFCIdentifier()

GSErrCode __ACENV_CALL ACAPI_Element_GetIFCIdentifier ( const API_Guid elementID,
API_Guid archicadIFCID,
API_Guid externalIFCID 
)

Get IFC Identifier of an element.

Since
Archicad 26
Parameters
elementID[in] GUID of the element
archicadIFCID[out] Archicad IFC ID of the element
externalIFCID[out] External IFC ID of the element
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - Invalid value passed in the elementID parameter.
  • APIERR_MODULNOTINSTALLED - IFC add-on is not present.
Remarks
This function returns the IFC Identifier of an element. There are two type of identifiers:
  • Archicad IFC ID - during an IFC export this value will be written to GlobalId attribute and can be seen in IFC Manager.
  • External IFC ID - if the element is originally from IFC then it contains the GlobalId. If it isn't then it is APINULLGuid. It can be seen in IFC Manager also. Conversion from API_Guid to IFC Guid string (IfcGloballyUniqueId) can be done with ACAPI_IFC_APIGuidToIFCGuid.

◆ ACAPI_Element_GetIFCProperties()

GSErrCode __ACENV_CALL ACAPI_Element_GetIFCProperties ( const API_Guid guid_Element,
bool  storedOnly,
GS::Array< API_IFCProperty > *  properties 
)

Get IFC properties of an element.

Parameters
guid_Element[in] GUID of the element
storedOnly[in] Get only the core data without the derived content, must be false is most cases
properties[out] IFC properties of the element
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Invalid value passed in the guid_Element parameter or properties is nullptr.
  • APIERR_MODULNOTINSTALLED - IFC add-on is not present.
Remarks
This function returns the IFC properties of an element.

◆ ACAPI_Element_GetIFCPropertyValuePrimitiveType()

GSErrCode __ACENV_CALL ACAPI_Element_GetIFCPropertyValuePrimitiveType ( const GS::UniString &  valueType,
API_IFCPropertyValuePrimitiveType *  primitiveType 
)

Get the primitive type of an IFC type.

Parameters
valueType[in] IFC type of the property value
primitiveType[out] Primitive type of the IFC type, see API_IFCPropertyAnyValue for values.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Invalid value passed in the valueType parameter or primitiveType is nullptr.
  • APIERR_MODULNOTINSTALLED - IFC add-on is not present.

◆ ACAPI_Element_GetIFCType()

GSErrCode __ACENV_CALL ACAPI_Element_GetIFCType ( const API_Guid elementID,
GS::UniString *  ifcType,
GS::UniString *  typeObjectIFCType 
)

Get IFC type and IfcTypeObject IFC type of an element.

Parameters
elementID[in] GUID of the element
ifcType[out] IFC type of the element
typeObjectIFCType[out] IFC type of the IfcTypeObject of the element
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - Invalid value passed in the elementID parameter.
  • APIERR_MODULNOTINSTALLED - IFC add-on is not present.

◆ ACAPI_Element_GetMemo()

GSErrCode __ACENV_CALL ACAPI_Element_GetMemo ( const API_Guid guid,
API_ElementMemo memo,
UInt64  mask = APIMemoMask_All 
)

Retrieves all additional information attached to elements.

Since
Archicad 25
Parameters
guid[in] Guid of the element.
memo[out] Pointer to the memo to be filled.
mask[in] Specifies which part of the memo you are interested in.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The passed memo parameter is nullptr
  • APIERR_BADID - The element type is invalid, or the element type is not supported by the server application
  • APIERR_BADID - The element guid is invalid.
  • APIERR_DELETED - The element does not exist in the database
  • APIERR_MEMFULL - not enough memory to complete the operation
Remarks
This function returns additional information attached to elements. This doesn't apply to all the drawing elements; you can check the hasMemo field of the element header. The following table shows which elements may have additional data attached; it also explains what information is returned in API_ElementMemo.
Value Parameters Function
API_WallID (API_Gable **) gables
(API_Coord **) coords
(Int32 **) pends
(API_PolyArc **) parcs
(UInt32 **) vertexIDs
(ProfileVectorImage*) customOrigProfile
(ProfileVectorImage*) stretchedProfile
(API_Guid **) wallWindows
(API_Guid **) wallDoors
Returns the gable 1 and the polygon data 2 and the vector image data of the complex cross-section profile 5. May also return the windows and doors in this wall.
API_ColumnID (API_Gable **) gables
(ProfileVectorImage*) customOrigProfile
(ProfileVectorImage*) stretchedProfile
(API_ColumnSegmentType*) columnSegments
(API_AssemblySegmentCutData*) assemblySegmentCuts
(API_AssemblySegmentSchemeData*) assemblySegmentSchemes
(API_AssemblySegmentProfileData*) assemblySegmentProfiles
Returns the gable data 1, the vector image data of the complex cross-section profile 5 and segment related information.
API_BeamID (API_Gable **) gables
(API_Beam_Hole **) beamHoles
(ProfileVectorImage*) customOrigProfile
(ProfileVectorImage*) stretchedProfile
(API_BeamSegmentType*) beamSegments
(API_AssemblySegmentCutData*) assemblySegmentCuts
(API_AssemblySegmentSchemeData*) assemblySegmentSchemes
(API_AssemblySegmentProfileData*) assemblySegmentProfiles
Returns the gable data 1, the vector image data of the complex cross-section profile 5, the holes of the beam, and segment related information.
API_WindowID API_DoorID (API_Gable **) gables
(char **) textContent
(API_AddParType **) params
Returns the gable data 1 and the parameters of the instance of a library part 4, also the window / door orientation text in textContent.
API_ObjectID API_LampID (API_Gable **) gables
(API_AddParType **) params
Returns the gable data 1 and the parameters of the instance of a library part 4
API_SkylightID (API_AddParType **) params Returns the parameters of the instance of a library part 4
API_SlabID (API_Coord **) coords
(Int32 **) pends
(API_PolyArc **) parcs
(UInt32 **) vertexIDs
(UInt32 **) edgeIDs
(UInt32 **) contourIDs
(API_EdgeTrim **) edgeTrims
(API_OverriddenAttribute *) sideMaterials
Returns the polygon 2, the edge trim data 3 and the side materials 6 of the slab.
API_RoofID (API_Coord **) coords
(Int32 **) pends
(API_PolyArc **) parcs
(UInt32 **) vertexIDs
(API_EdgeTrim **) edgeTrims
(API_RoofEdgeTypeID *) roofEdgeTypes
(API_OverriddenAttribute *) sideMaterials
(API_Coord **) pivotPolyCoords
(Int32 **) pivotPolyPends
(API_PolyArc **) pivotPolyParcs
(UInt32 ** *) pivotPolyVertexIDs
(API_PivotPolyEdgeData *) pivotPolyEdges
- API_PlaneRoofID: Returns the polygon 2, the edge trim data 3 and the side materials 6 of the roof.
- API_PolyRoofID: Returns the contour and pivot polygons 2, the edge trim data 3, the side materials 6 and the data of the pivot polygon edges 9 of the roof.
API_MeshID (API_Coord **) coords
(Int32 **) pends
(API_PolyArc **) parcs
(UInt32 **) vertexIDs
(double **) meshPolyZ
(API_MeshLevelCoord **) meshLevelCoords
(Int32 **) meshLevelEnds
Returns the polygon 2 of the mesh, and the level lines
API_ShellID API_ShellShapeData shellShapes[2]
(API_ShellContourData*) shellContours
Returns the profile shape polygon(s) 7 and the clipping and hole contour data 8 of the shell
API_MorphID (Modeler::Body*) morphBody
(API_OverriddenAttribute*) morphMaterialMapTable
Returns the body and the material override map table of the morph
API_DimensionID (API_DimElem **) dimElems Returns the coordinates, the neig information, the text, and the witness line information of the dimension
API_LabelID (char **) textContent
(short **) textLineStarts
(API_ParagraphType **) paragraphs
(API_AddParType **) params
Returns the text and its style for text-type labels, or the parameters of the originating library part for symbol labels.
API_SplineID (API_Coord **) coords
(API_SplineDir **) bezierDirs
Returns the Bezier curve parameters
API_TextID (char **) textContent
(short **) textLineStarts
(API_ParagraphType **) paragraphs
Returns the content the line starts
(offsets into textContent) and the style informations of the text. The content can be either in UTF-8 or UTF-16 encoding, depending on the text element's charCode member and the memo mask.
API_HatchID (API_Coord **) coords
(Int32 **) pends
(API_PolyArc **) parcs
(UInt32 **) vertexIDs
Returns the polygon of the hatch
API_ZoneID (API_Gable **) gables
(API_Coord **) coords
(Int32 **) pends
(API_PolyArc **) parcs
(API_AddParType **) params
Returns the polygon of the room 2
API_CameraID (API_LinkType **) linkList Returns the data of the camera
API_CutPlaneID (API_Coord **) sectionSegmentMainCoords
(API_Coord **) sectionSegmentDistCoords
(API_Coord **) sectionSegmentDepthCoords
Returns the coordinates of the main, amrked distant area, and depth line of the section segment.
API_ElevationID (API_Coord **) sectionSegmentMainCoords
(API_Coord **) sectionSegmentDistCoords
(API_Coord **) sectionSegmentDepthCoords
Returns the coordinates of the main, amrked distant area, and depth line of the section segment.
API_InteriorElevationID (API_SectionSegment **) intElevSegments
(API_Coord **) sectionSegmentMainCoords
(API_Coord **) sectionSegmentDistCoords
(API_Coord **) sectionSegmentDepthCoord
(API_AddParType **) params
Returns the coordinates of the main, amrked distant area, and depth line of the section segment, and also the parameters of the common marker.
API_ChangeMarkerID (API_Coord **) coords
(Int32 **) pends
(API_PolyArc **) parcs
Returns the polygon of the ChangeMarker 2, if it has a polygon.
API_DetailID API_WorksheetID (API_Coord **) coords
(Int32 **) pends
(API_PolyArc **) parcs
Returns the polygon of the detail or worksheet 2
API_PolyLineID (API_Coord **) coords
(Int32 **) pends
(API_PolyArc **) parcs
Returns the polygon of the polyline 2
API_PictureID (char **) pictHdl Returns the picture
API_DrawingID (API_Coord **) coords
(Int32 **) pends
(API_PolyArc **) parcs
(GSPtr) drawingData
Returns the polygon and drawing data of a drawing element
API_CurtainWallID (API_Coord **) coords
(Int32 **) pends
(API_PolyArc **) parcs
(UInt32 **) vertexIDs
(API_CWSegmentPatternData) cWSegPrimaryPattern
(API_CWSegmentPatternData) cWSegSecondaryPattern
(API_CWSegmentPatternCellData*) cWSegPatternCells
(API_CWSegmentType*) cWallSegments
(API_CWFrameType*) cWallFrames
(API_CWFrameType*) cWallFrameDefaults
(API_CWPanelType*) cWallPanels
(API_CWPanelGridIDTable*) cWallPanelGridIDTable
(API_CWPanelType*) cWallPanelDefaults
(API_CWPanelType*) cWallPanelDefaultSymbs
(API_CWJunctionType*) cWallJunctions
(API_CWAccessoryType*) cWallAccessories
Returns the polygon and all CW related data. cWSegPrimaryPattern, cWSegSecondaryPattern and cWSegPatternCells members will contain the default segment scheme of the curtain wall.
API_CurtainWallSegmentID (API_GridMesh*) cWSegGridMesh
(API_CWContourData*) cWSegContour
(API_CWSegmentPatternData) cWSegPrimaryPattern
(API_CWSegmentPatternData) cWSegSecondaryPattern
(API_CWSegmentPatternCellData*) cWSegPatternCells
Returns the CW segment related data.
API_CurtainWallPanelID (API_Coord **) coords Returns the coordinates of the panel's polygon. Please note that a curtain wall panel cannot contain holes.
API_StairID (API_StairRiserType*) stairRisers
(API_StairTreadType*) stairTreads
(API_StairStructureType*) stairStructures
(API_StairBoundaryData[2]) stairBoundary
Returns the Stair related data.
API_RailingID (API_Coord **) coords
(Int32 **) pends
(API_PolyArc **) parcs
(API_RailingNodeType*) railingNodes
(API_RailingSegmentType*) railingSegments
(API_RailingPostType*) railingPosts
(API_RailingRailEndType*) railingRailEnds
(API_RailingRailEndType*) railingHandrailEnds
(API_RailingRailEndType*) railingToprailEnds
(API_RailingRailConnectionType*) railingRailConnections
(API_RailingRailConnectionType*) railingHandrailConnections
(API_RailingRailConnectionType*) railingToprailConnections
(API_RailingRailType*) railingRails
(API_RailingToprailType*) railingToprails
(API_RailingHandrailType*) railingHandrails
(API_RailingPatternType*) railingPatterns
(API_RailingInnerPostType*) railingInnerPosts
(API_RailingPanelType*) railingPanels
(API_RailingBalusterSetType*) railingBalusterSets
(API_RailingBalusterType*) railingBalusters
(double**) polyZCoords;
Returns the Railing related data.
API_ExternalElemID (API_AddParType **) params Returns the parameters of the instance of a library part 4

1 Any number of gables can be present.
2 See the description of API_Polygon.
3 The length of the API_EdgeTrim memo handle is (poly.nCoords+1)*sizeof(API_EdgeTrim) ; the first and the last record are not used, filled with zero.
4 The parameters of an element are the parameters of its originating library part, their values are taken from the actual instance.
5 The drawing primitives of the complex profile are stored in a serialized HGX::VectorImage.
6 The length of the sideMaterials memo array is (poly.nCoords+1)*sizeof(API_OverriddenAttribute) ; the first and the last record are not used, filled with zero.
7 Fixed size array of two API_ShellShapeData records. The members of API_ShellShapeData are handled similarly to the members of API_Polygon.
8 The number of API_ShellContourData records in the shellContours memo array can be calculated from the API_ShellType parameters: numHoles+(hasContour?1:0).
9 The length of the pivotPolyEdges memo array is (pivotPolygon.nCoords+1)*sizeof(API_PivotPolyEdgeData); the first and the last record are not used, filled with zero. For improving performance you can select which data is needed with the mask parameter. This feature provides filtered access to the attached data; instead of converting all the attached data, the function returns only those which are in interest. The possible values of the mask are:
Mask Meaning
APIMemoMask_Polygon Returns the polygon for polygonal elements. For more information see API_Polygon.
APIMemoMask_Gables Returns the gable information.
APIMemoMask_AddPars Returns the additional parameters of a library part-based element (object, lamp, door, window, zone stamp, label).
APIMemoMask_EdgeTrims Returns the edge trim information for roofs and slabs. (Renamed from APIMemoMask_RoofSide.)
APIMemoMask_MeshPolyZ Returns Z coordinates of the mesh points for meshes.
APIMemoMask_MeshLevel Returns the mesh level information for meshes.
APIMemoMask_BeamHole Returns the hole information for beams.
APIMemoMask_TextContent Returns the content as ANSI string for textual elements (Text, Label). (This is the default.)
APIMemoMask_Paragraph Returns paragraph informations for textual elements (Text, Label). The paragraphs handle contains byte offsets. Use with APIMemoMask_TextContent mask. (This is the default.)
APIMemoMask_TextContentUni Returns the content as UniCode string for textual elements (Text, Label). You should cast the textContent handle to unsigned short **
APIMemoMask_ParagraphUni Returns paragraph informations for textual elements (Text, Label). The paragraphs handle contains character offsets. Use with APIMemoMask_TextContentUni mask.
APIMemoMask_DrawingData Returns the drawing data of a drawing element (API_DrawingType) in internal format. See also ACAPI_Drawing_StopDrawingData.
APIMemoMask_CustomOrigProfile Returns the original custom profile data applied to the wall, beam, or column element.
APIMemoMask_StretchedProfile Returns the stretched profile actually used by the wall, beam, or column element.
APIMemoMask_SectionSegments Returns the section segments of a section, elevation, or interior elevation element.
APIMemoMask_SectionMainCoords Returns the section view line coordinates of a section, elevation, or interior elevation element.
APIMemoMask_SectionDistCoords Returns the section marked distant area line coordinates of a section, elevation, or interior elevation element.
APIMemoMask_SectionDepthCoords Returns the section depth line coordinates of a section, elevation, or interior elevation element.
APIMemoMask_WallWindows Returns the Guid list of the windows placed in a given wall element.
APIMemoMask_WallDoors Returns the Guid list of the doors placed in a given wall element.
APIMemoMask_CWSegGridMesh Returns the GridMesh of a curtain wall segment.
APIMemoMask_CWSegPrimaryPattern Returns the primary pattern of a curtain wall segment.
APIMemoMask_CWSegSecPattern Returns the secondary pattern of a curtain wall segment.
APIMemoMask_CWSegPanelPattern Returns the panel pattern of curtain wall segment.
APIMemoMask_CWSegContour Returns the contour of curtain wall segment.
APIMemoMask_CWallSegments Returns the segments of curtain wall element.
APIMemoMask_CWallFrames Returns the frames of curtain wall element.
APIMemoMask_CWallPanels Returns the panels of curtain wall element.
APIMemoMask_CWallJunctions Returns the junctions of curtain wall element.
APIMemoMask_CWallAccessories Returns the accessories of curtain wall element.
APIMemoMask_FromFloorPlan Additional flag; take the element information from the floor plan database. This flag is excluded from APIMemoMask_All!
APIMemoMask_RoofEdgeTypes Returns the edge types of the contour polygon of a roof element.
APIMemoMask_SideMaterials Returns the side material indices of a Slab or Roof element.
APIMemoMask_PivotPolygon Returns the pivot polygon and the pivot edges of a Multi-plane Roof element (see API_PolyRoofData).
APIMemoMask_StairRiser Returns the Riser subelements of a Stair element.
APIMemoMask_StairTread Returns the Tread subelements of a Stair element.
APIMemoMask_StairStructure Returns the Stair Structure subelements of a Stair element.
APIMemoMask_RailingNode Returns the Nodes of a Railing element.
APIMemoMask_RailingSegment Returns the Segments of a Railing element.
APIMemoMask_RailingPost Returns the Railing Posts of a Railing element.
APIMemoMask_RailingInnerPost Returns the Inner Posts of a Railing element.
APIMemoMask_RailingRail Returns the Rails of a Railing element.
APIMemoMask_RailingHandrail Returns the Handrails of a Railing element.
APIMemoMask_RailingToprail Returns the Toprails of a Railing element.
APIMemoMask_RailingPanel Returns the Railing Panels of a Railing element.
APIMemoMask_RailingBaluster Returns the Balusters of a Railing element.
APIMemoMask_RailingPattern Returns the Railing Patterns of a Railing element.
APIMemoMask_RailingBalusterSet Returns the Baluster Sets of a Railing element.
APIMemoMask_RailingRailEnd Returns the Rail Ends of a Railing Node element.
APIMemoMask_RailingRailConnection Returns the Rail Connections of a Railing Node element.
APIMemoMask_BeamSegment Returns the Beam segments of a Beam element.
APIMemoMask_ColumnSegment Returns the Column segments of a Column element.
APIMemoMask_AssemblySegmentCut Returns cuts of a Column or a Beam element.
APIMemoMask_AssemblySegmentScheme Returns schemes of ColumnSegments or BeamSegments.
APIMemoMask_AssemblySegmentProfile Returns profiles of ColumnSegments or BeamSegments.
APIMemoMask_SurfaceLoadCustomData Returns the contour of the Custom Surface Load
APIMemoMask_All Returns all the applicable fields for the element.

Do not forget to call ACAPI_DisposeElemMemoHdls to dispose of the handles when you're finished.

Example
void DoAnything (const API_Guid&)
{
API_Element element = {};
GSErrCode err;
element.header.guid = guid;
err = ACAPI_Element_Get (&element);
if (err == NoError && element.header.hasMemo) {
err = ACAPI_Element_GetMemo (element.header.guid, &memo, APIMemoMask_Gables);
if (err == NoError) {
/* ... do anything with it ... */
}
}
}
bool hasMemo
Tells whether an element has extended information (memo) attached.
Definition: APIdefs_Elements.h:407

◆ ACAPI_Element_GetMemo_ExternalHierarchical()

GSErrCode __ACENV_CALL ACAPI_Element_GetMemo_ExternalHierarchical ( const API_Guid guid,
UInt32  nSubElems,
API_SubElement subElems,
UInt64  mask = APIMemoMask_All 
)

Retrieves all additional information of the sub elements of an external hierarchical element.

Since
Archicad 27
Parameters
guid[in] Guid of the external hierarchical element.
nSubElems[in] The number of subelems passed.
subElems[out] The subelem(s) of the desired element.
mask[in] Specifies which part of the memo you are interested in.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The element type is invalid, or the element type is not supported by the server application
  • APIERR_BADID - The element guid is invalid.
  • APIERR_DELETED - The element does not exist in the database
  • APIERR_MEMFULL - not enough memory to complete the operation

◆ ACAPI_Element_GetMoreQuantities()

GSErrCode __ACENV_CALL ACAPI_Element_GetMoreQuantities ( const GS::Array< API_Guid > *  elemGuids,
const API_QuantityPar params,
GS::Array< API_Quantities > *  quantities,
const API_QuantitiesMask mask = nullptr 
)

Returns information on the quantities parameters of multiple elements of the same type.

Parameters
elemGuids[in] Guids of the elements.
params[in] Input parameters.
quantities[Out] Optional quantity parameters, one in the array for each Guid.
mask[In] Optional parameter for masking the relevant fields of quantities (by default it is nullptr).
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Either elemGuids or quantities is nullptr, quantities does not have the same size as elemGuids, or mask is nullptr and either elements or composites field is nullptr in quantities.
  • APIERR_BADID - Incorrect elemGuids was specified.
Remarks
This function is used to get the quantity parameters of multiple elements of the same type. The quantitites are: surface, volume, perimeter, length and several other parameters. This applies to all construction elements. The elemGuids and the quantities arrays need to have the same size.
Example
GS::Array<API_Quantities> quantities;
GS::Array<API_Guid> elemGuids;
char s[256] = { '\0' };
GSErrCode err;
ACAPI_ELEMENT_QUANTITY_MASK_SET (mask, wall, surface1);
ACAPI_ELEMENT_QUANTITY_MASK_SET (mask, wall, volume);
quantities.SetSize (1);
quantities[0].elements = &quantity;
elemGuids.Push (elemGuid);
params.minOpeningSize = EPS;
err = ACAPI_Element_GetMoreQuantities (&elemGuids, &params, &quantities, &mask);
if (!err) {
sprintf (s, "surface1: %.2lf volume: %.2lf", quantity.wall.surface1, quantity.wall.volume);
ACAPI_WriteReport (s, true);
}
Describes the filter for the different calculated values for skins and elements.
Definition: APIdefs_Elements.h:17942
void ACAPI_ELEMENT_QUANTITY_MASK_CLEAR(API_QuantitiesMask &mask)
Clears the element part of the mask for querying element quantities.
Definition: APIdefs_Elements.h:17983
GSErrCode __ACENV_CALL ACAPI_Element_GetMoreQuantities(const GS::Array< API_Guid > *elemGuids, const API_QuantityPar *params, GS::Array< API_Quantities > *quantities, const API_QuantitiesMask *mask=nullptr)
Returns information on the quantities parameters of multiple elements of the same type.
Supplies extra information for some element quantity calculations.
Definition: APIdefs_Elements.h:17567
double minOpeningSize
minimum opening size to reduce wall [in square meters] (ignored at non-wall calculations)
Definition: APIdefs_Elements.h:17572
double surface1
surface of the wall on the reference line side
Definition: APIdefs_Elements.h:15074
double volume
volume of the wall
Definition: APIdefs_Elements.h:15044
Describes the different calculated values.
Definition: APIdefs_Elements.h:17353
API_WallQuantity wall
Describes the different calculated values for wall. API_WallQuantity.
Definition: APIdefs_Elements.h:17358

◆ ACAPI_Element_GetOpeningTransformation()

GSErrCode __ACENV_CALL ACAPI_Element_GetOpeningTransformation ( const API_Guid elemGuid,
API_Tranmat openingTranMat 
)

Returns the position and the normal vector of the given opening.

Parameters
elemGuid[in] The opening element's GUID.
openingTranMat[out] The global → local transformation matrix of the opening.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The openingTranMat parameter is nullptr.
  • APIERR_DELETED - The elemGuid doesn't point to a valid element.
  • APIERR_BADID - The elemGuid doesn't point to a valid opening.
  • APIERR_GENERAL - The transformation matrix cannot be calculated.
Remarks
The transformation matrix may result in a left-handed coordinate system if the opening is mirrored.

◆ ACAPI_Element_GetPropertyDefinitions() [1/2]

GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyDefinitions ( const API_ElemComponentID elemComponent,
API_PropertyDefinitionFilter  filter,
GS::Array< API_PropertyDefinition > &  propertyDefinitions 
)

Retrieves all of the property definitions that are available for a component of an element.

Parameters
elemComponent[in] The identifier of the element's component to search for.
filter[in] Filter the list of property definitions (API_PropertyDefinitionFilter_UserDefined, API_PropertyDefinitionFilter_BuiltIn, API_PropertyDefinitionFilter_All).
propertyDefinitions[out] Array of property definitions that are available for the given component.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The value of elemComponent did not refer to a valid component.
Example
GSErrCode GetPropertyDefinitionNames (const API_ElemComponentID& elemComponent, GS::Array<GS::UniString>& names)
{
GS::Array<API_PropertyDefinition> definitions;
const GSErrCode error = ACAPI_Element_GetPropertyDefinitions (elemComponent, API_PropertyDefinitionFilter_All, definitions);
if (error == NoError) {
for (UInt32 i = 0; i < definitions.GetSize (); ++i) {
names.Push (definitions[i].name);
}
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyDefinitions(const API_Guid &elemGuid, API_PropertyDefinitionFilter filter, GS::Array< API_PropertyDefinition > &propertyDefinitions)
Retrieves all of the property definitions that are available for an element.
Identifies a component of an element.
Definition: APIdefs_Component.h:28

◆ ACAPI_Element_GetPropertyDefinitions() [2/2]

GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyDefinitions ( const API_Guid elemGuid,
API_PropertyDefinitionFilter  filter,
GS::Array< API_PropertyDefinition > &  propertyDefinitions 
)

Retrieves all of the property definitions that are available for an element.

Parameters
elemGuid[in] The element's identifier to search for.
filter[in] Filter the list of property definitions (API_PropertyDefinitionFilter_UserDefined, API_PropertyDefinitionFilter_FundamentalBuiltIn, API_PropertyDefinitionFilter_UserLevelBuiltIn, API_PropertyDefinitionFilter_All).
propertyDefinitions[out] Array of property definitions that are available for a classification of the given element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The elemGuid did not refer to a valid element.
Example
GSErrCode GetPropertyDefinitionNames (const API_Guid& elemGuid, GS::Array<GS::UniString>& names)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitions (elemGuid, API_PropertyDefinitionFilter_UserDefined, definitions);
if (error == NoError) {
for (UInt32 i = 0; i < definitions.GetSize (); ++i) {
names.Push (definitions[i].name);
}
}
return error;
}

◆ ACAPI_Element_GetPropertyDefinitionsOfDefaultElem()

GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyDefinitionsOfDefaultElem ( const API_ElemType type,
API_PropertyDefinitionFilter  filter,
GS::Array< API_PropertyDefinition > &  definitions 
)

Retrieves all of the property definitions that are available for an element default.

Since
Archicad 26
Parameters
type[in] Type of the default element.
filter[in] The property definition type to filter for.
definitions[out] Array of property definitions that are available for a classification of the given element default.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - Incorrect type was specified.
Remarks
From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.
Example
GSErrCode GetPropertyDefinitionNames (const API_ElemType& type, GS::Array<GS::UniString>& names)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitionsOfDefaultElem (type, definitions);
if (error == NoError) {
for (UInt32 i = 0; i < definitions.GetSize (); i++) {
names.Push(definitions[i].name);
}
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyDefinitionsOfDefaultElem(const API_ElemType &type, API_PropertyDefinitionFilter filter, GS::Array< API_PropertyDefinition > &definitions)
Retrieves all of the property definitions that are available for an element default.

◆ ACAPI_Element_GetPropertyObjects()

GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyObjects ( const API_Elem_Head elemHead,
API_PropertyObjectRefType ***  propRefs,
Int32 *  nProp 
)

Returns property objects of the element.

Parameters
elemHead[in] The element to get the properties for.
propRefs[out] List of property objects.
nProp[out] Number of the property objects.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - propRefs or nProp is nullptr
  • APIERR_BADID - Incorrect elemHead was specified
  • APIERR_MEMFULL - Not enough memory to get the properties
Remarks
This function is used to get the list of property objects for a linked element. The properties can be associated with construction elements by criteria or by individual direct assignment. This applies to all construction elements. From Archicad 9 the linked properties of both an element instance and the element defaults can be accessed with two new functions: ACAPI_ElementLink_GetLinkedPropertyObjects and ACAPI_ElementLink_SetLinkedPropertyObjects.
Example
void GetProperties (const API_Guid& guid)
{
API_Elem_Head elemHead;
API_LibPart libPart;
Int32 nProp, i;
char s[256];
GSErrCode err;
BNZeroMemory (&elemHead, sizeof (API_Elem_Head));
elemHead.guid = guid;
err = ACAPI_Element_GetPropertyObjects (&elemHead, &propRefs, &nProp);
if (err == NoError) {
for (i = 0; i < nProp; i++) {
BNZeroMemory (&libPart, sizeof (API_LibPart));
libPart.index = (*propRefs)[i].libIndex;
err = ACAPI_LibraryPart_Get (&libPart);
if (err == NoError) {
if ((*propRefs)[i].assign)
sprintf (s, "Associated property:");
else
sprintf (s, "Property by criteria:");
sprintf (s, "%s %s", s, (const char *) GS::UniString (libPart.docu_UName).ToCStr ());
ACAPI_WriteReport (s, false);
}
}
BMKillHandle ((GSHandle *) &propRefs);
}
}
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyObjects(const API_Elem_Head *elemHead, API_PropertyObjectRefType ***propRefs, Int32 *nProp)
Returns property objects of the element.
The property object reference record.
Definition: APIdefs_Elements.h:18034

◆ ACAPI_Element_GetPropertyValue() [1/2]

GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValue ( const API_ElemComponentID elemComponent,
const API_Guid propertyDefinitionGuid,
API_Property property 
)

Retrieves the specified property definition's value from the component.

Parameters
elemComponent[in] The identifier of the element's component to search for.
propertyDefinitionGuid[in] The property definition to get the values for.
property[out] The value of the requested property.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The elemComponent did not refer to a valid component.
  • APIERR_GENERAL - The propertyDefinitionGuid did not refer to a valid property definition.
Example
GSErrCode GetPropertyValue (const API_ElemComponentID& elemComponent, API_PropertyValue& value)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitions (elemComponent, API_PropertyDefinitionFilter_All, definitions);
if (error == NoError && !definitions.IsEmpty ()) {
API_Property property = {};
error = ACAPI_Element_GetPropertyValue (elemComponent, definitions[0].guid, property);
if (error == NoError) {
value = property.value;
}
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValue(const API_Guid &elemGuid, const API_Guid &propertyDefinitionGuid, API_Property &property)
Retrieves the specified property definition's value from the element.
A container that can store different types of data.
Definition: APIdefs_Properties.h:781
A container for storing a property's value.
Definition: APIdefs_Properties.h:560

◆ ACAPI_Element_GetPropertyValue() [2/2]

GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValue ( const API_Guid elemGuid,
const API_Guid propertyDefinitionGuid,
API_Property property 
)

Retrieves the specified property definition's value from the element.

Parameters
elemGuid[in] The element GUID to search for.
propertyDefinitionGuid[in] The property definition to get the values for.
property[out] The value of the requested property.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The elemGuid did not refer to a valid element.
  • APIERR_GENERAL - The propertyDefinitionGuid did not refer to a valid property definition.
Example
GSErrCode GetPropertyValue (const API_Guid& elemGuid, API_PropertyValue& value)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitions (elemGuid, API_PropertyDefinitionFilter_UserDefined, definitions);
if (error == NoError) {
API_Property property = {};
error = ACAPI_Element_GetPropertyValue (elemGuid, definitions[0].guid, property);
if (error == NoError) {
value = property;
}
}
return error;
}

◆ ACAPI_Element_GetPropertyValueOfDefaultElem()

GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValueOfDefaultElem ( const API_ElemType type,
const API_Guid propertyDefinitionGuid,
API_Property property 
)

Retrieves the value of the specified property definition.

Since
Archicad 26
Parameters
type[in] Type of the default element.
propertyDefinitionGuid[in] The property definition's GUID to get the value for.
property[out] The value of the requested property.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - Incorrect type was specified.
Remarks
From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.
Example
GSErrCode GetPropertyValue (const API_ElemType& type, API_PropertyValue& value)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitionsOfDefaultElem (type, API_PropertyDefinitionFilter_UserDefined, definitions);
if (error == NoError && definitions.GetSize () > 0) {
API_Property property = {};
error = ACAPI_Element_GetPropertyValueOfDefaultElem (type, definitions[0].guid, property);
if (error == NoError) {
value = property;
}
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValueOfDefaultElem(const API_ElemType &type, const API_Guid &propertyDefinitionGuid, API_Property &property)
Retrieves the value of the specified property definition.

◆ ACAPI_Element_GetPropertyValues() [1/2]

GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValues ( const API_ElemComponentID elemComponent,
const GS::Array< API_PropertyDefinition > &  propertyDefinitions,
GS::Array< API_Property > &  properties 
)

Retrieves the values of the specified property definitions from the component.

Parameters
elemComponent[in] The identifier of the element's component to search for.
propertyDefinitions[in] The property definitions to get the values for.
properties[out] The definitions and values of the requested properties.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The elemComponent did not refer to a valid element.
Example
GSErrCode GetAllPropertyValues (const API_ElemComponentID& elemComponent, GS::Array<API_PropertyValue>& values)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitions (elemComponent, API_PropertyDefinitionFilter_All, definitions);
if (error == NoError) {
GS::Array<API_Property> properties;
error = ACAPI_Element_GetPropertyValues (elemComponent, definitions, properties);
if (error == NoError) {
for (UInt32 i = 0; i < properties.GetSize (); i++) {
if (properties[i].isDefault) {
values.Push (properties[i].definition.defaultValue.basicValue);
} else {
values.Push (properties[i].value);
}
}
}
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValues(const API_Guid &elemGuid, const GS::Array< API_PropertyDefinition > &propertyDefinitions, GS::Array< API_Property > &properties)
Retrieves the specified property definitions with values.

◆ ACAPI_Element_GetPropertyValues() [2/2]

GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValues ( const API_Guid elemGuid,
const GS::Array< API_PropertyDefinition > &  propertyDefinitions,
GS::Array< API_Property > &  properties 
)

Retrieves the specified property definitions with values.

Parameters
elemGuid[in] The element GUID to search for.
propertyDefinitions[in] The property definitions to get the values for. They are identified through definition.guid.
properties[out] The definitions and values of the requested properties.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The elemGuid did not refer to a valid element.
Example
GSErrCode GetAllPropertyValues (const API_Guid& elemGuid, GS::Array<API_PropertyValue>& values)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitions (elemGuid, API_PropertyDefinitionFilter_UserDefined, definitions);
if (error == NoError) {
GS::Array<API_Property> properties;
error = ACAPI_Element_GetPropertyValues (elemGuid, definitions, properties);
if (error == NoError) {
for (UInt32 i = 0; i < properties.GetSize (); i++) {
if (properties[i].isDefault) {
values.Push (properties[i].definition.defaultValue);
} else {
values.Push (properties[i].value);
}
}
}
}
return error;
}

◆ ACAPI_Element_GetPropertyValuesByGuid() [1/2]

GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValuesByGuid ( const API_ElemComponentID elemComponent,
const GS::Array< API_Guid > &  propertyDefinitions,
GS::Array< API_Property > &  properties 
)

Retrieves the specified property definitions (defined by their GUIDs) with values from the component.

Parameters
elemComponent[in] The identifier of the element's component to search for.
propertyDefinitions[in] The property definition GUIDs to get the values for.
properties[out] The definitions and values of the requested properties.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The elemComponent did not refer to a valid element.
Example
GSErrCode GetAllPropertyValues (const API_ElemComponentID& elemComponent, GS::Array<API_PropertyValue>& values)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitions (elemComponent, API_PropertyDefinitionFilter_UserDefined, definitions);
if (error == NoError) {
GS::Array<API_Guid> propertyDefinitionGuids;
for (UInt32 i = 0; i < definitions.GetSize (); i++) {
propertyDefinitionGuids.Push (definitions[i].guid);
}
GS::Array<API_Property> properties;
error = ACAPI_Element_GetPropertyValuesByGuid (elemComponent, propertyDefinitionGuids, properties);
if (error == NoError) {
for (UInt32 i = 0; i < properties.GetSize (); i++) {
if (properties[i].isDefault) {
values.Push (properties[i].definition.defaultValue.basicValue);
} else {
values.Push (properties[i].value);
}
}
}
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValuesByGuid(const API_Guid &elemGuid, const GS::Array< API_Guid > &propertyDefinitions, GS::Array< API_Property > &properties)
Retrieves the specified property definitions (defined by their GUIDs) with values.

◆ ACAPI_Element_GetPropertyValuesByGuid() [2/2]

GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValuesByGuid ( const API_Guid elemGuid,
const GS::Array< API_Guid > &  propertyDefinitions,
GS::Array< API_Property > &  properties 
)

Retrieves the specified property definitions (defined by their GUIDs) with values.

Parameters
elemGuid[in] The element GUID to search for.
propertyDefinitions[in] The property definition GUIDs to get the values for.
properties[out] The definitions and values of the requested properties.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The elemGuid did not refer to a valid element.
Example
GSErrCode GetAllPropertyValues (const API_Guid& elemGuid, GS::Array<API_PropertyValue>& values)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitions (elemGuid, API_PropertyDefinitionFilter_UserDefined, definitions);
if (error == NoError) {
GS::Array<API_Guid> propertyDefinitionList;
for (UInt32 i = 0; i (); i++) {
if (ACAPI_Element_IsPropertyDefinitionVisible (elemGuid, definitions[i].guid)) {
propertyDefinitionList.Push (definitions[i].guid);
}
}
GS::Array<API_Property> properties;
error = ACAPI_Element_GetPropertyValuesByGuid (elemGuid, propertyDefinitionList, properties);
if (error == NoError) {
for (UInt32 i = 0; i < properties.GetSize (); i++) {
if (properties[i].isDefault) {
values.Push (properties[i].definition.defaultValue);
} else {
values.Push (properties[i].value);
}
}
}
}
return error;
}
For more detailed examples, please see the Property_Test add-on.
Requirements
Version:
API 22 or later
Header:
ACAPinc.h
See Also
Properties
,
API Functions
Created on April 25, 2018
bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionVisible(const API_Guid &elemGuid, const API_Guid &propertyGuid)
Tells whether a property definition is visible for an element.

◆ ACAPI_Element_GetPropertyValuesOfDefaultElem()

GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValuesOfDefaultElem ( const API_ElemType type,
const GS::Array< API_PropertyDefinition > &  propertyDefinitions,
GS::Array< API_Property > &  properties 
)

Retrieves the values of the specified property definitions.

Since
Archicad 26
Parameters
type[in] Type of the default element.
propertyDefinitions[in] The property definitions (identified by definition.guid) to get the values for.
properties[out] The definitions and values of the requested properties.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - Incorrect type was specified.
Remarks
From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.
Example
GSErrCode GetAllPropertyValues (const API_ElemType& type, GS::Array<API_PropertyValue>& values)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitionsOfDefaultElem (type, API_PropertyDefinitionFilter_UserDefined, definitions);
if (error == NoError) {
GS::Array<API_Property> properties;
error = ACAPI_Element_GetPropertyValuesOfDefaultElem (type, definitions, properties);
if (error == NoError) {
for (UInt32 i = 0; i < properties.GetSize (); i++) {
if (properties[i].isDefault) {
values.Push (properties[i].definition.defaultValue);
} else {
values.Push (properties[i].value);
}
}
}
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValuesOfDefaultElem(const API_ElemType &type, const GS::Array< API_PropertyDefinition > &propertyDefinitions, GS::Array< API_Property > &properties)
Retrieves the values of the specified property definitions.

◆ ACAPI_Element_GetPropertyValuesOfDefaultElemByGuid()

GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValuesOfDefaultElemByGuid ( const API_ElemType type,
const GS::Array< API_Guid > &  propertyDefinitionGuids,
GS::Array< API_Property > &  properties 
)

Retrieves the values of the specified property definitions.

Since
Archicad 26
Parameters
type[in] Type of the default element.
propertyDefinitionGuids[in] The property definition GUIDs to get the values for.
properties[out] The definitions and values of the requested properties.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - Incorrect type was specified.
Remarks
From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.
Example
GSErrCode GetAllPropertyValuesByGuid (const API_ElemType& type, GS::Array<API_PropertyValue>& values)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitionsDefault (type, definitions);
if (error == NoError) {
GS::Array<API_Guid> propGuids;
for (UInt32 i = 0; i < definitions.GetSize (); i++) {
propGuids.Push (definitions[i].guid);
}
GS::Array<API_Property> properties;
error = ACAPI_Element_GetPropertyValuesOfDefaultElemByGuid (type, propGuids, properties);
if (error == NoError) {
for (UInt32 i = 0; i < properties.GetSize (); i++) {
if (properties[i].isDefault) {
values.Push (properties[i].definition.defaultValue);
} else {
values.Push (properties[i].value);
}
}
}
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_Element_GetPropertyValuesOfDefaultElemByGuid(const API_ElemType &type, const GS::Array< API_Guid > &propertyDefinitionGuids, GS::Array< API_Property > &properties)
Retrieves the values of the specified property definitions.

◆ ACAPI_Element_GetQuantities()

GSErrCode __ACENV_CALL ACAPI_Element_GetQuantities ( API_Guid  elemGuid,
const API_QuantityPar params,
API_Quantities quantities,
const API_QuantitiesMask mask = nullptr 
)

Returns information on the quantities parameters of an element.

Parameters
elemGuid[in] Guid of the element.
params[in] Input parameters.
quantities[Out] Optional quantity parameters.
mask[In] Optional parameter for masking the relevant fields of quantities (by default it is nullptr).
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - quantities is nullptr, or mask is nullptr and either elements or composites field is nullptr in quantities.
  • APIERR_BADID - Incorrect elemGuid was specified.
Remarks
This function is used to get the quantity parameters of an element. The quantitites are: surface, volume, perimeter, length and several other parameters. This applies to all construction elements.
Example
API_Quantities quantities;
char s[256] = { '\0' };
GSErrCode err;
ACAPI_ELEMENT_QUANTITY_MASK_SET (mask, wall, surface1);
ACAPI_ELEMENT_QUANTITY_MASK_SET (mask, wall, volume);
quantities.elements = &quantity;
params.minOpeningSize = EPS;
err = ACAPI_Element_GetQuantities (elemGuid, &params, &quantities, &mask);
if (!err) {
sprintf (s, "surface1: %.2lf volume: %.2lf", quantity.wall.surface1, quantity.wall.volume);
ACAPI_WriteReport (s, true);
}
Describes the different calculated values for skins of composite or complex elements.
Definition: APIdefs_Elements.h:17694
API_ElementQuantity * elements
Describes the different calculated values.
Definition: APIdefs_Elements.h:17699
GSErrCode __ACENV_CALL ACAPI_Element_GetQuantities(API_Guid elemGuid, const API_QuantityPar *params, API_Quantities *quantities, const API_QuantitiesMask *mask=nullptr)
Returns information on the quantities parameters of an element.

◆ ACAPI_Element_GetRelations()

GSErrCode __ACENV_CALL ACAPI_Element_GetRelations ( const API_Guid guid,
const API_ElemType otherType,
void *  relData,
UInt32  mask = 0 
)

Returns information on objects connected to walls, beams, beam segments, rooms, shells, roofs, curtain wall panels, skylights, windows and doors.

Since
Archicad 26
Parameters
guid[in] Guid of the element.
otherType[in] Type of the requested element.
relData[out] The relation data returned by the function. This pointer must refer to an API_WallRelation, API_BeamRelation, API_BeamSegmentRelation, API_RoomRelation, API_RoofRelation, API_ShellRelation, API_SkylightRelation, API_WindowRelation, or an API_DoorRelation structure according to the type of the requested element given be the guid parameter.
mask[in] Optional mask. Currently valid values are 0 and APIElemMask_FromFloorplan. In the latter case, the element referred by guid is searched in the floor plan database.
Returns
  • NoError - The operation was successful.
  • APIERR_BADPARS - The relData parameter was nullptr or otherID parameter is incorrect.
  • APIERR_BADID - Incorrect guid was specified.
  • APIERR_DELETED - The element does not exist in the database
Remarks
This function returns information on elements connected to the element identified by the given guid. The requested object type is given in otherType.
Type of the given element otherID Comment
walls API_ZombieElemID, API_WallID For walls the connected elements and the modified polygon is put into relData. Positive indices mean that the begin point of the other object is connected to the wall; while negative indices mean the end point. Five types of connections are returned: walls which are connected to the begin point, to the end point and to the reference line of the wall, walls to the reference line of whose the wall you requested information on is connected, and cross connections.
rooms API_ZombieElemID, API_WallID, API_ColumnID, API_ObjectID, API_LampID, API_WindowID API_DoorID, API_BeamID, API_CurtainWallID, API_CurtainWallFrameID, API_CurtainWallPanelID, API_CurtainWallJunctionID, API_CurtainWallAccessoryID, API_CurtainWallSegmentID, API_SkylightID, API_RoofID, API_ShellID, API_MorphID, API_StairID, API_RiserID, API_TreadID, API_StairStructureID, API_RailingID, API_RailingToprailID, API_RailingHandrailID, API_RailingRailID, API_RailingPostID, API_RailingInnerPostID, API_RailingBalusterID, API_RailingPanelID, API_RailingSegmentID, API_RailingToprailEndID, API_RailingHandrailEndID, API_RailingRailEndID, API_RailingToprailConnectionID, API_RailingHandrailConnectionID, API_RailingRailConnectionID, API_RailingNodeID or API_SlabID For rooms, the walls, columns, objects, lamps, windows, doors, beams, curtain walls, skylights, roofs, shells, morphs, stairs, risers, treads, railings and slabs are returned. For walls, beams and curtain wall segments the returned information contains that segment of the wall which is inside the room (see API_WallPart / API_CWSegmentPart and API_BeamPart).
beams API_ZombieElemID or API_BeamID For beams the connected elements and the modified polygon is put into relData. Positive indices mean that the begin point of the other object is connected to the beam; while negative indices mean the end point. Five types of connections are returned: beams which are connected to the begin point, to the end point and to the reference line of the beam, beams to the reference line of whose the beam you requested information on is connected, and cross connections.
beam segments API_ZombieElemID or API_BeamSegmentID For beam segments the connected elements and the modified polygon is put into relData. Positive indices mean that the begin point of the other object is connected to the beam segment; while negative indices mean the end point. Five types of connections are returned: beam segments which are connected to the begin point, to the end point and to the reference line of the beam segment, beam segments to the reference line of whose the beam segment you requested information on is connected, and cross connections.
curtain wall panels and skylights API_ZombieElemID or API_ZoneID For curtain wall panels and skylights the connected rooms are put into relData.
windows and doors API_ZombieElemID or API_ZoneID For windows and doors the connected rooms are put into relData.
roof and shell API_ZombieElemID or API_ZoneID For roof and shell the connected rooms are put into rooms.
Don't forget to call the appropriate ACAPI_DisposeRoomRelationHdls, ACAPI_DisposeWallRelationHdls, ACAPI_DisposeBeamRelationHdls, or ACAPI_DisposeBeamSegmentRelationHdls function to dispose the handles. From version 26 the otherTypeID parameter was changed into an API_ElemType parameter.
Example
// API_WallRelation example
GS::Array<API_Guid> elemList;
ACAPI_Element_GetElemList (API_WallID, &elemList);
for (const API_Guid& wallGuid : elemList) {
if (ACAPI_Element_GetRelations (wallGuid, API_WallID, (void*)& relData) != NoError)
continue;
ACAPI_WriteReport ("Connected walls to the wall %s", false, APIGuidToString (wallGuid).ToCStr ().Get ());
if (relData.conBeg != nullptr) {
ACAPI_WriteReport ("\tat the begin point:", false);
for (Int32 ind = 0; ind < relData.nConBeg; ind++) {
ACAPI_WriteReport ("\t\t#%ld ", false, (*(relData.conBeg))[ind]);
}
}
if (relData.conEnd != nullptr) {
ACAPI_WriteReport ("\tat the end point:", false);
for (Int32 ind = 0; ind < relData.nConEnd; ind++) {
ACAPI_WriteReport ("\t\t#%d", false, (*(relData.conEnd))[ind]);
}
}
if (relData.conRef != nullptr) {
ACAPI_WriteReport ("\ton the reference line not at the end points:", false);
for (Int32 ind = 0; ind < relData.nConRef; ind++) {
ACAPI_WriteReport ("\t\t#%d", false, (*(relData.conRef))[ind]);
}
}
if (relData.con != nullptr) {
ACAPI_WriteReport ("\ton the reference line:", false);
for (Int32 ind = 0; ind < relData.nCon; ind++) {
ACAPI_WriteReport ("\t\t#%d", false, (*(relData.con))[ind]);
}
}
if (relData.conX != nullptr) {
ACAPI_WriteReport ("\thaving intersection with:", false);
for (Int32 ind = 0; ind < relData.nConX; ind++) {
ACAPI_WriteReport ("\t\t#%d", false, (*(relData.conX))[ind]);
}
}
}
// API_RoomRelation example
elemList = {};
ACAPI_Element_GetElemList (API_ZoneID, &elemList);
for (const API_Guid& roomGuid : elemList) {
if (ACAPI_Element_GetRelations (roomGuid, API_ZombieElemID, (void*)& roomData) != NoError)
continue;
ACAPI_WriteReport ("Connected elems to the room %s", false, APIGuidToString (roomGuid).ToCStr ().Get ());
ACAPI_WriteReport ("\tWalls:", false);
if (roomData.relatedElementsGroupedByType.ContainsKey (API_WallID)) {
for (const API_Guid& wallGuid : roomData.relatedElementsGroupedByType[API_WallID]) {
ACAPI_WriteReport ("\t\t%s", false, APIGuidToString (wallGuid).ToCStr ().Get ());
}
}
ACAPI_WriteReport ("\tSlabs:", false);
if (roomData.relatedElementsGroupedByType.ContainsKey (API_SlabID)) {
for (const API_Guid& slabGuid : roomData.relatedElementsGroupedByType[API_SlabID]) {
ACAPI_WriteReport ("\t\t%s", false, APIGuidToString (slabGuid).ToCStr ().Get ());
}
}
}
void __ACENV_CALL ACAPI_DisposeWallRelationHdls(API_WallRelation *wallInfo)
Frees the memory occupied by all of the allocated wall relation handles.
GSErrCode __ACENV_CALL ACAPI_DisposeRoomRelationHdls(API_RoomRelation *roomInfo)
Frees the memory occupied by all of the allocated room relation handles.
GSErrCode __ACENV_CALL ACAPI_Element_GetRelations(const API_Guid &guid, const API_ElemType &otherType, void *relData, UInt32 mask=0)
Returns information on objects connected to walls, beams, beam segments, rooms, shells,...
Structure for retrieving data related to a room.
Definition: APIdefs_Elements.h:14607
Structure for retrieving connection data of a wall.
Definition: APIdefs_Elements.h:14668

◆ ACAPI_Element_GetRoomImage()

GSErrCode __ACENV_CALL ACAPI_Element_GetRoomImage ( API_RoomImage roomImage)

Returns the image of the given room.

Parameters
roomImage[in/out] The API_RoomImage object containing the parameters for the image and the output generated image.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The roomImage parameter or the contained (roomImage->nativeImagePtr) is nullptr.
  • APIERR_BADID - The given GUID (roomImage->roomGuid) is invalid.
Remarks
For example code please see the Goodie_Functions example Add-On.

◆ ACAPI_Element_GetSkylightHolePolygon()

GSErrCode __ACENV_CALL ACAPI_Element_GetSkylightHolePolygon ( const API_Guid skylightGuid,
Geometry::Polygon2D *  holePoly 
)

Returns the polygon data of a Skylight hole contour.

Parameters
skylightGuid[in] Identifier of the Skylight element.
holePoly[out] Polygon data of the hole contour.
Returns
  • NoError - The function has completed with success.
  • APIERR_NOPLAN - There is no active plan database.
  • APIERR_BADPARS - skylightGuid or holePoly is nullptr.
  • APIERR_BADINDEX - skylightGuid does not refer to a valid element in the database.
  • APIERR_REFUSEDPAR - The element specified with skylightGuid is not Skylight type.
Remarks
This function is used to get the contour polygon of a Skylight hole in absolute coordinates, projected to the horizontal plane. (Note that currently this is not the actual hole contour but the four corner points of the Skylight element). No need to dispose the allocated data of the Geometry::Polygon2D nor the Geometry::MultiPolygon2D.
Example
void AddSkylightHolesToRoofPolygon (Geometry::Polygon2DData& polygon2DData, const GS::Array<API_Guid>& skylights)
{
Geometry::MultiPolygon2D multi;
Geometry::ConvertPolygon2DDataToPolygon2D (multi, polygon2DData);
Geometry::Polygon2D polygon2D = multi.PopLargest ();
for (UIndex i = 0; i < skylights.GetSize (); i++) {
Geometry::Polygon2D holePoly;
if (ACAPI_Goodies (APIAny_GetSkylightHolePolygonID
, (void*) &skylights[i], &holePoly) == NoError) {
Geometry::MultiPolygon2D resultPolys;
polygon2D.Substract (holePoly, resultPolys);
if (!resultPolys.IsEmpty ()) {
polygon2D = resultPolys.PopLargest ();
}
}
}
Geometry::FreePolygon2DData (&Polygon2DData);
Geometry::ConvertPolygon2DToPolygon2DData (polygon2DData, polygon2D);
}

◆ ACAPI_Element_GetSurfaceQuantities()

GSErrCode __ACENV_CALL ACAPI_Element_GetSurfaceQuantities ( const GS::Array< API_Guid > *  elemGuids,
const GS::Array< API_Guid > *  coverElemGuids,
GS::Array< API_ElemPartSurfaceQuantity > *  quantities 
)

Returns information of the given elements surfaces.

Parameters
elemGuids[in] Array of elem guids, to calculate surface informations.
coverElemGuids[in] Array of elem guids to consider as cover elems, when calculating visible surfaces areas.
quantities[out] Calculated surface information will be pushed into this array, in the same order as in elemGuids.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Either elemGuids or coverElemGuids or quantities is nullptr
Remarks
This function is used to get one or more elements surface informations, mainly surface area. When calculating the surface area you can specify which elements are considered as cover elems. The area where a cover elem overlaps the given element will be reduced from the whole surface of the elem.
Example
char s[256] = { '\0' };
GS::Array<API_Guid> elemGuids = GetWallGuids ();
GS::Array<API_Guid> coverElemGuids = GetSlabGuids ();
GS::Array<API_ElemPartSurfaceQuantity> elemPartSurfaces;
GSErrCode err = ACAPI_Element_GetSurfaceQuantities (&elemGuids, &coverElemGuids, &elemPartSurfaces);
if (err == NoError) {
for (UInt32 i = 0; i < elemPartSurfaces.GetSize (); i++) {
sprintf (s, "Visible area of %s without the parts covered by slabs is %.2lf", APIGuidToString (elemGuids[i]).ToCStr ().Get (), elemPartSurfaces[i].exposedSurface);
ACAPI_WriteReport (s, true);
}
}
GSErrCode __ACENV_CALL ACAPI_Element_GetSurfaceQuantities(const GS::Array< API_Guid > *elemGuids, const GS::Array< API_Guid > *coverElemGuids, GS::Array< API_ElemPartSurfaceQuantity > *quantities)
Returns information of the given elements surfaces.

◆ ACAPI_Element_GetSyTran()

GSErrCode __ACENV_CALL ACAPI_Element_GetSyTran ( const API_Elem_Head elemHead,
API_SyTran syTran 
)

Obtains the transformation parameters of an actual instance of a library part.

Parameters
elemHead[in] Identifies the element. Its type should be API_WindowID, API_DoorID, API_ObjectID, API_LampID, or API_ZoneID.
syTran[out] The function returns the transformation parameters here.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The syTran parameter was nullptr.
  • APIERR_BADID - The element reference is invalid; elemHead->guid.
  • APIERR_DELETED - The element does not exist in the database
  • APIERR_GENERAL - The element reference is invalid; elemHead->guid.
Remarks
You can get the transformation parameters of an actual instance of a library part (type should be API_WindowID, API_DoorID, API_ObjectID, API_LampID, or API_ZoneID) with this function. The transformation parameters are not easy to calculate and keep up-to-date, this function helps you to obtain this information.

◆ ACAPI_Element_GetTextLineLength()

GSErrCode __ACENV_CALL ACAPI_Element_GetTextLineLength ( API_TextLinePars textLinePars,
double *  length 
)

Returns the length of a line of text in mms.

Parameters
textLinePars[in] parameters of the text to be measured
length[out] the length of the text
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - one or both of the parameters are nullptr
Remarks
The index field of textLinePars determines the behavior of the function.
index Behavior
-1 No line terminator; this is the last line of the text.
0 Line terminators are in the text; measure the whole string in textLinePars->lineStr.
> 0 Length of the line with the specified index.

The textLinePars->drvScaleCorr field determines whether any drawing scale correction is applied.

◆ ACAPI_Element_GetTextSizeFactor()

GSErrCode __ACENV_CALL ACAPI_Element_GetTextSizeFactor ( short *  api_fontID,
double *  textSizeFactor 
)

Returns the ratio of the font capital size and typography size.

Parameters
api_fontID[in] Font attribute index.
textSizeFactor[out] The ratio of the font capital size and typography size.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Any of the parameters are nullptr.
Remarks
Archicad uses the capital font size. This function is used to determine the ratio of the font capital size and typographical size.

◆ ACAPI_Element_GetUserData()

GSErrCode __ACENV_CALL ACAPI_Element_GetUserData ( API_Elem_Head elemHead,
API_ElementUserData userData,
UInt32  mask = 0 
)

Obtains the user data attached to an element or an element default.

Parameters
elemHead[in] Identifies the element or element default (only fields type and guid are used).
userData[in/out] Pointer to the user data.
mask[in] Optional mask. Currently valid values are 0 and APIElemMask_FloorPlan. In the latter case, the elements in the floor plan database are counted directly, without changing the database first.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The passed parameter is nullptr; userData
  • APIERR_BADID - The elemHead is incorrect.
  • APIERR_NOUSERDATA - No user data attached with the gived signature
Remarks
This function is used to get the user attached data from an element or from an element default. To obtain data from element default only elemHead->type is necessary and elemHead->guid should be APINULLGuid. To obtain data from an element only elemHead->guid is necessary and it should be set to element's guid. Use the ACAPI_Element_SetUserData functions to push data into the element record. You can read more about this topic at the Save data into Element records paper.
Example
//------------------------------------------------------------
// Obtain user data from wall default element
//------------------------------------------------------------
GSErrCode GetUserDataFromWallDefaultElem (CustomData data)
{
API_Elem_Head wallDefault = {};
wallDefault.type = API_WallID;
API_ElementUserData userData = {};
GSErrCode err = ACAPI_Element_GetUserData (&wallDefault, &userData);
if (err == NoError && userData.dataHdl != nullptr && userData.platformSign == GS::Act_Platform_Sign)
data = *reinterpret_cast<CustomData*>(*userData.dataHdl);
BMKillHandle (&userData.dataHdl);
return NoError;
}
//------------------------------------------------------------
// Obtain user data from an element identified by guid
//------------------------------------------------------------
GSErrCode GetUserDataFromElem (const API_Guid selectedElemGuid, CustomData data)
{
API_Elem_Head element = {};
element.guid = selectedElemGuid;
API_ElementUserData userData = {};
GSErrCode err = ACAPI_Element_GetUserData (&element, &userData);
if (err == NoError && userData.dataHdl != nullptr && userData.platformSign == GS::Act_Platform_Sign)
data = *reinterpret_cast<CustomData*>(*userData.dataHdl);
BMKillHandle (&userData.dataHdl);
return NoError;
}
GSErrCode __ACENV_CALL ACAPI_Element_GetUserData(API_Elem_Head *elemHead, API_ElementUserData *userData, UInt32 mask=0)
Obtains the user data attached to an element or an element default.
Custom data record attached to element sets.
Definition: APIdefs_Elements.h:14452
GSHandle dataHdl
handle containing the user data (arbitrary size)
Definition: APIdefs_Elements.h:14476
unsigned short platformSign
the platform the data was created on; defines the byte ordering (can be GS::Win_Platform_Sign,...
Definition: APIdefs_Elements.h:14462

◆ ACAPI_Element_InstallElementObserver()

GSErrCode __ACENV_CALL ACAPI_Element_InstallElementObserver ( APIElementEventHandlerProc handlerProc)

Installs an element observer function which receives notifications on elements' changes.

Parameters
handlerProc[in] The callback procedure to call when notifications are sent out on changes of elements. Specifying nullptr here means you don't need the notifications any more.
Returns
  • NoError - The function completed successfully.
Remarks
This function is used to register/unregister an add-on which wants to monitor the changes in elements. This is a common callback for all the different element observers which can be attached to an element with ACAPI_Element_AttachObserver. After registration your add-on's handlerProc you will be called when any of the monitored elements change. For more details see also the Element related notifications paragraph of the Notification Manager.
Example
// -----------------------------------------------------------------------------
// Element observer callback function
// -----------------------------------------------------------------------------
static GSErrCode __ACENV_CALL ElementEventHandler (const API_NotifyElementType *elemType)
{
GSErrCode err = NoError;
char msgStr[256];
char elemStr[32];
API_Elem_Head elemHead;
API_Element parentElement;
BNZeroMemory (&parentElement, sizeof (API_Element));
ACAPI_Notification_GetParentElement (&parentElement, nullptr, 0, nullptr);
switch (elemType->notifID) {
case APINotifyElement_Copy:
BNZeroMemory (&elemHead, sizeof (API_Elem_Head));
if (parentElement.header.guid != APINULLGuid && GetElementTypeString (elemType->type, elemStr)) {
sprintf (msgStr, "### Element_Manager: %s #%d copied from #%d",
elemStr, APIGuidToString (elemType->guid).ToCStr ().Get (),
APIGuidToString (parentElement.header.guid).ToCStr ().Get ());
elemHead.guid = elemType->guid;
err = ACAPI_Element_AttachObserver (&elemHead, 0);
}
break;
default:
err = APIERR_NOTSUPPORTED;
break;
}
if (err == NoError)
ACAPI_WriteReport (msgStr, false);
return err;
} // ElementEventHandler
// -----------------------------------------------------------------------------
// Called after the Add-On has been loaded into memory
// -----------------------------------------------------------------------------
GSErrCode __ACENV_CALL Initialize (void)
{
// catch changes in the selection
GSErrCode err = ACAPI_Element_InstallElementObserver (ElementEventHandler);
return err;
} // Initialize
GSErrCode __ACENV_CALL ACAPI_Element_InstallElementObserver(APIElementEventHandlerProc *handlerProc)
Installs an element observer function which receives notifications on elements' changes.

◆ ACAPI_Element_IsClassificationItemVisible()

bool __ACENV_CALL ACAPI_Element_IsClassificationItemVisible ( const API_Guid elemGuid,
const API_Guid classificationGuid 
)

Tells whether a classification item is visible for an element.

Parameters
elemGuid[in] The element GUID to search for.
classificationGuid[in] The classification item GUID to search for.
Returns
  • true - The given classification item is visible for the element. It can return true even if the parent of the classification item is hidden.
  • false - The given classification item is not visible for the element or invalid parameters.
Example
GSErrCode GetVisibleClassificationItems (const API_Guid& elemGuid, GS::Array<API_ClassificationItem>& visibleClassifications)
{
GS::Array<API_ClassificationItem> definitions;
GSErrCode error = ACAPI_Classification_GetClassificationItems (APINULLGuid, definitions);
if (error == NoError) {
for (UInt32 i = 0; i < definitions.GetSize (); ++i) {
if (ACAPI_Element_IsClassificationItemVisible (elemGuid, definitions[i].guid)) {
visibleClassifications.Push (definitions[i]);
}
}
}
return error;
}
bool __ACENV_CALL ACAPI_Element_IsClassificationItemVisible(const API_Guid &elemGuid, const API_Guid &classificationGuid)
Tells whether a classification item is visible for an element.

◆ ACAPI_Element_IsClassificationItemVisibleDefault()

bool __ACENV_CALL ACAPI_Element_IsClassificationItemVisibleDefault ( const API_ElemType type,
const API_Guid classificationGuid 
)

Tells whether a classification item is visible for an element default.

Since
Archicad 26
Parameters
type[in] Type of the default element.
classificationGuid[in] The classification item GUID to search for.
Returns
  • true - The given classification item is visible for the element default. It can return true even if the parent of the classification item is hidden.
  • false - The given classification item is not visible for the element default or invalid parameters.
Remarks
From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.
Example
GSErrCode GetVisibleClassificationItems (const API_ElemType& type, GS::Array<API_ClassificationItem>& visibleClassifications)
{
GS::Array<API_ClassificationItem> definitions;
GSErrCode error = ACAPI_Classification_GetClassificationItems (APINULLGuid, definitions);
if (error == NoError) {
for (UInt32 i = 0; i < definitions.GetSize (); ++i) {
if (ACAPI_Element_IsClassificationItemVisibleDefault (type, definitions[i].guid)) {
visibleClassifications.Push (definitions[i]);
}
}
}
return error;
}
bool __ACENV_CALL ACAPI_Element_IsClassificationItemVisibleDefault(const API_ElemType &type, const API_Guid &classificationGuid)
Tells whether a classification item is visible for an element default.

◆ ACAPI_Element_IsPropertyDefinitionAvailable()

bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionAvailable ( const API_Guid elemGuid,
const API_Guid propertyGuid 
)

Tells whether a property definition is available for an element.

Parameters
elemGuid[in] The element GUID to search for.
propertyGuid[in] The property definition GUID to search for.
Returns
  • true - The given property definition is available for the element.
  • false - The given property definition is not available for the element.
Example
GSErrCode GetAvailablePropertyDefinitions (const API_Guid& elemGuid, GS::Array<API_PropertyDefinition>& availableProperties)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Property_GetPropertyDefinitions (APINULLGuid, definitions);
if (error == NoError) {
for (UInt32 i = 0; i < definitions.GetSize (); ++i) {
if (ACAPI_Element_IsPropertyDefinitionAvailable (elemGuid, definitions[i].guid)) {
availableProperties.Push (definitions[i]);
}
}
}
return error;
}
bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionAvailable(const API_Guid &elemGuid, const API_Guid &propertyGuid)
Tells whether a property definition is available for an element.
GSErrCode __ACENV_CALL ACAPI_Property_GetPropertyDefinitions(const API_Guid &groupGuid, GS::Array< API_PropertyDefinition > &definitions)
Retrieves all the property definitions from a given group.

◆ ACAPI_Element_IsPropertyDefinitionAvailableDefault()

bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionAvailableDefault ( const API_ElemType type,
const API_Guid propertyGuid 
)

Tells whether a property definition is available for an element default.

Since
Archicad 26
Parameters
type[in] Type of the default element.
propertyGuid[in] The property definition GUID to search for.
Returns
  • true - The given property definition is available for the element default.
  • false - The given property definition is not available for the element default.
Remarks
From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.
Example
GSErrCode GetAvailablePropertyDefinitions (const API_ElemType& type, GS::Array<API_PropertyDefinition>& availableProperties)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Property_GetPropertyDefinitions (APINULLGuid, definitions);
if (error == NoError) {
for (UInt32 i = 0; i < definitions.GetSize (); ++i) {
if (ACAPI_Element_IsPropertyDefinitionAvailableDefault (type, definitions[i].guid)) {
availableProperties.Push (definitions[i]);
}
}
}
return error;
}
bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionAvailableDefault(const API_ElemType &type, const API_Guid &propertyGuid)
Tells whether a property definition is available for an element default.

◆ ACAPI_Element_IsPropertyDefinitionValueEditable()

bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionValueEditable ( const API_Guid elemGuid,
const API_Guid propertyGuid 
)

Tells whether the value of the property can be modified for the specified element. If the elemGuid argument is APINULLGuid, it tells whether the property definition's default value is editable.

Parameters
elemGuid[in] The element GUID to search for. It can be APINULLGuid, in this case the property definition's default value is checked.
propertyGuid[in] The property definition GUID to search for.
Returns
  • true - The value of the property, or the property definition's default value can be modified.
  • false - The value of the property, or the property definition's default value can not be modified. For example, it is a read-only property, or a User Defined property with expression, which has cyclic property references.
Example
GSErrCode GetEditablePropertyDefinitions (const API_Guid& elemGuid, GS::Array<API_PropertyDefinition>& editableProperties)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitions (elemGuid, API_PropertyDefinitionFilter_UserDefined, definitions);
if (error == NoError) {
for (UInt32 i = 0; i < definitions.GetSize (); ++i) {
if (ACAPI_Element_IsPropertyDefinitionValueEditable (elemGuid, definitions[i].guid)) {
editableProperties.Push (definitions[i]);
}
}
}
return error;
}
bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionValueEditable(const API_Guid &elemGuid, const API_Guid &propertyGuid)
Tells whether the value of the property can be modified for the specified element....

◆ ACAPI_Element_IsPropertyDefinitionValueEditableDefault()

bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionValueEditableDefault ( const API_ElemType type,
const API_Guid propertyGuid 
)

Tells whether the value of the property can be modified for the specified tool default.

Since
Archicad 26
Parameters
type[in] Type of the default element.
propertyGuid[in] The property definition GUID to search for.
Returns
  • true - The value of the property can be modified.
  • false - The value of the property can not be modified. For example, it is a read-only property, or a User Defined property with expression, which has cyclic property references.
Remarks
From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.
Example
GSErrCode GetAvailablePropertyDefinitions (const API_ElemType& type, GS::Array<API_PropertyDefinition>& editableProperties)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitionsOfDefaultElem (type, API_PropertyDefinitionFilter_UserDefined, definitions);
if (error == NoError) {
for (UInt32 i = 0; i < definitions.GetSize (); ++i) {
if (ACAPI_Element_IsPropertyDefinitionValueEditableDefault (type, definitions[i].guid)) {
editableProperties.Push (definitions[i]);
}
}
}
return error;
}
bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionValueEditableDefault(const API_ElemType &type, const API_Guid &propertyGuid)
Tells whether the value of the property can be modified for the specified tool default.

◆ ACAPI_Element_IsPropertyDefinitionVisible()

bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionVisible ( const API_Guid elemGuid,
const API_Guid propertyGuid 
)

Tells whether a property definition is visible for an element.

Parameters
elemGuid[in] The element GUID to search for.
propertyGuid[in] The property definition GUID to search for.
Returns
  • true - The given property definition is visible for the element.
  • false - The given property definition is not visible for the element.
Example
GSErrCode GetVisiblePropertyDefinitions (const API_Guid& elemGuid, GS::Array<API_PropertyDefinition>& visibleProperties)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Property_GetPropertyDefinitions (APINULLGuid, definitions);
if (error == NoError) {
for (UInt32 i = 0; i < definitions.GetSize (); ++i) {
if (ACAPI_Element_IsPropertyDefinitionVisible (elemGuid, definitions[i].guid)) {
visibleProperties.Push (definitions[i]);
}
}
}
return error;
}

◆ ACAPI_Element_IsPropertyDefinitionVisibleDefault()

bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionVisibleDefault ( const API_ElemType type,
const API_Guid propertyGuid 
)

Tells whether a property definition is visible for an element default.

Since
Archicad 26
Parameters
type[in] Type of the default element.
propertyGuid[in] The property definition GUID to search for.
Returns
  • true - The given property definition is visible for the element default.
  • false - The given property definition is not visible for the element default.
Remarks
From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.
Example
GSErrCode GetVisiblePropertyDefinitions (const API_ElemType& type, GS::Array<API_PropertyDefinition>& visibleProperties)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Property_GetPropertyDefinitions (APINULLGuid, definitions);
if (error == NoError) {
for (UInt32 i = 0; i < definitions.GetSize (); ++i) {
if (ACAPI_Element_IsPropertyDefinitionVisibleDefault (type, definitions[i].guid)) {
visibleProperties.Push (definitions[i]);
}
}
}
return error;
}
bool __ACENV_CALL ACAPI_Element_IsPropertyDefinitionVisibleDefault(const API_ElemType &type, const API_Guid &propertyGuid)
Tells whether a property definition is visible for an element default.

◆ ACAPI_Element_Merge_Elements()

GSErrCode __ACENV_CALL ACAPI_Element_Merge_Elements ( const GS::Array< API_Guid > &  guid_ElementsToMerge)

Merge elements given in the array.

Parameters
guid_ElementsToMerge[in] Array of GUIDs of the elements to merge.
Returns
  • NoError - The function has completed with success.
  • APIERR_NEEDSUNDOSCOPE - The function must be undoable, it wasn't called from an undoable command scope.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADINDEX - One or more of the passed IDs are invalid.
  • APIERR_BADPARS - Invalid value passed in the guid_ElementsToMerge parameter.
  • APIERR_BADELEMENTTYPE - There is element in the array, which is not construction element type.
Remarks
This function merges elements given in the array.
Example
void Do_Merge_Elements (void)
{
API_SelectionInfo selectionInfo;
API_Neig** selNeig;
API_Element element;
// Get selection
GSErrCode err = ACAPI_Selection_Get (&selectionInfo, &selNeig, true);
if (err != NoError && err != APIERR_NOSEL) {
ErrorBeep ("ACAPI_Selection_GetInfo", err);
return;
}
BMKillHandle ((GSHandle *) &selectionInfo.marquee.coords);
GS::Array<API_Guid> guid_ElementsToMerge;
for (Int32 i = 0; i < selectionInfo.sel_nElemEdit; i++) {
// Get selected element
BNZeroMemory (&element, sizeof(element));
element.header.guid = (*selNeig)[i].guid;
if (ACAPI_Element_Get (&element) != NoError)
continue;
API_ElemType tmpType = element.header.type;
API_Guid tmpGuid = element.header.guid;
if (tmpType == API_SectElemID) {
tmpType = element.sectElem.parentType;
tmpGuid = element.sectElem.parentGuid;
}
guid_ElementsToMerge.Push (tmpGuid);
}
BMKillHandle ((GSHandle *) &selNeig);
if (!guid_ElementsToMerge.IsEmpty ()) {
GSErrCode err = ACAPI_Element_Merge_Elements (guid_ElementsToMerge);
if (err != NoError) {
if (err == APIERR_NO3D)
WriteReport_Alert ("Elements To Merge can be construction elements only.");
else
WriteReport_Alert ("ACAPI_Element_Merge_Elements failed: %d", err);
}
} else {
WriteReport_Alert ("There are no selected construction elements!\n");
}
return;
}
GSErrCode __ACENV_CALL ACAPI_Element_Merge_Elements(const GS::Array< API_Guid > &guid_ElementsToMerge)
Merge elements given in the array.
API_ElemType parentType
Parent elem type.
Definition: APIdefs_Elements.h:9807
API_Guid parentGuid
Parent elem GUID.
Definition: APIdefs_Elements.h:9813
Int32 sel_nElemEdit
Number of the currently selected elements, which are editable.
Definition: APIdefs_Elements.h:18532
API_SectElemType sectElem
Represents an element in the section window.
Definition: APIdefs_Elements.h:13561

◆ ACAPI_Element_Merge_GetMergedElements()

GSErrCode __ACENV_CALL ACAPI_Element_Merge_GetMergedElements ( const API_Guid guid_Element,
GS::Array< API_Guid > *  guid_MergedElements 
)

Get the merged elements of the given element in the array.

Parameters
guid_Element[in] The element GUID.
guid_MergedElements[out] Array of GUIDs of the elements are merged with the given element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADINDEX - One or more of the passed IDs are invalid.
  • APIERR_BADPARS - Invalid value passed in the guid_Element parameter.
  • APIERR_BADELEMENTTYPE - The given element is not construction element.
Remarks
This function gets elements are merged with the given element.
Example
GSErrCode Do_GetMergedElements (const API_Guid& guid_Element)
{
GSErrCode err = NoError;
GS::Array<API_Guid> guid_MergedElements;
err = ACAPI_Element_Merge_GetMergedElements (guid_Element, &guid_MergedElements);
if (err != NoError)
return err;
for (UIndex i = 0; i < guid_MergedElements.GetSize (); i++) {
char str[256];
sprintf (str, " Element: %s is merged with Element: %s",
(const char *) APIGuid2GSGuid (guid_Element).ToUniString ().ToCStr (),
(const char *) APIGuid2GSGuid (guid_MergedElements [i]).ToUniString ().ToCStr ());
WriteReport (str);
}
return err;
}
GS::Guid & APIGuid2GSGuid(API_Guid &guid)
Definition: API_Guid.hpp:61
GSErrCode __ACENV_CALL ACAPI_Element_Merge_GetMergedElements(const API_Guid &guid_Element, GS::Array< API_Guid > *guid_MergedElements)
Get the merged elements of the given element in the array.

◆ ACAPI_Element_Merge_Remove()

GSErrCode __ACENV_CALL ACAPI_Element_Merge_Remove ( const API_Guid guid_Element1,
const API_Guid guid_Element2 
)

Remove the merge connection from the given elements.

Parameters
guid_Element1[in] The first element GUID.
guid_Element2[in] The second element GUID.
Returns
  • NoError - The function has completed with success.
  • APIERR_NEEDSUNDOSCOPE - The function must be undoable, it wasn't called from an undoable command scope.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADINDEX - One or more of the passed IDs are invalid.
  • APIERR_BADELEMENTTYPE - One of the elements is not construction element type.
Remarks
This function removes merge connection between the elements.
Example
void Do_Merge_Remove (void)
{
API_ElemType typeID1;
API_Guid guid_Element1;
if (!ClickAnElem ("Click on a construction element to remove the connection!", API_ZombieElemID, nullptr, &typeID1, &guid_Element1)) {
WriteReport_Alert ("No element was clicked.");
return;
}
API_Element tmpElement;
BNZeroMemory (&tmpElement, sizeof(tmpElement));
tmpElement.header.guid = guid_Element1;
if (ACAPI_Element_Get (&tmpElement) != NoError) {
WriteReport_Alert ("No element was clicked.");
return;
}
typeID1 = tmpElement.header.type;
guid_Element1 = tmpElement.header.guid;
if (typeID1 == API_SectElemID) {
typeID1 = tmpElement.sectElem.parentType;
guid_Element1 = tmpElement.sectElem.parentGuid;
}
API_ElemType typeID2;
API_Guid guid_Element2;
if (!ClickAnElem ("Click on a second construction element to remove the connection with the first!", API_ZombieElemID, nullptr, &typeID2, &guid_Element2)) {
WriteReport_Alert ("No element was clicked.");
return;
}
BNZeroMemory (&tmpElement, sizeof(tmpElement));
tmpElement.header.guid = guid_Element2;
if (ACAPI_Element_Get (&tmpElement) != NoError) {
WriteReport_Alert ("No element was clicked.");
return;
}
typeID2 = tmpElement.header.type;
guid_Element2 = tmpElement.header.guid;
if (typeID2 == API_SectElemID) {
typeID2 = tmpElement.sectElem.parentType;
guid_Element2 = tmpElement.sectElem.parentGuid;
}
GSErrCode err = ACAPI_Element_Merge_Remove (guid_Element1, guid_Element2);
if (err != NoError) {
if (err == APIERR_NO3D)
WriteReport_Alert ("Only construction elements have merge connection!");
else
WriteReport_Alert ("ACAPI_Element_Merge_Remove failed: %d", err);
}
return;
}
GSErrCode __ACENV_CALL ACAPI_Element_Merge_Remove(const API_Guid &guid_Element1, const API_Guid &guid_Element2)
Remove the merge connection from the given elements.

◆ ACAPI_Element_NeigIDToElemType()

GSErrCode __ACENV_CALL ACAPI_Element_NeigIDToElemType ( API_NeigID  neigID,
API_ElemType elemType 
)

Returns the element type assigned to a neig.

Since
Archicad 26
Parameters
neigID[in] neig identifier
elemType[out] element type identifier
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - any of the parameters are nullptr
  • APIERR_BADID - Invalid neigID has been passed
Remarks
This function is used to convert a neig identifier to element type. Refer to the API_NeigID structure to get information how neigs are assigned to elements.

◆ ACAPI_Element_NeigToCoord()

GSErrCode __ACENV_CALL ACAPI_Element_NeigToCoord ( API_Neig neig,
API_Coord3D coord3D,
API_Coord3D coord3DDocument = nullptr 
)

Returns the coordinate of a neig.

Parameters
neig[in] neig data
coord3D[out] coordinate assigned to the passed neig
coord3DDocument[out] coordinate over a 3D Document window
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - any of the parameters are nullptr
  • APIERR_BADID - Invalid neigID has been passed
Remarks
This function is used to convert neig to coordinate. Refer to the API_NeigID structure to get information how neigs are assigned to the element geometry.

◆ ACAPI_ELEMENT_QUANTITIES_MASK_CLEAR()

void ACAPI_ELEMENT_QUANTITIES_MASK_CLEAR ( API_QuantitiesMask mask)
inline

Clears the mask for querying quantities.

Parameters
maskthe quantity mask to clear

◆ ACAPI_ELEMENT_QUANTITIES_MASK_SETFULL()

void ACAPI_ELEMENT_QUANTITIES_MASK_SETFULL ( API_QuantitiesMask mask)
inline

Set the mask to full (return all quantities) for querying quantities.

Parameters
maskthe quantity mask to fill fully

◆ ACAPI_ELEMENT_QUANTITY_MASK_CLEAR()

void ACAPI_ELEMENT_QUANTITY_MASK_CLEAR ( API_QuantitiesMask mask)
inline

Clears the element part of the mask for querying element quantities.

Parameters
maskthe quantity mask to clear

◆ ACAPI_ELEMENT_QUANTITY_MASK_SETFULL()

void ACAPI_ELEMENT_QUANTITY_MASK_SETFULL ( API_QuantitiesMask mask)
inline

Set the element part of the mask to full (return all quantities) for querying element quantities.

Parameters
maskthe quantity mask to fill the element part fully

◆ ACAPI_Element_RefreshElement()

GSErrCode __ACENV_CALL ACAPI_Element_RefreshElement ( API_Elem_Head elemHead,
bool *  force 
)

Rebuilds (refreshes) a library part instance.

Parameters
elemHeadidentifies the element to refresh
forceforce rebuild for GDL based elements (run parameter script).
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - elemHead is nullptr
  • APIERR_BADINDEX - The element is not present in the Archicad database.
  • APIERR_DELETED - The element is deleted.
Remarks
This function is used to refresh (rebuild) a library part instance identified by its element header on the floor plan or in the section or detail window. This function is a non-undoable data structure modifier function. See more details on this topic at Command Overview.

◆ ACAPI_Element_RemoveClassificationItem()

GSErrCode __ACENV_CALL ACAPI_Element_RemoveClassificationItem ( const API_Guid elemGuid,
const API_Guid itemGuid 
)

Removes a classification from an element.

Parameters
elemGuid[in] The identifier of the element whose classification should be removed.
itemGuid[in] The guid of the classification item, that should be removed from the element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The elemGuid did not refer to a valid element or itemGuid did not refer to a valid classification item.
  • APIERR_BADPARS - The element did not have the specified classification.
  • APIERR_READONLY - The element can not be modified (i.e. from a hotlink) or you do not have the right to remove classifications from elements in the current teamwork plan.

◆ ACAPI_Element_RemoveClassificationItemDefault()

GSErrCode __ACENV_CALL ACAPI_Element_RemoveClassificationItemDefault ( const API_ElemType type,
const API_Guid itemGuid 
)

Removes a classification from an element.

Since
Archicad 26
Parameters
type[in] Type of the default element.
itemGuid[in] The guid of the classification item, that should be removed from the element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The type did not refer to a valid default element or itemGuid did not refer to a valid classification item.
  • APIERR_BADPARS - The element did not have the specified classification.
  • APIERR_READONLY - The element can not be modified (i.e. from a hotlink) or you do not have the right to remove classifications from elements in the current teamwork plan.
Remarks
From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.

◆ ACAPI_Element_RemoveIFCClassificationReference()

GSErrCode __ACENV_CALL ACAPI_Element_RemoveIFCClassificationReference ( const API_Guid guid_Element,
const API_IFCClassificationReference classificationReference 
)

Remove IFC classificationreference of an element.

Parameters
guid_Element[in] GUID of the element
classificationReference[in] IFC classificationreference to remove.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Invalid value passed in the guid_Element parameter or classificationReference is not correct.
  • APIERR_MODULNOTINSTALLED - IFC add-on is not present.
Remarks
If a classificationreference with the given referencename exists for the element, this function will remove it. For a successful removal, the classificationReference.referenceName must be set correctly explained in the API_IFCClassificationReference structure. The model may contain GDL objects with APPLICATION_QUERYs which display IFC data. It is the developer's responsability to refresh the views after modifying IFC data through API functions. See: ACAPI_Automation - ACAPI_View_Rebuild function.

◆ ACAPI_Element_RemoveIFCProperty()

GSErrCode __ACENV_CALL ACAPI_Element_RemoveIFCProperty ( const API_Guid guid_Element,
const API_IFCProperty property 
)

Remove IFC property of an element.

Parameters
guid_Element[in] GUID of the element
property[in] IFC property to remove.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Invalid value passed in the guid_Element parameter or property is not correct.
  • APIERR_MODULNOTINSTALLED - IFC add-on is not present.
Remarks
If a property with the given property name and propertyset name exists for the element, this function will remove it. If a property is not editable on the user interface, cannot be removed. For a successful removal, the property.head must be set correctly explained in the API_IFCPropertyHead structure. The model may contain GDL objects with APPLICATION_QUERYs which display IFC data. It is the developer's responsability to refresh the views after modifying IFC data through API functions. See: ACAPI_Automation - ACAPI_View_Rebuild function.

◆ ACAPI_Element_RoomReductions()

GSErrCode __ACENV_CALL ACAPI_Element_RoomReductions ( const API_Guid guid,
RoomReductionPolyProc roomReductionPolyProc 
)

Returns reduction data assigned to a room of the current database.

Parameters
guidThe referenced zone GUID identifier
roomReductionPolyProcCallback function to export reduction information
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Any of the parameters are nullptr.
  • APIERR_NESTING - The function is called from the body of a RoomReductionPolyProc.
  • APIERR_BADID - The zone reference is invalid.
  • APIERR_DELETED - The zone is deleted.
Remarks
Zones have very complex relationships to other elements. This function is used to make easy to find what elements may reduce the zone area and how. These elements may be walls, colums, hatches, gables and rest. The overlapping places return only by either of them (see image below).
Room reduction polygon
The reduction polygons can be obtained by the RoomReductionPolyProc callback function.
Example
static void __ACENV_CALL RoomRedCallBack (const API_RoomReductionPolyType *roomRed)
{
char s[32];
GSErrCode err;
switch (roomRed->type) {
case APIRoomReduction_Rest: sprintf (s, "Rest"); break;
case APIRoomReduction_Wall: sprintf (s, "Wall"); break;
case APIRoomReduction_Column: sprintf (s, "Column"); break;
case APIRoomReduction_Hatch: sprintf (s, "Hatch"); break;
case APIRoomReduction_Gable: sprintf (s, "Gable"); break;
}
ACAPI_WriteReport (s, false);
/* draw polygon by roomRed->nCoords, roomRed->coords, ... */
BMKillHandle ((GSHandle*) &roomRed->coords);
BMKillHandle ((GSHandle*) &roomRed->subPolys);
BMKillHandle ((GSHandle*) &roomRed->arcs);
return;
}
...
GSErrCode err = ACAPI_Database (APIDb_RoomReductionsID, &element.header.guid, (void *) RoomRedCallBack);
Parameters to get room reduction data.
Definition: APIdefs_Database.h:530
Int32 ** subPolys
The subpolygon endpoints.
Definition: APIdefs_Database.h:572
short type
Type of the polygon.
Definition: APIdefs_Database.h:542
API_PolyArc ** arcs
The polygon arcs.
Definition: APIdefs_Database.h:577
API_Coord ** coords
The coordinate array.
Definition: APIdefs_Database.h:567

◆ ACAPI_Element_SearchElementByCoord()

GSErrCode __ACENV_CALL ACAPI_Element_SearchElementByCoord ( const API_ElemSearchPars elemSearchPars,
API_Guid foundElement 
)

Searches an element by a coordinate.

Parameters
elemSearchPars[in] Parameters of searching
foundElement[out] guid of the found element
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - searchPars is nullptr or guid is nullptr, or no element is found matching the given parameters.
  • APIERR_REFUSEDPAR - The element to be searched is not a polygonal element.
Remarks
This function is used to search a polygonal element by a coordinate. Refer to the API_ElemSearchPars for the parametrization and more details. In the GUID was moved from the third parameter to the second.
Example
API_Guid guid;
API_ElemSearchPars searchPars;
BNZeroMemory (&searchPars, sizeof (API_ElemSearchPars));
searchPars.type = API_MeshID;
searchPars.filterBits = APIFilt_OnVisLayer | APIFilt_OnActFloor;
searchPars.loc.x = 1.0;
searchPars.loc.y = 3.0;
searchPars.z = BiggestDouble;
API_Goodies (APIAny_SearchElementByCoordID, &searchPars, &guid);
double x
Horizontal coordinate.
Definition: APIdefs_Base.h:82
double y
Vertical coordinate.
Definition: APIdefs_Base.h:87
Structure to search for an element by coordinate.
Definition: APIdefs_Goodies.h:174
API_ElemFilterFlags filterBits
the flags (APIFilt_xxx) used for filtering (see ACAPI_Element_Filter)
Definition: APIdefs_Goodies.h:184
API_Coord loc
the location on 2D plan
Definition: APIdefs_Goodies.h:189
double z
level to search down from
Definition: APIdefs_Goodies.h:194
API_ElemType type
element type to search for
Definition: APIdefs_Goodies.h:179

◆ ACAPI_Element_SetElementURLRef()

GSErrCode __ACENV_CALL ACAPI_Element_SetElementURLRef ( API_Elem_Head elemHead,
API_ElemURLRef elemURLRef 
)

Assigns a URL reference to an element.

Parameters
elemHead[in] The element the URL has to be assigned to.
elemURLRef[in] The URL reference of the element.
Returns
  • NoError - The function was completed successfully.
  • APIERR_BADPARS - Any of the parameters are nullptr.
  • APIERR_BADINDEX - The element is not present in the Archicad database.
  • APIERR_BADID - The element cannot hold a URL reference.
  • APIERR_DELETED e - The element is deleted.
  • APIERR_MOREUSER - The element already holds a URL reference.
Remarks
This function is used for assigning a URL reference to an Archicad database element. The same group of elements can hold a URL reference as userdata.

◆ ACAPI_Element_SetEmptyHoleUnId()

GSErrCode __ACENV_CALL ACAPI_Element_SetEmptyHoleUnId ( GSType *  signature,
const char *  emptyHoleUnIdStr,
const char *  emptyOpeningSubtypeUnIDStr 
)

Sets the unique ID of the empty hole.

Parameters
signature[in] A four-character identifier of this library part subtype.
emptyHoleUnIdStr[in] The unique ID string of this library part subtype.
emptyOpeningSubtypeUnIDStr...
Returns
  • NoError - The function has completed with success.
  • APIERR_NOTSUPPORTED - The root type is not window or door.
Remarks
This function is used to set the unique ID of the empty hole. It works only on window or door subtype.
Example
//------------------------------------------------------
// Called after the Add-On has been loaded into memory
//------------------------------------------------------
GSErrCode __ACENV_CALL Initialize (void)
{
GSErrCode err;
const char* emptyHoleUnIdStr = "{423059FF-C9C6-4368-9448-F82F47AAFC65}-{3E919DA8-41A0-4968-A2AE-875F1B56D2A2}";
err = ACAPI_Element_SetEmptyHoleUnId ((void*) (Int32) 'CRWD', (void*) emptyHoleUnIdStr);
return err;
} //Initialize
GSErrCode __ACENV_CALL ACAPI_Element_SetEmptyHoleUnId(GSType *signature, const char *emptyHoleUnIdStr, const char *emptyOpeningSubtypeUnIDStr)
Sets the unique ID of the empty hole.

◆ ACAPI_Element_SetIFCAttribute()

GSErrCode __ACENV_CALL ACAPI_Element_SetIFCAttribute ( const API_Guid guid_Element,
const API_IFCAttribute attribute 
)

Set IFC attribute of an element.

Parameters
guid_Element[in] GUID of the element
attribute[in] IFC attribute to modify.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Invalid value passed in the guid_Element parameter or attribute is not correct.
  • APIERR_MODULNOTINSTALLED - IFC add-on is not present.
Remarks
This function sets the IFC attribute of an element. If an attribute with the given name and type exists for the element, this command will change it. If an attribute is not editable on the user interface, must not be changed. For a successful change, the attribute must be set correctly explained in the API_IFCAttribute structure. The model may contain GDL objects with APPLICATION_QUERYs which display IFC data. It is the developer's responsability to refresh the views after modifying IFC data through API functions. See: ACAPI_Automation - ACAPI_View_Rebuild function.

◆ ACAPI_Element_SetIFCClassificationReference()

GSErrCode __ACENV_CALL ACAPI_Element_SetIFCClassificationReference ( const API_Guid guid_Element,
const API_IFCClassificationReference classificationReference 
)

Set IFC classificationreference of an element.

Parameters
guid_Element[in] GUID of the element
classificationReference[in] IFC classificationreference to add or modify.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Invalid value passed in the guid_Element parameter or classificationReference is not correct.
  • APIERR_MODULNOTINSTALLED - IFC add-on is not present.
Remarks
This function sets the IFC classificationreference of an element. If a classificationreference with the given referencename already exists for the element, this command will change it. For a successful setting, the classificationreference must be set correctly explained in the API_IFCClassificationReference structure. The model may contain GDL objects with APPLICATION_QUERYs which display IFC data. It is the developer's responsability to refresh the views after modifying IFC data through API functions. See: ACAPI_Automation - ACAPI_View_Rebuild function.

◆ ACAPI_Element_SetIFCProperty()

GSErrCode __ACENV_CALL ACAPI_Element_SetIFCProperty ( const API_Guid guid_Element,
const API_IFCProperty property 
)

Set IFC property of an element.

Parameters
guid_Element[in] GUID of the element
property[in] IFC property to add or modify.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Invalid value passed in the guid_Element parameter or property is not correct.
  • APIERR_MODULNOTINSTALLED - IFC add-on is not present.
Remarks
This function sets the IFC property of an element. If a property with the given property name and propertyset name already exists for the element, this command will change it. If a property is not editable on the user interface, must not be changed. For a successful setting, the property must be set correctly explained in the API_IFCProperty structure. The model may contain GDL objects with APPLICATION_QUERYs which display IFC data. It is the developer's responsability to refresh the views after modifying IFC data through API functions. See: ACAPI_Automation - ACAPI_View_Rebuild function.

◆ ACAPI_Element_SetProperties()

GSErrCode __ACENV_CALL ACAPI_Element_SetProperties ( const API_Guid elemGuid,
const GS::Array< API_Property > &  properties 
)

Sets the specified properties for the given values on an element.

Parameters
elemGuid[in] The element GUID to search for.
properties[in] Specifies the properties to be set.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The elemGuid did not refer to a valid element.
  • APIERR_NOACCESSRIGHT - The current user does not have the right to modify the properties of the specified element on a teamwork server.
  • APIERR_READONLY - Tried to modify a read-only property (for example a property coming from a hotlink).
  • APIERR_BADPROPERTY - The property definition is not available for the given element.
Example
GSErrCode SetAllPropertyValuesToDefault (const API_Guid& elemGuid)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitions (elemGuid, API_PropertyDefinitionFilter_UserDefined, definitions);
if (error == NoError) {
GS::Array<API_Property> properties;
error = ACAPI_Element_GetPropertyValues (elemGuid, definitions, properties);
if (error == NoError) {
for (UInt32 i = 0; i < properties.GetSize (); i++) {
properties[i].isDefault = true;
}
error = ACAPI_Element_SetProperties (elemGuid, properties);
}
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_Element_SetProperties(const API_Guid &elemGuid, const GS::Array< API_Property > &properties)
Sets the specified properties for the given values on an element.

◆ ACAPI_Element_SetPropertiesOfDefaultElem()

GSErrCode __ACENV_CALL ACAPI_Element_SetPropertiesOfDefaultElem ( const API_ElemType type,
const GS::Array< API_Property > &  properties 
)

Sets the specified properties for the given values on an element default.

Since
Archicad 26
Parameters
type[in] Type of the default element.
properties[in] Specifies the properties to be set.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - Incorrect type was specified or one of the property definitions' guid did not refer to a valid object.
  • APIERR_NOACCESSRIGHT - The current user does not have the right to modify the properties of the specified element on a teamwork server.
  • APIERR_READONLY - Tried to modify a read-only property (for example a property coming from a hotlink).
  • APIERR_BADPROPERTY - The property definition is not available for the given element.
Remarks
From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.
Example
GSErrCode SetAllPropertyValuesToDefault (const API_ElemType& type)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitionsOfDefaultElem (type, API_PropertyDefinitionFilter_UserDefined, definitions);
if (error == NoError) {
GS::Array<API_Property> properties;
error = ACAPI_Element_GetPropertyValuesOfDefaultElem (type, definitions, properties);
if (error == NoError) {
for (UInt32 i = 0; i < properties.GetSize (); i++) {
properties[i].isDefault = true;
}
error = ACAPI_Element_SetPropertiesOfDefaultElem (type, properties);
}
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_Element_SetPropertiesOfDefaultElem(const API_ElemType &type, const GS::Array< API_Property > &properties)
Sets the specified properties for the given values on an element default.

◆ ACAPI_Element_SetProperty()

GSErrCode __ACENV_CALL ACAPI_Element_SetProperty ( const API_Guid elemGuid,
const API_Property property 
)

Sets the specified property for the given values on an element.

Parameters
elemGuid[in] The element GUID to search for.
property[in] Specifies the property to be set.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - The elemGuid did not refer to a valid element.
  • APIERR_NOACCESSRIGHT - The current user does not have the right to modify the properties of the specified element on a teamwork server.
  • APIERR_READONLY - Tried to modify a read-only property (for example a property coming from a hotlink).
  • APIERR_BADPROPERTY - The property definition is not available for the given element.
Example
GSErrCode SetFirstPropertyValueToDefault (const API_Guid& elemGuid)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitions (elemGuid, API_PropertyDefinitionFilter_UserDefined, definitions);
if (error == NoError && definitions.GetSize () > 0) {
API_Property property = {};
error = ACAPI_Element_GetPropertyValue (elemGuid, definitions[0].guid, property);
if (error == NoError) {
property.isDefault = true;
error = ACAPI_Element_SetProperty (elemGuid, property);
}
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_Element_SetProperty(const API_Guid &elemGuid, const API_Property &property)
Sets the specified property for the given values on an element.

◆ ACAPI_Element_SetPropertyOfDefaultElem()

GSErrCode __ACENV_CALL ACAPI_Element_SetPropertyOfDefaultElem ( const API_ElemType type,
const API_Property property 
)

Sets the specified property to the given value on an element default.

Since
Archicad 26
Parameters
type[in] Type of the default element.
property[in] Specifies the property to be set.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADID - Incorrect type was specified or one of the property definitions' guid did not refer to a valid object.
  • APIERR_NOACCESSRIGHT - The current user does not have the right to modify the properties of the specified element on a teamwork server.
  • APIERR_READONLY - Tried to modify a read-only property (for example a property coming from a hotlink).
  • APIERR_BADPROPERTY - The property definition is not available for the given element.
Remarks
From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.
Example
GSErrCode SetFirstPropertyValueToDefault (const API_ElemType& type)
{
GS::Array<API_PropertyDefinition> definitions;
GSErrCode error = ACAPI_Element_GetPropertyDefinitionsOfDefaultElem (type, API_PropertyDefinitionFilter_UserDefined, definitions);
if (error == NoError) {
GS::Array<API_Property> properties;
error = ACAPI_Element_GetPropertyValuesOfDefaultElem (type, definitions, properties);
if (error == NoError) {
API_Property property = properties[0];
property.isDefault = true;
error = ACAPI_Element_SetPropertyOfDefaultElem (type, property);
}
}
return error;
}
GSErrCode __ACENV_CALL ACAPI_Element_SetPropertyOfDefaultElem(const API_ElemType &type, const API_Property &property)
Sets the specified property to the given value on an element default.
bool isDefault
Definition: APIdefs_Properties.h:807

◆ ACAPI_Element_SetUserData()

GSErrCode __ACENV_CALL ACAPI_Element_SetUserData ( API_Elem_Head elemHead,
const API_ElementUserData userData 
)

Attaches the user data to an element or an element default.

Parameters
elemHead[in] Header of the element (only fields type and guid are used).
userData[in] Pointer to the new user data.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - Any of the passed parameters is nullptr
  • APIERR_BADPLATFORMSIGN - The given platform sign is invalid (out of range)
  • APIERR_MEMFULL - Out of memory
Remarks
This function is used to push the user attached data into an element default or into an element. To set data to element default only elemHead->type is necessary and elemHead->guid should be APINULLGuid. To set data to an element only elemHead->guid is necessary and it should be set to element's guid. Use the ACAPI_Element_GetUserData function to get data from the element record. Note that this function is not undoable in case of element default setting. The caller should allocate and deallocate the userData->dataHdl handle.
Example
//------------------------------------------------------------
// Set user data to wall default element
//------------------------------------------------------------
GSErrCode SetUserDataToWallDefaultElem (const CustomData& data)
{
API_Elem_Head wallDefault = {};
wallDefault.type = API_WallID;
API_ElementUserData userData = {};
userData.dataVersion = 1;
userData.platformSign = GS::Act_Platform_Sign;
userData.flags = APIUserDataFlag_FillWith | APIUserDataFlag_Pickup;
userData.dataHdl = BMAllocateHandle (sizeof (data), ALLOCATE_CLEAR, 0);
*reinterpret_cast<CustomData*> (*userData.dataHdl) = data;
GSErrCode err = ACAPI_Element_SetUserData (&wallDefault, &userData);
BMKillHandle (&userData.dataHdl);
return err;
}
//------------------------------------------------------------
// Set user data to an element identified by guid
//------------------------------------------------------------
GSErrCode SetUserDataToElem (const API_Guid& selectedElemGuid, const CustomData& data)
{
API_Elem_Head element = {};
element.guid = selectedElemGuid;
API_ElementUserData userData = {};
userData.dataVersion = 1;
userData.platformSign = GS::Act_Platform_Sign;
userData.flags = APIUserDataFlag_FillWith | APIUserDataFlag_Pickup;
userData.dataHdl = BMAllocateHandle (sizeof (data), ALLOCATE_CLEAR, 0);
*reinterpret_cast<CustomData*> (*userData.dataHdl) = data;
GSErrCode err = ACAPI_CallUndoableCommand ("Set user data to an elem",
[&userData, &element] () -> GSErrCode {
return ACAPI_Element_SetUserData (&element, &userData);
}
);
BMKillHandle (&userData.dataHdl);
return err;
}
GSErrCode __ACENV_CALL ACAPI_Element_SetUserData(API_Elem_Head *elemHead, const API_ElementUserData *userData)
Attaches the user data to an element or an element default.
short dataVersion
the version of the user data
Definition: APIdefs_Elements.h:14457
GSFlags flags
Special flags | APIUserDataFlag_Pickup | copy userdata into default at element parameter transfer | |...
Definition: APIdefs_Elements.h:14470

◆ ACAPI_Element_SolidLink_Create()

GSErrCode __ACENV_CALL ACAPI_Element_SolidLink_Create ( API_Guid  guid_Target,
API_Guid  guid_Operator,
API_SolidOperationID  operation,
GSFlags  linkFlags 
)

Defines a new Solid Operation Link.

Parameters
guid_Target[in] Identifies the target element.
guid_Operator[in] Identifies the operator element.
operation[in] The operation type
linkFlags[in] Linking options (see ACAPI_Element_SolidLink_GetFlags)
Returns
  • NoError - The function has completed with success.
  • APIERR_NEEDSUNDOSCOPE - The function must be undoable, it wasn't called from an undoable command scope.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADINDEX - One or both of the passed IDs are invalid, or the two IDs are equal.
  • APIERR_BADPARS - Invalid value passed in the operation parameter.
  • APIERR_REFUSEDPAR - Linking together of hotlinked elements is not allowed.
  • APIERR_LINKEXIST - The elements has already been linked together.
Remarks
This function defines a new Solid Operation Link between two construction elements.
Example
Substract the first slab from the first wall, and the new surfaces inherit the attributes of the slab:

◆ ACAPI_Element_SolidLink_GetFlags()

GSErrCode __ACENV_CALL ACAPI_Element_SolidLink_GetFlags ( API_Guid  guid_Target,
API_Guid  guid_Operator,
GSFlags *  linkFlags 
)

Retrieves the flag of a Solid Operation Link.

Parameters
guid_Target[in] Identifies the target element.
guid_Operator[in] Identifies the operator element.
linkFlags[out] Linking options (see Remarks).
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADPARS - The linkFlags parameter is nullptr.
  • APIERR_LINKNOTEXIST - There is no Solid Link in the database between elements specified by guid_Target and guid_Operator.
Remarks
This function retrieves the attribute flag of a Solid Operation Link identified by the Target and the Operator element. The meaning of the flag bits:
Flag Meaning
APISolidFlag_OperatorAttrib The new surfaces inherit the attributes of the operator
APISolidFlag_SkipPolygonHoles Use operator (roof or slab) without holes

◆ ACAPI_Element_SolidLink_GetOperation()

GSErrCode __ACENV_CALL ACAPI_Element_SolidLink_GetOperation ( API_Guid  guid_Target,
API_Guid  guid_Operator,
API_SolidOperationID operation 
)

Retrieves the operation code of a Solid Operation Link.

Parameters
guid_Target[in] Identifies the target element.
guid_Operator[in] Identifies the operator element.
operation[out] The type of the Solid Operation.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADPARS - The operation parameter is nullptr.
  • APIERR_LINKNOTEXIST - There is no Solid Link in the database between elements specified by guid_Target and guid_Operator.
Remarks
This function retrieves the operation code of a Solid Operation Link defined between two construction elements.

◆ ACAPI_Element_SolidLink_GetOperators()

GSErrCode __ACENV_CALL ACAPI_Element_SolidLink_GetOperators ( API_Guid  guid_Target,
GS::Array< API_Guid > *  guid_Operators 
)

Retrieves the operator elements linked to a target element.

Parameters
guid_Target[in] The GUID of the target element.
guid_Operators[out] GUID list of the operator elements linked to the target element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADPARS - The guid_Operators parameter is nullptr.
Remarks
This function retrieves a list of operator elements associated with a given target element with Solid Operation Link.

◆ ACAPI_Element_SolidLink_GetTargets()

GSErrCode __ACENV_CALL ACAPI_Element_SolidLink_GetTargets ( API_Guid  guid_Operator,
GS::Array< API_Guid > *  guid_Targets 
)

Retrieves the target elements linked to an operator element.

Parameters
guid_Operator[in] The GUID of the operator element.
guid_Targets[out] GUID list of the target elements linked to the operator element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADPARS - The guid_Targets parameter is nullptr.
Remarks
This function retrieves a list of target elements associated with a given operator element with Solid Operation Link.

◆ ACAPI_Element_SolidLink_GetTime()

GSErrCode __ACENV_CALL ACAPI_Element_SolidLink_GetTime ( API_Guid  guid_Target,
API_Guid  guid_Operator,
GSTime *  linkTime,
UInt32 *  linkSubTime 
)

Retrieves the creation time of a Solid Operation Link.

Parameters
guid_Target[in] Identifies the target element.
guid_Operator[in] Identifies the operator element.
linkTime[out] Time of the link creation.
linkSubTime[out] Auxiliary time parameter of the link creation.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADPARS - The linkTime or the linkSubTime parameter is nullptr.
  • APIERR_LINKNOTEXIST - There is no Solid Link in the database between elements specified by guid_Target and guid_Operator.
Remarks
This function retrieves the creation time of a Solid Operation Link defined between two construction elements. Since GSTime is a second-precise date-time format, the linkTime parameter of that type is not enough to order the Solid Operation Links by their creation time. However it is important to know which operation is to be performed prior to another, if there is more than one Solid Operations defined to a given element. That is the auxiliary linkSubTime for, which distinguishes the link creation time values within one second.

◆ ACAPI_Element_SolidLink_Remove()

GSErrCode __ACENV_CALL ACAPI_Element_SolidLink_Remove ( API_Guid  guid_Target,
API_Guid  guid_Operator 
)

Discontinues a Solid Operation Link.

Parameters
guid_Target[in] Identifies the target element.
guid_Operator[in] Identifies the operator element.
Returns
  • NoError - The function has completed with success.
  • APIERR_NEEDSUNDOSCOPE - The function must be undoable, it wasn't called from an undoable command scope.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADINDEX - One or both of the passed IDs are invalid, or the two IDs are equal.
  • APIERR_LINKNOTEXIST - There is no Solid Link in the database between elements specified by guid_Target and guid_Operator.
  • APIERR_REFUSEDPAR - Hotlinked Solid Links cannot be removed.
Remarks
This function removes the Solid Operation Link defined between two construction elements.

◆ ACAPI_Element_SolidOperation_Create()

GSErrCode __ACENV_CALL ACAPI_Element_SolidOperation_Create ( API_Guid  guid_Target,
API_Guid  guid_Operator,
API_SolidOperationID  operation,
GS::Array< API_Guid > *  guid_Results = nullptr 
)

Creates a new Solid Operation.

Parameters
guid_Target[in] Identifies the target element.
guid_Operator[in] Identifies the operator element.
operation[in] The operation type
guid_Results[out] The result elements after the operation (in case of successfull operation, the target and operator elements will be deleted).
Returns
  • NoError - The function has completed with success.
  • APIERR_NEEDSUNDOSCOPE - The function must be undoable, it wasn't called from an undoable command scope.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADINDEX - One or both of the passed IDs are invalid, or the two IDs are equal.
  • APIERR_BADPARS - Invalid value passed in the operation parameter.
  • APIERR_NO3D - Solid operation targets and operators can be freeshape elements only.
Remarks
This function defines a new Solid Operation between two morph elements. In case of successfull operation, the target and operator elements will be deleted. The result elements will be returned in the guid_Results parameter.
Example
Substract and add morphs:

◆ ACAPI_Element_Trim_Elements()

GSErrCode __ACENV_CALL ACAPI_Element_Trim_Elements ( const GS::Array< API_Guid > &  guid_ElementsToTrim)

Trim elements given in the array with Roof(s) and/or Shell(s) are contained in the array.

Parameters
guid_ElementsToTrim[in] Array of GUIDs of the elements to trim with shells and roofs are contained in this array.
Returns
  • NoError - The function has completed with success.
  • APIERR_NEEDSUNDOSCOPE - The function must be undoable, it wasn't called from an undoable command scope.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADINDEX - One or more of the passed IDs are invalid.
  • APIERR_BADPARS - Invalid value passed in the guid_ElementsToTrim parameter.
  • APIERR_BADELEMENTTYPE - There is element in the array, which is not construction element type, or there is no Roof or Shell element in the array to trim with.
Remarks
This function trims elements given in the array with Roof(s) and/or Shell(s) are contained in the array.

◆ ACAPI_Element_Trim_ElementsWith()

GSErrCode __ACENV_CALL ACAPI_Element_Trim_ElementsWith ( const GS::Array< API_Guid > &  guid_ElementsToTrim,
const API_Guid guid_Element,
API_TrimTypeID  trimType 
)

Trim elements given in the array with the given Roof or Shell with the type of trim.

Parameters
guid_ElementsToTrim[in] Array of GUIDs of the elements to trim with the given Shell or Roof.
guid_Element[in] The trimming element GUID.
trimType[in] The type of the trimming.
Returns
  • NoError - The function has completed with success.
  • APIERR_NEEDSUNDOSCOPE - The function must be undoable, it wasn't called from an undoable command scope.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADINDEX - One or more of the passed IDs are invalid.
  • APIERR_BADPARS - Invalid value passed in the guid_ElementsToTrim parameter or invalid value passed in the trimType parameter.
  • APIERR_BADELEMENTTYPE - There is element in the array, which is not construction element type or the trimming element is not Roof or Shell.
Remarks
This function trims elements given in the array with the given Roof or Shell.

◆ ACAPI_Element_Trim_GetTrimmedElements()

GSErrCode __ACENV_CALL ACAPI_Element_Trim_GetTrimmedElements ( const API_Guid guid_Element,
GS::Array< API_Guid > *  guid_TrimmedElements 
)

Get the trimmed elements with the given Roof or Shell in the array.

Parameters
guid_Element[in] The element GUID.
guid_TrimmedElements[out] Array of GUIDs of the elements are trimmed with the given Shell or Roof.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADINDEX - One or more of the passed IDs are invalid.
  • APIERR_BADPARS - Invalid value passed in the guid_Element parameter.
  • APIERR_BADELEMENTTYPE - The given element is not Roof or Shell element.
Remarks
This function gets elements are trimmed with the given Roof or Shell.

◆ ACAPI_Element_Trim_GetTrimmingElements()

GSErrCode __ACENV_CALL ACAPI_Element_Trim_GetTrimmingElements ( const API_Guid guid_Element,
GS::Array< API_Guid > *  guid_TrimmingElements 
)

Get the trimming elements of the given element in the array.

Parameters
guid_Element[in] The element GUID.
guid_TrimmingElements[out] Array of GUIDs of the elements are trimming the given element.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADINDEX - One or more of the passed IDs are invalid.
  • APIERR_BADPARS - Invalid value passed in the guid_Element parameter.
  • APIERR_BADELEMENTTYPE - The given element is not construction element.
Remarks
This function gets elements are trimming the given element.

◆ ACAPI_Element_Trim_GetTrimType()

GSErrCode __ACENV_CALL ACAPI_Element_Trim_GetTrimType ( const API_Guid guid_Element1,
const API_Guid guid_Element2,
API_TrimTypeID trimType 
)

Get the type of trimming connection between the given elements.

Parameters
guid_Element1[in] The first element GUID.
guid_Element2[in] The second element GUID.
trimType[out] The type of the trimming.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADINDEX - One or more of the passed IDs are invalid.
  • APIERR_BADELEMENTTYPE - One of the elements is not construction element type or there is no given Roof or Shell.
Remarks
This function gets the type of trimming connection between the elements.

◆ ACAPI_Element_Trim_Remove()

GSErrCode __ACENV_CALL ACAPI_Element_Trim_Remove ( const API_Guid guid_Element1,
const API_Guid guid_Element2 
)

Remove the trimming connection from the given elements.

Parameters
guid_Element1[in] The first element GUID.
guid_Element2[in] The second element GUID.
Returns
  • NoError - The function has completed with success.
  • APIERR_NEEDSUNDOSCOPE - The function must be undoable, it wasn't called from an undoable command scope.
  • APIERR_BADDATABASE, APIERR_NOTMINE - The function cannot operate on the current database.
  • APIERR_BADINDEX - One or more of the passed IDs are invalid.
  • APIERR_BADELEMENTTYPE - One of the elements is not construction element type or there is no given Roof or Shell.
Remarks
This function removes trimming connection between the elements.

◆ ACAPI_Element_UI2ElemPriority()

GSErrCode __ACENV_CALL ACAPI_Element_UI2ElemPriority ( GS::Int32 *  uiPriority,
GS::Int32 *  elemPriority 
)

Returns user building material connection priority for a interface priority.

Parameters
uiPriority[in] The priority as it appers on the user interface.
elemPriority[out] The building material's connection priority.
Returns
  • NoError - The function has completed with success.