Functions | |
Project | |
int | setProjectNumber (string s, bool overwriteExisting=false) |
int | setProjectShortDescription (string s, bool overwriteExisting=false) |
int | setProjectLongDescription (string s, bool overwriteExisting=false) |
void | setTempValue (string name, var value) |
var | getTempValue (string name) |
array< string > | getListOfTempValues () |
void | clearListOfTempValues () |
Models | |
string | getModelByElement (string id, string domainFilter="all") |
array< string > | getModelListByName (string name, string domain="geometry") |
array< string > | getModelListByDomain (string domainFilter="all") |
string | getRootNodeByModel (string modelId) |
array< string > | getRootNodeListByDomain (string domainFilter="all") |
array< string > | getRootContainerList (string modelName) |
string | createModel (string name, bool createRootC=true, string domain="geometry") |
object | getModelMetaData (string modelId) |
int | deleteModel (string id) |
var | getModelImportSettings (string modelId) |
Objects / Lookup | |
array< string > | getAllElements (string domainFilter="geometry") |
bool | hasElement (string id) |
array< string > | filterByProperty (array< string > inputList, string propertyName, string propertyDatatype, string filterPattern, bool checkInherited=true, string domains="geometry") |
array< string > | filterByStatus (array< string > inputList, string status, bool value=true, string domains="geometry") |
void | itClear () |
int | itByFilter (string propName, string propDatatype, string filterPattern, bool checkInh=true, string domain="geometry") |
int | itFilterByStatus (string status, bool enabled=true, string domain="geometry") |
int | itByObjectList (string idList) |
string | itGetObjectList () |
bool | itHasNext () |
string | itNext () |
int | itCount () |
void | itToFront () |
array< var > | itGetAvailablePropertyValues (string propName, string propDatatype, int maxValues) |
void | itSetupDbCache (string propName, string propType) |
void | itSetMaterial (string matId) |
void | itColorCode (string propName, string propDT) |
void | itColorCodeNumber (string propName, string propDT, double intervalSize) |
void | itCalcOOBB (double eps) |
void | itUpdateOOBB (double eps) |
void | itCalcOOBBxy (double eps) |
void | itUpdateOOBBxy (double eps) |
string | findContainerByName (string parentId, string name, string lookupDomain="all") |
bool | isContainer (string id) |
Object Manipulation | |
int | startProjectTransaction (string domain="geometry") |
int | endProjectTransaction (string domain="geometry") |
var | createObject (string parentID, object objectMap) |
string | createObjectFromXml (string parentId, string objectXML) |
int | deleteObjects (string idList) |
object | getAsJSON (string objId) |
int | setAsComposite (string id, bool composite) |
Object Links | |
int | setLinkedObjects (string elementID, string IDList) |
int | removeAllLinkedObjects (string id) |
int | removeLinkedObjects (string id, string linkedIdList) |
int | updateRuleBasedLinks (string domainName, bool visibleOnly=false) |
int | removeRuleBasedLinks (string domainName) |
Locking of Objects | |
void | lockObjects (string idList) |
void | unlockObjects (string idList) |
void | unlockAllObjects () |
string | getLocked () |
int | countLocked () |
Object Tooltips | |
array< string > | getListOfObjTooltips () |
void | addObjectListToTooltip (string idList, string tooltipname) |
void | removeObjectListFromTooltip (string idList, string tooltipname) |
Property Types | |
int | createPropertyType (string propName, string propDatatype, string uomCode, bool isInh, int target, string domainName="all") |
int | setPropertyTypeMetaData (string pName, string ptype, object metadata) |
int | deletePropertyType (string propertyName, string propertyDatatype, string domainName="all") |
array< var > | getPropertyTypeBookmarkList () |
object | getPropertyTypeBookmarkByID (string bookmarkId) |
int | activatePropertyTypeBookmark (string bkmId) |
bool | setPropertyTypeActive (string pName, string ptype, string domain, bool active) |
int | setAllPropertyTypesActive () |
int | removePropertyTypeBookmarkByID (string bkmId) |
string | addPropertyTypeBookmark (object bookmarkConfig) |
Properties | |
int | setPropertyValue (string objId, string propName, string propDataType, var value) |
int | deleteProperty (string objId, string propName, string propDatatype) |
array< var > | getPropertyValues (string propName, string propDatatype, int maxValues=0, string domainName="all", bool getNullValues=false) |
array< var > | getPropertyValuesByObjectList (string propertyName, string propertyDatatype, bool checkInherited, var objectIdList, int maxValues=0, string domains="all", bool getNullValues=false) |
object | getPropertyListAsJSON (object options) |
void | setPropertyListAsJSON (object propmap, object opt) |
Property Scripts | |
object | getPropertyScriptList () const |
string | getPropertyScriptCode (string domain, string pname, string datatype) const |
string | getPropertyScriptFgColor (string domain, string pname, string datatype) const |
string | getPropertyScriptBgColor (string domain, string pname, string datatype) const |
int | setPropertyScriptCode (string domain, string pname, string datatype, string code) |
int | setPropertyScriptFgColor (string domain, string pname, string datatype, string code) |
int | setPropertyScriptBgColor (string domain, string pname, string datatype, string code) |
object | addPropertyScript (string domain, string pname, string datatype, string code=string()) |
int | removePropertyScript (string domain, string pname, string datatype) |
void | propertyScriptClearCache (string domain="all", string pname="", string datatype="") |
object | getPropertyScriptOptions (string domain, string pname, string datatype) |
int | setPropertyScriptOptions (string domain, string pname, string datatype, object opt) |
Documents | |
int | synchronizeDocumentContainer (string containerId, bool waitForCompletion=false) |
void | resetDocumentMetaData (string objId) |
array< object > | findDocumentsByLocationGps (double lat, double lon, double distance, array< string > idList=array< string >()) |
array< object > | findDocumentsByLocationRangeGps (array< string > gpsCoordinates, double distance, array< string > idList=array< string >()) |
array< object > | findDocumentsByLocationGk (double rw, double hw, double distance, array< string > idList=array< string >()) |
array< string > | findDocumentsByDate (date start, date end, array< string > idList=array< string >(), bool useRef=false) |
Activities - Calendar | |
string | createCalendar (string name, string comment) |
int | removeCalendar (string calendarID) |
array< string > | getCalendarList () |
string | getCalendarByName (string name) |
string | getDefaultCalendar () |
string | getCalendarByTask (string taskID, bool checkInh=true) |
int | setCalendar (string taskID, string calendarID) |
int | removeCalendarFromTask (string taskID) |
int | setCalendarOptions (string calendarID, object options) |
object | getCalendarOptions (string calendarID) |
array< object > | getCalendarExceptions (string calendarID) |
int | addCalendarExceptions (string calendarID, array< object > exceptions) |
int | removeCalendarException (string calendarID, var date) |
int | clearCalendarExceptions (string calendarID) |
int | setCalendarWorkingTime (string calendarID, object workingTime) |
object | getCalendarWorkingTime (string calendarID) |
int | calcWorkInMinutes (date start, date finish, string calendarID=string()) |
Activities - Task Restrictions | |
array< string > | getTaskRestrictionsList () |
string | getTaskRestrictionsByName (string name) |
int | setTaskRestrictions (string taskID, string restrictionsID) |
int | removeTaskRestrictions (string taskID) |
Activities - Task Visualisations | |
object | getVisualisationList () |
int | setVisualisationByID (string taskIDList, string visID) |
int | removeVisualisation (string taskIDList) |
Activities - Tools | |
int | setTaskMode (string taskID, int mode) |
int | recalculateActivityProject (string taskID=string(), bool visibleOnly=false) |
object | calcPropertyValuesOverTime (string propName, string propType, object options) |
int | createTimeSchedule (object config) |
Geometry | |
int | hasContact (string objId1, string objId2, object options=object()) |
string | createContactObject (string parentId, string objId1, string objId2, string matId, object options=object()) |
array< string > | cutObject (string parentId, string objId, object plane=object(), bool closeCuts=true, bool splitUnconnectedParts=true) |
string | mergeObjects (string parentContainerId, string idList, bool skipClosed=false, bool keepTransparency=false, bool keepCommonProperties=false, bool replaceParent=false) |
bool | isIncludedIn (string objId1, string objId2) |
int | isPointIncludedIn (double x, double y, double z, string objId, double tol=1.e-5) |
int | checkIntersection (string objId1, string objId2, double tolerance=-0.00001) |
int | transformObject (string objId, string transformation) |
int | setAsOpening (string objId, string openingIDList) |
string | getProjectionAsSvg (string idList, object options=object()) |
double | calcDistance (string objId1, string objId2) |
var | calculateDistance (string meshID1, string meshID2) |
int | swapOrientationOfTriangles (array< object > idList) |
Geometry - Materials | |
var | addMaterial (string modelID, var materialData) |
var | setMaterialData (string materialID, var materialData) |
var | getMaterialData (string materialID) |
var | removeMaterial (string materialID) |
string | createMaterial (string matXml, string modelId=string()) |
int | deleteMaterial (string matId) |
array< string > | getMaterialList () |
string | getMaterialAsXmlByID (string matId, bool formatXML=true) |
object | getMaterial (string matId) |
string | getMaterialIDByName (string matName) |
void | updateMaterial (string matId, string xmlMat) |
int | setMaterialToObjects (string matId, var objectIds) |
int | setTransparency (string objectIds, float defaultTransparency=0.95) |
void | resetMaterials (bool updateUI=true) |
void | colorCodeObjects (array< string > objectIds, string propertyName, string propertyDatatype, double intervalSize=1.0) |
Geometry - Color Schema | |
string | createColorSchema (string setContainerId, string name) |
string | createColorSchemaFromCurrentMaterials (string name, bool updateExisting, object options=object()) |
int | deleteColorSchema (string namePattern) |
array< string > | getColorSchemaList () |
string | getCurrentColorSchema () |
bool | activateColorSchemaByName (string name) |
Geometry - Wire Mode | |
void | showWireModeSchema (string name) |
void | clearWireMode () |
void | setObjectsToWireMode (string ids, bool wired) |
string | createWireModeSchema (string ids, string wmName, bool overwrite=false) |
string | getWired () |
int | countWired () |
Geometry - Bounding Box | |
double | getBBoxMinX () |
double | getBBoxMaxX () |
double | getBBoxMinY () |
double | getBBoxMaxY () |
double | getBBoxMinZ () |
double | getBBoxMaxZ () |
void | updateBoundingBox3DView () |
int | calcOOBB (var objectIds, double eps=0.001) |
int | updateOOBB (var objectIds, double eps=0.001) |
int | calcOOBBxy (var objectIds, double eps=0.001) |
int | updateOOBBxy (var objectIds, double eps=0.001) |
object | getBoundingBoxCommon (var objectIds) |
object | getOOBBCommon (var objectIds) |
object | getOOBBxyCommon (var objectIds) |
double | checkOverlapOBB (string id1, string id2, double eps=0.001) |
Selection Sets | |
string | createSelectionSets (string propertyTypes, string rootName, object config=object()) |
array< string > | getRootNodeListSelectionSets (string domainFilter="all") |
int | addToSelectionSetGeometry (string setId, string objectIDList) |
int | removeFromSelectionSetGeometry (string setId, string objectIDs) |
string | createSelectionSet (string name, string parentID=string()) |
bool | removeSelectionSet (string selsetID) |
int | updateSmartSets (array< string > smartSetIDs=array< string >()) |
Regions of Alignments | |
string | addRegionToAlignment (string alignmentId, object setting) |
int | removeAllRegionsFromAlignment (string alignmentId) |
int | addRangeToRegion (string regionId, double fromStation, double toStation, string alignmentId=string()) |
int | removeRangeFromRegion (string regionId, double fromStation, double toStation, string alignmentId=string()) |
int | removeAllRangesFromRegion (string regionId, string alignmentId=string()) |
File Operations | |
int | createDirectory (string path, string dirName) |
bool | writeFile (string filePath, string content, string encoding=string()) |
bool | appendToFile (string filePath, string content, string encoding=string()) |
bool | removeFile (string filePath) |
bool | copyFile (string fnFrom, string fnTo) |
bool | moveFile (string fnFrom, string fnTo) |
bool | checkIfFileExists (string filePath) |
bool | openFile (string filePath, string encoding=string()) |
bool | writeToFile (string content) |
bool | closeFile () |
array< string > | readTextFile (string filename, bool ignoreLineBreakesInDoubleQuotes=false, string codec=string()) |
string | readTextFileAsString (string filePath, string codec=string()) |
var | readFileInChunks (string filePath, object options) |
object | readCsvFile (string filePath, string delimiter=";", string encoding="Windows-1252") |
int | csvOpen (string filePath, string delimiter=";", string encoding="Windows-1252") |
array< string > | csvNextLine () |
bool | csvHasNextLine () |
bool | csvClose () |
string | readImageFile (string filename, string targetFormat="", bool applyExifRotation=false) |
array< object > | getDirectoryEntryList (string dirPath, bool filesOnly=false, string orderBy="Name") |
Database | |
bool | dbIsLocalCopy () |
string | dbGetFilepath () const |
int | dbOpen (const var connectionData=var()) |
bool | dbClose () |
void | dbCheckIn () |
void | dbCheckOut (array< string > propList) |
bool | dbQueryExec (string sqlQuery) |
object | dbQueryRecordset (string sqlQuery, string key, int maxNumberOfRows=0) |
bool | dbEndQueryExec () |
bool | dbQueryNext () |
var | dbQueryValue (int column) |
string | dbQueryLastError () |
int | setPropertyValueDB (string objIdList, string propName, string propDataType, string propDomain, var value, bool createType=true) |
int | writePropertyValueDB (string objIdList, string propName, string propDataType, string propDomain, var value, bool createType=true) |
bool | startTransaction () |
bool | endTransaction () |
bool | dbGetImmediateUpdate () |
void | dbSetImmediateUpdate (bool) |
int | dbClearCache (string propName, string propType) |
void | dbClearCacheAll () |
int | dbDeleteProperty (string objIdList, string propName, string propType) |
int | dbAssertTable (string tableName, array< string > columnsList) |
Model Check / Clash Detection | |
bool | setCheckActive (string checkRunID, bool active) |
int | runCheck (string checkRunID) |
int | clearCheckResults (string checkRunID) |
int | setCheckOptions (string checkRunID, object options) |
object | getCheckOptions (string checkRunID) const |
int | setCheckFilterList (string checkRunID, array< object > filterList, bool rightSet=false) |
array< object > | getCheckFilterList (string checkRunID, bool rightSet=false) const |
int | setCheckItems (string checkRunID, array< string > elementIDist, bool rightSet=false) |
array< string > | getCheckItems (string checkRunID, bool rightSet=false) const |
int | setPostProcessingCode (string checkRunID, string code) |
string | addCheckRule (string checkRunID, object rule, string parentRuleID=string()) |
int | removeCheckRule (string checkRunID, string type, string ruleID) |
int | clearCheckRules (string checkRunID, string ruleTypeFilter=string()) |
object | getCheckRules (string checkRunID, string ruleTypeFilter=string()) |
Geo Location | |
void | enableGeoLocation (int msecInterval=60) |
void | disableGeoLocation () |
object | currentGeoPosition () |
Tools / Miscellaneous | |
int | setBoQBreakdownStructure (string boqModelID, string templateStr) |
int | sortContainerByProperty (string containerId, string propName, string propType, bool ascending=true, int maxDepth=0) |
int | validateIfcCompatibiliy (string bsModelID) |
Functions inherited from CoreAPI | |
string | addDays (string dateStr, int nrDays) |
int | getCalendarWeek (date dt) |
string | createID () |
long | calcHashcode (string str) |
string | compressToIfcGuid (string id) |
string | uncompressFromIfcGuid (string ifcGuid) |
bool | checkRegExp (string value, string pattern) |
double | calcSlantedArea (string objId, double angleMin=0.0, double angleMax=45.0) |
object | calcGpsCoordsByStation (string objId, double station) |
object | calcGpsCoordsByModelCoords (double x, double y) |
object | calcModelCoordsByGpsCoords (double lat, double lon) |
object | calcGkCoordsByModelCoords (double x, double y, double z) |
object | calcModelCoordsByGkCoords (double r, double h) |
object | calcGkCoordsByGpsCoords (double lat, double lon) |
object | calcGpsCoordsByGkCoords (double rw, double hw) |
object | convertCoordinates (object coordinates) |
string | idListToStr (array< string > idList) |
array< string > | strToIdList (string strIDList) |
var | mapToExternalIDs (const array< string > cpIDs) |
var | mapFromExternalIDs (const array< string > cpExternalIDs) |
var | getFileInfo (string filePath) |
string | getAbsolutePath (string filePath) |
string | getBaseName (string filePath) |
string | getFileName (string filePath) |
string | getApplicationDirectory () |
string | getApplicationFilename () |
string | getApplicationLanguage () |
string | getVersionAsString () |
object | getVersion () |
bool | requireVersion (int major, int minor, int patch) |
string | getDomainByElement (string objId) |
string | getUserName () |
string | getProjectName () |
string | getProjectDirectory () |
object | getProjectLocation () const |
object | getProjectInfo () |
array< string > | getContainedElements (string containerId, int maxDepth, bool loadExternal=true) |
int | countContainedElements (string containerId, int maxDepth, bool loadExternal=true) |
string | getParent (string objId) |
array< string > | getOpenings (string objId) |
array< string > | getParts (string objId) |
array< string > | getLinkedObjects (string objectIDList, string resultDomains="all", string objectLookupDomains="all") |
bool | isVisible (string objId) |
bool | isSelected (string objId) |
bool | isLocked (string objId) |
bool | isWired (string objId) |
var | getPropertyValue (string objId, string propName, string propType, bool inh=true) |
array< object > | getPropertyValuesByObject (string objId, string filterpattern="*") |
var | getPropertySource (string objId, string propName, string propType, bool inh=true) |
string | getPropertyUnit (string propName, string propType) |
object | getPropertyTypeMetaData (string propName, string propType) |
array< object > | getPropertyTypeList (string domain="all", string filterPattern="*", bool activeOnly=false) |
array< object > | getPropertyTypeListByObject (string objId, string filterPattern="*") |
bool | isPropertyInherited (string objId, string propName, string propType) |
string | getPropertyValueRange (string idList, string propName, string propType, string domainFilter="geometry") |
var | evaluateFormula (string code, string id, string id_otherdomain=string()) |
string | prepareJsCode (string code, string id, int dec=-1, string frmt="%L1", int fieldWidth=10, QChar fillChar=QChar()) |
array< string > | extractPropertyNames (string code, string startTag="[[", string endTag="]]") |
array< object > | getGlobalProjectProperties () |
array< object > | getPointList (string objId) |
object | getPointOnAlignmentAtStation (string alignmentId, double d) |
double | getStationOfProjectedPoint (string alignmentId, double x, double y, double z=0.0) |
array< string > | getRegionsOfAlignment (string alignmentId) |
array< object > | getRangesOfRegion (string alignmentID, string regionID) |
double | getValueOfAlignmentRegion (string alignmentID, string regionID) |
int | getTaskMode (string taskID) |
string | getTaskVisualisation (string taskID) |
string | getTaskRestrictionsByTask (string taskID) |
Signals | |
void | synchronizationFinished (bool success) |
void | fileChunkReceived (string data) |
void | geoPositionUpdated (object pos) |
|
function |
Activate color scheme with given name (case sensitive). If name is empty, materials will be restored. View will be repainted.
|
function |
|
function |
Set exceptions (user defined days or holidays) to calendar. Existing dates will be overwritten.
calendarID | ID of the calendar |
exceptions | List of exceptions |
|
function |
Add rule to check run. Only Attribute Rules can be nested.
checkRunID | ID of (model) check run |
rule | Object which defines the check rule. For rules of type 'AttributeRule', valid sub-types are 'simple' (no child rules allowed), 'conditional' and 'group'. |
parentRuleID | ID of parent rule (attribute rule groups and conditional rules only) |
Example:
|
function |
Create a new material to change the look of a geometric element in the project.
modelID | ID of the model to assign the new material to. If empty, a default material will be created. |
materialData | material data passed as an object |
Example #1:
Example #2:
|
function |
Add object list to tooltip.
idList | List of objects |
tooltipname | Name of the tooltip template |
|
function |
|
function |
Add property type bookmark.
bookmarkConfig | Bookmark config information map. For format description see getPropertyTypeBookmarkByID() |
|
function |
Add an ADDITIONAL range to a region (a region can have several - possibly disjunct - ranges with the same value).
regionId | ID of region (will be returned if region is successfully added to an alignment) |
fromStation | Lower bound of range |
toStation | Upper bound of range |
alignmentId | ID of alignment. Optional parameter, if given, method is faster, because not all objects have to be searched |
|
function |
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).
alignmentId | ID of alignment |
options | Options, given as json object (see below). |
Example
|
function |
Add objects to selection set in domain 'geometry'.
|
function |
Append a string to a file. User does not need to take care of opening and closing the file.
filePath | Name and path of the file to be written. If no path is given, the current project's path will be used. |
content | Data to be appended to the end of the file |
encoding | File encoding, such as "ISO 8859-1", "UTF-8", or "UTF-16". To write binary data, use "base64" and encode the string accordingly. |
|
function |
Calculate distance between two mesh objects.
objId1 | ID of first object |
objId2 | ID of second object |
|
function |
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.
objectIds | IDs of objects to be affected (array or string, using ';' as separator) |
eps | Threshold for optimization (default: 0.001) |
|
function |
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.
objectIds | IDs of objects to be affected (array or string, using ';' as separator) |
eps | Threshold for optimization (default: 0.001) |
|
function |
Calculate property values over time. Returns an object with a list of property values for each day between startDay and endDay.
Options:
Return:
|
function |
Calculate distance between two mesh objects.
meshID1 | ID of first mesh |
meshID2 | ID of second mesh |
On error (e.g. if one of the two input IDs could not be found or is not a mesh), "closestPoints" and "distance" will be missing from the output.
If the two meshes intersect, "distance" will be 0.0.
|
function |
Calculate working time in minutes between two given dates by specifying a calendar.
start | Start date and time |
finish | Finish date and time |
calendarID | ID of calendar (if empty the default calendar is used) |
|
function |
Checks if a file exists
filePath | Name and path of the file. If no path is given, the current project's path will be used. |
|
function |
Check if two geometric objects intersects.
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. |
|
function |
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).
id1 | ID of first object |
id2 | ID of second object |
eps | Precision for generating missing OOBBs |
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.
|
function |
Removes all exceptions from a calendar.
calendarID | ID of the calendar |
|
function |
Remove all check results from check.
checkRunID | ID of checkRun |
|
function |
Remove all check rules from check run.
checkRunID | ID of (model) check run |
ruleTypeFilter | Type of check rule. If empty, all check rules will be removed.
|
|
function |
Set all objects to normal mode, 3D view will be refreshed.
|
function |
Close an open file. There can only be one open file at once!
|
function |
Assign a distinct color to objects that share a common property value.
For numerical values, an interval can be set.
objectIds | IDs of geometric objects to color-code |
propertyName | Property name |
propertyDatatype | Property data type |
intervalSize | [optional] Interval for grouping numerical property values (xs:int, xs:long, xs:float, xs:double). Will be ignored for properties of other types. Default is 1.0. |
|
function |
Copy file 'fnFrom' to file 'fnTo'.
|
function |
Count locked objects.
|
function |
Count objects which are in wireframe mode.
|
function |
Create a new calendar.
name | Name of calendar (should be unique, must not be empty) |
comment | Comment |
|
function |
Create color schema with given name from the hierarchy (content) given by a container.
setContainerId | ID of container whose content defines the color schema. For each contained container a material is created with the container names. |
name | Name of new color schema. If name already exists it is augmented by an index, e.g. '~(2)'. |
|
function |
Create color scheme with given name from current material settings.
name | Name of new color scheme |
updateExisting | If '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 | See below for possible keys and values |
Options:
|
function |
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.
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. |
|
function |
Create new directory at given file path. Resulting directory path is path + '/' + dirName.
dirName | Name of new directory |
path | File path of directory in which new directory should be created (relative paths are allowed) |
|
function |
Create a new material for visualization. If the material already exists the existing material is not changed.
matXml | Material encoded as XML. If a tag is missing, default values are set. |
modelId | Create a new material in this model, an invalid or empty model ID will create a global material. |
Example:
|
function |
Create a new model in a specified domain.
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.
name | Name of model |
domain | Domain in which the model is created. |
createRootC | If 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!) |
|
function |
Create an object encoded as a JavaScript object map.
If a key "ID" is not given or if the ID is already used, a new ID will be generated.
parentID | ID of parent container |
objectMap | JavaScript object; see examples below |
Error Codes:
Available objects
Examples
The elements "description", "status", "assignedTo", "priority" and "due" are optional. If "status" or "priority" are omitted, default values will be set according to the project configuration.
If the project is configured to only allow a fixed set of values for Priority and/or Status, non-compliant values are replaced by defaults.
IDs of issues must be GUIDs.
See ProjectAPI::getViewpointData() for a full example of all the data fields.
|
function |
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.
parentId | ID of parent element |
objectXML | XML code |
Error Codes:
Available objects
Examples
Available objects
Note: If WBS is empty, it will be automatically created from parent task WBS and child index of the new task.
Examples
Available objects
Available types:
Examples
Create two nested sections in the building structure
Available objects
Examples
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.
Available objects
Examples
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:
Available objects
Examples
Available objects
Examples
ID, prefix and comment are optional.
Available objects
Examples
Available objects
Examples
Available objects
Examples
Available objects
Examples
The elements "description", "status", "assignedTo", "priority" and "due" are optional. If "status" or "priority" are omitted, default values will be set according to the project configuration.
If the project is configured to only allow a fixed set of values for Priority and/or Status, non-compliant values are replaced by defaults.
IDs of issues must be GUIDs.
See ProjectAPI::getViewpointData() for a full example of all the data fields, which then must be adapted into XML elements.
Prefer using createObject(), which accepts data in JavaScript object format rather than XML.
|
function |
uomCode | Unit of Measurement |
target | 1 - Project Repository 2 - Database |
|
function |
name | Name of new Selection Set |
parentID | Parent of new Selection Set. If empty the set is created on top level. |
|
function |
Create selections sets of geometry objects.
For each value of a given property type a selection set is created.
propertyTypes | A 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.
rootName | Name 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. |
config | Object/map containing options.
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 }); |
|
function |
Create a time schedule from building structure and process components (Tools 4D).
config | Calculation settings { 'pcRootID' : 'dab8cd58-e961-4419-87f8-d493261bd540', // ID of process components root node 'bsRootID' : '5c3abb0e-47b4-42e6-91a5-116a3eb38cc8-oh', // ID of building structure root node 'calendarID' : '', // ID of calendar (optional). If empty, the default calendar is used 'projectStart' : '2022-01-03T08:00:00' // Project start date/time (ISO string or Date) (optional). If empty, the current date is used } |
|
function |
Create a wire mode schema for objects.
ids | String of semicolon-separated object IDs |
wmName | Name of new wire-frame mode |
overwrite | If 'true' an existing schema will be overwritten with current settings (default: 'false') |
|
function |
Finish/cleanup of reading a CSV file, started by csvOpen().
|
function |
Checks if CSV file opened by csvOpen() has another line of data.
|
function |
Returns next line of a CSV file initialized by csvOpen().
|
function |
Open text file in CSV format for reading.
filePath | Name and path of file (if path is missing, file is expected in the project directory) |
delimiter | One character as delimiter of cells, most common are semicolon or tab. |
encoding | File Encoding, by default "Windows-1252". Other options are "UTF-8", "UTF-16", "ISO 8859-1". |
|
function |
Returns the current geo position, this is the cached position signaled by geoPositionUpdated.
Location tracking has to be active, otherwise call desiteAPI.enableGeoLocation.
|
function |
Cut object into subparts.
parentId | ID of parent container. If empty, subparts will be added to object. |
objId | ID of object |
plane | Cutting plane encoded as JSON. If not specified, the default values of the code snipped (see below) will be chosen. |
closeCuts | Close mesh of cut parts. |
splitUnconnectedParts | Split cut parts which are not connected (e.g. when cutting an U-shape horizontally). |
Example: Cut object ID="ABCxyz123" by xy-plane (through origin) and append parts to object (parent=""):
|
function |
Check if database has a specific table with certain columns.
tableName | Table name |
columnsList | List of columns specified in the format [columnname columndatatype] |
Example:
|
function |
Database check-in.
|
function |
Check out properties in local database. Only properties which are checked out can be edited. All other properties are locked in local database.
propList | List of properties in such format: propName##propType |
|
function |
|
function |
|
function |
Close the currently connected DB. Returns false if no DB was connected.
|
function |
Delete properties from database.
objIdList | The properties are removed and deleted from these objects. |
|
function |
Free all resources bound to the last dbQueryExec.
|
function |
If the connected DB is file-based, returns the filename and path. Otherwise, an empty string is returned.
|
function |
|
function |
Check if current database is a local copy.
|
function |
Open and connect a project database. Will do nothing if a database connection is already open.
Pass connection data as object.
Example:
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.
|
function |
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().
sqlQuery | Database query as SQL statement |
|
function |
Get the error message that the last executed SQL query returned (if any).
|
function |
Go to next record of last query.
|
function |
Create a database query by SQL statement.
sqlQuery | the SQL query string. |
key | the field name used as key in record set returned. For more than one key value only the last one will be returned. |
maxNumberOfRows | max number of rows in result set returned, left open or 0 for unlimited. |
Example call: desiteAPI.dbQueryRecordset("SELECT matchKey, price FROM tblPrices", "matchKey", 0);
Example:
|
function |
|
function |
|
function |
Remove and delete color scheme by name (pattern).
namePattern | Name 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. |
|
function |
Delete material with given ID. Only materials of the default model which are not used (e.g. by north arrow) can be deleted.
matId | ID of material to be deleted |
|
function |
Delete Model.
Contained elements are removed from all locations where they are used (links, viewpoints, ...) and will be deleted afterwards.
id | ID of model |
|
function |
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, ...)
idList | List of object/container IDs separated by ';' |
|
function |
Delete property 'propName' with data type 'propDatatype' from the element identified by 'objId'.
objId | ID of element. Use 'GlobalProject' to remove and delete a global project property. |
|
function |
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.)
propertyName | Name of property type |
propertyDatatype | Data type of property type |
domainName | Name of domain (default: "all", combinations are allowed) |
|
function |
Disable tracking of your current geo location.
|
function |
Enable tracking of your current geo location, position will be updated by given interval in milliseconds.
|
function |
Finish transaction on project of given domain.
|
function |
Finish database transaction.
|
signal |
Emitted by readFileInChunks() for transmitting data.
|
function |
Apply a property filter on a list of elements.
inputList | Source list of element IDs that the filter will be applied to |
propertyName | Property name |
propertyDatatype | Property data type ('xs:string', 'xs:double', 'xs:long', ...) |
filterPattern | Filter string. This can either be in standard DESITE filter format (supports asterisks, space means OR, not case sensitive) or a Regular Expression in JavaScript notation. |
checkInherited | [optional] Check inherited properties, too (true by default) |
domains | [optional] Domain(s) to be checked ('geometry' by default) |
Example:
Filter and show geometric elements with more than 100 vertices and which names begin with "Basic"
|
function |
Apply a status filter on a list of elements.
inputList | Source list of element IDs that the filter will be applied to |
status | Status as string, one of ['visible', 'selected', 'wired', 'locked'] |
value | [optional] Value of status, either true (default) or false |
domains | [optional] Domain(s) to be checked ('geometry' by default) |
Example:
Filter for selected geometric elements
|
function |
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.
parentId | Parent node ID |
name | Name of the container |
lookupDomain | Lookup container 'name' in this domain, default = 'all' |
|
function |
Get documents where the creation date is between a given range or where the reference date is between a given range.
start | Start of date range |
end | End 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 |
|
function |
Get documents which are located around a given point in Gauss-Krueger coordinates by a given distance.
rw | 'Rechtswert' (x-coordinate) of search point |
hw | 'Hochwert' (y-coordinate) of search point |
distance | Search range |
idList | (optional) List of IDs of documents. If empty, all documents will be considered. |
|
function |
Get documents which are located around a given point in GPS coordinates by a given distance.
lat | Latitude of search point |
lon | Longitude of search point |
distance | Search range |
idList | (optional) List of IDs of documents. If empty, all documents will be considered. |
|
function |
Get documents which are located around a given point list in GPS coordinates by a given distance.
gpsCoordinates | List of GPS coordinates (lat/lon) as string, delimited by ';', e.g. ['51.4556;7.0116',...] |
distance | Search range |
idList | (optional) List of IDs of documents |
|
signal |
Emitted when current geo position got updated.
Location tracking has to be active (call desiteAPI.enableGeoLocation).
Example:
|
function |
Get IDs of all elements as an array.
domainFilter | Get all IDs of given domain(s) |
|
function |
Get geometric object data.
Example:
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:
|
function |
Get maximal x-coordinate of overall bounding box of all geometric objects (visible and hidden) in the project.
|
function |
Get maximal y-coordinate of overall bounding box of all geometric objects (visible and hidden) in the project.
|
function |
Get maximal z-coordinate of overall bounding box of all geometric objects (visible and hidden) in the project.
|
function |
Get minimal x-coordinate of overall bounding box of all geometric objects (visible and hidden) in the project.
|
function |
Get minimal y-coordinate of overall bounding box of all geometric objects (visible and hidden) in the project.
|
function |
Get minimal z-coordinate of overall bounding box of all geometric objects (visible and hidden) in the project.
|
function |
Get common bounding box of all given objects. If an object ID represents a composite (geometric container), all parts of it will be taken into account.
objectIds | IDs of objects to be affected (array or string, using ';' as separator) |
|
function |
Get calendars with given name.
name | Name of calendar |
|
function |
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.
taskID | ID of task |
checkInh | Also check inherited calendars |
|
function |
Get list of calendar exceptions (user defined days or holidays).
calendarID | ID of the calendar |
Example return:
|
function |
Get available calendars.
|
function |
Get default options of calendar.
calendarID | ID of the calendar |
Example return:
|
function |
Get weekly working time.
calendarID | ID of the calendar |
Example return:
|
function |
Get object filter for check- or clash run.
checkRunID | ID of checkRun |
rightSet | In case of clash runs, set filter for left (= false) or right (= true) object set |
|
function |
Get elements (explicitly set) to be processed by check- or clash run. Note: The IDs of the element/containers to be checked are returned, not the IDs of the check items itself
checkRunID | ID of checkRun |
rightSet | In case of clash runs, set filter for left (= false) or right (= true) object set |
|
function |
Get options of a check- or clash run as object.
checkRunID | ID of checkRun |
|
function |
Get check rules of check run.
checkRunID | ID of (model) check run |
ruleTypeFilter | Type of check rule. If empty, all check rules will be returned.
|
|
function |
Get all color schemes.
|
function |
Get current (applied) color scheme.
|
function |
Get default calendar.
|
function |
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:
dirPath | Full path to the directory to scan |
filesOnly | (default false) if this is set to true, subdirectories will not be included in the list |
orderBy | Sort the result list either by "Name" (alphabetically, default), "Size" (largest first), or "Time" (most recently modified first) |
|
function |
Get list of tooltip templates.
|
function |
Get list of temporary values.
|
function |
Get all locked objects.
|
function |
Get material as object.
matId | ID of Material |
Example return:
|
function |
Get material encoded by XML.
matId | ID of Material |
formatXML | enable or disable XML formatting |
|
function |
Retrieve attributes for the passed in material like name or color.
materialID | ID of the material |
|
function |
Get ID of material with given name.
matName | Name of material |
|
function |
Get list of all available materials.
|
function |
Lookup the parent model of the element with the given ID. If the model could not be found, this method returns an empty string.
id | Element 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. |
|
function |
Get settings the model was imported with.
modelID | ID of model |
|
function |
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.
domainFilter | Given domain(s) (default = 'all'). Different domain names have to be separated by ';'. |
|
function |
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'
|
function |
Get meta data of a given model as JSON object.
Keys of JSON object:
|
function |
Calculate the common OOBB of all given objects. 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.
objectIds | IDs of objects to be affected (array or string, using ';' as separator) |
|
function |
Calculate the common OOBBxy of all given objects. 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.
objectIds | IDs of objects to be affected (array or string, using ';' as separator) |
|
function |
Get projection of given geometric objects as SVG.
idList | Given geometric objects, list of IDs separated by ';' |
options | Options as JSON object If an empty JSON object is passed to this method, the size and viewBox is adjusted to the drawn objects. |
Example Options:
resolution - resolution in DPI, default is 72
|
function |
Get list of properties.
This is the same format as the export/import of properties used by the GUI.
opt | Options to configure the export. |
Example:
|
function |
Get code (background) of property script.
|
function |
Get code (value) of property script.
|
function |
Get code (foreground) of property script.
|
function |
Get list of property scripts as JSON object.
Example:
|
function |
|
function |
Get a property type bookmark as an object.
The 'Type' of the bookmark is 1 for User-defined and 2 for Global.
bookmarkId | ID of the bookmark to look up. If the ID isn't found, an empty object is returned. |
|
function |
Return list of property types bookmarks.
Example:
|
function |
Get all available property values for a given property type and domain.
propName | Name of property type |
propDatatype | Data type of property type |
maxValue | Max. number of values which should be returned. If 'maxValue' = 0 all available values will be returned. |
domainName | Name of domain (default: "all", combinations are allowed) |
|
function |
Get all available different property values for a given property type, list of objects and domain.
propertyName | Name of property type |
propertyDatatype | Data type of property type |
checkInherited | true = Consider inherited properties, false = Check direct properties only |
objectIdList | IDs of objects to check property values of |
maxValues | [optional] Max. number of values which should be returned (pass <= 0 for all) |
domains | [optional] Domain(s) to check (default: "all") |
getNullValues | [optional] Set true if result list shall contain NULL values for objects not having this property. |
|
function |
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.
modelName | : Name of the model(s) |
|
function |
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.
|
function |
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.
domainFilter | Given domain(s) (default = 'all'). Different domain names have to be separated by ';'. |
|
function |
Get root nodes of selection sets. These root nodes are the top level selection sets in a domain project.
|
function |
Get first task restriction with given name.
name | Name of task restriction |
|
function |
Get available task restrictions.
|
function |
Retrieve a temporarily stored property.
|
function |
Get list of visualization configurations as JSON object.
Example:
|
function |
Get all objects which are set to wireframe mode.
|
function |
Check if two objects have contact.
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. |
|
function |
Check if an object or container with the given ID exists.
|
function |
Checks if the object with the given ID is a container.
id | : Object ID |
|
function |
Check if object with ID 'objId1' is included in object with ID 'objId2'.
|
function |
Check if point with given coordinates is included in object with ID 'objId'.
x | : x coordinate of point |
y | : y coordinate of point |
z | : z coordinate of point |
objId | : ID of object (mesh or composite) |
tol | : numerical tolerance (The number of decimal places in tolerance should match with the decimal places in coordinate point values) |
|
function |
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).
propName | Property name |
propDatatype | Property data type [xs:string, xs:double, xs:long, ... ] |
checkInh | Check inherited properties |
domain | [ all, geometry, activities, ... ] |
|
function |
Object Iterator is set to objects in idList.
idList | List of Object IDs as String separated by ';'. |
|
function |
Calculate OptOBB of all contained 3D-objects. The bounding box is only calculated if an object has no OOBB.
|
function |
Calculate OptOBBxy of all contained 3D-objects. The bounding box is only calculated if an object has no OOBBxy.
|
function |
Clear and delete an existing object iterator.
|
function |
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().
propName | : property name |
propDT | : property data type |
|
function |
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() ).
propName | : property name |
propDT | : property data type |
intervalSize | : Size of interval |
|
function |
Count the elements in current object iterator.
|
function |
Filter objects in iterator list by their status.
status | Status as string ['visible', 'selected', 'wired' or 'locked'] |
enabled | Value of status [true, false] |
domain | Domain as string to check ['geometry', 'activities', 'documents, 'building', 'boq', 'qto', 'pc', 'cd', 'qa', 'type', 'res', 'all]', combinations are allowed (separated by ';') |
|
function |
Get property values of objects in current object iterator.
|
function |
Get list of IDs of current object iterator.
|
function |
Check if iterator is not at end.
|
function |
Get ID of next element in object iterator.
|
function |
Set material to current objects of iterator.
|
function |
Setup cache for objects in iterator and property 'propname'.
|
function |
Set object iterator before first element. Call itNext(9 to get the first element.
|
function |
Calculate OptOBB of all contained 3D-objects. The bounding box is always calculated.
|
function |
Calculate OptOBB of all contained 3D-objects. The bounding box is always calculated.
|
function |
Locks given objects.
idList | List of IDs of objects to lock (separated by ';') |
|
function |
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.
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 meshes 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. |
|
function |
Move file 'fnFrom' to file 'fnTo'.
|
function |
Open a new file for writing. By default, local 8 bit encoding is used.
To change it, set encoding as optional second parameter.
filePath | Name and path of the file to be opened. If no path is given, the current project's path will be used. |
encoding | File encoding, such as "ISO 8859-1", "UTF-8", or "UTF-16". To write binary data, use "base64". |
|
function |
Clear cache of property scripts.
Calling this function without parameters will clear the entire cache.
|
function |
Read text file in CSV format and return an array of all rows/cells.
filePath | Name and path of file (if path is missing, file is expected in the project directory) |
delimiter | Single character as delimiter of cells, most common are semicolon or tab. |
encoding | File Encoding, by default "Windows-1252". Other options are "UTF-8", "UTF-16", "ISO 8859-1". |
Example:
... returns something like:
|
function |
Read a file and return its contents in chunks via a signal/callback.
Currently, only text files are supported.
The signal fileChunkReceived() will be emitted for each chunk, with its single string parameter containing the data.
After reading is finished, fileChunkReceived() will be emitted one last time with an empty string, indicating EOF (end of file).
Note that for small files (< 64 MB), you can use the more convenient readTextFile().
filePath | Name and path of the file to read. |
options | Object specifying 'encoding' and 'bufferSizeInCharacters' . Please see the example script below. |
Small (but complete) usage example:
|
function |
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.
filename | Name of image file |
targetFormat | Optionally 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 ""). |
applyExifRotation | If 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). |
|
function |
Read text file and return each line as string.
filename | Name of file |
ignoreLineBreakesInDoubleQuotes | |
code | Codec for reading the textfile, one of [ "ISO 8859-1", "UTF-8", "UTF-16" ] |
|
function |
Read text file and return complete content.
filePath | Name (and path) of file |
|
function |
Recalculate projected dates of Activity Project.
taskID | ID of root task. If ID is empty, all time schedules will be considered. |
visibleOnly | Use visible tasks only |
|
function |
Remove all linked objects from the element with the given ID.
id | ID of element |
|
function |
Remove all ranges from region.
regionId | ID of region (will be returned if region is successfully added to an alignment) |
alignmentId | ID of alignment. Optional parameter, if given, method is faster, because not all objects have to be searched |
|
function |
Remove all regions from an alignment with given ID.
|
function |
Removes a calendar. Note: The default calendar cannot be removed.
calendarID | ID of calendar |
|
function |
Remove an exception from a calendar.
calendarID | ID of the calendar |
date | Date as ISO date string or Javascript Date(). When using Javascript Date, consider time differences (GMT). |
|
function |
Remove calendar from task. This will not affect inherited calendars.
taskID | ID of the task |
|
function |
Remove check rule from check run. In case of attribute rules, the ID is required, else the (unique!) name or property type key. (TODO)
checkRunID | ID of (model) check run |
ruleTypeFilter | Type of check rule. If empty, all check rules will be removed.
|
ruleID | ID of check rule (pattern for UniquePattern check) |
|
function |
Remove a file
filePath | Name and path of file to be removed. If no path is given, the current project's path will be used. |
|
function |
Remove objects from selection set in domain 'geometry'.
objectIDs | String containing object IDs, separated by ';'. |
|
function |
Remove links to a given list of objects from another object.
|
function |
Remove the material from the project. This is only applicable to default materials, that are not assigned to a model.
materialID | ID of the material to remove |
|
function |
Removes the object list from tooltip.
idList | List of objects |
tooltipname | Name of the tooltip template |
|
function |
|
function |
|
function |
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]
regionId | ID of region (will be returned if region is successfully added to an alignment) |
fromStation | Lower bound of range |
toStation | Upper bound of range |
alignmentId | ID of alignment. Optional parameter, if given, method is faster, because not all objects have to be searched |
|
function |
Remove rule based object links for a given domain.
domainName | Name of domain |
|
function |
Remove selection set with given ID.
|
function |
Remove task restriction from task.
taskID | ID of task |
|
function |
Remove visualisation configuration from tasks.
taskIDList | IDs of task, separated by semicolon |
|
function |
Forces the MetaDataThreadWorker to reread the meta data of document from URL.
|
function |
Reset all object materials to materials originally imported with the geometry model file.
updateUI | If set to true (default), an active color scheme will be unapplied and the 3D view will be repainted |
|
function |
Run check in domain Model Check or Clash Detection.
checkRunID | ID of checkRun |
|
function |
Set all property types active.
|
function |
Change container with given ID to composite and vice versa.
id | ID of container/composite |
composite | true: set as composite, false: set as container |
|
function |
Set list of objects as opening elements to a given object. Objects in lists which have openings will be skipped.
objId | ID of object for which to set openings |
openingIDList | Objects to set as openings |
|
function |
Set BoQ model structure by template string.
boqModelID | ID of BoQ model |
templateStr | Text with information about the BoQ structure like "1122PPPPI" |
|
function |
Set a calendar for a task.
taskID | ID of the task |
calendarID | ID of calendar |
|
function |
Set default options of calendar.
calendarID | ID of the calendar |
|
function |
Set weekly working time. Existing values will be overwritten, invalid input data will be ignored.
calendarID | ID of the calendar |
workingTime | Object holding weekly working time. |
|
function |
Set check active or inactive
checkRunID | ID of checkRun |
active | true/false |
|
function |
Set object filter for check- or clash run.
checkRunID | ID of checkRun |
filterList | Array holding filters, see below |
rightSet | In case of clash runs, set filter for left (= false) or right (= true) object set |
|
function |
Explicitly set elements to be processed by check- or clash run. This can be done in addition to or instead of an object filter. Setting an empty list will clear the list of checked elements.
checkRunID | ID of checkRun |
elementIDList | Array holding IDs of elements/containers to be checked |
rightSet | In case of clash runs, set filter for left (= false) or right (= true) object set |
|
function |
Set options of a check- or clash run.
checkRunID | ID of checkRun |
options | Object holding options, see below |
Model Check:
Clash Detection:
|
function |
Create a link (relation) between objects.
elementID | ID of element to the linked.object links. The element can be of any domain (like geometry, activity etc). |
IDList | List of objects to be linked to. List must be a semicolon-separated string. Currently, only geometric elements are supported as link targets. |
|
function |
Change attributes for the passed in material like name or color. The name cannot be changed on materials assigned to a model, it is needed for proper re-mapping.
materialID | ID of the material |
materialData | material data passed as an object |
Example #1:
|
function |
Set material to given objects (elements of domain 'geometry').
matId | ID of material |
objectIds | Object IDs to which the material is to be assigned. Can be passed as an array or a string (semicolon-separated). If an ID is an ID of a container, the material is assigned to all contained objects. |
|
function |
Set objects to wire-frame mode based on condition.
ids | String of semicolon-separated object IDs |
wired | true = set objects to wire mode false = set objects to normal mode |
|
function |
Set code for post processing
checkRunID | ID of checkRun |
code | Javascript code |
|
function |
|
function |
|
function |
|
function |
Set list of property values to objects.
propmap | List of properties as JSON object. |
Example: Property List
opt | Options for setting property values. Target: 1: Database 2: Repo 3: Default HandleExisting: 0: overwrite 1: ignore |
Example: Options
|
function |
Set code (background) of property script.
|
function |
Set code (value) of property script.
|
function |
Set code (foreground) of property script.
|
function |
|
function |
domain | Domain(s) for which to set the active status, e.g. "geometry", "geometry;activities", "all" |
|
function |
Set meta data of property type such as display name and unit.
pName | Name of property type |
pType | Data type of property type |
metadata | Object containing data to set |
Example:
|
function |
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
.
objId | ID of element to set the property value to |
propName | Name of the Property |
propDataType | Data Type of the Property in XML notation (for example 'xs:string' or 'xs:long') |
value | Property Value |
|
function |
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.
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 |
Changed in 1.3.0, 30 jan 2014:
Extended signature by parameter 'propDomain'.
|
function |
Set Task Mode:
taskmodeManuallyScheduled = 1, taskmodeAutomaticallyScheduled = 2
To get task mode see class CoreAPI.
|
function |
Set task restrictions for a task.
taskID | ID of the task |
restrictionsID | ID of task restrictions |
|
function |
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.
|
function |
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.
objectIds | String of semicolon-separated IDs of objects to change material of. |
defaultTransparency | Transparency value used (default: 0.95). Existing transparency remains unchanged. |
|
function |
Set visualisation configuration to task.
taskIDList | IDs of task, separated by semicolon |
visID | ID of visualisation |
|
function |
Apply wire mode schema with given name.
name | Name of wire mode schema which should be applied. 'Reset' resets wire mode (draw all objects solid). |
|
function |
Sort the elements of a container (any domain) by their property values of a given type.
The sorting is stable.
containerId | Container to sort the children of |
propName | Property Type name |
propType | Property Type datatype |
ascending | True by default, set to False for descending sort order |
maxDepth | Hierarchy depth (meaning that sub-containers will be sorted, too). A value of 1 would only sort direct children. The default value of 0 will sort all levels. |
|
function |
Start transaction on project of given domain. Use this if you want to create many objects at once.
|
function |
Start database transaction.
|
function |
Swap orientation of triangles.
idList | List of mesh object IDs. |
|
signal |
Emitted when API call synchronizeDocumentContainer() finishes.
|
function |
Synchronizes a document container with the assigned local directory or webservice. A URL or RemoteURL must be set for the container which should be synchronized.
By default, the operation will run asynchronously.
The signal synchronizationFinished
will be emitted on completion, with one bool parameter indicating success or failure.
The optional parameter 'waitForCompletion' can be used to block further script execution until the synchronization has finished. Note that if you call the function from a WebForms context, you will still need to add the await
keyword for this to work.
containerId | : ID of container to synchronize |
waitForCompletion | : if true, blocks script execution until completed (default is false) |
Example (non-blocking):
Example (blocking):
(Note that you can still connect to the synchronizationFinished
signal as in the first example, but it usually won't be very useful.)
|
function |
Rotate, scale, translate object.
objId | ID of object which should be transformed |
transformation | scale, translate, rotate encoded as XML |
Transformation:
|
function |
Unlocks all objects.
|
function |
Unlocks given objects.
idList | List of IDs of objects to lock (separated by ';') |
|
function |
Update overall bounding box of all objects in 3D view.
|
function |
Update material properties such as diffuse, transparency, ...
matId | ID of material |
matXml | New material properties as XML |
|
function |
Update optimized, orientated bounding box (OOBB) of all given geometric objects. It will always be re-calculated.
objectIds | IDs of objects to be affected (array or string, using ';' as separator) |
eps | Threshold for optimization (default: 0.001) |
|
function |
Update optimized, orientated bounding box in xy-plane (OOBBxy) of all given geometric objects. It will always be re-calculated.
objectIds | IDs of objects to be affected (array or string, using ';' as separator) |
eps | Threshold for optimization (default: 0.001) |
|
function |
Update rule based object links for a given domain.
domainName | Name of domain |
visibleOnly | If true, only objects links of visible domain items will be updated (default: false) |
|
function |
Update the Smart Sets with given IDs. If ID list is empty (default), all available Smart Sets will be updated.
|
function |
Checks if a building structure model is valid to be used by geometry export (must fulfill structural conditions).
bsModelID | ID of building structure model |
|
function |
Write a string as a whole to a file.
filePath | Name and path of the file to be written. If no path is given, the current project's path will be used. |
content | Data to be written to the file |
encoding | File encoding, such as "ISO 8859-1", "UTF-8", or "UTF-16". To write binary data, use "base64" and encode the string accordingly. |
|
function |
Write property value to database.
Other than setPropertyValueDB(), this method does not check if the objects given by objIdList exist in the project.
|
function |
Write text to an open file.
content | Content to be written |
Created: Wed Oct 30 2024 09:33:04 |