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 (const QString &parentId, const QString &name, const 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)
 
int setTaskMode (QString taskID, int mode)
 
QVariantMap calcPropertyValuesOverTime (QString propName, QString propType, QVariantMap options)
 
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 parentContainerId, QString idList, 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())
 
double calcDistance (QString objId1, QString objId2)
 
DOMAINS
QString getDomainByElement (QString id)
 
SELECTION SETS
QString createSelectionSets (QString propertyTypes, QString rootName, QVariantMap config=QVariantMap())
 
QStringList getRootNodeListSelectionSets (QString domainFilter="all")
 
int addToSelectionSetGeometry (QString setId, QString objectIDList)
 
int removeFromSelectionSetGeometry (QString setId, QString objectIDList)
 
QString createSelectionSet (QString name, QString parentID=QString())
 
bool removeSelectionSet (QString selsetID)
 
MODELS
QString getModelByName (QString name, QString domainFilter="geometry")
 
QString getModelByElement (QString id, 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 (const QString &id)
 
PROJECT
void setCloudSettings (QVariantMap vm)
 
void setTempValue (QString name, QVariant value)
 
QVariant getTempValue (QString name)
 
QStringList getListOfTempValues ()
 
void clearListOfTempValues ()
 
LINKED OBJECTS
int setLinkedObjects (const QString &elementID, const QString &IDList)
 
int removeAllLinkedObjects (QString id)
 
int removeLinkedObjects (QString id, QString linkedIdList)
 
PROPERTY TYPES
int createPropertyType (const QString &propName, const QString &propDatatype, const QString &uomCode, bool isInh, int target, const QString &domainName="all")
 
int setPropertyTypeMetaData (QString pName, QString ptype, QVariantMap metadata)
 
int deletePropertyType (QString propName, QString propDatatype, QString domainName="all")
 
QList< QVariant > getPropertyTypeBookmarkList ()
 
QVariantMap getPropertyTypeBookmarkByID (const QString &bookmarkId)
 
int activatePropertyTypeBookmark (QString bkmId)
 
int setAllPropertyTypesActive ()
 
int removePropertyTypeBookmarkByID (QString bkmId)
 
QString addPropertyTypeBookmark (QVariantMap vmBkm)
 
PROPERTIES
int setPropertyValue (QString objId, QString propName, QString propDataType, QVariant value)
 
int deleteProperty (QString objId, QString propName, QString propDatatype)
 
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", bool getNullValues=false)
 
QList< QVariant > getPropertyValuesByObjectList (QString propName, QString propDatatype, bool checkInh, QString objIdList, int maxValues=0, QString domainName="all", bool getNullValues=false)
 
QVariantMap getPropertyListAsJSON (QVariantMap opt)
 
void setPropertyListAsJSON (QVariantMap propmap, QVariantMap opt)
 
PROPERTY SCRIPTS
QVariantMap getPropertyScriptList () const
 
QString getPropertyScriptCode (QString domain, QString pname, QString datatype) const
 
QString getPropertyScriptFgColor (QString domain, QString pname, QString datatype) const
 
QString getPropertyScriptBgColor (QString domain, QString pname, QString datatype) const
 
int setPropertyScriptCode (QString domain, QString pname, QString datatype, QString code)
 
int setPropertyScriptFgColor (QString domain, QString pname, QString datatype, QString code)
 
int setPropertyScriptBgColor (QString domain, QString pname, QString datatype, QString code)
 
QVariantMap addPropertyScript (QString domain, QString pname, QString datatype, QString code=QString())
 
int removePropertyScript (QString domain, QString pname, QString datatype)
 
void propertyScriptClearCache ()
 
void propertyScriptClearCache (QString domain, QString pname, QString datatype)
 
QVariantMap getPropertyScriptOptions (QString domain, QString pname, QString datatype)
 
int setPropertyScriptOptions (QString domain, QString pname, QString datatype, QVariantMap opt)
 
GEOMETRY - MATERIALS
QString createMaterial (QString matXml, QString modelId=QString())
 
int deleteMaterial (QString matId)
 
QStringList getMaterialList ()
 
QString getMaterialAsXmlByID (QString matId)
 
QVariantMap getMaterial (const QString &matId)
 
QString getMaterialIDByName (QString matName)
 
void updateMaterial (QString matId, QString xmlMat)
 
int setMaterialToObjects (QString matId, QString objectIds)
 
int setTransparency (QString objectIds, float defaultTransparency=0.95)
 
void resetMaterials (bool updateUI=true)
 
void reorderElements ()
 
GEOMETRY - COLOR SCHEMA
QString createColorSchema (QString setContainerId, QString name)
 
QString createColorSchemaFromCurrentMaterials (QString name, bool updateExisting, QVariantMap options=QVariantMap())
 
int deleteColorSchema (QString namePattern)
 
QStringList getColorSchemaList ()
 
QString getCurrentColorSchema ()
 
bool activateColorSchemaByName (QString name)
 
GEOMETRY- WIREMODE
void showWireModeSchema (QString name)
 
void clearWireMode ()
 
void setObjectsToWireMode (QString ids, bool wired)
 
QString createWireModeSchema (QString ids, 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.001)
 
int updateOOBB (QString obIDList, double eps=0.001)
 
int calcOOBBxy (QString objIdList, double eps=0.001)
 
int updateOOBBxy (QString objIdList, double eps=0.001)
 
QVariantMap getBoundingBoxCommon (QString objIdList)
 
QVariantMap getOOBBCommon (QString objIdList)
 
QVariantMap getOOBBxyCommon (QString objIdList)
 
double checkOverlapOBB (QString id1, QString id2, double eps)
 
CREATE / DELETE OBJECTS / GET OBJECTS
int startProjectTransaction (const QString &domain="geometry")
 
int endProjectTransaction (const QString &domain="geometry")
 
QString createObjectFromXml (const QString &parentId, const QString &objectXML)
 
int deleteObjects (QString IDList)
 
void setName (QString objIdList, QString name)
 
QString createObject (QString parentId, QString name)
 
QVariantMap getAsJSON (QString objId)
 
int setAsComposite (const QString &id, bool composite)
 
REGIONS OF ALIGNMENTS
QString addRegionToAlignment (QString alignmentId, QVariantMap setting)
 
int removeAllRegionsFromAlignment (QString alignmentId)
 
int addRangeToRegion (QString regionId, double fromStation, double toStation, QString alignmentId=QString())
 
int removeRangeFromRegion (QString regionId, double fromStation, double toStation, QString alignmentId=QString())
 
int removeAllRangesFromRegion (QString regionId, QString alignmentId=QString())
 
FILE OPERATIONS
int createDirectory (QString path, QString dirName)
 
bool writeFile (QString filePath, const QString &content, const QString &encoding=QString())
 
bool appendToFile (QString filePath, const QString &content, const QString &encoding=QString())
 
bool removeFile (QString filePath)
 
bool copyFile (QString fnFrom, QString fnTo)
 
bool moveFile (QString fnFrom, QString fnTo)
 
bool checkIfFileExists (QString filePath)
 
bool openFile (QString filePath, const QString &encoding=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="\"")
 
int csvOpen (QString filename, QString delimiter=";", QString quoteSign="\"")
 
QStringList csvNextLine ()
 
bool csvHasNextLine ()
 
bool csvClose ()
 
QString readImageFile (QString filename, QString targetFormat="")
 
QVariantList getDirectoryEntryList (QString dirPath, bool filesOnly=false, QString orderBy="Name")
 
Database
bool dbIsLocalCopy ()
 
QString dbGetFilepath () const
 
int dbOpen (const QVariant connectionData=QVariant())
 
bool dbClose ()
 
void dbCheckIn ()
 
void dbCheckOut (const QStringList &propList)
 
bool dbQueryExec (const QString &sqlQuery)
 
QVariantMap dbQueryRecordset (const QString &sqlQuery, const QString &key, int maxNumberOfRows=0)
 
bool dbEndQueryExec ()
 
bool dbQueryNext ()
 
QVariant dbQueryValue (int column)
 
QString dbQueryLastError ()
 
int setPropertyValueDB (const QString &objIdList, const QString &propName, const QString &propDataType, const QString &propDomain, const QVariant &value, bool createType=true)
 
int writePropertyValueDB (const QString &objIdList, const QString &propName, const QString &propDataType, const QString &propDomain, const QVariant &value, bool createType=true)
 
bool startTransaction ()
 
bool endTransaction ()
 
bool dbGetImmediateUpdate ()
 
void dbSetImmediateUpdate (bool)
 
int dbClearCache (const QString &propName, const QString &propType)
 
void dbClearCacheAll ()
 
int dbDeleteProperty (const QString &objIdList, const QString &propName, const QString &propType)
 
int dbAssertTable (const QString &tableName, const 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="geometry")
 
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::Nbsp)
 
QString formatDateTime (QDateTime dt, QString formatstr="iso")
 
QString createID ()
 
long calcHashcode (QString str)
 
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 calcModelCoordsByGpsCoords (double lat, double lon)
 
QVariantMap calcGkCoordsByGpsCoords (double lat, double lon)
 
QVariantMap calcGpsCoordsByGkCoords (double rw, double hw)
 
QString idListToStr (QStringList idList)
 
QStringList strToIdList (QString strIDList)
 
QVariantMap getFileInfo (QString filePath)
 
QString getAbsolutePath (QString filePath)
 
QString getBaseName (QString filePath)
 
QString getFileName (QString filePath)
 
QString getApplicationDirectory ()
 
QString getApplicationFilename ()
 
QString getApplicationLanguage ()
 
QString getVersionAsString ()
 
int getVersionMAJOR ()
 
int getVersionMINOR ()
 
int getVersionBUILD ()
 
QVariantMap getVersion ()
 
bool requireVersion (int major, int minor, int patch)
 
QString getUserName ()
 
QString getProjectID ()
 
int getProjectVariantNumber ()
 
int getProjectVersionNumber ()
 
QString getProjectNumber ()
 
QString getProjectName ()
 
QString getProjectShortDescription ()
 
QString getProjectLongDescription ()
 
QString getProjectDirectory ()
 
QString getLocation ()
 
QVariantMap getProjectLocation () const
 
QVariantMap getCloudSettings ()
 
QVariantMap getProjectInfo ()
 
QString getDomainByElement (QString objId)
 
QVariant getPropertyValue (QString objId, QString propName, QString propType, bool inh=true)
 
QList< QVariant > getPropertyValuesByObject (QString objId, QString filterpattern="*")
 
QVariant getPropertySource (QString objId, QString propName, QString propType, bool inh=true)
 
QString getPropertyUnit (QString objId, QString propName, QString propType, bool inh=true)
 
QString getPropertyUnit (QString propName, QString propType)
 
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)
 
QVariantList getPropertyDateList (QString objectId, QString propertyBaseName, QString propertyType)
 
QVariantMap getPropertyTypesByObject (QString objId, QString filterPattern="*")
 
QVariantMap getPropertyTypesByDomain (QString domainName, QString filterPattern="*")
 
QVariantMap getPropertyTypeMetaData (QString propName, QString propType)
 
QList< QVariant > getPropertyTypeList (QString domain="all", QString filterPattern="*")
 
QList< QVariant > getPropertyTypeListByObject (QString objId, 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 extractPropertyNames (const QString &code, const QString &startTag="[[", const QString &endTag="]]")
 
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)
 
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)
 
QStringList getRegionsOfAlignment (QString alignmentId)
 
QVariantList getRangesOfRegion (QString alignmentID, QString regionID)
 
double getValueOfAlignmentRegion (QString alignmentID, QString regionID)
 
int getTaskMode (QString taskId)
 
QString getTaskVisualisation (QString taskId)
 

Detailed Description

DESITE API for scripting in automation.

Since
1.5.0, 17 nov 2014, ah
Id
AutomationAPI.h 2983 2019-10-17 13:37:25Z ansgar.horstmann

(c) ceapoint aec technologies GmbH

Member Function Documentation

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

Activate color scheme with given name (case sensitive). If name is empty, materials will be restored. 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
int domainBim::AutomationAPI::activatePropertyTypeBookmark ( QString  bkmId)
slot
Returns
-1 : Could not activate bookmark
0 : undefined
1 : OK
Since
2.2.4, 27 oct 2018, jh
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
QVariantMap domainBim::AutomationAPI::addPropertyScript ( QString  domain,
QString  pname,
QString  datatype,
QString  code = QString() 
)
slot
Since
2.5.0, 10 mar 2019, jh
QString domainBim::AutomationAPI::addPropertyTypeBookmark ( QVariantMap  vmBkm)
slot

Add property type bookmark.

Parameters
vmBkmBookmark as JSON object. Format see method getPropertyTypeBookmarkByID()
Returns
ID of new bookmark. If the given ID (in the passed object) is already used, a new ID is created.
Since
2.2.4, 27 oct 2018, jh
int domainBim::AutomationAPI::addRangeToRegion ( QString  regionId,
double  fromStation,
double  toStation,
QString  alignmentId = QString() 
)
slot

Add an ADDITIONAL range to a region (a region can have several - possibly disjunct - ranges with the same value).

Parameters
regionIdID of region (will be returned if region is successfully added to an alignment)
fromStationLower bound of range
toStationUpper bound of range
alignmentIdID of alignment. Optional parameter, if given, method is faster, because not all objects have to be searched
Returns
1 success
-1 alignment ID not found
-2 region ID not found
-3 invalid range parameters
Since
2.2.1, 20 apr 2018, sl
QString domainBim::AutomationAPI::addRegionToAlignment ( QString  alignmentId,
QVariantMap  setting 
)
slot

Add a region with a first given range and value to an alignment (simplified, linear representation of a road or track).
A region is represented by a strip along an alignment with a name, value and color and is used to visualize different properties/data, indicated by a color and a value, along the alignment. Further ranges (which will get the same name, color and value) can be added to this region afterwards. At the beginning of each range, the name and the value set will be drawn (like stations).

Parameters
alignmentIdID of alignment
optionsOptions, given as json object (see below).
See also
addRangeToRegion()

Example

var options =
{
name: 'Test',
range: [100.0,126.5],
value: 123.456,
offset: 2.0,
offsetZ: 0.0,
width: 1.0,
color: '#ff00cc'
}
Returns
ID of region created
-1 alignment ID not found
-3 invalid settings
-4 region range outside range of alignment
Since
2.2.1, 26 apr 2018, sl
int domainBim::AutomationAPI::addToSelectionSetGeometry ( QString  setId,
QString  objectIDList 
)
slot

Add objects to selection set in domain 'geometry'

Returns
1 Ok
-1 Selection Set not found in domain 'geometry' -2 Object not found in domain 'geometry'
Since
2.2.2, 28 aug 2018, jh
bool domainBim::AutomationAPI::appendToFile ( QString  filePath,
const QString &  content,
const QString &  encoding = QString() 
)
slot

Append a string to a file. User must not take care of opening and closing the file.

Parameters
filePathName and path of the file to be written. If no path is given, the current project's path will be used.
contentString to be appended to the end of the file
encodingFile encoding, such as "ISO 8859-1", "UTF-8", or "UTF-16" (optional)
Returns
true if file was written successfully, else false
Since
2.0.16, 27 oct 2017, ar
Remarks
2.4.2, 01 mar 2019, ah : changed behavior when no path is given (using project directory instead of application directory)
double domainBim::AutomationAPI::calcDistance ( QString  objId1,
QString  objId2 
)
slot

Calculate distance between two surface objects.

Parameters
objId1ID of first object
objId2ID of second object
Returns
Distance, if no error occurred. If objects intersect, distance is zero.
-1 Could not find objects/wrong type.
Since
2.2.2, 31 aug 2018, sl
int domainBim::AutomationAPI::calcOOBB ( QString  objIdList,
double  eps = 0.001 
)
slot

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

Parameters
objIdListIDs of objects to be affected (separated by ';')
epsThreshold for optimization (default: 0.001)
Returns
Number of affected objects
Since
1.5.0, 13 jan 2015, ah
Remarks
2.1.5, 19 jan 2019, sl: extended to handle composites
int domainBim::AutomationAPI::calcOOBBxy ( QString  objIdList,
double  eps = 0.001 
)
slot

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

Parameters
objIdListIDs of objects to be affected (separated by ';')
epsThreshold for optimization (default: 0.001)
Returns
Number of affected objects
Since
1.5.0, 13 jan 2015, ah
Remarks
2.1.5, 19 jan 2019, sl: extended to handle composites
QVariantMap domainBim::AutomationAPI::calcPropertyValuesOverTime ( QString  propName,
QString  propType,
QVariantMap  options 
)
slot

Calculate property values over time. Returns an object with a list of property values for each day between startDay and endDay.

Options:

var options = {
'StartDay': '2018-09-10',
'EndDay': '2018-09-20',
'VisibleTasks': false, // consider only visible tasks
'CheckInherited': false, // check inherited values
'BaseIndex': 0 // 0 = Work, 1 = Actual Work, 2 = Baseline Work
};
var pv = desiteAPI.calcPropertyValuesOverTime( 'cpCost', 'xs:double', opt );

Return:

{
"2018-09-10": 3.5,
"2018-09-11": 3,
"2018-09-12": 0,
"2018-09-13": 0,
"2018-09-14": 3,
"2018-09-15": 0,
"2018-09-16": 3,
"2018-09-17": 3,
"2018-09-18": 36,
"2018-09-19": 3,
"2018-09-20": 0
}
Since
2.2.3, 14 sep 2018, jh
bool domainBim::AutomationAPI::checkIfFileExists ( QString  filePath)
slot

Checks if a file exists

Parameters
filePathName and path of the file. If no path is given, the current project's path will be used.
Returns
true if file exists, else false
Remarks
2.4.2, 01 mar 2019, ah : changed behavior when no path is given (using project directory instead of application directory)
Since
1.9.0, 05 jul 2016, mm
int domainBim::AutomationAPI::checkIntersection ( QString  objId1,
QString  objId2,
double  tolerance = -0.00001 
)
slot

Check if two geometric objects intersects.

Parameters
objId1: ID of object #1
objId2: ID of object #2
tolerance: Numerical tolerance (default -0.00001). If tolerance is set to a small negative value, objects may overlap without intersection detected. A value > 0 means approach.
Returns
1 Objects do intersect
0 Objects do not intersect
-1 No Object with given ID objId1 or objId2 or of wrong type
Since
1.9.0, 13 apr 2016, sl
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
bool domainBim::AutomationAPI::copyFile ( QString  fnFrom,
QString  fnTo 
)
slot

Copy file 'fnFrom' to file 'fnTo'.

Since
2.0.18, 31 jan 2018, 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 schema with given name from the hierarchy (content) given by a container.

Parameters
setContainerIdID 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. Resulting directory path is path + '/' + dirName.

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 visualization. If the material already exists the existing material is not changed.

Parameters
matXmlMaterial encoded as XML. If a tag is missing, default values are set.
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
Remarks
Deprecated since 1.9.0, 14 Apr 2016
Deprecated:
Use createObjectFromXml() instead.
Reason: Very limited usefulness.
QString domainBim::AutomationAPI::createObjectFromXml ( const QString &  parentId,
const QString &  objectXML 
)
slot

Create a new object encoded by XML.
If ID is not given, or the given ID is already used in the 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 : parent (identified by parentId) is not a container or does not have the required type
-3 : could not find model of parentId
-4 : could not create new object
-5 : parsing Error
-10 : unsupported object type (tag name)

DOMAIN GEOMETRY

Available objects

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

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" />
// create composite
<container ID="idabc" name="c1" composite="true" />
<objectProxy ID="IdOfProxy" name="proxy-1" objId="IdOfEmbeddedObject"/>
<objectPoint ID="IdOfPoint" name="point-1" matId="mat-xyz">
<p x="1.0" y="1.0" z="1.5" />
</objectPoint>

DOMAIN ACTIVITIES

Available objects

<task>

Note: If WBS is empty, it will be automatically created from parent task WBS and child index of the new 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

Available objects

<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

Available objects

<document>
<documentDir>
<container>

Examples

<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>
<document path="https://thinkproject.com" />
<documentDir path="C:/test/" />
<container ID="IdOfDocumentContainer" name="container-1" />

Note that a "document" object can be used either as a file link or as a URL.
A "documentDir" will scan contained directories recursively, so deeply nested directory structures may incur a performance penalty.

DOMAIN BoQ (Bill of Quantities)

Available objects

<item>

Examples

<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 (LV-Bereich)
2 - BOQ-Item (LV-Position)
3 - Markup Item (Zuschlagsposition)
4 - Remark (Hinweistext)
5 - Performance Description (Ausfuehrungsbeschreibung)
6 - Sub-Description (Unterbeschreibung)
7 - Invalid, reserved for internal use
8 - AddText (Zusatztext)
9 - Take-Off Sheet (Aufmassblatt)
10 - Take-Off Row (Aufmasszeile)

qty is the quantity as floating point number (double). unit is the unit of measurements as text. up is the unit price as a floating point number (double).

Example JavaScript:

var id = desiteAPI.createID();
var xml = '<item wbs="1.1" ID="' + id + '" name="Stahlbeton Decken" type="2"> \
<attr> \
<qty>10.123</qty> \
<unit>m2</unit> \
<up>0</up> \
</attr> \
</item>';
var parentId = '32b098cf-6942-4abf-a9fc-81fe229db767';
var ret = desiteAPI.createObjectFromXml( parentId, xml );
ret;

DOMAIN RESOURCES

Available objects

<resourceItem>
<resourceInstance>

Examples

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

Available objects

<typeItem>

Examples

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

ID, prefix and comment are optional.

DOMAIN PROCESS COMPONENTS

Available objects

<pcItem name="newProcessComponent" ID="xyz344" comment="created by script" prefix="RB" />
<pcContainer name="newContainer" ID="xyz344" comment="created by script" prefix="RB" />
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.1.0, 24 apr 2017, ah
domain ProcessComponents added, 2.2.1, 25 may 2018, jh
int domainBim::AutomationAPI::createPropertyType ( const QString &  propName,
const QString &  propDatatype,
const QString &  uomCode,
bool  isInh,
int  target,
const 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
Since
2.0
QString domainBim::AutomationAPI::createSelectionSet ( QString  name,
QString  parentID = QString() 
)
slot
Parameters
nameName of new Selection Set
parentIDParent of new Selection Set. If empty the set is created on top level.
Since
2.5.1, 30 apr 2019, jh
QString domainBim::AutomationAPI::createSelectionSets ( QString  propertyTypes,
QString  rootName,
QVariantMap  config = QVariantMap() 
)
slot

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

Parameters
propertyTypesA concatenation of Property Type Keys, each containing a name and datatype.
Example:
'cpName##xs:string; cpVolume##xs:double'
Prior to version 2.2.1, it was only possible to give a single property name, and the type was always String. Example: 'cpName'.
This is still possible, but deprecated.
rootNameName of the Selection Set Container to be created. If the name is already used, a suffix will be added.
configObject containing Options. Default Values:
{
maxItems: 0,
considerCompositeParts: true,
considerOpenings: true,
considerParts: true,
intervalSize: 0.5
}

Usage examples:

desiteAPI.createSelectionSets('cpName', 'selSet1'); // deprecated!
desiteAPI.createSelectionSets('cpName##xs:string', 'selSet2'); // better! (since 2.2.1)
desiteAPI.createSelectionSets('cpName##xs:string; cpVolume##xs:double', 'selSet3', { intervalSize: 1.0 });
Returns
ID of new selection sets.
Empty string if selection set could not be created.
Since
1.4.0
Remarks
2.2.1, 2018-08-07, ah : extended first parameter to support list of Property Type Keys
QString domainBim::AutomationAPI::createWireModeSchema ( QString  ids,
QString  wmName,
bool  overwrite = false 
)
slot

Create a wire mode schema for objects.

Parameters
idsString of semicolon-separated object IDs
wmNameName of new wire-frame 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
bool domainBim::AutomationAPI::csvClose ( )
slot

Closes csv file opend using csvOpen().

Returns
false if no csv file open
Since
2.2.4, 30 oct 2018, ar
bool domainBim::AutomationAPI::csvHasNextLine ( )
slot

Checks if csv file has more data.

Returns
true if file stream pointer is not at end
Since
2.2.4, 30 oct 2018, ar
QStringList domainBim::AutomationAPI::csvNextLine ( )
slot

Reads next line of csv.

Returns
data line as array of strings
Since
2.2.4, 30 oct 2018, ar
int domainBim::AutomationAPI::csvOpen ( QString  filename,
QString  delimiter = ";",
QString  quoteSign = "\"" 
)
slot

Open text file in CSV format for reading.

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 line breaks within quotes are ignored.
Returns
1 - if successful
-1 - if delimiter missing
-2 - if quoteSign missing
-3 - if file couldn't be opened
-4 - if file stream couldn't be established for reading
Since
2.2.4, 2018-10-30, ar
Remarks
2.4.5, 2019-08-13, ah : changed behavior when no path is given (using project directory instead of application directory)
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 ( const QString &  tableName,
const 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
Since
2.0
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 ( const 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 ( const QString &  propName,
const 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
bool domainBim::AutomationAPI::dbClose ( )
slot

Close the currently connected DB. Returns false if no DB was connected.

Since
2.4.1, 2019-01-28, ah
int domainBim::AutomationAPI::dbDeleteProperty ( const QString &  objIdList,
const QString &  propName,
const 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::dbEndQueryExec ( )
slot

Free all resources bound to the last dbQueryExec.

Returns
true if there was an open dbConnection and has been closed successfully
Since
2.1.6, 02 mar 2018, ar
QString domainBim::AutomationAPI::dbGetFilepath ( ) const
slot

If the connected DB is file-based, returns the filename and path. Otherwise, an empty string is returned.

Since
2.4.1, 2019-01-17, ah
bool domainBim::AutomationAPI::dbGetImmediateUpdate ( )
slot
See also
dbSetImmediateUpdate()
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
int domainBim::AutomationAPI::dbOpen ( const QVariant  connectionData = QVariant())
slot

Open and connect a project database. Will do nothing if a database connection is already open.
Pass connection data as object.

Example:

{
"FileName": "C:/db/test.db"
}

You can pass an empty object or no connection data at all. In that case, a DB will be opened with default parameters (in the current project's directory). Project must have been saved first.

Returns
1 - Success
2 - DB already open and connected
-1 - Connection Error -2 - Input Error (e.g. FileName missing and no project open)
Since
2.4.1, 2019-01-28, ah
bool domainBim::AutomationAPI::dbQueryExec ( const QString &  sqlQuery)
slot

Create a database query by a 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
QString domainBim::AutomationAPI::dbQueryLastError ( )
slot

Get the error message that the last executed SQL query returned (if any).

Since
2.3.1, 12 dec 2018, ah
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
QVariantMap domainBim::AutomationAPI::dbQueryRecordset ( const QString &  sqlQuery,
const QString &  key,
int  maxNumberOfRows = 0 
)
slot

Create a database query by SQL statement.

Parameters
sqlQuerythe SQL query string.
keythe field name used as key in record set returned. For more than one key value only the last one will be returned.
maxNumberOfRowsmax number of rows in result set returned, left open or 0 for unlimited.

Example call: desiteAPI.dbQueryRecordset("SELECT matchKey, price FROM tblPrices", "matchKey", 0);

Returns
object holding a 'recordset' as a 2-dimensional array.

Example:

{
"recordSet": {
"96.62.003.0160": [424.7039],
"96.62.003.0170": [424.70398],
"96.62.004.0000": [0]
},
"fieldNames": [price],
"key": "matchKey",
"rowsFetched": 3,
"rowsRequested": 0
}
Since
2.1.6, 18 mar 2018, ar
QVariant domainBim::AutomationAPI::dbQueryValue ( int  column)
slot
Since
1.0.18, 14 aug 2012, jh
void domainBim::AutomationAPI::dbSetImmediateUpdate ( bool  )
slot
See also
dbGetImmediateUpdate()
Since
1.3.0, 14 nov 2013, jh
int domainBim::AutomationAPI::deleteColorSchema ( QString  namePattern)
slot

Remove and delete color scheme by name (pattern).

Parameters
namePatternName of the color scheme that should be deleted. Could be a pattern such as 'csXYZ*', which means that all CS which name starts with 'csXYZ' are removed and deleted.
Returns
Number of deleted color schemes.
Since
2.2.1, 04 jul 2018, 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 ( const QString &  id)
slot

Delete Model.

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

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, ...)

Parameters
objIdListList of object/container IDs separated 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 the element identified by 'objId'.

Parameters
objIdID of element. Use 'GlobalProject' to remove and delete a global project property.
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 deleting a db or core property
Since
1.5.0, 14 mar 2015, jh
int domainBim::AutomationAPI::deletePropertyType ( QString  propName,
QString  propDatatype,
QString  domainName = "all" 
)
slot

Remove property type from domain. All affected properties will be deleted.
Note that for DB property types, this will only work if the type is defined for a single domain only. (To delete DB property types across all domains, use the database widget.)

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
int domainBim::AutomationAPI::endProjectTransaction ( const QString &  domain = "geometry")
slot

Finish transaction on project of given domain.

See also
startProjectTransaction()
Returns
number of currently open project transactions
Since
2.2.1, 02 aug 2018, sl
bool domainBim::AutomationAPI::endTransaction ( )
slot

Finish database transaction.

Since
1.0.18, 20 aug 2012, jh
QString domainBim::AutomationAPI::findContainerByName ( const QString &  parentId,
const QString &  name,
const QString &  lookupDomain = "all" 
)
slot

Get container with name 'name' and parent node 'parentId'. If the container does not exist, an empty string is returned.
Note that a name is not necessarily unique; this method will only return the first match.

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 creation date is between a given range or where the reference date is between a given range.

Parameters
startStart of date range
endEnd of date range
idList(optional) List of IDs of documents. If empty, all documents will be considered.
useRef(optional) Flag determining if documents are searched by their create or reference date
Since
2.0.0, 20 jun 2016, mm
QVariantList domainBim::AutomationAPI::findDocumentsByLocationGk ( double  rw,
double  hw,
double  distance,
QStringList  idList = QStringList() 
)
slot

Get documents which are located around a given point in Gauss-Krueger coordinates by a given distance.

Parameters
rw'Rechtswert' (x-coordinate) of search point
hw'Hochwert' (y-coordinate) of search point
distanceSearch range
idList(optional) List of IDs of documents. If empty, all documents will be considered.
Since
2.0.0, 20 jun 2016, mm
QVariantList domainBim::AutomationAPI::findDocumentsByLocationGps ( double  lat,
double  lon,
double  distance,
QStringList  idList = QStringList() 
)
slot

Get documents which are located around a given point in GPS coordinates by a given distance.

Parameters
latLatitude of search point
lonLongitude of search point
distanceSearch range
idList(optional) List of IDs of documents. If empty, all documents will be considered.
Since
2.0.0, 20 jun 2016, mm
QVariantList domainBim::AutomationAPI::findDocumentsByLocationRangeGps ( QStringList  gpsCoordinates,
double  distance,
QStringList  idList = QStringList() 
)
slot

Get documents which are located around a given point list in GPS coordinates by a given distance.

Parameters
gpsCoordinatesList of GPS coordinates ('lat::lon')
distanceSearch range
idList(optional) List of IDs of documents
Since
2.0.0, 20 jun 2016, mm
QVariantMap domainBim::AutomationAPI::getAsJSON ( QString  objId)
slot

Get object data.

Example:

var objidList = desiteAPI.getSelected();
var idList = objidList.split(';');
for ( n in idList ) {
var id = idList[n];
if( id.length < 1 ) continue;
var objJSON = desiteAPI.getAsJSON(id);
console.log( JSON.stringify(objJSON) );
}

A 3D-objects contains vertices and triangles.
Example Result:

{
"ElementType": "surface",
"ID": "1f3seZUqbEQOb70h0P_jcX:1",
"Name": "Basiswand:MW 24.0 WD 12.0:375287 - Teil 1",
"triangleList": [ 9, 10, 15,
11, 15, 10, 9, 15, 14,
1, 5, 0, 0, 4, 1,
2, 0, 5, 6, 1, 4,
0, 3, 4, 5, 8, 2,
7, 2, 8, 8, 10, 7,
9, 7, 10, 11, 10, 8,
6, 13, 1, 1, 13, 5,
8, 5, 13, 8, 13, 15,
8, 15, 11, 7, 9, 14,
7, 14, 2, 0, 2, 14,
0, 14, 12, 0, 12, 3,
15, 13, 12, 14, 15, 12,
3, 12, 13, 3, 13, 4,
4, 13, 6
],
"vertexList": [ -13.770044052255699, 4.899163275305381, 0.7535853976531943,
-13.770044052255699, 4.53916327530538, 0.7487046632124355,
-13.770044052255699, 4.899163275305381, 1.4928292046936114,
-13.770044052255699, 4.899163275305381, 0,
-13.770044052255699, 4.723631360411764, 0,
-13.770044052255699, 4.53916327530538, 1.4674611398963644,
-13.770044052255699, 4.53916327530538, 0,
-13.770044052255699, 4.899163275305381, 2.2539504563233375,
-13.770044052255699, 4.53916327530538, 2.2213471502590583,
-13.770044052255699, 4.899163275305381, 3,
-13.770044052255699, 4.723631360411764, 3,
-13.770044052255699, 4.53916327530538, 3,
-7.9900440522556995, 4.899163275305381, 0,
-7.9900440522556995, 4.53916327530538, 0,
-7.9900440522556995, 4.899163275305381, 3,
-7.9900440522556995, 4.53916327530538, 3
]
}
Since
2.1.0, 30 may 2017, jh
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
Remarks
Deprecated since 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 the project.

Since
1.4
double domainBim::AutomationAPI::getBBoxMaxY ( )
slot

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

Since
1.4
double domainBim::AutomationAPI::getBBoxMaxZ ( )
slot

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

Since
1.4
double domainBim::AutomationAPI::getBBoxMinX ( )
slot

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

Since
1.4
double domainBim::AutomationAPI::getBBoxMinY ( )
slot

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

Since
1.4
double domainBim::AutomationAPI::getBBoxMinZ ( )
slot

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

Since
1.4
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
Deprecated:
This method will be removed in future versions of DESITE MD and should not be used for new scripts anymore.

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

Parameters
parentId: Parent node ID
name: Name of the container
Returns
container ID
Since
1.0.18, 19 aug 2012, jh
Remarks
Deprecated since 2.4.1, 28 Jan 2019
Deprecated:
Use findContainerByName() instead.
Reason: Does not work with any domain but geometry. Automatic creation of containers is unexpected behavior.
QString domainBim::AutomationAPI::getCurrentColorSchema ( )
slot

Get current (applied) color scheme.

Returns
Name of current color scheme, empty string if no color scheme is active
Since
1.0.16
QVariantList domainBim::AutomationAPI::getDirectoryEntryList ( QString  dirPath,
bool  filesOnly = false,
QString  orderBy = "Name" 
)
slot

Return a list of all files and (optionally) subdirectories in the given directory.
The list will NOT include system and hidden files.
A Windows environment variable can be used, but only once in the string (e.g. 'userprofile%/pictures')
Objects in the returned list will contain the following keys:
Name
AbsoluteFilePath
AbsolutePath
SizeInBytes
CreationDateTime
LastModifiedDateTime
IsReadable
IsWritable
IsDirectory

Parameters
dirPathFull path to the directory to scan
filesOnly(default false) if this is set to true, subdirectories will not be included in the list
orderBySort the result list either by "Name" (alphabetically, default), "Size" (largest first), or "Time" (most recently modified first)
Returns
Object list with each object representing a file or a subdirectory found in the given directory.
If the source directory was not found or an error occurred, the list will be empty.
Since
2.0.16, 17 oct 2017, ah
QString domainBim::AutomationAPI::getDomainByElement ( QString  id)
slot

Get domain of the element with the given 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
QStringList domainBim::AutomationAPI::getListOfTempValues ( )
slot

Get list of temporary values.

Since
2.4.1, 11 feb 2019, jh
QString domainBim::AutomationAPI::getLocked ( )
slot

Get all locked objects.

Returns
List of IDs of locked objects (separated by ';')
Since
1.3.6, 25 apr 2014, jh
QVariantMap domainBim::AutomationAPI::getMaterial ( const QString &  matId)
slot

Get material as object.

Parameters
matIdID of Material

Example return:

{
"ID": "{16e8fe62-6af7-4b9c-8598-479d310bea1e}-49",
"Name": "m:0091c926",
"ambi": [0,0.5686274766921997,0.7882353663444519,0.15294110774993896],
"diff": [0,0.5686274766921997,0.7882353663444519,0.15294110774993896],
"shin": 0.5,
"spec": [1,1,1,0.15294110774993896],
"tran": 0.847058892250061
}
Since
2.3.1, 19 dec 2018, ah
QString domainBim::AutomationAPI::getMaterialAsXmlByID ( QString  matId)
slot

Get material encoded by XML.

Parameters
matIdID of Material
Returns
Material as XML string
Since
1.4
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  id,
QString  domainFilter = "all" 
)
slot

Lookup the parent model of the element with the given ID. If the model could not be found, this method returns an empty string.

Parameters
idElement ID 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
Deprecated:
This method will be removed in future versions of DESITE MD and should not be used for new scripts anymore.

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

Since
1.0.17, 16 jun 2012, jh
Remarks
Deprecated since 1.9.0, 14 apr 2016
Deprecated:
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
QVariantMap domainBim::AutomationAPI::getOOBBCommon ( QString  objIdList)
slot

Calculate the common OOBB of all objects in objIdList. The OOBB is not explicitly set to affected objects and cannot be re-used (see properties cpOOBB... and so on). If an object ID represents a composite or geometric container, all parts of it will be taken into account.

Parameters
objIdListIDs of objects to be affected (separated by ';')
Returns
JSON object with 4 arrays specifying the origin and the 3 axis which define the OOBB, e.g.
{
origin: [0.0,0.0,0.0],
axis1: [1.0,0.0,0.0],
axis2: [0.0,1.0,0.0],
axis3: [0.0,0.0,1.0]
}
Since
2.1.0, 09 may 2017, sl
QVariantMap domainBim::AutomationAPI::getOOBBxyCommon ( QString  objIdList)
slot

Calculate the common OOBBxy of all objects in objIdList. The OOBBxy is not explicitly set to affected objects and cannot be re-used (see properties cpOOBBxy... and so on). If an object ID represents a composite or geometric container, all parts of it will be taken into account.

Parameters
objIdListIDs of objects to be affected (separated by ';')
Returns
JSON object with 4 arrays specifying the origin and the 2 axis and a height which define the OOBBxy, e.g.
{
origin: [0.0,0.0],
axis1: [1.0,0.0],
axis2: [0.0,1.0],
height: 1.2
}
Since
2.1.0, 09 may 2017, sl
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 - resolution in DPI, default is 72

Since
2.0.9, 03 feb 2017, jh
QVariantMap domainBim::AutomationAPI::getPropertyListAsJSON ( QVariantMap  opt)
slot

Get list of properties as JSON format.
This is the same format as the export/import of properties used by the GUI.

Parameters
optOptions to configure the export.

Example:

var opt = {
"ExportVisibleObjects": true, // default = false
"ActivePropertiesBookmark": "EXP_STATUS", // if bookmark does not exist no properties will be returned,
// if no bookmark is given all properties are returned
"ExportInheritedProperties": true, // default = true
"EvaluateProperties": true // default = true
"PropertyTypeList": [ "cpCount##xs:long", "WebTest##xs:string" ] // export contained property types, this member overrides "ActivePropertiesBookmark"
};
var g = desiteAPI.getPropertyListAsJSON(opt);
console.log( JSON.stringify(g) );
Since
2.2.1, 20 jun 2018, jh
QString domainBim::AutomationAPI::getPropertyScriptBgColor ( QString  domain,
QString  pname,
QString  datatype 
) const
slot

Get code (background) of property script.

Since
2.5.0, 06 mar 2019, jh
QString domainBim::AutomationAPI::getPropertyScriptCode ( QString  domain,
QString  pname,
QString  datatype 
) const
slot

Get code (value) of property script.

Since
2.5.0, 06 mar 2019, jh
QString domainBim::AutomationAPI::getPropertyScriptFgColor ( QString  domain,
QString  pname,
QString  datatype 
) const
slot

Get code (foreground) of property script.

Since
2.5.0, 06 mar 2019, jh
QVariantMap domainBim::AutomationAPI::getPropertyScriptList ( ) const
slot

Get list of property scripts as JSON object.

Example:

{
"activities": [
{
"DataType": "xs:double",
"DisplayName": "PROP_B",
"Name": "PROP_B",
"Unit": ""
}
],
"boq": [],
"building": [],
"cd": [],
"documents": [],
"geometry": [
{
"DataType": "xs:string",
"DisplayName": "PROP_A",
"Name": "PROP_A",
"Unit": ""
}
],
"pc": [],
"qa": [],
"res": [],
"type": []
}
Since
2.5.0, 06 mar 2019, jh
QVariantMap domainBim::AutomationAPI::getPropertyScriptOptions ( QString  domain,
QString  pname,
QString  datatype 
)
slot
options {
"IsCached": true,
"IsInherited": true,
"Unit": "m2",
"DisplayName": "abc"
}
Since
2.5.0, 10 mar 2019, jh
QVariantMap domainBim::AutomationAPI::getPropertyTypeBookmarkByID ( const QString &  bookmarkId)
slot

Get a property type bookmark as an object.

{
"ID": "a0373145-30f9-4f81-84cb-65d1186dc7a0",
"Name": "AREA",
"Type": 2,
"PropertyTypes": {
"activities": [],
"boq": [],
"building": [],
"cd": [],
"documents": [],
"geometry": [{
"name": "cpLateralArea",
"type": "xs:double"
},
{
"name": "cpTopArea",
"type": "xs:double"
}],
"pc": [],
"qa": [],
"res": [],
"type": []
}
}
Parameters
bookmarkIdID of the bookmark to look up. If the ID isn't found, an empty object is returned.
Since
2.2.4, 27 oct 2018, jh
QList<QVariant> domainBim::AutomationAPI::getPropertyTypeBookmarkList ( )
slot

Return list of property types bookmarks.

Example:

[
{
"ID": "57d490e2-8900-42cd-b04d-4cbf84f1da8f",
"Name": "EXPORT_BBOX",
"Type": 2
},
{
"ID": "8ddf3747-a6d7-428e-afa9-5cc3ecb20ad5",
"Name": "BKM2",
"Type": 2
},
{
"ID": "a0373145-30f9-4f81-84cb-65d1186dc7a0",
"Name": "AREA",
"Type": 2
}
]
Since
2.2.4, 27 oct 2018, jh
QList<QVariant> domainBim::AutomationAPI::getPropertyValues ( QString  propName,
QString  propDatatype,
int  maxValues = 0,
QString  domainName = "all",
bool  getNullValues = false 
)
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 occurred 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",
bool  getNullValues = false 
)
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)
getNullValuesSet true if result list shall contain NULL values for objects not having this property.
Returns
Array with all property values
Empty array if an error occurred 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
Deprecated:
This method will be removed in future versions of DESITE MD and should not be used for new scripts anymore.

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
Remarks
Deprecated since 1.9.0, 14 Apr 2016
Deprecated:
Use createModel() and getRootContainerList() instead.
Reason: Names are not unique identifiers.
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 tree view. The model itself is not visible in the 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 separated by ';'.
Since
1.5.0, 28 oct 2015, jh
See also
getRootNodeByModel()
QStringList domainBim::AutomationAPI::getRootNodeListSelectionSets ( QString  domainFilter = "all")
slot

Get root nodes of selection sets. These root nodes are the toplevel selection sets in a domain project.

Remarks
Currently (2.2.2) domain 'geometry' is supported only.
Since
2.2.2, 28 aug 2018, jh
QVariant domainBim::AutomationAPI::getTempValue ( QString  name)
slot

Retrieve a temporarily stored property.

Since
2.4.1, 02 feb 2019, ar
QVariantMap domainBim::AutomationAPI::getVisualisationList ( )
slot

Get list of visualization 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 an object or container with the given ID exists.

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

Checks if the object with the given ID is a container.

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 data type [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 bounding box 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 bounding box 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 = "geometry" 
)
slot

Filter objects in iterator list by their status.

Parameters
statusStatus as string ['visible', 'selected', 'wired' or 'locked']
enabledValue of status [true, false]
domainDomain as string to check ['geometry', 'activities', 'documents, 'building', 'boq', 'qto', 'pc', 'cd', 'qa', 'type', 'res', 'all]', combinations are allowed (separated by ';')
Returns
amount of objects found, 0 if none or undefined, -1 if an error occurred
Since
1.9.0, 18 may 2016, ar
Remarks
2.4.3, 21 may 2019, sl: changed default domain to 'geometry'
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

Check if iterator is not at end.

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 bounding box 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 bounding box 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 (separated by ';')
Since
1.3.6, 25 apr 2014, jh
QString domainBim::AutomationAPI::mergeObjects ( QString  parentContainerId,
QString  idList,
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.
Source Objects must be deleted manually if merging was successful.

Parameters
parentContainerId: ID of container 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 container with given ID
-2 No objects with given IDs
Since
1.5.0, 05 aug 2015, sl
bool domainBim::AutomationAPI::moveFile ( QString  fnFrom,
QString  fnTo 
)
slot

Move file 'fnFrom' to file 'fnTo'.

Since
2.0.18, 31 jan 2018, jh
bool domainBim::AutomationAPI::openFile ( QString  filePath,
const QString &  encoding = QString() 
)
slot

Open a text stream to a new file for writing. By default, local 8 bit encoding is used.
To change it, set encoding as optional second parameter.

Parameters
filePathName and path of the file to be opened. If no path is given, the current project's path will be used.
encodingFile encoding, such as "ISO 8859-1", "UTF-8", or "UTF-16" (optional)
Returns
true if file was opened successfully, else false
Since
1.3.0, 30 oct 2013, jh
Remarks
1.5.0, 23 jul 2015, ah : added encoding parameter
2.4.2, 01 mar 2019, ah : changed behavior when no path is given (using project directory instead of application directory)
void domainBim::AutomationAPI::propertyScriptClearCache ( )
slot

Clear cache of all property scripts.

Since
2.5.0, 10 mar 2019, jh
void domainBim::AutomationAPI::propertyScriptClearCache ( QString  domain,
QString  pname,
QString  datatype 
)
slot
Since
2.5.0, 10 mar 2019, jh
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 line-breaks 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
Remarks
Since this function loads the whole file into memory at once better use line wise reading using csvOpen() and csvNextLine() for larger files. 2.2.4, 30 oct 2018, ar
QString domainBim::AutomationAPI::readImageFile ( QString  filename,
QString  targetFormat = "" 
)
slot

Read image file and return a Base64-encoded string.
The source image format will be determined automatically.

Parameters
filenameName of image file
targetFormatoptionally specify "png", "jpg", "bmp" or "gif" for target format if you want a conversion. If you want to keep the original source format (determined automatically), this parameter can be omitted (or set to "").
Returns
Base64-encoded image; empty string on error
Since
2.0.16, 18 oct 2017, ah
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  id)
slot

Remove all linked objects from the element with the given ID.

Parameters
idID of element
Returns
1 success
-1 element with given ID does not exist
Since
1.0.17, 16 jun 2012, jh
int domainBim::AutomationAPI::removeAllRangesFromRegion ( QString  regionId,
QString  alignmentId = QString() 
)
slot

Remove all ranges from region.

Parameters
regionIdID of region (will be returned if region is successfully added to an alignment)
alignmentIdID of alignment. Optional parameter, if given, method is faster, because not all objects have to be searched
Returns
number of ranges removed on success
-1 alignment ID not found
-2 region ID not found
Since
2.2.1, 20 apr 2018, sl
int domainBim::AutomationAPI::removeAllRegionsFromAlignment ( QString  alignmentId)
slot

Remove all regions from an alignment with given ID.

Returns
number of regions removed on success
-1 alignment ID not found
See also
addRegionToAlignment( QString alignmentID, QVariantMap setting )
Since
2.2.1, 12 apr 2018, sl
bool domainBim::AutomationAPI::removeFile ( QString  filePath)
slot

Remove a file

Parameters
filePathName and path of file to be removed. If no path is given, the current project's path will be used.
Returns
true if file was removed successfully, else false
Since
1.9.0, 24 jun 2016, mm
Remarks
2.4.2, 01 mar 2019, ah : changed behavior when no path is given (using project directory instead of application directory)
int domainBim::AutomationAPI::removeFromSelectionSetGeometry ( QString  setId,
QString  objectIDList 
)
slot

Remove objects from selection set in domain 'geometry'

Parameters
objectIDListList of objects which should be remove from selection set. IDs are separated by ';'
Returns
1 Ok
-1 Selection Set not found in domain 'geometry' -2 Object not found in domain 'geometry'
Since
2.2.2, 28 aug 2018, jh
int domainBim::AutomationAPI::removeLinkedObjects ( QString  id,
QString  linkedIdList 
)
slot

Remove links to a given list of objects from another object.

Returns
1 success
-1 element with given ID 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::removePropertyScript ( QString  domain,
QString  pname,
QString  datatype 
)
slot
Since
2.5.0, 10 mar 2019, jh
int domainBim::AutomationAPI::removePropertyTypeBookmarkByID ( QString  bkmId)
slot
Since
2.2.4, 27 oct 2018, jh
int domainBim::AutomationAPI::removeRangeFromRegion ( QString  regionId,
double  fromStation,
double  toStation,
QString  alignmentId = QString() 
)
slot

Remove a range from a region. Example: Remove [110.0,300.0] from [0.0,350.0] => [0.0,110.0] + [300.0,350.0]

Parameters
regionIdID of region (will be returned if region is successfully added to an alignment)
fromStationLower bound of range
toStationUpper bound of range
alignmentIdID of alignment. Optional parameter, if given, method is faster, because not all objects have to be searched
Returns
1 success
-1 alignment ID not found
-2 region ID not found
-3 invalid range parameters
Since
2.2.1, 20 apr 2018, sl
bool domainBim::AutomationAPI::removeSelectionSet ( QString  selsetID)
slot
Since
2.5.1, 30 apr 2019, jh
int domainBim::AutomationAPI::removeVisualisation ( QString  taskIDList)
slot

Remove visualisation configuration from tasks.

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::resetDocumentMetaData ( QString  objId)
slot

Forces the MetaDataThreadWorker to reread the meta data of document from URL. since 1.9.0, 18 jun 2016, jh

void domainBim::AutomationAPI::resetMaterials ( bool  updateUI = true)
slot

Reset all object materials to materials originally imported with the geometry model file.

Parameters
updateUIIf set to true (default), an active color scheme will be unapplied and the 3D view will be repainted
Since
1.0.20, 14 jan 2013, jh
int domainBim::AutomationAPI::setAllPropertyTypesActive ( )
slot

Set all property types active.

Since
2.2.4, 27 oct 2018, jh
int domainBim::AutomationAPI::setAsComposite ( const QString &  id,
bool  composite 
)
slot

Change container with given ID to composite and vice versa.

Parameters
idID of container/composite
compositetrue: set as composite, false: set as container
Returns
1 if successful
0 container is already of desired type -1 No container with the given ID was found in domain geometry
Since
2.4.1, 06 feb 2019, sl
int domainBim::AutomationAPI::setAsOpening ( QString  objId,
QString  openingIDList 
)
slot

Set list of objects as opening elements to a given object. Objects in lists which have openings will be skipped.

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/wrong type -2 Empty opening list
Since
2.0.3, 10 oct 2016, sl
void domainBim::AutomationAPI::setCloudSettings ( QVariantMap  vm)
slot

Set Cloud Data such as URL, User and Password. Password is not saved when the project is saved.

{
"Url": "https://cloud.ceapoint.com/CLOUD",
"User": "Donald Duck",
"Password": "abc123"
}
Since
2.2.3, 20 sep 2018, jh
int domainBim::AutomationAPI::setLinkedObjects ( const QString &  elementID,
const QString &  IDList 
)
slot

Create a link (relation) between objects.

Parameters
elementIDID of element to the linked.object links. The element can be of any domain (like geometry, activity etc).
IDListList of objects to be linked to. List must be a semicolon-separated string. Currently, only geometric elements are supported as link targets.
Returns
Number of objects linked.
-1 element 'eleID' does not exist
Since
1.0.17, 16 jun 2012, jh
Remarks
last modified 2.4.2, 21 feb 2019, ah
int domainBim::AutomationAPI::setMaterialToObjects ( QString  matId,
QString  objectIds 
)
slot

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

Parameters
matIdID of material
objectIdsString of semicolon-separated 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.
Returns
Number of affected objects
-1 Error: Material not found
Since
1.4
void domainBim::AutomationAPI::setName ( QString  objIdList,
QString  name 
)
slot
Deprecated:
This method will be removed in future versions of DESITE MD and should not be used for new scripts anymore.

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
Remarks
Deprecated since 1.9.0, 14 Apr 2016
Deprecated:
Use setPropertyValue() instead.
Reason: Redundant.
void domainBim::AutomationAPI::setObjectsToWireMode ( QString  ids,
bool  wired 
)
slot

Set objects to wire-frame mode based on condition.

Parameters
idsString of semicolon-separated object IDs
wiredtrue = set objects to wire mode
false = set objects to normal mode
Since
1.3.0, 13 nov 2013, jh
void domainBim::AutomationAPI::setPropertyListAsJSON ( QVariantMap  propmap,
QVariantMap  opt 
)
slot

Set list of property values to objects.

Parameters
propmapList of properties as JSON object.

Example: Property List

{
"domains": {
"geometry": [{
"ID": "Project Name::b1179c42-d5e9-4ae6-8e30-331aacaa30ec-00019c33",
"name": "-",
"3": "4"
},
{
"ID": "Project Name::fa530fc1-55d3-4bbb-9cfb-daae0b400fc8-00019ce3",
"name": "-",
"3": "2"
},
{
"ID": "Project Name::fa530fc1-55d3-4bbb-9cfb-daae0b400fc8-00019d0b",
"name": "-",
"3": "2"
},
{
"ID": "Project Name::fa530fc1-55d3-4bbb-9cfb-daae0b400fc8-00019d54",
"name": "-",
"3": "4"
}],
"documents": [],
"activities": [],
"type": [],
"boq": [],
"cd": [],
"pc": [],
"res": []
},
"proptypes": {
"3": {
"name": "cp:STATUS",
"type": "xs:long"
}
},
"meta": {
"created": "2018-08-03 14:24:04",
"createdBy": "web@ceapoint.com"
}
}
Parameters
optOptions for setting property values.
       Target:       <br>
       1: Database   <br>
       2: Repo       <br>
       3: Default   <br>

       HandleExisting: 
       0: overwrite  <br>
       1: ignore     <br>
       2: backupWithDate

Example: Options

var opt = {
"Prefix": "PRE:",
"Suffix": "@2018-03-04",
"Target": 2,
"HandleExisting": 0
};
Since
2.2
int domainBim::AutomationAPI::setPropertyScriptBgColor ( QString  domain,
QString  pname,
QString  datatype,
QString  code 
)
slot

Set code (background) of property script.

Returns
0 Property not found
1 ok
-1 Internal Error: Project not set
Since
2.5.0, 06 mar 2019, jh
int domainBim::AutomationAPI::setPropertyScriptCode ( QString  domain,
QString  pname,
QString  datatype,
QString  code 
)
slot

Set code (value) of property script.

Returns
0 Property not found
1 ok
-1 Internal Error: Project not set
Since
2.5.0, 06 mar 2019, jh
int domainBim::AutomationAPI::setPropertyScriptFgColor ( QString  domain,
QString  pname,
QString  datatype,
QString  code 
)
slot

Set code (foreground) of property script.

Returns
0 Property not found
1 ok
-1 Internal Error: Project not set
Since
2.5.0, 06 mar 2019, jh
int domainBim::AutomationAPI::setPropertyScriptOptions ( QString  domain,
QString  pname,
QString  datatype,
QVariantMap  opt 
)
slot
Returns
-1 : Error
0 : Property not fount, no changes
1 : Options set to property
options {
"IsCached": true,
"IsInherited": true,
"Unit": "m2",
"DisplayName": "abc"
}
Since
2.5.0, 10 mar 2019, jh
int domainBim::AutomationAPI::setPropertyTypeMetaData ( QString  pName,
QString  ptype,
QVariantMap  metadata 
)
slot

Set meta data of property type such as display name and unit.

Parameters
pNameName of property type
pTypeData type of property type
Returns
1 OK 0 undefined -1 could not find property type

Example:

{
"DisplayName": "ABC",
"Unit": "m3",
"Domain": "geometry"
}
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 the Project Repository, DB or model (the lookup sequence for this is the same as when setting a Property via the GUI).
If the Property Type does not exist, it is created in the Project Repository.

To set a global property use objId = GlobalProject.

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()
createPropertyType()
Since
1.0.17, 28 jun 2012, jh
Remarks
2.0.6, 18 nov 2016, ah: added data type check
int domainBim::AutomationAPI::setPropertyValueDB ( const QString &  objIdList,
const QString &  propName,
const QString &  propDataType,
const QString &  propDomain,
const 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
int setPropertyValue()
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::setTaskMode ( QString  taskID,
int  mode 
)
slot

Set Task Mode:

taskmodeManuallyScheduled = 1, taskmodeAutomaticallyScheduled = 2

To get task mode see class CoreAPI.

Returns
1 - Ok
-1 Could not find task 'taskID'
-2 Could not set task mode
Since
2.1.6, 15 mar 2018, jh
void domainBim::AutomationAPI::setTempValue ( QString  name,
QVariant  value 
)
slot

Stores the value for property name as long as the project is not closed or reloaded. Webform reload has no effect on it. No persistence. Information is lost when project is reloaded or DESITE ist closed, even when the project is saved before.

Since
2.4.1, 02 feb 2019, ar
int domainBim::AutomationAPI::setTransparency ( QString  objectIds,
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.

Parameters
objectIdsString of semicolon-separated IDs of objects to change material of.
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 schema which should be applied. 'Reset' resets wire mode (draw all objects solid).
Since
1.3.0, 30 oct 2013, jh
int domainBim::AutomationAPI::startProjectTransaction ( const QString &  domain = "geometry")
slot

Start transaction on project of given domain. Use this if you want to create many objects at once.

See also
endProjectTransaction()
Returns
number of currently open project transactions
Since
2.2.1, 02 aug 2018, sl
bool domainBim::AutomationAPI::startTransaction ( )
slot

Start database transaction.

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 with ID 'containerId' could not be found
-2 : element with ID '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

Transformation:

<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
-2 Not a geometric 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 (separated 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()
Since
1.4
int domainBim::AutomationAPI::updateOOBB ( QString  obIDList,
double  eps = 0.001 
)
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.001)
Returns
Number of affected objects
Since
1.5.0, 13 jan 2015, ah
Remarks
2.1.5, 19 jan 2019, sl: extended to handle composites
int domainBim::AutomationAPI::updateOOBBxy ( QString  objIdList,
double  eps = 0.001 
)
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.001)
Returns
Number of affected objects
Since
1.5.0, 13 jan 2015, ah
Remarks
2.1.5, 19 jan 2019, sl: extended to handle composites
bool domainBim::AutomationAPI::writeFile ( QString  filePath,
const QString &  content,
const QString &  encoding = QString() 
)
slot

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

Parameters
filePathName and path of the file to be written. If no path is given, the current project's path will be used.
contentString to be written to the file
encodingFile encoding, such as "ISO 8859-1", "UTF-8", or "UTF-16"
Returns
true if file was written successfully, else false
Since
1.3.0, 30 oct 2013, jh
Remarks
2.4.2, 01 mar 2019, ah : changed behavior when no path is given (using project directory instead of application directory)
int domainBim::AutomationAPI::writePropertyValueDB ( const QString &  objIdList,
const QString &  propName,
const QString &  propDataType,
const QString &  propDomain,
const QVariant &  value,
bool  createType = true 
)
slot

Write property value to database.

Other than setPropertyValueDB(), 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: Tue Oct 22 2019 05:58:50