MainPage   Related pages 
List of all members
domainBim::AutomationAPI Class Reference

#include <domainBim/AutomationAPI.h>

Inheritance diagram for domainBim::AutomationAPI:
domainBim::CoreAPI desiteCore::ProjectAPI desiteCore::NavigatorProjectAPI

Public Slots

FIND OBJECTS
bool hasElement (QString ID)
 
QStringList getRootContainerList (QString modelName)
 
QString findContainerByName (QString parentID, QString name, QString lookupDomain="all")
 
QString getContainerByName (QString parentID, QString name)
 
bool isContainer (QString ID)
 
QVariantList findDocumentsByLocationGps (double lat, double lon, double distance, QStringList idList=QStringList())
 
QVariantList findDocumentsByLocationRangeGps (QStringList gpsCoordinates, double distance, QStringList idList=QStringList())
 
QVariantList findDocumentsByLocationGk (double rw, double hw, double distance, QStringList idList=QStringList())
 
QStringList findDocumentsByDate (QDateTime start, QDateTime end, QStringList idList=QStringList(), bool useRef=false)
 
DOCUMENTS - SYNC, METADATA
int synchronizeDocumentContainer (QString containerID)
 
void resetDocumentMetaData (QString objID)
 
ACTIVITIES - TOOLS
QVariantMap getVisualisationList ()
 
int setVisualisationByID (QString taskIDList, QString visID)
 
int removeVisualisation (QString taskIDList)
 
GEOMETRY
int hasContact (QString objID1, QString objID2, QVariantMap options=QVariantMap())
 
QString createContactObject (QString parentID, QString objID1, QString objID2, QString matID, QVariantMap options=QVariantMap())
 
QStringList cutObject (QString parentID, QString objID, QVariantMap plane=QVariantMap())
 
QString mergeObjects (QString parentID, QString IDs, bool skipClosed=false, bool keepTransparency=false)
 
bool isIncludedIn (QString objID1, QString objID2)
 
int isPointIncludedIn (double x, double y, double z, QString objID, double tol=1.e-5)
 
int checkIntersection (QString objID1, QString objID2, double tolerance=-0.00001)
 
int transformObject (QString objID, QString transformation)
 
int setAsOpening (QString objID, QString openingIDList)
 
QString getProjectionAsSvg (QString idList, QVariantMap options=QVariantMap())
 
DOMAINS
QString getDomainByElement (QString id)
 
MODELS
QString getModelByName (QString name, QString domainFilter="geometry")
 
QString getModelByElement (QString eleID, QString domainFilter="all")
 
QString getRootContainerByName (QString modelName, QString rootContainerName)
 
QStringList getModelListByName (QString name, QString domain="geometry")
 
QStringList getModelListByDomain (QString domainFilter="all")
 
QString getRootNodeByModel (QString modelID)
 
QStringList getRootNodeListByDomain (QString domainFilter="all")
 
QString createModel (QString name, bool createRootC=true, QString domain="geometry")
 
QVariantMap getModelMetaData (QString modelID)
 
int deleteModel (QString id)
 
LINKED OBJECTS
int setLinkedObjects (QString eleID, QString IDList)
 
int removeAllLinkedObjects (QString objID)
 
int removeLinkedObjects (QString objID, QString IDList)
 
PROPERTIES
int setPropertyValue (QString objID, QString propName, QString propDataType, QVariant value)
 
int deleteProperty (QString objID, QString propName, QString propDatatype)
 
int createPropertyType (QString propName, QString propDatatype, QString uomCode, bool isInh, int target, QString domainName="all")
 
int setPropertyTypeMetaData (QString pName, QString ptype, QVariantMap metadata)
 
int deletePropertyType (QString propName, QString propDatatype, QString domainName="all")
 
QList< QVariant > getAvailablePropertyValues (QString propName, QString propDatatype, int maxValues, QString domainName="geometry")
 
QList< QVariant > getPropertyValues (QString propName, QString propDatatype, int maxValues=0, QString domainName="all")
 
QList< QVariant > getPropertyValuesByObjectList (QString propName, QString propDatatype, bool checkInh, QString objIdList, int maxValues=0, QString domainName="all")
 
GEOMETRY - MATERIALS
QString createMaterial (QString matXml, QString modelID=QString())
 
int deleteMaterial (QString matID)
 
QStringList getMaterialList ()
 
QString getMaterialAsXmlByID (QString matID)
 
QString getMaterialIDByName (QString matName)
 
void updateMaterial (QString matID, QString xmlMat)
 
int setMaterialToObjects (QString matID, QString objectIDList)
 
int setTransparency (QString objectIDList, float defaultTransparency=0.95)
 
void resetMaterials (bool emitSignal=true)
 
QString createColorSchema (QString setContainerID, QString name)
 
QString createColorSchemaFromCurrentMaterials (QString name, bool updateExisting, QVariantMap options=QVariantMap())
 
QStringList getColorSchemaList ()
 
QString getCurrentColorSchema ()
 
bool activateColorSchemaByName (QString name)
 
void reorderElements ()
 
GEOMETRY- WIREMODE
void showWireModeSchema (QString name)
 
void clearWireMode ()
 
void setObjectsToWireMode (QString idList, bool wired)
 
QString createWireModeSchema (QString idList, QString wmName, bool overwrite=false)
 
QString getWired ()
 
int countWired ()
 
BOUNDINGBOX
double getBBoxMinX ()
 
double getBBoxMaxX ()
 
double getBBoxMinY ()
 
double getBBoxMaxY ()
 
double getBBoxMinZ ()
 
double getBBoxMaxZ ()
 
void updateBoundingBox3DView ()
 
int calcOOBB (QString objIDList, double eps=0.01)
 
int updateOOBB (QString obIDList, double eps=0.01)
 
int calcOOBBxy (QString objIDList, double eps=0.01)
 
int updateOOBBxy (QString objIDList, double eps=0.01)
 
QVariantMap getBoundingBoxCommon (QString objIDList)
 
double checkOverlapOBB (QString id1, QString id2, double eps)
 
CREATE / DELETE OBJECTS
QString createObjectFromXml (QString parentID, QString objectXML)
 
int deleteObjects (QString IDList)
 
void setName (QString objIdList, QString name)
 
QString createObject (QString parentID, QString name)
 
QString createSelectionSets (QString propName, QString rootName, QVariantMap config=QVariantMap())
 
FILE OPERATIONS
int createDirectory (QString path, QString dirName)
 
bool writeFile (QString filename, QString content, QString codec=QString())
 
bool removeFile (QString filename)
 
bool checkIfFileExists (QString filename)
 
bool openFile (QString filename, QString codec=QString())
 
bool writeToFile (QString content)
 
bool closeFile ()
 
QStringList readTextFile (QString filename, bool ignoreLineBreakesInDoubleQuotes=false, QString codec=QString())
 
QString readTextFileAsString (QString filename, QString codec=QString())
 
QVariantMap readCsvFile (QString filename, QString delimiter=";", QString quoteSign="\"")
 
Database
bool dbIsLocalCopy ()
 
void dbCheckIn ()
 
void dbCheckOut (QStringList propList)
 
bool dbQueryExec (QString sqlQuery)
 
bool dbQueryNext ()
 
QVariant dbQueryValue (int column)
 
int setPropertyValueDB (QString objIDList, QString propName, QString propDataType, QString propDomain, QVariant value, bool createType=true)
 
int writePropertyValueDB (QString objIDList, QString propName, QString propDataType, QString propDomain, QVariant value, bool createType=true)
 
bool startTransaction ()
 
bool endTransaction ()
 
bool dbGetImmediateUpdate ()
 
void dbSetImmediateUpdate (bool)
 
int dbClearCache (QString propName, QString propType)
 
void dbClearCacheAll ()
 
int dbDeleteProperty (QString objIDList, QString propName, QString propType)
 
int dbAssertTable (QString tableName, QStringList columnsList)
 
Object Tooltips
QStringList getListOfObjTooltips ()
 
void addObjectListToTooltip (QString idList, QString tooltipname)
 
void removeObjectListFromTooltip (QString idList, QString tooltipname)
 
Locking of Objects
void lockObjects (QString idList)
 
void unlockObjects (QString idList)
 
void unlockAllObjects ()
 
QString getLocked ()
 
int countLocked ()
 
Object Iterator
void itClear ()
 
int itByFilter (QString propName, QString propDatatype, QString filterPattern, bool checkInh=true, QString domain="geometry")
 
int itFilterByStatus (QString status, bool enabled=true, QString domain="all")
 
int itByObjectList (QString idList)
 
QString itGetObjectList ()
 
bool itHasNext ()
 
QString itNext ()
 
int itCount ()
 
void itToFront ()
 
QList< QVariant > itGetAvailablePropertyValues (QString propName, QString propDatatype, int maxValues)
 
void itSetupDbCache (QString propName, QString propType)
 
void itSetMaterial (QString matID)
 
void itColorCode (QString propName, QString propDT)
 
void itColorCodeNumber (QString propName, QString propDT, double intervalSize)
 
void itCalcOOBB (double eps)
 
void itUpdateOOBB (double eps)
 
void itCalcOOBBxy (double eps)
 
void itUpdateOOBBxy (double eps)
 
- Public Slots inherited from domainBim::CoreAPI
QString addDays (QString dateStr, int nrDays)
 
QString timeStamp (QString format=QString())
 
int getCalendarWeek (QDateTime dt)
 
QString format (double v, int dec=2, QString frmt="%L1", int fieldWidth=10, QChar fillChar=QChar())
 
QString formatDateTime (QDateTime dt, QString formatstr="iso")
 
QString createID ()
 
QString compressToIfcGuid (QString id)
 
QString uncompressFromIfcGuid (QString ifcGuid)
 
bool checkRegExp (QString value, QString pattern)
 
double calcSlantedArea (QString objID, double angleMin=0.0, double angleMax=45.0)
 
QVariantMap calcGpsCoordsByStation (QString objID, double station)
 
QVariantMap calcGpsCoordsByModelCoords (double x, double y)
 
QVariantMap calcGkCoordsByModelCoords (double x, double y, double z)
 
QString getApplicationDirectory ()
 
QString getApplicationFilename ()
 
QString getVersionAsString ()
 
int getVersionMAJOR ()
 
int getVersionMINOR ()
 
int getVersionBUILD ()
 
bool requireVersion (int MAJOR, int MINOR, int BUILD)
 
QString getUserName ()
 
QString getProjectID ()
 
int getProjectVariantNumber ()
 
QString getProjectNumber ()
 
QString getProjectName ()
 
QString getProjectShortDescription ()
 
QString getProjectLongDescription ()
 
QString getProjectDirectory ()
 
QString getLocation ()
 
QString getDomainByElement (QString objID)
 
QVariant getPropertyValue (QString objID, QString propName, QString propType, bool inh=true)
 
QVariant getPropertySource (QString objID, QString propName, QString propType, bool inh=true)
 
QString getPropertyUnit (QString objID, QString propName, QString propType, bool inh=true)
 
QVariant getPropertyValueByDate (QString objID, QString propName, QString propType, bool inh=true)
 
QDateTime getPropertyLastDate (QString objID, QString propName, QString propType, bool inh=true)
 
QDateTime getPropertyFirstDate (QString objID, QString propName, QString propType, bool inh)
 
QVariantMap getPropertyDateListAsJSON (QString objID, QString propName, QString propType, bool inh=true)
 
QVariantMap getPropertyTypesByObject (QString objID, QString filterPattern="*")
 
QVariantMap getPropertyTypesByDomain (QString domainName, QString filterPattern="*")
 
QVariantMap getPropertyTypeMetaData (QString pName, QString ptype)
 
QList< QVariant > getPropertyTypeList (QString domain="all", QString filterPattern="*")
 
bool isPropertyInherited (QString objID, QString propName, QString propType)
 
QString getPropertyValueRange (QString IDList, QString propName, QString propType, QString domainFilter="geometry")
 
QStringList getPropertyValueList (QString propName, QString propType, int maxValues)
 
QString getPropertyValueAsString (QString objID, QString propName, QString propType, bool inh=true)
 
QVariant evaluateFormula (QString code, QString id, QString id_otherdomain=QString())
 
QString prepareJsCode (QString code, QString id, int dec=-1, QString frmt="%L1", int fieldWidth=10, QChar fillChar=QChar())
 
QStringList getLinkedObjects (QString objectIDList, QString resultDomains="all", QString objectLookupDomains="all")
 
QStringList getTasksByObjectList (QString IDList)
 
QStringList getObjectsByTaskList (QString IDList)
 
QStringList getDocumentsByObjectList (QString IDList)
 
QStringList getObjectsByDocumentList (QString IDList)
 
QStringList getSectionsByObjectList (QString IDList)
 
QStringList getObjectsBySectionList (QString IDList)
 
QStringList getTypesByObjectList (QString IDList)
 
QStringList getObjectsByTypeList (QString IDList)
 
QStringList getResourcesByObjectList (QString IDList)
 
QStringList getObjectsByResourcesList (QString IDList)
 
QStringList getBoQItemsByObjectList (QString IDList)
 
QStringList getObjectsByBoQItemList (QString IDList)
 
QStringList getPcItemsByObjectList (QString IDList)
 
QStringList getObjectsByPcItemList (QString IDList)
 
QStringList getContainedElements (QString containerID, int maxDepth)
 
int countContainedElements (QString containerID, int maxDepth)
 
QString getParent (QString objID)
 
QStringList getOpenings (QString objID)
 
QStringList getParts (QString objID)
 
QString getModelAsJson (QString modelId)
 
bool isVisible (QString objID)
 
bool isSelected (QString objID)
 
bool isLocked (QString objID)
 
bool isWired (QString objID)
 
QVariantList getPointList (QString objID)
 
QVariantMap getPointOnAlignmentAtStation (QString objID, double d)
 
double getStationOfProjectedPoint (QString objID, double x, double y, double z=0.0)
 

Public Member Functions

Constructors
 AutomationAPI (BimProject *bimPrj, bool isAutomation, QObject *parent=0)
 
virtual ~AutomationAPI ()
 
- Public Member Functions inherited from domainBim::CoreAPI
 CoreAPI::CoreAPI (BimProject *bimPrj, QObject *parent=0)
 
virtual ~CoreAPI ()
 
BimProject * getBimProject ()
 

Additional Inherited Members

- Protected Member Functions inherited from domainBim::CoreAPI
model::IContainerObject * getIContainerObject (const QString &id, model::eDomainType domainFilter=model::typeDomainAll)
 
model::IContainer * getIContainer (const QString &id, model::eDomainType domainFilter=model::typeDomainAll)
 
model::Element * getElement (const QString &id, model::eDomainType domainFilter=model::typeDomainAll)
 
model::IProperty * _getProperty (QString objID, QString propName, QString propType, bool inh)
 
QVariant _getPropertyValue (const QString &objID, const QString &propName, const QString &propType, bool inh, bool evaluate, bool formatAsString)
 
void collectGeoObjects (const QString &IDList, QList< model::IObject * > &list)
 
QList< QDateTime > getPropertyDateList (QString objID, QString propName, QString propType, bool inh=true)
 

Detailed Description

DESITE API for scripting in automation.

Since
1.5.0, 17 nov 2014, ah
Id
AutomationAPI.h 783 2017-09-28 14:04:22Z alexander.rensch

(c) ceapoint aec technologies GmbH

Constructor & Destructor Documentation

domainBim::AutomationAPI::AutomationAPI ( BimProject *  bimPrj,
bool  isAutomation,
QObject *  parent = 0 
)
Parameters
isAutomationAffects access rights

Member Function Documentation

bool domainBim::AutomationAPI::activateColorSchemaByName ( QString  name)
slot

Activate color scheme with given name (case sensitive). View will be repainted.

Returns
true if color scheme was activated, else false (e.g. when name does not exist)
See also
resetMaterials(bool emitSignal = true);
Since
2.0.4, 26 oct 2016, sl
void domainBim::AutomationAPI::addObjectListToTooltip ( QString  idList,
QString  tooltipname 
)
slot

Add object list to tooltip.

Parameters
idListList of objects
tooltipnameName of the tooltip template
Since
1.3.2, 28 mar 2014, jh
int domainBim::AutomationAPI::calcOOBB ( QString  objIDList,
double  eps = 0.01 
)
slot

Calculate optimized, orientated bounding box (OOBB) of all given geometric objects. The boundingbox is only calculated if an object has no OOBB yet.

Parameters
objIDListIDs of objects to be affected (separated by ';')
epsThreshold for optimization (default: 0.01)
Returns
Number of affected objects
Since
1.5.0, 13 jan 2015, ah
int domainBim::AutomationAPI::calcOOBBxy ( QString  objIDList,
double  eps = 0.01 
)
slot

Calculate optimized, orientated bounding box in xy-plane (OOBBxy) of all given geometric objects. The boundingbox is only calculated if an object has no OOBBxy yet.

Parameters
objIDListIDs of objects to be affected (separated by ';')
epsThreshold for optimization (default: 0.01)
Returns
Number of affected objects
Since
1.5.0, 13 jan 2015, ah
bool domainBim::AutomationAPI::checkIfFileExists ( QString  filename)
slot

Checks if a file exists

Parameters
filenameName of file
Returns
true, if file exists, else false
Since
1.9.0, 05 jul 2016, mm
double domainBim::AutomationAPI::checkOverlapOBB ( QString  id1,
QString  id2,
double  eps 
)
slot

Check overlap of oriented bounding boxes of two given objects with 'id1' and 'id2'. If an OOBB has not been already calculated for each object, it will be calculated with numerical precision eps (default 0.01).

Returns
A value between [0, 1] indicating the overlapping factor (of the smaller box).

Note: In case of two OBBs with the same orientation it is the exact percentage of overlap, else only a indicative value. If no geometric object exists for one of both ids, 0.0 will be returned.

Since
1.4.10, 01 jun 2015, sl
void domainBim::AutomationAPI::clearWireMode ( )
slot

Set all objects to normal mode, 3D view will be refreshed.

Since
1.3.0, 13 nov 2013, jh
bool domainBim::AutomationAPI::closeFile ( )
slot

Close an open file. There can only be one open file at once!

Returns
true - success
false - file is not open
Since
1.3.0, 30 oct 2013, jh
int domainBim::AutomationAPI::countLocked ( )
slot

Count locked objects.

Returns
Number of locked objects
Since
1.3.6, 25 apr 2014, jh
int domainBim::AutomationAPI::countWired ( )
slot

Count objects which are in wireframe mode.

Since
1.9.0, 03 mar 2016, sl
QString domainBim::AutomationAPI::createColorSchema ( QString  setContainerID,
QString  name 
)
slot

Create color scheme with given name from the hierarchy (content) given by a container.

Parameters
containerIDID of container whose content defines the color schema. For each contained container a material is created with the container names.
nameName of new color schema. If name already exists it is augmented by an index, e.g. '~(2)'.
Returns
Name of new Color Schema
Since
1.0.20, 18 jan 2013, jh
QString domainBim::AutomationAPI::createColorSchemaFromCurrentMaterials ( QString  name,
bool  updateExisting,
QVariantMap  options = QVariantMap() 
)
slot

Create color scheme with given name from current material settings.

Parameters
nameName of new color scheme
updateExistingIf 'true' an already existing color scheme is updated, otherwise a new color scheme is created. If name already exists it is augmented by an index, e.g. '~(2)'.
Options,e.g.if a legend shall be drawn if color scheme is applied

Options:

{
legend: true
}
Returns
Name of new color scheme.
Since
1.3.0, 15 nov 2013, jh
QString domainBim::AutomationAPI::createContactObject ( QString  parentID,
QString  objID1,
QString  objID2,
QString  matID,
QVariantMap  options = QVariantMap() 
)
slot

Create contact object (contact surface) between two objects. If angle > 0, the resulting surface may differ for each object. In this case the projection on object 1 ist choosen.

Parameters
parentID: ID of container the newly created object should be added.
objID1: ID of object 1.
objID2: ID of object 2.
matID: ID of material of the newly created object. If empty, a default material (dark orange) will be chosen.
options: Options encoded as JSON. If not specified, the default values of the code snipped (see below) will be chosen.
Returns
ID of new object, else "" if no contact could be calculated, or
-1 - error, object 'objID1' not found or of wrong type
-2 - error, object 'objID2' not found or of wrong type
-3 - error, IContainer 'parentID' not found or of wrong type
-4 - error, model not found or model is read-only
var opt = {
locflag: 7, // 1 = contact at top, 2 = contact at bottom, 4 = contact at sides (and combinations)
tol: 0.001, // maximum distance tolerance [m]
oppdir: true, // flag that indicates that normal vectors of contacting faces must point in opposite directions
angle: 2.0 // maximum angle deviation between normal vectors of opposite faces [°]
}
var idnew = desiteAPI.createContactObject( parentID, id1, id2, "", opt );
Since
1.5.0, 07 jan 2015, sl
int domainBim::AutomationAPI::createDirectory ( QString  path,
QString  dirName 
)
slot

Create new directory at given file path.

Parameters
dirNameName of new directory
pathFile path of directory in which new directory should be created (relative paths are allowed)
Returns
error code:
1 - success
0 - directory already exists, no changes
-1 - error
Since
1.5.0, 16 mar 2016, mm
QString domainBim::AutomationAPI::createMaterial ( QString  matXml,
QString  modelID = QString() 
)
slot

Create a new material for visualisation. If the material already exists the existing material is not changed.

Parameters
matXmlMaterial encoded as XML
modelIDCreate a new material in this model. If the model is not found or the string is empty (default) the standard model of the geometry project is used.
Returns
ID of new material, empty string if material could not be created.
If the material already exists, the existing material is returned.
An existing material can be located in an other model than 'modelID'.

Example:

var matXml =
'<material ID="default-mat-11" name="default-mat-11">
<diff r="140" b="40" g="150" a="1"/>
<amb r="140" b="40" g="150" a="1"/>
<spec r="255" b="255" g="255" a="1"/>
<trans v="0"/>
<shin v="0.5"/>
</material>';
var matID = desiteAPI.createMaterial(matXml,'12345');
See also
deleteMaterial()
Since
1.0.20, 14 jan 2013, jh
QString domainBim::AutomationAPI::createModel ( QString  name,
bool  createRootC = true,
QString  domain = "geometry" 
)
slot

Create a new model in a specified domain.

By default the model is empty.

For models within the geometry and documents domain a root container has to be created. to access the rootnode in the model use method getRootNodeByModel(). The model itself is not visible in the GUI.

Parameters
nameName of model
domainDomain in which model is created. This is one of
  • 'geometry'
  • 'activities'
  • 'documents'
  • 'qa'
  • 'building'
  • 'boq'
  • 'qto'
  • 'pc'
  • 'cd'
  • 'res'
  • 'type'
createRootCIf true, create a root container (in domain 'geometry': a container on which transformations can be applied) with the same name as the new model (only for domains: geometry/documents!)
Returns
ID of new model.
-1 Model could not be created.
-2 Domain is unknown or not unique
Since
1.3.0, 21 jan 2014, jh
QString domainBim::AutomationAPI::createObject ( QString  parentID,
QString  name 
)
slot
Deprecated:
This method will be removed in future versions of DESITE MD and should not be used for new scripts anymore.

Create an attribute object (no geometry).

Parameters
parentIDID of parent container
nameName of new object.
Returns
ID of new object
Empty string in case of any error
Since
1.0.17, 16 jun 2012, jh ; deprecated 1.9.0, 14 apr 2016
Deprecated:
Use createObjectFromXml() instead!
QString domainBim::AutomationAPI::createObjectFromXml ( QString  parentID,
QString  objectXML 
)
slot

Create a new object encoded by XML.
If ID is not given or ID is already used in project a new ID will be created.

Returns
ID of new object, else
error code if object cannot be created.

Error Codes:

0 : Undefined
-1 : Could not find parentID
-2 : parentID is not a container
-3 : could not find model of parentID
-4 : could not create new object
-10 : unsupported object type (tagname)

DOMAIN GEOMETRY

Available objects

<object3D>
<objectLines>
<objectText>
<genericObject>
<container>
<objectProxy>

The 3D-view is not refreshed after the objects have been created. Call 'repaint3DView()' to update the screen after creating objects.

Examples

<object3D ID="ABCxyz123" name="object-1" matID="mat-abcxyz" >
<p nr="0" x="1.0" y="1.0" z="1.5" />
<p nr="1" x="10.0" y="20.0" z="1.5" />
<p nr="2" x="1.0" y="10.0" z="1.5" />
<t p1="0" p2="1" p3="2" />
</object3D>
<objectLines ID="ABCxyz123" name="line-1" matID="mat-xyz">
<p nr="0" x="1.0" y="1.0" z="1.5" />
<p nr="1" x="10.0" y="20.0" z="1.5" />
<l p1="0" p2="1" />
</objectLines>
<objectText ID="ABCxyz123" name="text-1" matID="mat-xyz">
<textItem c="Der Text" h="1.0" rx="0.0" ry="0.0" rz="0.0" x="0.0" y="0.0" z="0.0"></textItem>
</objectText>
<genericObject ID="IdOfGeneric" name="genric-1" />
<container ID="IdOfContainer" name="container-1" />
<objectProxy ID="IdOfProxy" name="proxy-1" objID="IdOfEmbeddedObject"/>

DOMAIN ACTIVITIES

<task>

Note: if wbs is empty, it will be automatically created from wbs and number of child tasks of the parent task.

Examples

<task ID="xyz344" name="Rohbau" wbs="1.2" d="480" start="2015-08-06T09:00:00" finish="2015-08-06T17:00:00"/>

DOMAIN BUILDING STRUCTURE

<section>

Examples

Create two nested sections in the building structure

var objXml = '<section name="Building A"/>';
var id = desiteAPI.createObjectFromXml( parentID, objXml );
objXml = '<section name="00EG"/>';
var id2 = desiteAPI.createObjectFromXml( id, objXml );

DOMAIN DOCUMENTS

<document>

Examples

Create a document

<document ID="xyz123" path="C:/file.json" date="2016-03-16T12:27:34">
<location refID="abc321" lon="45.55523" lat="7.04567" refFrom="" refTo="" />
</document>

Create a document linked to a directory

<documentDir path="C:/" />
See also
To create a directory on the hard drive see also createDirectory(path, dirName)

DOMAIN BoQ (Bill of Quantities)

<item>

Examples

Create an boq-item from an xml string.

<item wbs="1.1" ID="3" name="newItem" type="2">
<attr>
<qty>0</qty>
<unit></unit>
<up>0</up>
</attr>
</item>

Available types: 1 - Category 2 - BOQ-Item 3 - Markup Item (Zuschlagsposition) 4 - Remark 5 - Performance Description 6 - Sub-Description

qty is quantity as double number. unit is the unit of measurements as text. up is the unit price as double number.

DOMAIN RESOURCES

<resourceItem>
<resourceInstance>

Example

var parentID = '';
var c = desiteAPI.itByFilter( 'cpName', 'xs:string', '*TRANSPORT*', false, 'res' );
if( c == 0 ) {
// create model, get ID of root node
var ID = desiteAPI.createModel( "TRANSPORT", false, 'res' );
parentID = desiteAPI.getRootNodeByModel( ID );
} else {
// use first element in list as parent
parentID = desiteAPI.itNext();
}
var xmlStr = '<resourceItem name="T1"/>';
desiteAPI.createObjectFromXml( parentID, xmlStr );
xmlStr = '<resourceInstance name="T2"/>';
desiteAPI.createObjectFromXml( parentID, xmlStr );

DOMAIN TYPES

<typeItem>

Examples

<typeItem name="newTypeItem" />
<typeItem ID="xyz344" name="newTypeItem2" prefix="Prefix" comment="created by script" />

ID, Prefix and Comment are optional.

Since
1.5.0, 06 jul 2015, jh
Remarks
domain BoQ added 2.0.8. 05 jan 2017, ar
domain Resources added 2.0.11, 04 apr 2017, jh
domain Types added 2.0.13, 28 apr 2017, ah
int domainBim::AutomationAPI::createPropertyType ( QString  propName,
QString  propDatatype,
QString  uomCode,
bool  isInh,
int  target,
QString  domainName = "all" 
)
slot
Returns
0 undefined
1 Property Type created
2 Property Type already exists
-1 Error, could not create Property Type
-2 Error, undefined target
Parameters
uomCodeUnit of Measurement
target1 - Project Repository
2 - Database
QString domainBim::AutomationAPI::createSelectionSets ( QString  propName,
QString  rootName,
QVariantMap  config = QVariantMap() 
)
slot

Create selections sets of geometry objects.
For each value of a given property name a selection set is created.

Parameters
propNameName of property
rootNameName of selection set container to add new sets
configOption for creating selection sets from a property list. See Example code.

Example, Default Values:

{
maxItems: 0,
considerCompositeParts: true,
considerOpenings: true,
considerParts: true
}
Returns
ID of new selection sets.
Empty string if selection set could not be created.
QString domainBim::AutomationAPI::createWireModeSchema ( QString  idList,
QString  wmName,
bool  overwrite = false 
)
slot

Create a wire mode schema for objects.

Parameters
idListList of object IDs, separated by ';'
wmNameName of new wireframe mode
overwriteIf 'true' an existing schema will be overwritten with current settings (default: 'false')
Returns
Name of the schema created
Since
1.3.0, 13 nov 2013, jh
Remarks
1.9.0, 17 Jun 2016, ar, changed to return name of the schema created
QStringList domainBim::AutomationAPI::cutObject ( QString  parentID,
QString  objID,
QVariantMap  plane = QVariantMap() 
)
slot

Cut object into subparts. ...

Parameters
parentID: ID of parent container. If empty, subparts will be added to object.
objID: ID of object
options: Options encoded as JSON. If not specified, the default values of the code snipped (see below) will be chosen.
Returns
ID list of subparts.

Example: Cut object id="ABCxyz123" by xy-plane (through origin) and append parts to object (parent=""):

var plane = {
px : 0.0,
py : 0.0,
pz : 0.0,
nx : 0.0,
ny : 0.0,
nz : 1.0,
}
var idList = desiteAPI.cutObject( "", "ABCxyz123", plane );
Since
1.5.0, 05 aug 2015, sl
int domainBim::AutomationAPI::dbAssertTable ( QString  tableName,
QStringList  columnsList 
)
slot

Check if database has a specific table with certain columns.

Parameters
tableNameTable name
columnsListList of columns specified in the format [columnname columndatatype]

Example:

var tblName = "TestTable";
var colList = [ 'RecID string', 'colNmbr real' ];
desiteAPI.dbAssertTable( tblName, colList );
Returns
-1 No database connection
-2 failed to create table
void domainBim::AutomationAPI::dbCheckIn ( )
slot

Database check-in.

Since
1.0.17, 18 jul 2012, jh
Remarks
1.5.0, 15 dec 2014, moved to class AutomationAPI
void domainBim::AutomationAPI::dbCheckOut ( QStringList  propList)
slot

Check out properties in local database. Only properties which are checked out can be edited. All other properties are locked in local database.

Parameters
propListList of properties in such format: propName##propType
Since
1.0.17, 18 jul 2012, jh
int domainBim::AutomationAPI::dbClearCache ( QString  propName,
QString  propType 
)
slot
Returns
errCode 1 = OK
-1 = error
Since
1.3.6, 28 apr 2014, jh
void domainBim::AutomationAPI::dbClearCacheAll ( )
slot
See also
To setup cached values see also itSetupDbCache()
Since
1.3.6, 28 apr 2014, jh
int domainBim::AutomationAPI::dbDeleteProperty ( QString  objIDList,
QString  propName,
QString  propType 
)
slot

Delete properties from database.

Parameters
objIDListThe properties are removed and deleted from these objects.
Returns
0 undefined
-4 database is not open -5 no objects found in domain projects
Since
1.4.9, 12 dec 2015, jh
bool domainBim::AutomationAPI::dbGetImmediateUpdate ( )
slot
Since
1.3.0, 14 nov 2013, jh
bool domainBim::AutomationAPI::dbIsLocalCopy ( )
slot

Check if current database is a local copy.

Since
1.0.17, 18 jul 2012, jh
bool domainBim::AutomationAPI::dbQueryExec ( QString  sqlQuery)
slot

Create a database query by an SQL statement. To iterate over the query result use dbQueryNext() and get the values of the current record by dbQueryValue().

Parameters
sqlQueryDatabase query as SQL statement
Returns
true - success
false - query has failed
Since
1.0.18, 14 aug 2012, jh
bool domainBim::AutomationAPI::dbQueryNext ( )
slot

Go to next record of last query.

Returns
true - success
false - iterator is at end, no next query
See also
dbQueryExec()
Since
1.0.18, 14 aug 2012, jh
QVariant domainBim::AutomationAPI::dbQueryValue ( int  column)
slot
Since
1.0.18, 14 aug 2012, jh
void domainBim::AutomationAPI::dbSetImmediateUpdate ( bool  )
slot
Since
1.3.0, 14 nov 2013, jh
int domainBim::AutomationAPI::deleteMaterial ( QString  matID)
slot

Delete material with given ID.

Parameters
matIDID of material to be deleted
Returns
ErrorCode 1 success
-1 Material could not be found
-2 Material could not be deleted
Since
1.0.20, 14 jan 2013, jh
int domainBim::AutomationAPI::deleteModel ( QString  id)
slot

Delete Model.

Contained elements are removed from all locations where they are used (links, viewpoints, ...) and will be deleted afterwards.

The 3D view is not refreshed after the objects have been deleted. Call 'repaint3DView()' to update the screen after deleting objects.

Parameters
idID of model
Returns
Error Code:
1 - ok, model was deleted
-1 - error, id does not exist
-2 - error, model is write protected
Since
2.0.13, 25 apr 2017, sl
int domainBim::AutomationAPI::deleteObjects ( QString  IDList)
slot

Delete and remove one or more objects or containers. Model root nodes will not be deleted!

Contained elements are also removed and deleted. Also these elements are removed from all other locations where they are used (links, viewpoints, ...)

The 3D view is not refreshed after the objects have been deleted. Call 'repaint3DView()' to update the screen after deleting objects.

Parameters
objIDListList of object/container IDs seperated by ';'
Returns
Number of deleted objects and containers
Since
1.3.0, 02 jan 2014, jh
Remarks
2.0.11, 05 apr 2017, sl: BimProject::deleteElements() is now responsible for collecting contained elements
int domainBim::AutomationAPI::deleteProperty ( QString  objID,
QString  propName,
QString  propDatatype 
)
slot

Delete property 'propName' from element 'eleID'.

Parameters
eleIDID of element. Set ID to 'GlobalProject' to remove and delete property from global project.
Returns
0 - undefined
1 - ok, property does not exist for given object
2 - ok, property has been deleted
-1 - error, object 'objID' not found
-2 - error, no model found in which obj is contained
-3 - error, model is read only
-4 - error, objID not of type domainGeometry3D::Element
Since
1.5.0, 14 mar 2015, jh
Remarks
2.0.11, 03 apr 2017, sl: used method BimProject::deletePropertyByObjectID(...) updated (domain and project repo fix).
int domainBim::AutomationAPI::deletePropertyType ( QString  propName,
QString  propDatatype,
QString  domainName = "all" 
)
slot

Remove property type from domain. All affected properties will be deleted. Will not work for properties stored in database. To delete database properties use the database widget instead.

Parameters
propNameName of property type
propDatatypeData type of property type
domainNameName of domain (default: "all", combinations are allowed)
Returns
1 - ok
0 - undefined
-1 - error, invalid propName
-2 - error, invalid propType
-3 - error, invalid domainName
-4 - property type could not be deleted
Since
1.5.0, 14 dez 2015, sl
bool domainBim::AutomationAPI::endTransaction ( )
slot
Since
1.0.18, 20 aug 2012, jh
QString domainBim::AutomationAPI::findContainerByName ( QString  parentID,
QString  name,
QString  lookupDomain = "all" 
)
slot

Get container with name 'name' and parent node 'parentID'. If the container does not exist an empty string is returned.

Parameters
parentIDParent node id
nameName of the container
lookupDomainLookup container 'name' in this domain, default = 'all'
Returns
container Id
Since
1.5.0, 10 dec 2014, jh
QStringList domainBim::AutomationAPI::findDocumentsByDate ( QDateTime  start,
QDateTime  end,
QStringList  idList = QStringList(),
bool  useRef = false 
)
slot

Get documents where the create date is between a given range or where the reference date is between a given range.

Parameters
startdate range start
enddate range end
idListsearch list
useRefflag determining if documents are searched by their create or reference date
Since
2.0.0, 20 jun 2016, mm
QList<QVariant> domainBim::AutomationAPI::getAvailablePropertyValues ( QString  propName,
QString  propDatatype,
int  maxValues,
QString  domainName = "geometry" 
)
slot
Deprecated:
This method will be removed in future versions of DESITE MD and should not be used for new scripts anymore.

Get all available values of property 'propName/propDatatype'.

Parameters
maxValues0 - get all values
> 0 - do not get more than 'maxValues' items

Example:

var pList = desiteAPI.getAvailablePropertyValues( 'cpiComponentType', 'xs:string', 0 );
for( var i=0; i<pList.length;i++) {
str += '[' + pList[i] + ']\n';
}
Since
1.3.0, 04 nov 2013, jh ; deprecated 1.9.0, 14 apr 2016
Deprecated:
Use getPropertyValues() instead!
double domainBim::AutomationAPI::getBBoxMaxX ( )
slot

Get maximal x-coordinate of overall bounding box of all geometric objects (visible and hidden) in project .

double domainBim::AutomationAPI::getBBoxMaxY ( )
slot

Get maximal y-coordinate of overall bounding box of all geometric objects (visible and hidden) in project .

double domainBim::AutomationAPI::getBBoxMaxZ ( )
slot

Get maximal z-coordinate of overall bounding box of all geometric objects (visible and hidden) in project .

double domainBim::AutomationAPI::getBBoxMinX ( )
slot

Get minimal x-coordinate of overall bounding box of all geometric objects (visible and hidden) in project .

double domainBim::AutomationAPI::getBBoxMinY ( )
slot

Get minimal y-coordinate of overall bounding box of all geometric objects (visible and hidden) in project .

double domainBim::AutomationAPI::getBBoxMinZ ( )
slot

Get minimal z-coordinate of overall bounding box of all geometric objects (visible and hidden) in project .

QVariantMap domainBim::AutomationAPI::getBoundingBoxCommon ( QString  objIDList)
slot

Get common bounding box of all objects in objIdList. If an object id represents a composite (geometric container), all parts of it will be taken into account.

Parameters
objIDListIDs of objects to be affected (separated by ';')
Returns
Json object with min and max coordinates of bounding box, e.g.
{
minX: 0.0,
minY: 0.0,
minZ: 0.0,
maxX: 2.0,
maxY: 2.0,
maxZ: 2.0
}
Since
1.4.10, 10 jun 2015, sl
Remarks
extended 2.0.11, 29 mar 2017, sl
QStringList domainBim::AutomationAPI::getColorSchemaList ( )
slot

Get all color schemes.

Returns
List of names of all color schemes
Since
1.0.16
QString domainBim::AutomationAPI::getContainerByName ( QString  parentID,
QString  name 
)
slot

Get container with name 'name' and parent node 'parentID'. If the container does not exist it is created.

Since
1.0.18, 19 aug 2012, jh
Parameters
parentID: Parent node id
name: Name of the container
Returns
container Id
QString domainBim::AutomationAPI::getCurrentColorSchema ( )
slot

Get current (applied) color scheme.

Returns
Name of current color scheme
Since
1.0.16
QString domainBim::AutomationAPI::getDomainByElement ( QString  id)
slot

Get domain of object id.

Since
2.0.3, 10 oct 2016, jh
QStringList domainBim::AutomationAPI::getListOfObjTooltips ( )
slot

Get list of tooltip templates.

Since
1.3.2, 28 mar 2014, jh
QString domainBim::AutomationAPI::getLocked ( )
slot

Get all locked objects.

Returns
List of IDs of locked objects (separeted by ';')
Since
1.3.6, 25 apr 2014, jh
QString domainBim::AutomationAPI::getMaterialAsXmlByID ( QString  matID)
slot

Get material encoded by XML.

Parameters
matIDID of material
Returns
Material as XML string
QString domainBim::AutomationAPI::getMaterialIDByName ( QString  matName)
slot

Get ID of material with given name.

Parameters
matNameName of material
Returns
ID of material. If material does not exist an empty string is returned.
Since
1.0.20, 14 jan 2013, jh
QStringList domainBim::AutomationAPI::getMaterialList ( )
slot

Get list of all available materials.

Returns
Material list as list of material IDs
Since
1.0.20, 14 jan 2013, jh
QString domainBim::AutomationAPI::getModelByElement ( QString  eleID,
QString  domainFilter = "all" 
)
slot

Lookup model ID in which the element 'eleID' is contained. If the model could not be found this method returns an empty string.

Parameters
eleIDElement to find the model of
domainFilter[optional] Domain(s) to look in; by default "all". The lookup may be faster if you narrow the search to specific domains.
Since
1.9.0, 13.05.2016, jh
QString domainBim::AutomationAPI::getModelByName ( QString  name,
QString  domainFilter = "geometry" 
)
slot

Return ID of Model 'name'. If the model does not exist it is created.

Since
1.0.17, 16 jun 2012, jh ; deprecated 1.9.0, 14 apr 2016
Deprecated:
This method will be removed in future versions of DESITE MD and should not be used for new scripts anymore.
Use createModel() and getModelListByName() instead.
Reason: A Model is not uniquely identified by its name.
QStringList domainBim::AutomationAPI::getModelListByDomain ( QString  domainFilter = "all")
slot

Return a ID-list of all models in a given domain.

Parameters
domainFilterGiven domain(s) (default = 'all'). Different domain names have to be separated by ';'.
Since
1.5.0, 28 oct 2015, jh
QStringList domainBim::AutomationAPI::getModelListByName ( QString  name,
QString  domain = "geometry" 
)
slot

Get a list of IDs of all models with name 'name'.

name : Name of the model domain : Domain name combination. Default is 'geometry'

See also
DOMAINS
Returns
model ids as list
Since
1.3.0, 02 jan 2014, jh
QVariantMap domainBim::AutomationAPI::getModelMetaData ( QString  modelID)
slot

Get meta data of a given model as JSON object.

Keys of JSON object:

ExportFileName
ExportFileNameUser
ExportCreated
ExportCreatedBy
SourceModelID
SourceApp
SourceFormat
SourceFileName
SourceModelRecID
SourceDbLink
SourceUrl
ProjectFileName
ProjectModelRecID
ProjectDbLink
ProjectUrl
Imported
ImportedBy
ExportFormatName
ExportFormatVersion
Since
1.5.0, 28 oct 2015, jh
QString domainBim::AutomationAPI::getProjectionAsSvg ( QString  idList,
QVariantMap  options = QVariantMap() 
)
slot

Get projection of given geometric objects as SVG.

Parameters
idListGiven geometric objects, list of IDs separated by ';'
optionsOptions as JSON object
If an empty JSON object is passed to this method, the size and viewBox is adjusted to the drawn objects.
Returns
Picture as SVG

Example Options:

{
"width": 600,
"height": 200,
"viewBox": "10 10 800 400",
"resolution": 1

resolution - resoltion in dpi, default is 72

Since
2.0.9, 03 feb 2017, jh
QList<QVariant> domainBim::AutomationAPI::getPropertyValues ( QString  propName,
QString  propDatatype,
int  maxValues = 0,
QString  domainName = "all" 
)
slot

Get all available property values for a given property type and domain.

Parameters
propNameName of property type
propDatatypeData type of property type
maxValueMax. number of values which should be returned. If 'maxValue' = 0 all available values will be returned.
domainNameName of domain (default: "all", combinations are allowed)
Returns
Array with all property values
Empty array if an error occured or no property values are found in given domain(s)
See also
getPropertyValuesByObjectList()
Since
1.5.0, 15 dez 2015, sl
QList<QVariant> domainBim::AutomationAPI::getPropertyValuesByObjectList ( QString  propName,
QString  propDatatype,
bool  checkInh,
QString  objIdList,
int  maxValues = 0,
QString  domainName = "all" 
)
slot

Get all available different property values for a given property type, list of objects and domain.

Parameters
propNameName of property type
propDatatypeData type of property type
checkinhtrue = Consider inherited properties, false = Check direct properties only
maxValueMax. number of values which should be returned. If 'maxValue'<= 0 all available values will be returned.
obIdListIds of objects to check property values.
domainNameName of domain (default: "all", combinations are allowed)
Returns
Array with all property values
Empty array if an error occured or no property values are found in given domain(s)
See also
getPropertyValues()
Since
1.5.0, 15 dez 2015, sl
QString domainBim::AutomationAPI::getRootContainerByName ( QString  modelName,
QString  rootContainerName 
)
slot

Return ID of Root Container 'rootContainerName' which is elements of model 'modelName'.

If the model or the container does not exist it is created. If the model is readonly an empty string is returned.

Since
1.0.17, 16 jun 2012, jh ; deprecated 1.9.0, 14 apr 2016
Deprecated:
This method will be removed in future versions of DESITE MD and should not be used for new scripts anymore.
QStringList domainBim::AutomationAPI::getRootContainerList ( QString  modelName)
slot

Get a list of IDs of all root containers of all models with name 'modelName'. Works only in domain geometry, because not the model roots but the 'red' root containers (where transformations can be applied) are returned.

Parameters
modelName: Name of the model(s)
Returns
Container Ids as list
Since
1.0.18, 19 aug 2012, jh
Remarks
last modified 1.9.0, 14 apr 2016, ah
QString domainBim::AutomationAPI::getRootNodeByModel ( QString  modelID)
slot

Get ID of root node of a given model.

Each model has a container as root node in which the whole object hierarchy of a model is stored. This root node is visible in the treeview. The model itself is not visble in hte GUI but can be accessed by methods in the API.

Returns
ID of root node, else '-1' if 'modelID' is not an ID of any model.
Since
1.5.0, 28 oct 2015, jh
See also
getRootNodeListByDomain()
QStringList domainBim::AutomationAPI::getRootNodeListByDomain ( QString  domainFilter = "all")
slot

Get list of IDs of root nodes of a given domain filter.

Each model has a container as a root node in which the whole object hierarchy of a model is stored.

Parameters
domainFilterGiven domain(s) (default = 'all'). Different domain names have to be seperated by ';'.
Since
1.5.0, 28 oct 2015, jh
See also
getRootNodeByModel()
QVariantMap domainBim::AutomationAPI::getVisualisationList ( )
slot

Get list of visualisation configurations as JSON object.

Example

{
"list":[ {"id":"{9ba5d816-1db8-43c1-8985-100d8c95610b}-6f","name":"MW"},
{"id":"{9ba5d816-1db8-43c1-8985-100d8c95610b}-70","name":"StB"}
]
}
Since
1.9.0, 16 jul 2016, jh
QString domainBim::AutomationAPI::getWired ( )
slot

Get all objects which are set to wireframe mode.

Since
1.9.0, 03 mar 2016, sl
int domainBim::AutomationAPI::hasContact ( QString  objID1,
QString  objID2,
QVariantMap  options = QVariantMap() 
)
slot

Check if two objects have contact.

Parameters
objID1: ID of object 1
objID2: ID of object 2
options: Options encoded as JSON. If not specified, the default values of the code snipped (see below) will be chosen.
Returns
1 if objects have contact using given options
0 - no contact -1 - error, object 'objID1' not found or of wrong type
-2 - error, object 'objID2' not found or of wrong type
Remarks
TODO: parameter oppdir needs implementation
var opt = {
locflag: 7, // 1 = contact at top, 2 = contact at bottom, 4 = contact at sides (and combinations)
checkall: true, // if true, all given location combination checks must be true
tol: 0.001, // maximum distance tolerance [m]
angle: 5.0, // maximum angle deviation between normal vectors of opposite faces [°]
oppdir: true, // flag that indicates that normal vectors of contacting faces must point in opposite directions
}
desiteAPI.hasContact( id1, id2, opt );
Since
1.5.0, 10 dec 2014, sl
bool domainBim::AutomationAPI::hasElement ( QString  ID)
slot

Check if object or container exists with the identificator 'ID'.

Since
1.3.0, 21 jan 2014, jh
Parameters
ID: Element id
Returns
True or False
bool domainBim::AutomationAPI::isContainer ( QString  ID)
slot

Checks for given object id is container or not.

Since
16 mar 2015, jh
Parameters
ID: Object Id
Returns
true or false
bool domainBim::AutomationAPI::isIncludedIn ( QString  objID1,
QString  objID2 
)
slot

Check if object with id 'objID1' is included in object with id 'objID2'.

Returns
false if there is no inclusion
true if object 1 is included in object 2 or is (geometrically) identical
Since
1.5.0, 10 dec 2014, sl
int domainBim::AutomationAPI::isPointIncludedIn ( double  x,
double  y,
double  z,
QString  objID,
double  tol = 1.e-5 
)
slot

Check if point with given coordinates is included in object with id 'objID'.

Parameters
x: x coordinate of point
y: y coordinate of point
z: z coordinate of point
objID: id of object
tol: numerical tolerance
Returns
1 - point is inside
0 - point is on border
-1 - point is outside
-2 - object not found
Since
2.0.13, 05 may 2017, sl
int domainBim::AutomationAPI::itByFilter ( QString  propName,
QString  propDatatype,
QString  filterPattern,
bool  checkInh = true,
QString  domain = "geometry" 
)
slot

Get objects which match the filter. If the filter should be applied on all objects, make sure the object iterator is cleared first. Otherwise the filter is applied on an existing object iterator. The filter string is not case sensitive (except for data type xs:ID and xs::IDREF).

Parameters
propNameProperty name
propDatatypeProperty Datatype [xs:string, xs:double, xs:long, ... ]
checkInhCheck inherited properties
domain[ all, geometry, activities, ... ]
Returns
Number of objects in iterator.
See also
itClear();
Since
1.3.0, 05 nov 2013, jh
int domainBim::AutomationAPI::itByObjectList ( QString  idList)
slot

Object Iterator is set to objects in idList.

Parameters
idListList of Object IDs as String separated by ';'.
Since
1.3.0, 15 nov 2013, jh
void domainBim::AutomationAPI::itCalcOOBB ( double  eps)
slot

Calculate OptOBB of all contained 3D-objects. The boundingbox is only calculated if an object has no OOBB.

Since
1.4.7, 5 sep 2014, jh
void domainBim::AutomationAPI::itCalcOOBBxy ( double  eps)
slot

Calculate OptOBBxy of all contained 3D-objects. The boundingbox is only calculated if an object has no OOBBxy.

Since
1.4.7, 5 sep 2014, jh
void domainBim::AutomationAPI::itClear ( )
slot

Clear and delete an existing object iterator.

Since
1.3.0, 05 nov 2013, jh
void domainBim::AutomationAPI::itColorCode ( QString  propName,
QString  propDT 
)
slot

Color code objects in current object iterator. If the current object iterator does not exist all objects are color coded by property 'propName'. An existing object iterator is deleted by calling itClear().

Since
1.3.0, 15 nov 2013, jh
Parameters
propName: property name
propDT: property data type
void domainBim::AutomationAPI::itColorCodeNumber ( QString  propName,
QString  propDT,
double  intervalSize 
)
slot

Color code objects in current object iterator. If the current object iterator is empty or does not exists all objects are color coded by property 'propName'. (An existing object iterator can be deleted by calling itClear() ).

Since
1.3.0, 15 nov 2013, jh
Parameters
propName: property name
propDT: property data type
intervalSize: Size of interval
int domainBim::AutomationAPI::itCount ( )
slot

Count the elements in current object iterator.

Since
1.3.0, 05 nov 2013, jh
int domainBim::AutomationAPI::itFilterByStatus ( QString  status,
bool  enabled = true,
QString  domain = "all" 
)
slot

Filter objects in iterator list by their status.

Parameters
statusStatus as string [visible, selected, wired or locked]
enabledfilter objects where status is true or false, true is asumed if not defined
domainselect domains to look at [geometry, activities, documents, building, qa, boq, qto, pc, cd, type, res, all], any combinations are allowed
Returns
amount of objects found, 0 if none or undefined, -1 if an error occurred
Since
1.9.0, 18 may 2016, ar
QList<QVariant> domainBim::AutomationAPI::itGetAvailablePropertyValues ( QString  propName,
QString  propDatatype,
int  maxValues 
)
slot

Get property values of objects in current object iterator.

See also
QList<QVariant> getAvailablePropertyValues(QString propName, QString propDatatype, int maxValues );
Since
1.3.1, 24 mar 2014, jh
QString domainBim::AutomationAPI::itGetObjectList ( )
slot

Get list of IDs of current object iterator.

Since
1.3.7, 1 may 2014, jh
bool domainBim::AutomationAPI::itHasNext ( )
slot
Returns
true if the current object iterator has more elements.
Since
1.3.0, 05 nov 2013, jh
QString domainBim::AutomationAPI::itNext ( )
slot

Get ID of next element in object iterator.

Since
1.3.0, 05 nov 2013, jh
void domainBim::AutomationAPI::itSetMaterial ( QString  matID)
slot

Set material to current objects of iterator.

Since
1.3.7, 1 may 2014, jh
void domainBim::AutomationAPI::itSetupDbCache ( QString  propName,
QString  propType 
)
slot

Setup cache for objects in iterator and property 'propname'.

Since
1.3.6, 28 apr 2014, jh
void domainBim::AutomationAPI::itToFront ( )
slot

Set object iterator before first element. Call itNext(9 to get the first element.

Since
1.3.0, 05 nov 2013, jh
void domainBim::AutomationAPI::itUpdateOOBB ( double  eps)
slot

Calculate OptOBB of all contained 3D-objects. The boundingbox is always calculated.

Since
1.4.7, 5 sep 2014, jh
void domainBim::AutomationAPI::itUpdateOOBBxy ( double  eps)
slot

Calculate OptOBB of all contained 3D-objects. The boundingbox is always calculated.

Since
1.4.7, 5 sep 2014, jh
void domainBim::AutomationAPI::lockObjects ( QString  idList)
slot

Locks given objects.

Parameters
idListList of IDs of objects to lock (separeted by ';')
Since
1.3.6, 25 apr 2014, jh
QString domainBim::AutomationAPI::mergeObjects ( QString  parentID,
QString  IDs,
bool  skipClosed = false,
bool  keepTransparency = false 
)
slot

Merge objects into a new one. The material of the resulting object is the material of the object with the largest surface area, or, if flag 'keepTransparency' is set, the transparent material.
Objects must be deleted manually if merging was successful.

Parameters
parentID: ID of parent to which merged object should be added.
IDList: String of IDs of objects to be merged, separated by ";"
skipClosed: Exclude closed surfaces from merging.
keepTransparency: Keep transparent material if any.
Returns
ID of merged object, else empty string if no objects were merged. In case of errors:
-1 No parent with given ID
-2 No objects with given IDs
Since
1.5.0, 05 aug 2015, sl
bool domainBim::AutomationAPI::openFile ( QString  filename,
QString  codec = QString() 
)
slot

Open a textstream to a new file for writing. By deafult, local 8 bit encoding is used.
To change it, set codec name as optional second parameter.

Parameters
filenameName of file to be openend
codecCodec name, e.g. "ISO 8859-1", "UTF-8", "UTF-16" (optional)
Returns
true - success,
false - file could not be opened
Since
1.3.0, 30 oct 2013, jh
Remarks
1.5.0, 23 jul 2015, ah - added codec parameter
QVariantMap domainBim::AutomationAPI::readCsvFile ( QString  filename,
QString  delimiter = ";",
QString  quoteSign = "\"" 
)
slot

Read text file in csv format and return a JSON-object of cells.

Parameters
filenameName of file
delimiterone character as delimiter of cells, mostly ";" or " " (a tab sign)
quoteSignone character, Some csv files use quotes to specify text. Delimiters and linebreaks within quotes are ignored.
Returns
JSON-object

Example:

var lvFile = "tab-separated-text-file.txt";
var csv = desiteAPI.readCsvFile( lvFile, " ", "\"" );
console.log(JSON.stringify(csv, undefined, 2) );

... returns something like:

{
"csv": [
[
"RECID",
"konfignr",
"FORMULA",
"TEXT"
],
[
"1132042",
"1",
"",
"Schalung der Innen- und Aussenwand, \nals glatte Schalung aus Schalungsplatten gleicher Größe.\nBetonfläche möglichst absatzfrei."
],
[
"1129053",
"1",
"(2.683)*2",
"Ortbeton für Aufzugsunterfahrt aus Stahlbeton,\nals Normalbeton für Außenbauteile nach DIN 1045-1;-2, C 25/30 \nExpositionsklasse XC2 nach Vorgabe Planer prüfen."
]
]
}
Since
2.0.9, 17 jan 2017, ar
QStringList domainBim::AutomationAPI::readTextFile ( QString  filename,
bool  ignoreLineBreakesInDoubleQuotes = false,
QString  codec = QString() 
)
slot

Read text file and return each line as string.

Parameters
filenameName of file
ignoreLineBreakesInDoubleQuotes
codeCodec for reading the textfile, one of [ "ISO 8859-1", "UTF-8", "UTF-16" ]
Returns
List of strings containing each line of file
var lineList = desiteAPI.readTextFile( desiteAPI.getProjectDirectory () + '/WebForms/mat.csv' );
for( var i=0; i<lineList.length; i++) {
console.append( lineList[i] );
}
Since
1.3.6, 26 apr 2014, jh
Remarks
update 2.0.9, 17. jan 2017, ar handling quoted text
QString domainBim::AutomationAPI::readTextFileAsString ( QString  filename,
QString  codec = QString() 
)
slot

Read text file and return complete content.

Parameters
filenameName of file
Returns
Complete content in one string
Since
1.5.0, 23 aug 2015, jh
int domainBim::AutomationAPI::removeAllLinkedObjects ( QString  objID)
slot

Remove all linked objects from element 'eleID'.

Parameters
eleIDID of element
Returns
1 success
-1 element with given ID 'eleID' does not exist
Since
1.0.17, 16 jun 2012, jh
bool domainBim::AutomationAPI::removeFile ( QString  filename)
slot

Remove a file

Parameters
filenameName of file to be removed
Returns
true, if file was removed successfully, else false
Since
1.9.0, 24 jun 2016, mm
int domainBim::AutomationAPI::removeLinkedObjects ( QString  objID,
QString  IDList 
)
slot

Remove a given list of objects from object.

Returns
1 success
-1 element with given ID 'eleID' does not exist
Since
2.0.13, 1 may 2017, jh
void domainBim::AutomationAPI::removeObjectListFromTooltip ( QString  idList,
QString  tooltipname 
)
slot

Removes the object list from tooltip.

Parameters
idListList of objects
tooltipnameName of the tooltip template
Since
1.3.2, 28 mar 2014, jh
int domainBim::AutomationAPI::removeVisualisation ( QString  taskIDList)
slot

Remove visualisation configuration from task.

Since
1.9.0, 16 jul 2016, jh
void domainBim::AutomationAPI::reorderElements ( )
slot

Renew painting order of geometric elements. Transparent objects have to be drawn at last to appear properly in 3d view. This method should be called after changes in transparency of visible materials.

Since
1.3.5, 19 apr 2014, jh
void domainBim::AutomationAPI::resetMaterials ( bool  emitSignal = true)
slot

Reset all materials of objects to materials coming from imported geometry model file. 3D View is not updated automatically, to refresh 3D view call repaint3DView().

Parameters
emitSignalIf set to true (default), an active color scheme will be unapplied
Since
1.0.20, 14 jan 2013, jh
int domainBim::AutomationAPI::setAsOpening ( QString  objID,
QString  openingIDList 
)
slot

Set list of objects as opening elements to a given object.

Parameters
objIDID of object for which to set openings
openingIDListObjects to set as openings
Returns
number of objects set as openings
-1 Could not find object -2 Objects of wrong type
Since
2.0.3, 10 oct 2016, sl
int domainBim::AutomationAPI::setLinkedObjects ( QString  eleID,
QString  IDList 
)
slot

Link objects in given IDList to element with eleID.

Parameters
eleIDID of element to the object links. The element can be of any domain (like goemetry, tasks etc).
IDListList of geometric objects to be linked to eleID. List must be a semicolon-separated String.
Returns
Number of objects linked.
-1 element 'eleID' does not exist
Since
1.0.17, 16 jun 2012, jh
Remarks
last modified 1.9.0, 14 apr 2016, ah
int domainBim::AutomationAPI::setMaterialToObjects ( QString  matID,
QString  objectIDList 
)
slot

Set material to given objects (elements of domain 'geometry').

Parameters
matIDID of material
objectIDListList of object IDs to which the material is to be assigned, if an ID is an ID of a container, the material is assigned to all contained objects in this container
Returns
Number of affected objects
-1 Error: Material not found
void domainBim::AutomationAPI::setName ( QString  objIdList,
QString  name 
)
slot

Set name of all given elements.

Parameters
eleIDListList of elements to be renamed
nameName to be set to elements
Since
1.4.10, 11 jun 2015, sl
Deprecated:
Use setPropertyValue() instead.
void domainBim::AutomationAPI::setObjectsToWireMode ( QString  idList,
bool  wired 
)
slot

Set objects to wireframe mode based on condition.

Parameters
idListList of object IDs, separated by ';'
wiredtrue = set objects to wire mode
false = set objects to normal mode
Since
1.3.0, 13 nov 2013, jh
int domainBim::AutomationAPI::setPropertyTypeMetaData ( QString  pName,
QString  ptype,
QVariantMap  metadata 
)
slot

Set meta data of propertytype such as displayname and unit.

Parameters
pNameName of property type
pTypeDatatype of property type
Returns
1 OK 0 undefined -1 could not find property type
Since
2.0.13, 13 may 2017
int domainBim::AutomationAPI::setPropertyValue ( QString  objID,
QString  propName,
QString  propDataType,
QVariant  value 
)
slot

A property value is set in a model, DB, or project repository.

Parameters
objIDID of element to set the property value to
propNameName of the Property
propDataTypeData Type of the Property in XML notation (for example 'xs:string' or 'xs:long')
valueProperty Value
Returns
Code:
1 - ok
0 - undefined
-1 - error, object not found
-2 - error, unknown type
-3 - error, writing was rejected, could be read only or wrong format
See also
setPropertyValueDB()
Since
1.0.17, 28 jun 2012, jh
Remarks
2.0.6, 18 nov 2016, ah: added data type check
int domainBim::AutomationAPI::setPropertyValueDB ( QString  objIDList,
QString  propName,
QString  propDataType,
QString  propDomain,
QVariant  value,
bool  createType = true 
)
slot

A property is set in the database.

Only datatypes supported by the database are provided. In SQLite DBs, datatypes xs:int and xs:float are mapped to xs:long and xs:double accordingly.

Parameters
objIDList: List of objects (objIDs separated by ';') which should be affected.
propDomain: Domains that the object IDs will be looked up in and the property will be created for. Example: "geometry;activities". If empty, "geometry" is used.
createType: If true (default), a property type will be created if not yet existing; if false, the operation will fail if th property type does not already exist
Returns
Code:
1 - ok
0 - undefined
-1 - error: DB error
-2 - error: At least one Object in 'objIDList' not found, or list was empty or too large (>5000 elements)
-3 - error: Property Type locked
-4 - error: Property Type not found
-5 - error: Data type unknown or invalid
See also
setPropertyValue()
writePropertyValueDB();
Since
1.0.18, 18 aug 2012, jh

Changed in 1.3.0, 30 jan 2014:
Extended signature by parameter 'propDomain'.

Remarks
1.9.0, 1 apr 2016, ah: added optional parameter 'createType'
2.0.6, 18 nov 2016, ah: added data type check and return value -5
int domainBim::AutomationAPI::setTransparency ( QString  objectIDList,
float  defaultTransparency = 0.95 
)
slot

Objects get a transparent version of their original material. A new material is created if not already assigned to an object. '-T' is appended to the original name. 3D View is not updated automatically, to refresh 3D view call repaint3DView().

Parameters
objectIDListIDs of objects to change material of (separated by ;)
defaultTransparencyTransparency value used (default: 0.95). Existing transparency remains unchanged.
Returns
Number of affected objects
Since
1.3.5, 25 apr 2014, ah
int domainBim::AutomationAPI::setVisualisationByID ( QString  taskIDList,
QString  visID 
)
slot

Set visualisation configuration to task.

Since
1.9.0, 16 jul 2016, jh
void domainBim::AutomationAPI::showWireModeSchema ( QString  name)
slot

Apply wire mode schema with given name.

Parameters
nameName of wire mode shema which schould be applied. 'Reset' resets wire mode (draw all objects solid). 3D View is not updated automatically, to refresh 3D view call repaint3DView().
Since
1.3.0, 30 oct 2013, jh
bool domainBim::AutomationAPI::startTransaction ( )
slot
Since
1.0.18, 20 aug 2012, jh
int domainBim::AutomationAPI::synchronizeDocumentContainer ( QString  containerID)
slot

Synchronizes a document container with the file directory. An URL must be set for the container which should be synchronized!

Parameters
containerID: container node id
Returns
errCode 1 : ok
0 : undefined
-1 : element 'containerID' could not be found
-2 : containerID is not a container
Since
1.5.0, 06 apr 2016, mm
int domainBim::AutomationAPI::transformObject ( QString  objID,
QString  transformation 
)
slot

Rotate, scale, translate object.

Parameters
objIDID of object which should be transformed
transformationscale, translate, rotate encoded as XML

Transformaton:

<t>
<scale sx="1.0" sy="1.0" sz="1.0" />
<translate dx="10.0" dy="20.0" dz="30.0" />
<rotate x="2.0" y="1.0" z="2.0" m="0.5 0.5 0.0 0.5 0.0 0.5 0.0 0.0 1.0" />
</t>
Returns
1 Ok
-1 Could not find object
Since
27 dec 2013, jh
void domainBim::AutomationAPI::unlockAllObjects ( )
slot

Unlocks all objects.

Since
1.3.6, 25 apr 2014, jh
void domainBim::AutomationAPI::unlockObjects ( QString  idList)
slot

Unlocks given objects.

Parameters
idListList of IDs of objects to lock (separeted by ';')
Since
1.3.6, 25 apr 2014, jh
void domainBim::AutomationAPI::updateBoundingBox3DView ( )
slot

Update overall bounding box of all objects in 3D view.

Since
1.3.5, 15 apr 2014, jh
void domainBim::AutomationAPI::updateMaterial ( QString  matID,
QString  xmlMat 
)
slot

Update material properties such as diffuse, transparency, ...

Parameters
matIDID of material
matXmlNew material properties as XML
See also
createMaterial()
int domainBim::AutomationAPI::updateOOBB ( QString  obIDList,
double  eps = 0.01 
)
slot

Update optimized, orientated bounding box (OOBB) of all given geometric objects. It will always be re-calculated.

Parameters
objIDListIDs of objects to be affected (separated by ';')
epsThreshold for optimization (default: 0.01)
Returns
Number of affected objects
Since
1.5.0, 13 jan 2015, ah
int domainBim::AutomationAPI::updateOOBBxy ( QString  objIDList,
double  eps = 0.01 
)
slot

Update optimized, orientated bounding box in xy-plane (OOBBxy) of all given geometric objects. It will always be re-calculated.

Parameters
objIDListIDs of objects to be affected (separated by ';')
epsThreshold for optimization (default: 0.01)
Returns
Number of affected objects
Since
1.5.0, 13 jan 2015, ah
bool domainBim::AutomationAPI::writeFile ( QString  filename,
QString  content,
QString  codec = QString() 
)
slot

Write a string as whole to file. User must not take care of opening and closing the file.

Parameters
filenameName of file to be written
contentString to be written to file
Returns
true, if file was written successfully, else false
Since
1.3.0, 30 oct 2013, jh
int domainBim::AutomationAPI::writePropertyValueDB ( QString  objIDList,
QString  propName,
QString  propDataType,
QString  propDomain,
QVariant  value,
bool  createType = true 
)
slot

Write property value to database.

This method does not check if the objects given by objIDList exist in the project.

Returns
Code:
1 - ok
0 - undefined
-1 - error: DB error
-2 - error: list is too large (>5000 elements)
-3 - error: Property Type locked
-4 - error: Property Type not found
-5 - error: Data type unknown or invalid
Since
2.0.16, 16 sep 2017, jh
bool domainBim::AutomationAPI::writeToFile ( QString  content)
slot

Write text to an open file.

Parameters
contentText to be written
Returns
true - success,
false - file is not open
See also
openFile()
Since
1.3.0, 30 oct 2013, jh

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

Created: Sun Oct 8 2017 13:29:59