API Reference
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
DB.Api.Site Class Reference

Class to handle the site object. The site is the highest level object in the Sketch model object hierarchy. The model hierarchy runs from site down to zone surface openings which lie at the bottom of the hierarchy. Sites contain building objects. Building objects can contain component blocks, assembly instances and building blocks. Building blocks can contain component blocks, assembly instances and zones. Zones are comprised of surfaces and surfaces incorporate openings. By default, attribute data can be inherited from the site level down to zone surface opening level but may be overridden at any level in the hierarchy. This class incorporates methods to access objects within the hierarchy and to manipulate attribute data and data stored in tables. More...

Public Member Functions

Building CreateBuilding ()
 Used to create an empty building, initialise it with default attribute data and add it to the site.
 
Table AddTable (string tableName, int fieldCount)
 Adds an empty table to the site with the supplied name and number of fields.
 
Table AddTableFromFile (string tableName, string filePath)
 Adds an empty table to the site with the supplied name and then populates it with data from the .DAT file with the supplied name (refer to the Table class for further information concerning .DAT file format, etc.).
 
Table GetTable (string tableName)
 Returns the site table with the supplied name.
 
bool RemoveTable (string tableName)
 Removes the table with the supplied name from the site.
 
void RemoveAllTables ()
 Removes all site tables.
 
bool ClearTable (string tableName)
 Removes all contents from the site table with the supplied name.
 
Table CopyTable (string srcTableName, string dstTableName)
 Used to add an empty destination table to the site and then copy the contents of an existing source site table to the empty table.
 
bool CopyTableToComponents (string tableName)
 Used to copy the supplied table to the DB components tables (see ApplicationComponents class).
 
bool CopyTableToTemplates (string tableName)
 Used to copy the supplied table to the DB templates tables (see ApplicationTemplates class).
 
void AddAttribute (string attributeName, string value)
 Adds an attribute with the supplied name and value.
 
bool SetAttribute (string attributeName, string value)
 Sets an attribute with the supplied name to the supplied value.
 
string GetAttribute (string attributeName)
 Returns the string value of the attribute with the supplied name.
 
int GetAttributeAsInt (string attributeName)
 Returns the integer value of the attribute with the supplied name (same as GetIntegerAttribute). If the value of the attribute is not an integer value, the return value is undefined. To use this method, foreknowledge is required that the value of the attribute is in fact an integer value.
 
double GetAttributeAsDouble (string attributeName)
 Returns the double value of the attribute with the supplied name. If the value of the attribute is not a double value, the return value is undefined. To use this method, foreknowledge is required that the value of the attribute is in fact an double value.
 
int GetIntegerAttribute (string attributeName)
 Returns the integer value of the attribute with the supplied name (same as GetAttributeAsInt). If the value of the attribute is not an integer value, the return value is undefined. To use this method, foreknowledge is required that the value of the attribute is in fact an integer value.
 
bool IsAttributeTrue (string attributeName)
 Returns boolean value (TRUE/FALSE) of the attribute with the supplied name.
 
void RebuildModel ()
 Used to force a rebuild of the model geometry. A model rebuild forces all model zones to be rebuilt from primary geometry (building blocks, partitions, voids, etc.) and all zone adjacencies to be re-established.
 
bool SelectBuilding (int index)
 Used to select the building with the supplied index.
 
Building GetBookmarkedBuilding (int index, int bookmark)
 Returns the building with the supplied index if the supplied bookmark index is -1. If the bookmark index is a positive integer, the bookmark building with that index will be returned from the building with the supplied building index.
 
void CreateDisplayLists ()
 
bool ExportZonesToDxfFile (string filePath, int maxVertices, bool triangulate)
 Exports the geometry of the model zones in the form of a collection of polygons to a DXF file. Polygons are generated for all zone surfaces of the model but excludes inner surfaces, window frames, window panes, etc. If the number of vertices in a polygon exceeds the supplied maximum limit, the polygon will be triangulated. Triangulation can be forced via the 'triangulate' parameter.
 
bool ExportSlabGeometryToDxfFile (string filePath)
 Writes the geometry of the primary model objects in the form of a collection of polygons to a DXF file. Polygons are generated for all internal and external surfaces of the model and include external walls, internal partitions, window frames, window panes, etc.
 
bool ExportXMLFile (string filePath)
 Exports the model in the form of an XML file.
 
bool ImportXMLFile (string filePath)
 Imports the model from an XML file.
 
void Dispose ()
 

Properties

Collections.Buildings Buildings [get]
 Returns a collection of buildings stored within the site (refer to Building class).
 
Collections.DataObjects AttributeDataObjects [get]
 Returns a collection of data objects which can be used to manipulate attribute data (refer to DataObject class).
 
Collections.Polygons PrimaryGeometryPolygons [get]
 Returns the geometry of the primary model objects in the form of a collection of polygons. Polygons are generated for all internal and external surfaces of the model and include external walls, internal partitions, window frames, window panes, etc.
 
double Azimuth [set]
 Used to set the site azimuth.
 
BoundingBox3d Bounds [get]
 Used to retrieve the geometric range of the site in the form of a 3D bounding box.
 

Detailed Description

Class to handle the site object. The site is the highest level object in the Sketch model object hierarchy. The model hierarchy runs from site down to zone surface openings which lie at the bottom of the hierarchy. Sites contain building objects. Building objects can contain component blocks, assembly instances and building blocks. Building blocks can contain component blocks, assembly instances and zones. Zones are comprised of surfaces and surfaces incorporate openings. By default, attribute data can be inherited from the site level down to zone surface opening level but may be overridden at any level in the hierarchy. This class incorporates methods to access objects within the hierarchy and to manipulate attribute data and data stored in tables.

Member Function Documentation

◆ AddAttribute()

void DB.Api.Site.AddAttribute ( string  attributeName,
string  value 
)

Adds an attribute with the supplied name and value.

Parameters
attributeNameName of attribute to be added.
valueValue of attribute to be added.

◆ AddTable()

Table DB.Api.Site.AddTable ( string  tableName,
int  fieldCount 
)

Adds an empty table to the site with the supplied name and number of fields.

Parameters
tableNameName of table to be added.
fieldCountNumber of fields in table.
Returns
TRUE if table is successfully added to the site otherwise FALSE.

◆ AddTableFromFile()

Table DB.Api.Site.AddTableFromFile ( string  tableName,
string  filePath 
)

Adds an empty table to the site with the supplied name and then populates it with data from the .DAT file with the supplied name (refer to the Table class for further information concerning .DAT file format, etc.).

Parameters
tableNameName of table to be added.
filePathFull path name of .DAT file from which table will be populated.
Returns
TRUE if table is successfully added and populated otherwise FALSE.

◆ ClearTable()

bool DB.Api.Site.ClearTable ( string  tableName)

Removes all contents from the site table with the supplied name.

Parameters
tableNameName of table from which all contents is to be removed.
Returns
TRUE if table is cleared successfully otherwise FALSE.

◆ CopyTable()

Table DB.Api.Site.CopyTable ( string  srcTableName,
string  dstTableName 
)

Used to add an empty destination table to the site and then copy the contents of an existing source site table to the empty table.

Parameters
srcTableNameName of existing table the contents of which is to be copied to the new destination table.
dstTableNameName of new destination table to which the contents of the existing source table is to be copied.
Returns
TRUE if the destination table is added successfully and the contents of the existing source table copied to it successfully otherwise FALSE.

◆ CopyTableToComponents()

bool DB.Api.Site.CopyTableToComponents ( string  tableName)

Used to copy the supplied table to the DB components tables (see ApplicationComponents class).

Parameters
tableNameName of table to be copied to components tables.
Returns
TRUE if table copied successfully otherwise FALSE.

◆ CopyTableToTemplates()

bool DB.Api.Site.CopyTableToTemplates ( string  tableName)

Used to copy the supplied table to the DB templates tables (see ApplicationTemplates class).

Parameters
tableNameName of table to be copied to templates tables.
Returns
TRUE if table copied successfully otherwise FALSE.

◆ CreateBuilding()

Building DB.Api.Site.CreateBuilding ( )

Used to create an empty building, initialise it with default attribute data and add it to the site.

Returns
TRUE if building created successfully otherwise FALSE.

◆ ExportSlabGeometryToDxfFile()

bool DB.Api.Site.ExportSlabGeometryToDxfFile ( string  filePath)

Writes the geometry of the primary model objects in the form of a collection of polygons to a DXF file. Polygons are generated for all internal and external surfaces of the model and include external walls, internal partitions, window frames, window panes, etc.

Parameters
filePathFull path name of DXF file.
Returns
TRUE if geometry successfully exported otherwise FALSE.

◆ ExportXMLFile()

bool DB.Api.Site.ExportXMLFile ( string  filePath)

Exports the model in the form of an XML file.

Parameters
filePathFull path name of XML file.
Returns
TRUE if XML file successfully exported otherwise FALSE.

◆ ExportZonesToDxfFile()

bool DB.Api.Site.ExportZonesToDxfFile ( string  filePath,
int  maxVertices,
bool  triangulate 
)

Exports the geometry of the model zones in the form of a collection of polygons to a DXF file. Polygons are generated for all zone surfaces of the model but excludes inner surfaces, window frames, window panes, etc. If the number of vertices in a polygon exceeds the supplied maximum limit, the polygon will be triangulated. Triangulation can be forced via the 'triangulate' parameter.

Parameters
filePathFull path name of DXF file.
maxVerticesMaximum number of vertices allowed in exported polygon (otherwise triangulated).
triangulateIf set to TRUE, polygons will be triangulated.
Returns
TRUE if geometry successfully exported otherwise FALSE.

◆ GetAttribute()

string DB.Api.Site.GetAttribute ( string  attributeName)

Returns the string value of the attribute with the supplied name.

Parameters
attributeNameName of attribute from which value is to be retrieved
Returns
TRUE if attribute is retrieved successfully otherwise FALSE

◆ GetAttributeAsDouble()

double DB.Api.Site.GetAttributeAsDouble ( string  attributeName)

Returns the double value of the attribute with the supplied name. If the value of the attribute is not a double value, the return value is undefined. To use this method, foreknowledge is required that the value of the attribute is in fact an double value.

Parameters
attributeNameName of attribute from which double value is to be retrieved
Returns
Double value of attribute

◆ GetAttributeAsInt()

int DB.Api.Site.GetAttributeAsInt ( string  attributeName)

Returns the integer value of the attribute with the supplied name (same as GetIntegerAttribute). If the value of the attribute is not an integer value, the return value is undefined. To use this method, foreknowledge is required that the value of the attribute is in fact an integer value.

Parameters
attributeNameName of attribute from which integer value is to be retrieved
Returns
Integer value of attribute

◆ GetBookmarkedBuilding()

Building DB.Api.Site.GetBookmarkedBuilding ( int  index,
int  bookmark 
)

Returns the building with the supplied index if the supplied bookmark index is -1. If the bookmark index is a positive integer, the bookmark building with that index will be returned from the building with the supplied building index.

Parameters
indexIndex of building or bookmark building to be returned.
bookmarkIndex of bookmark building to be returned (-1 if the building itself is to be returned).
Returns
Either the building or the building bookmark depending on the bookmark index parameter (null if the method fails).

◆ GetIntegerAttribute()

int DB.Api.Site.GetIntegerAttribute ( string  attributeName)

Returns the integer value of the attribute with the supplied name (same as GetAttributeAsInt). If the value of the attribute is not an integer value, the return value is undefined. To use this method, foreknowledge is required that the value of the attribute is in fact an integer value.

Parameters
attributeNameName of attribute from which integer value is to be retrieved
Returns
Integer value of attribute

◆ GetTable()

Table DB.Api.Site.GetTable ( string  tableName)

Returns the site table with the supplied name.

Parameters
tableNameName of table to be retrieved.
Returns
The required table as a Table object if successful otherwise null.

◆ ImportXMLFile()

bool DB.Api.Site.ImportXMLFile ( string  filePath)

Imports the model from an XML file.

Parameters
filePathFull path name of XML file.
Returns
TRUE if XML file successfully imported otherwise FALSE.

◆ IsAttributeTrue()

bool DB.Api.Site.IsAttributeTrue ( string  attributeName)

Returns boolean value (TRUE/FALSE) of the attribute with the supplied name.

Parameters
attributeNameAttribute name
Returns
TRUE if boolean value of attribute is true otherwise FALSE

◆ RemoveTable()

bool DB.Api.Site.RemoveTable ( string  tableName)

Removes the table with the supplied name from the site.

Parameters
tableNameName of table to be removed.
Returns
TRUE if table removed successfully otherwise FALSE.

◆ SelectBuilding()

bool DB.Api.Site.SelectBuilding ( int  index)

Used to select the building with the supplied index.

Parameters
indexIndex of building to be selected
Returns
TRUE if the building is selected successfully otherwise FALSE.

◆ SetAttribute()

bool DB.Api.Site.SetAttribute ( string  attributeName,
string  value 
)

Sets an attribute with the supplied name to the supplied value.

Parameters
attributeNameName of attribute to be set
valueValue to which attribute is to be set
Returns
TRUE if attribute is set successfully otherwise FALSE

The documentation for this class was generated from the following file: