#include <domainBim/CoreAPI.h>
Public Slots | |
TOOLS | |
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) |
TOOLS - FILES | |
QVariantMap | getFileInfo (QString filePath) |
QString | getAbsolutePath (QString filePath) |
QString | getBaseName (QString filePath) |
QString | getFileName (QString filePath) |
APPLICATION | |
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) |
PROJECT | |
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 () |
DOMAINS | |
QString | getDomainByElement (QString objId) |
PROPERTIES | |
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="]]") |
LINKS BETWEEN OBJECTS | |
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) |
OBJECT HIERARCHY | |
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) |
STATUS | |
bool | isVisible (QString objId) |
bool | isSelected (QString objId) |
bool | isLocked (QString objId) |
bool | isWired (QString objId) |
GEOMETRY | |
QVariantList | getPointList (QString objId) |
ALIGNMENTS / REGIONS | |
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) |
ACTIVITIES | |
int | getTaskMode (QString taskID) |
QString | getTaskVisualisation (QString taskID) |
QString | getTaskRestrictionsByTask (QString taskID) |
LINKRULES | |
int | updateRuleBasedLinks (QString domainName, bool visibleOnly=false) |
int | removeRuleBasedLinks (QString domainName) |
Static Public Attributes | |
static bool | BLOCK_UNSAFE |
This class provides API functions on level 1 which provides the calculation of object properties as well as convenience methods.
Each methods declared in section 'public slots' is accessible by the API.
Core API. Baseclass for all API classes
JavaScript Objectname: desiteAPI
(c) ceapoint aec technologies GmbH
|
slot |
Add days to a given date.
dateStr | Date to add days to, in ISO format (yyyy-MM-dd) |
nrDays | Number of days to add |
|
slot |
Calculate global Gauss-Krueger coordinates from internal model coordinates.
Since the model can be moved and the reference point can be specified by the user, the Gauss-Krueger coordinates can change.
Example:
|
slot |
Returns GPS coordinates as JSON object.
Example:
|
slot |
Calculate global GPS coordinates from internal model coordinates.
Since the model can be moved and the reference point can be specified by the user the GPS coordinates can change.
Example:
|
slot |
Calculates the GPS coordinates by a station situated on an alignment.
The alignment is determined by traversing up the object hierarchy until an object of type 'typeBsAlignment' is found. Therefore each direct and indirect child object of an alignment can be passed to the method. The GPS coordinates are returned as a JSON object, if an error occurs during the calculation, an additional error code is written to the JSON object.
objId | : ID of a bs element |
station | : The station |
Example:
|
slot |
Calculate hashcode from a given string.
|
slot |
Calculate global Gauss-Krueger coordinates from GPS coordinates.
Example:
|
slot |
Calculate the up-facing surface area of an object that is slanted by a given angle (e.g ramps or roofs).
0 <= angleMin <= angleMax <= 180
objId | : ID of object |
angleMin | : Min. deviation angle in relation to vector (0,0,1), default = 0.0 [deg] |
angleMax | : Max. deviation angle in relation to vector (0,0,1), default = 45.0 [deg] (top area criteria) |
|
slot |
Check regular expression. Wildcards are enabled.
Examples:
|
slot |
ID | - An ID is expected in the format 4F3E15A2-0000-2A06-3133-323934363838 |
Example:
|
slot |
Recursively count objects (and containers) in container with given ID.
containerId | Unique ID of container |
maxDepth | Maximum Depth of hierarchy to be traversed, 0 for unlimited |
loadExternal | Load external data of container with given ID if storage type is external and content type is undefined (default: true). Note: Does not work for nested external storage types yet. |
|
slot |
Create a GUID.
|
slot |
Evaluate formula with JavaScript, similar to what you can do in a property.
code | Formula code |
id | Object which is used to get property values in variables such as [[cpPercentComplete##xs:double]] |
id_otherdomain | Object of other domain (yet only domain 'geometry' is supported), e.g. a linked object, the variables must contain the domain. Example: [[cpVolume##xs:double##geometry]] |
Example #1:
Example #2 (with other domain):
|
slot |
Extract variables/properties from a formula/code. A property is enclosed by a start tag and an end tag. By default start tag = '[[' and end tag is ']]'. A property consists of a name and a data type separated by ##.
Example:
Result:
|
inlineslot |
Formats the parameter number v.
Example:
|
slot |
Format date/time
dt | Date/Time to format (The format of QDateTime must be as in the example below:) |
formatstr | Format string. Could be a format string such as YYYY-MM-DD or the predefined format 'iso'. |
Example format strings:
Example code:
Important note: When used in a WebForm, the returned string will always be in Zulu format. For above example:
|
slot |
Example: C:/test/myTextFile.txt -> C:/test
|
slot |
|
slot |
|
virtualslot |
|
slot |
Example: C:/test/myTextFile.txt -> myTextFile
|
slot |
|
slot |
Get calendar week by date. The format of QDateTime must be as in the following example:
Example:
|
slot |
Get URL, User Example:
|
slot |
Get a list of objects contained in the container with the given ID.
All contained containers are traversed recursively and appended to the list as well. If the object 'containerId' could not be found, an empty list is returned.
containerId | Unique ID of container |
maxDepth | Maximum depth of the hierarchy to be traversed, 0 for unlimited |
loadExternal | Load external data of container with given ID if storage type is external and content type is undefined (default: true). Note: Does not work for nested external storage types yet. |
|
slot |
|
slot |
Get domain by object.
objId | Lookup this object |
Example:
|
slot |
Example:
|
slot |
Example: C:/test/myTextFile.txt -> myTextFile.txt
|
slot |
Get objects which are linked to given objects.
Results can be optionally restricted to specific domains.
Passed IDs can be of any domain, but you can optionally use the third parameter to assert that they are of a specific domain or domains.
objectIDList | Objects to check the links of. Note that all passed IDs must be valid or the returned list will be empty. |
resultDomains | [optional] domain filter for linked objects to return. Can be a list (like 'geometry;activities'). Default is 'all'. |
objectLookupDomains | [optional] domain filter for the passed objects (link sources). The method looks up the objects in objectIDList only in these domains. Can also be a list. Default 'all'. |
Examples:
Same as above, but only linked geometric objects are retrieved.
Same as above, but it is ensured that the passed IDs identify tasks (objects of domain 'activities').
Note that you will rarely (if ever) need the third parameter as you usually know which kinds of IDs you're passing.
|
slot |
Get geographic location of project.
Example return value:
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
Get 3D objects which are linked to types (objects in domain 'types') given by an list of IDs.
|
slot |
Retrieves all opening objects (if any) for a given object. Openings are sub-elements of a given object.
objId | Object for which to get openings of |
|
slot |
Get ID of parent element of object with ID 'objId'. If object has no parent, an empty string will be returned.
|
slot |
Get IDs of parts (result of a cut) of object with ID 'objId'. If object has no parts, an empty array will be returned.
objId | ID of object |
|
slot |
|
slot |
Get points of object as JSON.
objId | ID of geometric element |
|
slot |
Get point on alignment at specified station length as JSON. If length > alignment length, the end point will be returned.
Station start is not taken into account and has to be substracted from d. See desiteAPI.getPropertyValue(alignmentId, "Alignment:StationStart", "xs:double");
alignmentId | Alignment Object ID |
d | Distance from start |
|
slot |
|
slot |
|
slot |
Get project informations as JavaScript object. If no project is opened, most values will be empty.
|
slot |
Get geographic location of a project.
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
Get Project Version Number.
|
slot |
Get a list of dates for a given property.
If a time is not specified for a certain property the time is set to 12:00 by default. (Consider the time shift to your local time.)
propertyBaseName | Name of the Property Type without the date suffix. For example, if you have "myProp@2019-08-13" and "myProp@2019-08-12", pass "myProp" ("myProp@" will also work). |
Example
Output:
|
slot |
Get list of dates for a given property as JSON object.
If a time is not specified for a certain property the time is set to 12:00 by default. (Consider the time shift to your local time.)
Example
Output:
|
slot |
Example:
|
slot |
Get last date/time of a property. If the property has no dates the current date/time is returned.
The dates are defined by the concatenation of the property name and the date separated by an @.
Example:
|
slot |
If the property is a formula, return the formula. Otherwise the value is returned.
|
slot |
Get available property types for a given domain combination and a specified filter pattern.
domain | Domain or domains (semicolon-separated) for lookup (default "all") |
filterPattern | Filter properties by name. Wildcards are supported. |
activeOnly | If set to true, the returned list will only contain Property Types which are active in at least one of the given domains. |
Example for return format:
|
slot |
Get available property types for a given object ID and a specified filter pattern.
objId | ID of the object to look up property types for. |
filterPattern | Filter properties by name. Wildcards are supported. |
Example for return format:
Analogous to getPropertyTypeList() :
|
slot |
Get meta data of property type such as display name and unit.
pName | Name of property type |
pType | Data type of property type |
|
slot |
Get available property types for a given domain combination.
filterPattern | Filter properties by name. Wildcards are supported. |
Example for return format:
|
slot |
Get available property types for object 'objId'.
filterPattern | Return only property types which name matches filterPattern |
Example for return format:
|
slot |
Get unit of measurement (unit code).
|
slot |
Get unit of measurement (unit code)
|
slot |
Get property value for a loop of visible objects.
To access project properties use 'GlobalProject
' as objId. Built-in properties can be retrieved as well as user defined properties.
Built-in global project properties:
Example
inh | : Check inherited property values. Default is 'true' |
|
slot |
Get property value for a single object. Convert result to String. This method returns a valid result even if the property or the object does not exist.
|
slot |
Get a propertyValue at a specific date/time. The method returns the value of the last date/time before the given timestamp. If no timestamp is given, the latest value is returned.
Example:
|
slot |
Get available property values for visible objects.
|
slot |
Get property values/range for a list of objects for specified domain(s).
A range is formatted as [<minValue>/<maxValue>], e.g. [-3,000/2,000].
The values of different domains are concatenated and separated by ';'.
|
slot |
Get properties of an object.
filterpattern | Get only property values of types which name fits filterpattern. Default = '*' (all properties) |
Example:
Return:
|
slot |
Get all ranges of a regions.
alignmentID | ID of the alignment object |
regionID | ID of the region |
|
slot |
Get a list with regions (represented by their IDs) of an alignment with given ID.
alignmentId | ID of the alignment object |
|
slot |
|
slot |
|
slot |
Get station (distance from start) of a given point related to the alignment.
Station start is not taken into account and must be added. See desiteAPI.getPropertyValue(alignmentId, "Alignment:StationStart", "xs:double");
alignmentId | Alignment Object ID |
x | x-coordinate of point to check |
y | y-coordinate of point to check |
z | z-coordinate of point to check (optional) |
|
slot |
1 | manually scheduled |
2 | automatically scheduled |
-1 | unable to get task 'taskId' |
-2 | unable to get task mode |
|
slot |
Get task restrictions assigned to a task.
taskID | ID of task |
|
slot |
Get tasks which are linked to 3D objects.
|
slot |
Get task visualisation configuration assigned to a task. Also inherited visualisations are checked. Note: If no visualisation is explicitly assigned to a task, the ID of the default visualisation (named "...") will be returned.
taskID | ID of task |
|
slot |
|
slot |
|
slot |
Get the value assigned to a region.
alignmentID | ID of the alignment object |
regionID | ID of the region |
|
slot |
Get DESITE version information as an object.
Example:
|
slot |
Get DESITE version information as a string, for example "2.2.1".
|
slot |
Get DESITE patch version number.
|
slot |
Get DESITE major version number.
|
slot |
Get DESITE minor version number.
|
slot |
Build a semicolon-separated string from a list of IDs.
|
slot |
Check if an object is locked.
|
slot |
Check if a property value is inherited.
|
slot |
Check if an object is selected.
|
slot |
Objects status which can be visible/hidden, selected/unselected, wireframed, blocked.
Check if an object is visible.
|
slot |
Check if an object is in wireframe mode.
|
slot |
Prepare a formula, i.e. JavaScript code, by replacing variables.
code | Code of formula |
id | ID of object which provides property values. |
dec | Number of decimals, -1 = all decimals |
frmt | Format to format numbers (see Qt) |
|
slot |
Remove rule based object links for a given domain.
domainName | Name of domain |
|
slot |
Returns true if version of current application is equal or higher than required.
|
slot |
|
slot |
|
slot |
|
slot |
Turn a string of semicolon-separated IDs into a list.
|
slot |
If format is empty, get current date/time in format: yyyy-MM-ddThh-mm-ss.
If format is 'ISO', then timestamp is formatted as ISO format (yyyy-MM-ddThh:mm:ss), otherwise format specifies the format of the returned time.
|
slot |
ifcGuId | - ID in IFC format (base64 encoded, 22 characters) |
|
slot |
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) |
Created: Tue Dec 13 2022 13:14:00 |