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, QScriptValue callback=QScriptValue(), bool blockExecution=false)
 
void resetDocumentMetaData (QString objId)
 
ACTIVITIES - TOOLS
QVariantMap getVisualisationList ()
 
int setVisualisationByID (QString taskIDList, QString visID)
 
int removeVisualisation (QString taskIDList)
 
int setTaskMode (QString taskID, int mode)
 
int recalculateActivityProject (QString taskID=QString(), bool visibleOnly=false)
 
QVariantMap calcPropertyValuesOverTime (QString propName, QString propType, QVariantMap options)
 
ACTIVITIES - CALENDAR
QStringList getCalendarList ()
 
QString getCalendarByName (QString name)
 
QString getCalendarByTask (QString taskID, bool checkInh=true)
 
int setCalendar (QString taskID, QString calendarID)
 
int removeCalendarFromTask (QString taskID)
 
int setCalendarOptions (QString calendarID, QVariantMap options)
 
QVariantMap getCalendarOptions (QString calendarID)
 
int calcWorkInMinutes (QDateTime start, QDateTime finish, QString calendarID=QString())
 
ACTIVITIES - TASK RESTRICTIONS
QStringList getTaskRestrictionsList ()
 
QString getTaskRestrictionsByName (QString name)
 
int setTaskRestrictions (QString taskID, QString restrictionsID)
 
int removeTaskRestrictions (QString taskID)
 
BOQ - TOOLS
int setBoQBreakdownStructure (QString boqModelID, QString templateStr)
 
- 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 ()
 
virtual 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 ()
 
int setProjectNumber (QString s, bool overwriteExisting=false)
 
QString getProjectName ()
 
QString getProjectShortDescription ()
 
int setProjectShortDescription (QString s, bool overwriteExisting=false)
 
QString getProjectLongDescription ()
 
int setProjectLongDescription (QString s, bool overwriteExisting=false)
 
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="*", bool activeOnly=false)
 
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, bool loadExternal=true)
 
int countContainedElements (QString containerId, int maxDepth, bool loadExternal=true)
 
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 alignmentId, double d)
 
double getStationOfProjectedPoint (QString alignmentId, 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)
 
QString getTaskRestrictionsByTask (QString taskID)
 
int updateRuleBasedLinks (QString domainName, bool visibleOnly=false)
 
int removeRuleBasedLinks (QString domainName)
 

Public Member Functions

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 objectIDs)
 
QString createSelectionSet (QString name, QString parentID=QString())
 
bool removeSelectionSet (QString selsetID)
 
int updateSmartSets (QStringList smartSetIDs=QStringList())
 
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 (QString bookmarkId)
 
int activatePropertyTypeBookmark (QString bkmId)
 
bool setPropertyTypeActive (QString pName, QString ptype, QString domain, bool active)
 
int setAllPropertyTypesActive ()
 
int removePropertyTypeBookmarkByID (QString bkmId)
 
QString addPropertyTypeBookmark (QVariantMap bookmarkConfig)
 
PROPERTIES
int setPropertyValue (QString objId, QString propName, QString propDataType, QVariant value)
 
int setPropertyValueRepository (QString objId, QString propName, QString propDataType, QVariant value, bool createType=true)
 
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 options)
 
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=0.001)
 
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 writeBinaryFile (QString filePath, const QByteArray &data)
 
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())
 
QByteArray readBinaryFile (QString filePath)
 
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="", bool applyExifRotation=false)
 
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)
 

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(), bool closeCuts=true, bool splitUnconnectedParts=true)
 
QString mergeObjects (QString parentContainerId, QString idList, bool skipClosed=false, bool keepTransparency=false, bool keepCommonProperties=false, bool replaceParent=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)
 
int swapOrientationOfTriangles (QVariantList idList)
 

Additional Inherited Members

- Static Public Attributes inherited from domainBim::CoreAPI
static bool BLOCK_UNSAFE
 

Detailed Description

DESITE API for scripting in automation.

Since
1.5.0, 17 nov 2014, ah
Id
AutomationAPI.h 6752 2022-08-09 12:21:33Z stefan.losch

(c) ceapoint aec technologies GmbH

Member Function Documentation

◆ activateColorSchemaByName()

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

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

◆ activatePropertyTypeBookmark()

int domainBim::AutomationAPI::activatePropertyTypeBookmark ( QString  bkmId)
Returns
-1 : Could not activate bookmark
0 : undefined
1 : OK
Since
2.2.4, 27 oct 2018, jh

◆ addObjectListToTooltip()

void domainBim::AutomationAPI::addObjectListToTooltip ( QString  idList,
QString  tooltipname 
)

Add object list to tooltip.

Parameters
idListList of objects
tooltipnameName of the tooltip template
Since
1.3.2, 28 mar 2014, jh

◆ addPropertyScript()

QVariantMap domainBim::AutomationAPI::addPropertyScript ( QString  domain,
QString  pname,
QString  datatype,
QString  code = QString() 
)
Since
2.5.0, 10 mar 2019, jh

◆ addPropertyTypeBookmark()

QString domainBim::AutomationAPI::addPropertyTypeBookmark ( QVariantMap  bookmarkConfig)

Add property type bookmark.

Parameters
bookmarkConfigBookmark config information map. For format description see 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

◆ addRangeToRegion()

int domainBim::AutomationAPI::addRangeToRegion ( QString  regionId,
double  fromStation,
double  toStation,
QString  alignmentId = QString() 
)

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

◆ addRegionToAlignment()

QString domainBim::AutomationAPI::addRegionToAlignment ( QString  alignmentId,
QVariantMap  setting 
)

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',
textcolor: '#000000',
textscale: 0.5
}
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

◆ addToSelectionSetGeometry()

int domainBim::AutomationAPI::addToSelectionSetGeometry ( QString  setId,
QString  objectIDList 
)

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

◆ appendToFile()

bool domainBim::AutomationAPI::appendToFile ( QString  filePath,
const QString &  content,
const QString &  encoding = QString() 
)

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)

◆ calcDistance()

double domainBim::AutomationAPI::calcDistance ( QString  objId1,
QString  objId2 
)

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

◆ calcOOBB()

int domainBim::AutomationAPI::calcOOBB ( QString  objIdList,
double  eps = 0.001 
)

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

◆ calcOOBBxy()

int domainBim::AutomationAPI::calcOOBBxy ( QString  objIdList,
double  eps = 0.001 
)

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

◆ calcPropertyValuesOverTime

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', // if invalid the current date is set
'EndDay': '2018-09-20', // if invalid the current date is set
'VisibleTasks': false, // consider only visible tasks
'CheckInherited': false, // check inherited values
'BaseIndex': 0 // 0 = Default, 1 = Actual, 2 = Baseline
};
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

◆ calcWorkInMinutes

int domainBim::AutomationAPI::calcWorkInMinutes ( QDateTime  start,
QDateTime  finish,
QString  calendarID = QString() 
)
slot

Calculate working time between two given dates by specifying a calendar.

Parameters
startStart date and time
finishFinish date and time
calendarIDID of calendar (if empty the default calendar is used)
Returns
1 Ok
-1 Invalid start or finish
-2 Could not find calendar
Since
2.8.5, 14 OCT 2021

◆ checkIfFileExists()

bool domainBim::AutomationAPI::checkIfFileExists ( QString  filePath)

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

◆ checkIntersection()

int domainBim::AutomationAPI::checkIntersection ( QString  objId1,
QString  objId2,
double  tolerance = -0.00001 
)

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

◆ checkOverlapOBB()

double domainBim::AutomationAPI::checkOverlapOBB ( QString  id1,
QString  id2,
double  eps = 0.001 
)

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

Parameters
id1ID of first object
id2ID of second object
epsPrecision for generating missing OOBBs
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

◆ clearWireMode()

void domainBim::AutomationAPI::clearWireMode ( )

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

Since
1.3.0, 13 nov 2013, jh

◆ closeFile()

bool domainBim::AutomationAPI::closeFile ( )

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

◆ copyFile()

bool domainBim::AutomationAPI::copyFile ( QString  fnFrom,
QString  fnTo 
)

Copy file 'fnFrom' to file 'fnTo'.

Since
2.0.18, 31 jan 2018, jh

◆ countLocked()

int domainBim::AutomationAPI::countLocked ( )

Count locked objects.

Returns
Number of locked objects
Since
1.3.6, 25 apr 2014, jh

◆ countWired()

int domainBim::AutomationAPI::countWired ( )

Count objects which are in wireframe mode.

Since
1.9.0, 03 mar 2016, sl

◆ createColorSchema()

QString domainBim::AutomationAPI::createColorSchema ( QString  setContainerId,
QString  name 
)

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

◆ createColorSchemaFromCurrentMaterials()

QString domainBim::AutomationAPI::createColorSchemaFromCurrentMaterials ( QString  name,
bool  updateExisting,
QVariantMap  options = QVariantMap() 
)

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

◆ createContactObject

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

◆ createDirectory()

int domainBim::AutomationAPI::createDirectory ( QString  path,
QString  dirName 
)

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 -2 - execution blocked
Since
1.5.0, 16 mar 2016, mm

◆ createMaterial()

QString domainBim::AutomationAPI::createMaterial ( QString  matXml,
QString  modelId = QString() 
)

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 default 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

◆ createModel()

QString domainBim::AutomationAPI::createModel ( QString  name,
bool  createRootC = true,
QString  domain = "geometry" 
)

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

◆ createObject()

QString domainBim::AutomationAPI::createObject ( QString  parentId,
QString  name 
)
Deprecated:
This method will be removed in future versions of DESITE 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.

◆ createObjectFromXml()

QString domainBim::AutomationAPI::createObjectFromXml ( const QString &  parentId,
const QString &  objectXML 
)

Create a new object encoded by XML.
If ID (attribute ID="..." in code) is not given or is already used in the project, a new ID will be created.
If the attribute matID is used, the material must exist in the same model as the object! If this attribute is not used, a default material will be created in the same model as the object.

Parameters
parentIdID of parent element
objectXMLXML code
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>

Available types:

  • typeBsUnknown
  • typeBsContainer
  • typeBsSection (general containment)
  • typeBsSite
  • typeBsBuilding
  • typeBsBuildingStorey
  • typeBsLevel (arbitrary level)
  • typeBsUnit (e.g. an apartment unit)
  • typeBsSpace (room)
  • typeBsLocation (any location point)
  • typeBsAlignment (e.g. road)
  • typeBsStation (station point of alignment)
  • typeBsSegment (e.g. line, curve or spiral)
  • typeBsTakt
  • typeBsGroup (group, zone, system)

Examples

Create two nested sections in the building structure

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

DOMAIN DOCUMENTS

Available objects

<document>
<documentDir>
<container>

Examples

<document ID="xyz123" path="C:/file.json" created="2016-03-16T12:27:34" createdBy="" refDateTimeStart="" refDateTimeFinish="">
<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
<container> (domain Documents) added 2.4.1, 31 jan 2019, ah
types 9 and 10 (domain BoQ) added, 2.5.4, 28 may 2019, ah <section> (domain BuildingStructure) attribute 'type' added, 2.5.4, 08 feb 2020, sl

◆ createPropertyType()

int domainBim::AutomationAPI::createPropertyType ( const QString &  propName,
const QString &  propDatatype,
const QString &  uomCode,
bool  isInh,
int  target,
const QString &  domainName = "all" 
)
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

◆ createSelectionSet()

QString domainBim::AutomationAPI::createSelectionSet ( QString  name,
QString  parentID = QString() 
)
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

◆ createSelectionSets()

QString domainBim::AutomationAPI::createSelectionSets ( QString  propertyTypes,
QString  rootName,
QVariantMap  config = QVariantMap() 
)

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 empty, the name is constructed from property type key names. If the name is already used, a suffix will be added.
configObject/map containing options. Default Values:
{
"maxItems" : 0,
"considerCompositeParts" : true,
"considerOpenings" : true,
"considerParts" : true,
"intervalSize" : 0.5,
"visibleOnly" : false,
"createAsSmartSet" : false
}

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
2.2.1, 07 Aug 2018 : extended first parameter to support list of Property Type Keys
2.8.4, 13 Aug 2021 : extended options to consider visible object only
2.8.5, 11 Dec 2021 : extended options to create smart sets

◆ createWireModeSchema()

QString domainBim::AutomationAPI::createWireModeSchema ( QString  ids,
QString  wmName,
bool  overwrite = false 
)

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

◆ csvClose()

bool domainBim::AutomationAPI::csvClose ( )

Closes csv file opend using csvOpen().

Returns
false if no csv file open
Since
2.2.4, 30 oct 2018, ar

◆ csvHasNextLine()

bool domainBim::AutomationAPI::csvHasNextLine ( )

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

◆ csvNextLine()

QStringList domainBim::AutomationAPI::csvNextLine ( )

Reads next line of csv.

Returns
data line as array of strings
Since
2.2.4, 30 oct 2018, ar

◆ csvOpen()

int domainBim::AutomationAPI::csvOpen ( QString  filename,
QString  delimiter = ";" 
)

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 - successful
-1 - delimiter missing
-2 - quoteSign missing
-3 - file couldn't be opened
-4 - file stream couldn't be established for reading -5 - execution blocked
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)

◆ cutObject

QStringList domainBim::AutomationAPI::cutObject ( QString  parentId,
QString  objId,
QVariantMap  plane = QVariantMap(),
bool  closeCuts = true,
bool  splitUnconnectedParts = true 
)
slot

Cut object into subparts.

Parameters
parentIdID of parent container. If empty, subparts will be added to object.
objIdID of object
planeCutting plane encoded as JSON. If not specified, the default values of the code snipped (see below) will be chosen.
closeCutsClose mesh of cut parts.
splitUnconnectedPartsSplit cut parts which are not connected (e.g. when cutting an U-shape horizontally).
Returns
ID list of subparts, empty list if an error occurs.

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

◆ dbAssertTable()

int domainBim::AutomationAPI::dbAssertTable ( const QString &  tableName,
const QStringList &  columnsList 
)

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
-3 execution blocked
Since
2.0

◆ dbCheckIn()

void domainBim::AutomationAPI::dbCheckIn ( )

Database check-in.

Since
1.0.17, 18 jul 2012, jh
Remarks
1.5.0, 15 dec 2014, moved to class AutomationAPI

◆ dbCheckOut()

void domainBim::AutomationAPI::dbCheckOut ( const QStringList &  propList)

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

◆ dbClearCache()

int domainBim::AutomationAPI::dbClearCache ( const QString &  propName,
const QString &  propType 
)
Returns
errCode 1 = OK
-1 = error
Since
1.3.6, 28 apr 2014, jh

◆ dbClearCacheAll()

void domainBim::AutomationAPI::dbClearCacheAll ( )
See also
To setup cached values see also itSetupDbCache()
Since
1.3.6, 28 apr 2014, jh

◆ dbClose()

bool domainBim::AutomationAPI::dbClose ( )

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

Since
2.4.1, 2019-01-28, ah

◆ dbDeleteProperty()

int domainBim::AutomationAPI::dbDeleteProperty ( const QString &  objIdList,
const QString &  propName,
const QString &  propType 
)

Delete properties from database.

Parameters
objIdListThe properties are removed and deleted from these objects.
Returns
0 undefined
-3 execution blocked
-4 database is not open
-5 no objects found in domain projects
Since
1.4.9, 12 dec 2015, jh

◆ dbEndQueryExec()

bool domainBim::AutomationAPI::dbEndQueryExec ( )

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

◆ dbGetFilepath()

QString domainBim::AutomationAPI::dbGetFilepath ( ) const

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

◆ dbGetImmediateUpdate()

bool domainBim::AutomationAPI::dbGetImmediateUpdate ( )
See also
dbSetImmediateUpdate()
Since
1.3.0, 14 nov 2013, jh

◆ dbIsLocalCopy()

bool domainBim::AutomationAPI::dbIsLocalCopy ( )

Check if current database is a local copy.

Since
1.0.17, 18 jul 2012, jh

◆ dbOpen()

int domainBim::AutomationAPI::dbOpen ( const QVariant  connectionData = QVariant())

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) -3 - execution blocked
Since
2.4.1, 2019-01-28, ah

◆ dbQueryExec()

bool domainBim::AutomationAPI::dbQueryExec ( const QString &  sqlQuery)

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

◆ dbQueryLastError()

QString domainBim::AutomationAPI::dbQueryLastError ( )

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

Since
2.3.1, 12 dec 2018, ah

◆ dbQueryNext()

bool domainBim::AutomationAPI::dbQueryNext ( )

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

◆ dbQueryRecordset()

QVariantMap domainBim::AutomationAPI::dbQueryRecordset ( const QString &  sqlQuery,
const QString &  key,
int  maxNumberOfRows = 0 
)

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

◆ dbQueryValue()

QVariant domainBim::AutomationAPI::dbQueryValue ( int  column)
Since
1.0.18, 14 aug 2012, jh

◆ dbSetImmediateUpdate()

void domainBim::AutomationAPI::dbSetImmediateUpdate ( bool  )
See also
dbGetImmediateUpdate()
Since
1.3.0, 14 nov 2013, jh

◆ deleteColorSchema()

int domainBim::AutomationAPI::deleteColorSchema ( QString  namePattern)

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

◆ deleteMaterial()

int domainBim::AutomationAPI::deleteMaterial ( QString  matId)

Delete material with given ID. Only materials of the default model which are not used (e.g. by north arrow) can be deleted.

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

◆ deleteModel()

int domainBim::AutomationAPI::deleteModel ( const QString &  id)

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

◆ deleteObjects()

int domainBim::AutomationAPI::deleteObjects ( QString  idList)

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
idListList of object/container IDs separated by ';'
Returns
Number of deleted objects and containers
Since
1.3.0, 02 jan 2014, jh

◆ deleteProperty()

int domainBim::AutomationAPI::deleteProperty ( QString  objId,
QString  propName,
QString  propDatatype 
)

Delete property 'propName' with data type 'propDatatype' 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

◆ deletePropertyType()

int domainBim::AutomationAPI::deletePropertyType ( QString  propName,
QString  propDatatype,
QString  domainName = "all" 
)

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

◆ endProjectTransaction()

int domainBim::AutomationAPI::endProjectTransaction ( const QString &  domain = "geometry")

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

◆ endTransaction()

bool domainBim::AutomationAPI::endTransaction ( )

Finish database transaction.

Since
1.0.18, 20 aug 2012, jh

◆ findContainerByName

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

◆ findDocumentsByDate

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

◆ findDocumentsByLocationGk

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

◆ findDocumentsByLocationGps

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

◆ findDocumentsByLocationRangeGps

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) as string, delimited by '#', e.g. ['51.4556#7.0116',...]
distanceSearch range
idList(optional) List of IDs of documents
Since
2.0.0, 20 jun 2016, mm

◆ getAsJSON()

QVariantMap domainBim::AutomationAPI::getAsJSON ( QString  objId)

Get geometric 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, undefined, 2) );
}

A 3D-object that contains vertices, triangles and faces (uv is available only if texture is attached on the surface).
Note: the triangle list - unlike the face list - is not grouped; each consecutive triple of vertex indices forms a triangle
Example Result:

{
"ElementType": "surface",
"ID": "ccf5ac9b-6eeb-4134-a9d0-558bf92b9a8e",
"Name": "Basisdecke [2409746]",
"faceList": [
[
0,
1
]
],
"triangleList": [
0,
1,
3,
3,
2,
0
],
"uv": [
105.5401840209961,
152.18524169921875,
105.5401840209961,
134.1296844482422,
126.3735122680664,
134.1296844482422,
126.3735122680664,
134.1296844482422,
126.3735122680664,
152.18524169921875,
105.5401840209961,
152.18524169921875
],
"vertexList": [
18.99723345336914,
27.393344219970704,
2.600000019836426,
18.99723345336914,
24.143344921875002,
2.600000019836426,
22.74723246459961,
27.393344219970704,
2.600000019836426,
22.74723246459961,
24.143344921875002,
2.600000019836426
]
}
Since
2.1.0, 2017-05-30, jh
2.7.3, 2021-01-11, ek: faceList added

◆ getAvailablePropertyValues()

QList<QVariant> domainBim::AutomationAPI::getAvailablePropertyValues ( QString  propName,
QString  propDatatype,
int  maxValues,
QString  domainName = "geometry" 
)
Deprecated:
This method will be removed in future versions of DESITE 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.

◆ getBBoxMaxX()

double domainBim::AutomationAPI::getBBoxMaxX ( )

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

Since
1.4

◆ getBBoxMaxY()

double domainBim::AutomationAPI::getBBoxMaxY ( )

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

Since
1.4

◆ getBBoxMaxZ()

double domainBim::AutomationAPI::getBBoxMaxZ ( )

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

Since
1.4

◆ getBBoxMinX()

double domainBim::AutomationAPI::getBBoxMinX ( )

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

Since
1.4

◆ getBBoxMinY()

double domainBim::AutomationAPI::getBBoxMinY ( )

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

Since
1.4

◆ getBBoxMinZ()

double domainBim::AutomationAPI::getBBoxMinZ ( )

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

Since
1.4

◆ getBoundingBoxCommon()

QVariantMap domainBim::AutomationAPI::getBoundingBoxCommon ( QString  objIdList)

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

◆ getCalendarByName

QString domainBim::AutomationAPI::getCalendarByName ( QString  name)
slot

Get calendar by name. If more than one calendars with the same name exists, return the first calendar

Parameters
nameName of calendar
Returns
ID of calendar, empty string else
Since
2.8.5, 14 OCT 2021

◆ getCalendarByTask

QString domainBim::AutomationAPI::getCalendarByTask ( QString  taskID,
bool  checkInh = true 
)
slot

Get calendar assigned to a task. Note: If no calendar is explicitly assigned to a task, the ID of the default calendar will be returned.

Parameters
taskIDID of task
checkInhAlso check inherited calendars
Returns
ID of calendar
Since
2.8.5, 14 OCT 2021

◆ getCalendarList

QStringList domainBim::AutomationAPI::getCalendarList ( )
slot

Get available calendars.

Returns
List of calendar IDs
Since
2.8.5, 14 OCT 2021

◆ getCalendarOptions

QVariantMap domainBim::AutomationAPI::getCalendarOptions ( QString  calendarID)
slot

Get default options of calendar.

Parameters
calendarIDID of the calendar
Returns
Options

Example return:

{
"DefaultStartTime" : "08:00",
"DefaultFinishTime" : "17:00",
"HoursPerDay" : 8,
"HoursPerWeek" : 40,
"DaysPerMonth" : 20
}
Since
2.8.6, 28 Feb 2022

◆ getColorSchemaList()

QStringList domainBim::AutomationAPI::getColorSchemaList ( )

Get all color schemes.

Returns
List of names of all color schemes
Since
1.0.16

◆ getContainerByName

QString domainBim::AutomationAPI::getContainerByName ( QString  parentId,
QString  name 
)
slot
Deprecated:
This method will be removed in future versions of DESITE 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.

◆ getCurrentColorSchema()

QString domainBim::AutomationAPI::getCurrentColorSchema ( )

Get current (applied) color scheme.

Returns
Name of current color scheme, empty string if no color scheme is active
Since
1.0.16

◆ getDirectoryEntryList()

QVariantList domainBim::AutomationAPI::getDirectoryEntryList ( QString  dirPath,
bool  filesOnly = false,
QString  orderBy = "Name" 
)

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

◆ getListOfObjTooltips()

QStringList domainBim::AutomationAPI::getListOfObjTooltips ( )

Get list of tooltip templates.

Since
1.3.2, 28 mar 2014, jh

◆ getListOfTempValues()

QStringList domainBim::AutomationAPI::getListOfTempValues ( )

Get list of temporary values.

Since
2.4.1, 11 feb 2019, jh

◆ getLocked()

QString domainBim::AutomationAPI::getLocked ( )

Get all locked objects.

Returns
List of IDs of locked objects (separated by ';')
Since
1.3.6, 25 apr 2014, jh

◆ getMaterial()

QVariantMap domainBim::AutomationAPI::getMaterial ( const QString &  matId)

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

◆ getMaterialAsXmlByID()

QString domainBim::AutomationAPI::getMaterialAsXmlByID ( QString  matId)

Get material encoded by XML.

Parameters
matIdID of Material
Returns
Material as XML string
Since
1.4

◆ getMaterialIDByName()

QString domainBim::AutomationAPI::getMaterialIDByName ( QString  matName)

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

◆ getMaterialList()

QStringList domainBim::AutomationAPI::getMaterialList ( )

Get list of all available materials.

Returns
Material list as list of material IDs
Since
1.0.20, 14 jan 2013, jh

◆ getModelByElement()

QString domainBim::AutomationAPI::getModelByElement ( QString  id,
QString  domainFilter = "all" 
)

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

◆ getModelByName()

QString domainBim::AutomationAPI::getModelByName ( QString  name,
QString  domainFilter = "geometry" 
)
Deprecated:
This method will be removed in future versions of DESITE 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.

◆ getModelListByDomain()

QStringList domainBim::AutomationAPI::getModelListByDomain ( QString  domainFilter = "all")

Return a ID-list of all models in a given domain.
NOTE: The model ID is not identical to the ID of the model root nodes in the element hierarchies.

Parameters
domainFilterGiven domain(s) (default = 'all'). Different domain names have to be separated by ';'.
See also
getRootNodeListByDomain()
Since
1.5.0, 28 oct 2015, jh

◆ getModelListByName()

QStringList domainBim::AutomationAPI::getModelListByName ( QString  name,
QString  domain = "geometry" 
)

Get a list of IDs of all models with name 'name'.
NOTE: The model ID is not identical to the ID of the model root nodes in the element hierarchies.

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

See also
DOMAINS
Returns
model IDs as list
See also
QString getRootNodeByModel(QString modelId)
Since
1.3.0, 02 jan 2014, jh

◆ getModelMetaData()

QVariantMap domainBim::AutomationAPI::getModelMetaData ( QString  modelId)

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

◆ getOOBBCommon()

QVariantMap domainBim::AutomationAPI::getOOBBCommon ( QString  objIdList)

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

◆ getOOBBxyCommon()

QVariantMap domainBim::AutomationAPI::getOOBBxyCommon ( QString  objIdList)

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

◆ getProjectionAsSvg()

QString domainBim::AutomationAPI::getProjectionAsSvg ( QString  idList,
QVariantMap  options = QVariantMap() 
)

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

◆ getPropertyListAsJSON()

QVariantMap domainBim::AutomationAPI::getPropertyListAsJSON ( QVariantMap  options)

Get list of properties.

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 (means all, visible or not)
"ActivePropertiesBookmark": "EXP_STATUS", // if no bookmark is given, all properties are returned,
// if "PropertyTypeList" is used, this setting will be ignored altogether
"ExportInheritedProperties": true, // default: true
"EvaluateProperties": true, // default: true
"PropertyTypeList": [ "cpCount##xs:long", "WebTest##xs:string" ], // export contained property types. this will override "ActivePropertiesBookmark".
"Domains": [ "geometry" ], // passing a string (semicolon-separated) instead of a "true" list will also work (default: all)
"ReportNull": true // Get also property values as 'null' if property does not exist for a specific object (default: false)
};
var g = desiteAPI.getPropertyListAsJSON(opt);
console.log( JSON.stringify(g) );
Since
2.2.1, 20 jun 2018, jh
Remarks
, 2.5.3, jh, Parameter 'ReportNull' added

◆ getPropertyScriptBgColor()

QString domainBim::AutomationAPI::getPropertyScriptBgColor ( QString  domain,
QString  pname,
QString  datatype 
) const

Get code (background) of property script.

Since
2.5.0, 06 mar 2019, jh

◆ getPropertyScriptCode()

QString domainBim::AutomationAPI::getPropertyScriptCode ( QString  domain,
QString  pname,
QString  datatype 
) const

Get code (value) of property script.

Since
2.5.0, 06 mar 2019, jh

◆ getPropertyScriptFgColor()

QString domainBim::AutomationAPI::getPropertyScriptFgColor ( QString  domain,
QString  pname,
QString  datatype 
) const

Get code (foreground) of property script.

Since
2.5.0, 06 mar 2019, jh

◆ getPropertyScriptList()

QVariantMap domainBim::AutomationAPI::getPropertyScriptList ( ) const

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

◆ getPropertyScriptOptions()

QVariantMap domainBim::AutomationAPI::getPropertyScriptOptions ( QString  domain,
QString  pname,
QString  datatype 
)
options {
"IsCached": true,
"IsInherited": true,
"Unit": "m2",
"DisplayName": "abc"
}
Since
2.5.0, 10 mar 2019, jh

◆ getPropertyTypeBookmarkByID()

QVariantMap domainBim::AutomationAPI::getPropertyTypeBookmarkByID ( QString  bookmarkId)

Get a property type bookmark as an object.
The 'Type' of the bookmark is 1 for User-defined and 2 for Global.

{
"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

◆ getPropertyTypeBookmarkList()

QList<QVariant> domainBim::AutomationAPI::getPropertyTypeBookmarkList ( )

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

◆ getPropertyValues()

QList<QVariant> domainBim::AutomationAPI::getPropertyValues ( QString  propName,
QString  propDatatype,
int  maxValues = 0,
QString  domainName = "all",
bool  getNullValues = false 
)

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

◆ getPropertyValuesByObjectList()

QList<QVariant> domainBim::AutomationAPI::getPropertyValuesByObjectList ( QString  propName,
QString  propDatatype,
bool  checkInh,
QString  objIdList,
int  maxValues = 0,
QString  domainName = "all",
bool  getNullValues = false 
)

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

◆ getRootContainerByName()

QString domainBim::AutomationAPI::getRootContainerByName ( QString  modelName,
QString  rootContainerName 
)
Deprecated:
This method will be removed in future versions of DESITE 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.

◆ getRootContainerList

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

◆ getRootNodeByModel()

QString domainBim::AutomationAPI::getRootNodeByModel ( QString  modelId)

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.
See also
getRootNodeListByDomain()
Since
1.5.0, 28 oct 2015, jh

◆ getRootNodeListByDomain()

QStringList domainBim::AutomationAPI::getRootNodeListByDomain ( QString  domainFilter = "all")

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 ';'.
See also
getRootNodeByModel()
Since
1.5.0, 28 oct 2015, jh

◆ getRootNodeListSelectionSets()

QStringList domainBim::AutomationAPI::getRootNodeListSelectionSets ( QString  domainFilter = "all")

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

Remarks
Currently (2.2.2) domain 'geometry' is supported only.
Since
2.2.2, 28 aug 2018, jh

◆ getTaskRestrictionsByName

QString domainBim::AutomationAPI::getTaskRestrictionsByName ( QString  name)
slot

Get first task restriction with given name.

Parameters
nameName of task restriction
Returns
ID of task restriction, empty string else
Since
2.8.5, 14 Oct 2021

◆ getTaskRestrictionsList

QStringList domainBim::AutomationAPI::getTaskRestrictionsList ( )
slot

Get available task restrictions.

Returns
List of task restriction IDs
Since
2.8.5, 14 Oct 2021

◆ getTempValue()

QVariant domainBim::AutomationAPI::getTempValue ( QString  name)

Retrieve a temporarily stored property.

Since
2.4.1, 02 feb 2019, ar

◆ getVisualisationList

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

◆ getWired()

QString domainBim::AutomationAPI::getWired ( )

Get all objects which are set to wireframe mode.

Since
1.9.0, 03 mar 2016, sl

◆ hasContact

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

◆ hasElement

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

◆ isContainer

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

◆ isIncludedIn()

bool domainBim::AutomationAPI::isIncludedIn ( QString  objId1,
QString  objId2 
)

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

◆ isPointIncludedIn()

int domainBim::AutomationAPI::isPointIncludedIn ( double  x,
double  y,
double  z,
QString  objId,
double  tol = 1.e-5 
)

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 (surface or composite)
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

◆ itByFilter()

int domainBim::AutomationAPI::itByFilter ( QString  propName,
QString  propDatatype,
QString  filterPattern,
bool  checkInh = true,
QString  domain = "geometry" 
)

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

◆ itByObjectList()

int domainBim::AutomationAPI::itByObjectList ( QString  idList)

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

◆ itCalcOOBB()

void domainBim::AutomationAPI::itCalcOOBB ( double  eps)

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

◆ itCalcOOBBxy()

void domainBim::AutomationAPI::itCalcOOBBxy ( double  eps)

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

◆ itClear()

void domainBim::AutomationAPI::itClear ( )

Clear and delete an existing object iterator.

Since
1.3.0, 05 nov 2013, jh

◆ itColorCode()

void domainBim::AutomationAPI::itColorCode ( QString  propName,
QString  propDT 
)

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

◆ itColorCodeNumber()

void domainBim::AutomationAPI::itColorCodeNumber ( QString  propName,
QString  propDT,
double  intervalSize 
)

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

◆ itCount()

int domainBim::AutomationAPI::itCount ( )

Count the elements in current object iterator.

Since
1.3.0, 05 nov 2013, jh

◆ itFilterByStatus()

int domainBim::AutomationAPI::itFilterByStatus ( QString  status,
bool  enabled = true,
QString  domain = "geometry" 
)

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'

◆ itGetAvailablePropertyValues()

QList<QVariant> domainBim::AutomationAPI::itGetAvailablePropertyValues ( QString  propName,
QString  propDatatype,
int  maxValues 
)

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

◆ itGetObjectList()

QString domainBim::AutomationAPI::itGetObjectList ( )

Get list of IDs of current object iterator.

Since
1.3.7, 1 may 2014, jh

◆ itHasNext()

bool domainBim::AutomationAPI::itHasNext ( )

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

◆ itNext()

QString domainBim::AutomationAPI::itNext ( )

Get ID of next element in object iterator.

Since
1.3.0, 05 nov 2013, jh

◆ itSetMaterial()

void domainBim::AutomationAPI::itSetMaterial ( QString  matId)

Set material to current objects of iterator.

Since
1.3.7, 1 may 2014, jh

◆ itSetupDbCache()

void domainBim::AutomationAPI::itSetupDbCache ( QString  propName,
QString  propType 
)

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

Since
1.3.6, 28 apr 2014, jh

◆ itToFront()

void domainBim::AutomationAPI::itToFront ( )

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

Since
1.3.0, 05 nov 2013, jh

◆ itUpdateOOBB()

void domainBim::AutomationAPI::itUpdateOOBB ( double  eps)

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

Since
1.4.7, 5 sep 2014, jh

◆ itUpdateOOBBxy()

void domainBim::AutomationAPI::itUpdateOOBBxy ( double  eps)

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

Since
1.4.7, 5 sep 2014, jh

◆ lockObjects()

void domainBim::AutomationAPI::lockObjects ( QString  idList)

Locks given objects.

Parameters
idListList of IDs of objects to lock (separated by ';')
Since
1.3.6, 25 apr 2014, jh

◆ mergeObjects()

QString domainBim::AutomationAPI::mergeObjects ( QString  parentContainerId,
QString  idList,
bool  skipClosed = false,
bool  keepTransparency = false,
bool  keepCommonProperties = false,
bool  replaceParent = false 
)

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.
New: Source Objects must NOT 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.
keepCommonProperties: Keep common properties of merged objects.
replaceParent: Replace parent container with merged object, if all children could be merged into one.
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
-3 Could not get model of parent container
-4 Parent could not be replaced. This could be the case if not all children are merged or the given parent is not the direct parent of the merged objects.
-5 No objects merged
Since
1.5.0, 05 Aug 2015, sl
2.8.3, 28 Jul 2021, sl: Added 2 parameters according to GUI functionality, method now works like the tool.

◆ moveFile()

bool domainBim::AutomationAPI::moveFile ( QString  fnFrom,
QString  fnTo 
)

Move file 'fnFrom' to file 'fnTo'.

Since
2.0.18, 31 jan 2018, jh

◆ openFile()

bool domainBim::AutomationAPI::openFile ( QString  filePath,
const QString &  encoding = QString() 
)

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)

◆ propertyScriptClearCache() [1/2]

void domainBim::AutomationAPI::propertyScriptClearCache ( )

Clear cache of all property scripts.

Since
2.5.0, 10 mar 2019, jh

◆ propertyScriptClearCache() [2/2]

void domainBim::AutomationAPI::propertyScriptClearCache ( QString  domain,
QString  pname,
QString  datatype 
)
Since
2.5.0, 10 mar 2019, jh

◆ readBinaryFile()

QByteArray domainBim::AutomationAPI::readBinaryFile ( QString  filePath)

Read a file and return its complete content as unformatted data.

Parameters
filePathName and path of file
Returns
Raw data from the file
Since
2.8.2, 2021-04-30

◆ readCsvFile()

QVariantMap domainBim::AutomationAPI::readCsvFile ( QString  filename,
QString  delimiter = ";" 
)

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

◆ readImageFile()

QString domainBim::AutomationAPI::readImageFile ( QString  filename,
QString  targetFormat = "",
bool  applyExifRotation = false 
)

Read image file and return a Base64-encoded string.
By default, this just encodes the raw input data into Base64, but you can optionally add image format conversion and Exif rotation.

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, this parameter can be omitted (or set to "").
applyExifRotationIf set to true, Exif data (if present in the source file) is evaluated to rotate the image. This will only work if an output format is specified (because otherwise, the raw input data will only be encoded, but not otherwise processed).
Returns
Base64-encoded image; empty string on error
Since
2.0.16, 2017-10-18, ah
2.7.2, 2020-12-08, ah : added Exif processing

◆ readTextFile()

QStringList domainBim::AutomationAPI::readTextFile ( QString  filename,
bool  ignoreLineBreakesInDoubleQuotes = false,
QString  codec = QString() 
)

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

◆ readTextFileAsString()

QString domainBim::AutomationAPI::readTextFileAsString ( QString  filename,
QString  codec = QString() 
)

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

◆ recalculateActivityProject

int domainBim::AutomationAPI::recalculateActivityProject ( QString  taskID = QString(),
bool  visibleOnly = false 
)
slot

Recalculate projected dates of Activity Project.

Parameters
taskIDID of root task. If ID is empty, all time schedules will be considered.
visibleOnlyUse visible tasks only
Returns
1 - Ok
-1 - Error, Could not find task 'taskID'
-2 - Error, dependencies contain cycles
-3 - Error, failed to recalculate START/FINISH of summary tasks
Since
2.8.6, 24 Feb 2022

◆ removeAllLinkedObjects()

int domainBim::AutomationAPI::removeAllLinkedObjects ( QString  id)

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

◆ removeAllRangesFromRegion()

int domainBim::AutomationAPI::removeAllRangesFromRegion ( QString  regionId,
QString  alignmentId = QString() 
)

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

◆ removeAllRegionsFromAlignment()

int domainBim::AutomationAPI::removeAllRegionsFromAlignment ( QString  alignmentId)

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

◆ removeCalendarFromTask

int domainBim::AutomationAPI::removeCalendarFromTask ( QString  taskID)
slot

Remove calendar from task. This will not affect inherited calendars.

Parameters
taskIDID of the task
Returns
1 Ok
-1 Could not find task
Since
2.8.5, 14 Oct 2021

◆ removeFile()

bool domainBim::AutomationAPI::removeFile ( QString  filePath)

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)

◆ removeFromSelectionSetGeometry()

int domainBim::AutomationAPI::removeFromSelectionSetGeometry ( QString  setId,
QString  objectIDs 
)

Remove objects from selection set in domain 'geometry'.

Parameters
objectIDsString containing object IDs, separated by ';'.
Returns
1 Ok
-1 Selection Set not found in domain 'geometry'
-2 Object(s) not found in domain 'geometry'
Since
2.2.2, 28 aug 2018, jh

◆ removeLinkedObjects()

int domainBim::AutomationAPI::removeLinkedObjects ( QString  id,
QString  linkedIdList 
)

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

◆ removeObjectListFromTooltip()

void domainBim::AutomationAPI::removeObjectListFromTooltip ( QString  idList,
QString  tooltipname 
)

Removes the object list from tooltip.

Parameters
idListList of objects
tooltipnameName of the tooltip template
Since
1.3.2, 28 mar 2014, jh

◆ removePropertyScript()

int domainBim::AutomationAPI::removePropertyScript ( QString  domain,
QString  pname,
QString  datatype 
)
Since
2.5.0, 10 mar 2019, jh

◆ removePropertyTypeBookmarkByID()

int domainBim::AutomationAPI::removePropertyTypeBookmarkByID ( QString  bkmId)
Since
2.2.4, 27 oct 2018, jh

◆ removeRangeFromRegion()

int domainBim::AutomationAPI::removeRangeFromRegion ( QString  regionId,
double  fromStation,
double  toStation,
QString  alignmentId = QString() 
)

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

◆ removeSelectionSet()

bool domainBim::AutomationAPI::removeSelectionSet ( QString  selsetID)

Remove selection set with given ID.

Returns
true if selection set could be removed, else false
Since
2.5.1, 30 apr 2019, jh

◆ removeTaskRestrictions

int domainBim::AutomationAPI::removeTaskRestrictions ( QString  taskID)
slot

Remove task restriction from task.

Parameters
taskIDID of task
Returns
1 Ok
-1 Could not find task
Since
2.8.5, 14 Oct 2021

◆ removeVisualisation

int domainBim::AutomationAPI::removeVisualisation ( QString  taskIDList)
slot

Remove visualisation configuration from tasks.

Parameters
taskIDListIDs of task, separated by semicolon
Returns
1 Ok
-1 Could not find any task
Since
1.9.0, 16 jul 2016, jh

◆ reorderElements()

void domainBim::AutomationAPI::reorderElements ( )

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

◆ resetDocumentMetaData

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

◆ resetMaterials()

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

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

◆ setAllPropertyTypesActive()

int domainBim::AutomationAPI::setAllPropertyTypesActive ( )

Set all property types active.

Since
2.2.4, 27 oct 2018, jh

◆ setAsComposite()

int domainBim::AutomationAPI::setAsComposite ( const QString &  id,
bool  composite 
)

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

◆ setAsOpening()

int domainBim::AutomationAPI::setAsOpening ( QString  objId,
QString  openingIDList 
)

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

◆ setBoQBreakdownStructure

int domainBim::AutomationAPI::setBoQBreakdownStructure ( QString  boqModelID,
QString  templateStr 
)
slot

Set BoQ model breakdown structure by template string.

Parameters
boqModelIDID of BoQ model
templateStrText with information about the BoQ structure like "1122PPPPI"
Returns
1 - Ok
-1 - Could not find model
-2 - Wrong template
Since
2.8.5, 27 oct 2021, sl

◆ setCalendar

int domainBim::AutomationAPI::setCalendar ( QString  taskID,
QString  calendarID 
)
slot

Set a calendar for a task.

Parameters
taskIDID of the task
calendarIDID of calendar
Returns
1 Ok
-1 Could not find task
-2 Could not find calendar
Since
2.8.5, 14 OCT 2021

◆ setCalendarOptions

int domainBim::AutomationAPI::setCalendarOptions ( QString  calendarID,
QVariantMap  options 
)
slot

Set default options of calendar.

Parameters
calendarIDID of the calendar
Returns
1 Ok
-1 Could not find calendar
-2 Invalid value passed in options
See also
getCalendarOptions(QString calendarID)
Since
2.8.6, 28 Feb 2022

◆ setCloudSettings()

void domainBim::AutomationAPI::setCloudSettings ( QVariantMap  vm)

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

◆ setLinkedObjects()

int domainBim::AutomationAPI::setLinkedObjects ( const QString &  elementID,
const QString &  IDList 
)

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

◆ setMaterialToObjects()

int domainBim::AutomationAPI::setMaterialToObjects ( QString  matId,
QString  objectIds 
)

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

◆ setName()

void domainBim::AutomationAPI::setName ( QString  objIdList,
QString  name 
)
Deprecated:
This method will be removed in future versions of DESITE 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.

◆ setObjectsToWireMode()

void domainBim::AutomationAPI::setObjectsToWireMode ( QString  ids,
bool  wired 
)

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

◆ setPropertyListAsJSON()

void domainBim::AutomationAPI::setPropertyListAsJSON ( QVariantMap  propmap,
QVariantMap  opt 
)

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

◆ setPropertyScriptBgColor()

int domainBim::AutomationAPI::setPropertyScriptBgColor ( QString  domain,
QString  pname,
QString  datatype,
QString  code 
)

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

◆ setPropertyScriptCode()

int domainBim::AutomationAPI::setPropertyScriptCode ( QString  domain,
QString  pname,
QString  datatype,
QString  code 
)

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

◆ setPropertyScriptFgColor()

int domainBim::AutomationAPI::setPropertyScriptFgColor ( QString  domain,
QString  pname,
QString  datatype,
QString  code 
)

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

◆ setPropertyScriptOptions()

int domainBim::AutomationAPI::setPropertyScriptOptions ( QString  domain,
QString  pname,
QString  datatype,
QVariantMap  opt 
)
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

◆ setPropertyTypeActive()

bool domainBim::AutomationAPI::setPropertyTypeActive ( QString  pName,
QString  ptype,
QString  domain,
bool  active 
)
Parameters
domainDomain(s) for which to set the active status, e.g. "geometry", "geometry;activities", "all"
Since
2.6.1, 2020-08-26, ah

◆ setPropertyTypeMetaData()

int domainBim::AutomationAPI::setPropertyTypeMetaData ( QString  pName,
QString  ptype,
QVariantMap  metadata 
)

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

Parameters
pNameName of property type
pTypeData type of property type
metadataObject containing data to set
Returns
1 OK
0 undefined
-1 could not find property type

Example:

{
"DisplayName": "Volume",
"Unit": "m3",
"Domain": "geometry",
"Inheritable": false
}
Since
2.0.13, 13 May 2017
2.8.7, 22 Mar 2022: added option 'Inheritable'

◆ setPropertyValue()

int domainBim::AutomationAPI::setPropertyValue ( QString  objId,
QString  propName,
QString  propDataType,
QVariant  value 
)

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 data type
-3 - error, writing was rejected, could be read only or wrong format
-4 - error, illegal value type
See also
setPropertyValueDB()
setPropertyValueRepo()
createPropertyType()
Since
1.0.17, 28 jun 2012, jh
Remarks
2.0.6, 18 nov 2016, ah: added data type check
2.8.5, 22 nov 2021, sl: added QVariant type check

◆ setPropertyValueDB()

int domainBim::AutomationAPI::setPropertyValueDB ( const QString &  objIdList,
const QString &  propName,
const QString &  propDataType,
const QString &  propDomain,
const QVariant &  value,
bool  createType = true 
)

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 the 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
-6 - error: execution blocked
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

◆ setPropertyValueRepository()

int domainBim::AutomationAPI::setPropertyValueRepository ( QString  objId,
QString  propName,
QString  propDataType,
QVariant  value,
bool  createType = true 
)
Deprecated:
This method will be removed in future versions of DESITE and should not be used for new scripts anymore.

Explicitly force the property to be written in project repository (memory).

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
createTypeIf true (default), a property type will be created if not yet existing; if false, the operation will fail if the property type does not already exist
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
setPropertyValue()
setPropertyValueDB()
createPropertyType()
Since
2.6.1, 01 sep 2020, sl
Remarks
Deprecated since 2.8.3, 10 jul 2021
Deprecated:
Use setPropertyValue() instead.
Reason: Use may have undesirable side effects.

◆ setTaskMode

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 - Error, could not find task 'taskID'
-2 - Error, could not set task mode
Since
2.1.6, 15 mar 2018, jh

◆ setTaskRestrictions

int domainBim::AutomationAPI::setTaskRestrictions ( QString  taskID,
QString  restrictionsID 
)
slot

Set task restrictions for a task.

Parameters
taskIDID of the task
restrictionsIDID of task restrictions
Returns
1 Ok
-1 Could not find task
-2 Could not find task restrictions
Since
2.8.5, 14 Oct 2021

◆ setTempValue()

void domainBim::AutomationAPI::setTempValue ( QString  name,
QVariant  value 
)

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

◆ setTransparency()

int domainBim::AutomationAPI::setTransparency ( QString  objectIds,
float  defaultTransparency = 0.95 
)

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

◆ setVisualisationByID

int domainBim::AutomationAPI::setVisualisationByID ( QString  taskIDList,
QString  visID 
)
slot

Set visualisation configuration to task.

Parameters
taskIDListIDs of task, separated by semicolon
visIDID of visualisation
Returns
1 Ok
-1 Could not find visualisation with given ID
-2 Could not get any task
Since
1.9.0, 16 jul 2016, jh

◆ showWireModeSchema()

void domainBim::AutomationAPI::showWireModeSchema ( QString  name)

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

◆ startProjectTransaction()

int domainBim::AutomationAPI::startProjectTransaction ( const QString &  domain = "geometry")

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

◆ startTransaction()

bool domainBim::AutomationAPI::startTransaction ( )

Start database transaction.

Since
1.0.18, 20 aug 2012, jh

◆ swapOrientationOfTriangles()

int domainBim::AutomationAPI::swapOrientationOfTriangles ( QVariantList  idList)

Swap orientation of triangles of surface objects.

Parameters
idListList of surface object IDs.
Returns
Number of objects affected
Since
2.8.7, 28 Mar 2022

◆ synchronizeDocumentContainer

int domainBim::AutomationAPI::synchronizeDocumentContainer ( QString  containerId,
QScriptValue  callback = QScriptValue(),
bool  blockExecution = false 
)
slot

Synchronizes a document container with the assigned local directory or webservice. An URL must be set for the container which should be synchronized!

Parameters
containerId: container node ID
callbackWhen synching via webservice, the process will be asynchronous. You can optionally set this callback to be triggered when the sync finishes. The callback function should have one boolean parameter, indicating success (true) or failure (false).
blockExecutionWill only have an effect with a webservice sync. With this flag set to true, script execution will not continue until the synchronisation has finished. This may incur a performance penalty and is generally not recommended. If possible, use a callback function to define post-sync steps instead.
Returns
errCode 1 : ok
0 : undefined
-1 : element with ID 'containerId' could not be found
-2 : element with ID 'containerId' is not a container

Example 1: Non-blocking with callback

function callAfterCompletion(success)
{
if (success) {
console.log('sync completed successfully');
} else {
console.log('sync failed');
}
}
desiteAPI.synchronizeDocumentContainer(id, callAfterCompletion);

Example 2: Blocking, no callback

desiteAPI.synchronizeDocumentContainer(id, 0, true);
Since
1.5.0, 2016-04-06, mm
2.6.2, 2020-09-22, ah : optional callback parameter
2.6.4, 2021-02-04, ah : optional blockExecution parameter

◆ transformObject()

int domainBim::AutomationAPI::transformObject ( QString  objId,
QString  transformation 
)

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

◆ unlockAllObjects()

void domainBim::AutomationAPI::unlockAllObjects ( )

Unlocks all objects.

Since
1.3.6, 25 apr 2014, jh

◆ unlockObjects()

void domainBim::AutomationAPI::unlockObjects ( QString  idList)

Unlocks given objects.

Parameters
idListList of IDs of objects to lock (separated by ';')
Since
1.3.6, 25 apr 2014, jh

◆ updateBoundingBox3DView()

void domainBim::AutomationAPI::updateBoundingBox3DView ( )

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

Since
1.3.5, 15 apr 2014, jh

◆ updateMaterial()

void domainBim::AutomationAPI::updateMaterial ( QString  matId,
QString  xmlMat 
)

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

Parameters
matIdID of material
matXmlNew material properties as XML
See also
createMaterial()
Since
1.4

◆ updateOOBB()

int domainBim::AutomationAPI::updateOOBB ( QString  obIDList,
double  eps = 0.001 
)

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

◆ updateOOBBxy()

int domainBim::AutomationAPI::updateOOBBxy ( QString  objIdList,
double  eps = 0.001 
)

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

◆ updateSmartSets()

int domainBim::AutomationAPI::updateSmartSets ( QStringList  smartSetIDs = QStringList())

Update the Smart Sets with given IDs. If ID list is empty (default), all available Smart Sets will be updated.

Returns
number of updated sets (can be used to check if ID lookups were successful)
Since
2.7.3, 2021-02-02, ah

◆ writeBinaryFile()

bool domainBim::AutomationAPI::writeBinaryFile ( QString  filePath,
const QByteArray &  data 
)

Write any unformatted data to a file.

Parameters
filePathName and path of the file to be written. If no path is given, the current project's path will be used.
dataData to be written to the file
Returns
true if file was written successfully, else false
Since
2.8.2, 2021-04-30

◆ writeFile()

bool domainBim::AutomationAPI::writeFile ( QString  filePath,
const QString &  content,
const QString &  encoding = QString() 
)

Write a string as a whole to a 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
Remarks
2.4.2, 01 mar 2019 : changed behavior when no path is given (using project directory instead of application directory)

◆ writePropertyValueDB()

int domainBim::AutomationAPI::writePropertyValueDB ( const QString &  objIdList,
const QString &  propName,
const QString &  propDataType,
const QString &  propDomain,
const QVariant &  value,
bool  createType = true 
)

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
-6 - error: execution blocked
Since
2.0.16, 16 sep 2017, jh

◆ writeToFile()

bool domainBim::AutomationAPI::writeToFile ( QString  content)

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 Dec 13 2022 13:14:00