Functions | |
TOOLS | |
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) |
void | enableGeoLocation (int msecInterval=60) |
void | disableGeoLocation () |
object | currentGeoPosition () |
string | idListToStr (array< string > idList) |
array< string > | strToIdList (string strIDList) |
TOOLS - FILES | |
object | getFileInfo (string filePath) |
string | getAbsolutePath (string filePath) |
string | getBaseName (string filePath) |
string | getFileName (string filePath) |
APPLICATION | |
string | getApplicationDirectory () |
string | getApplicationFilename () |
string | getApplicationLanguage () |
string | getVersionAsString () |
object | getVersion () |
bool | requireVersion (int major, int minor, int patch) |
PROJECT | |
string | getUserName () |
int | setProjectNumber (string s, bool overwriteExisting=false) |
string | getProjectName () |
int | setProjectShortDescription (string s, bool overwriteExisting=false) |
int | setProjectLongDescription (string s, bool overwriteExisting=false) |
string | getProjectDirectory () |
object | getProjectLocation () const |
object | getProjectInfo () |
DOMAINS | |
string | getDomainByElement (string objId) |
PROPERTIES | |
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) |
var | getPropertyValueByDate (string objId, string propName, string propType, bool inh=true) |
array< object > | getPropertyDateList (string objectId, string propertyBaseName, string propertyType) |
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 () |
LINKS BETWEEN OBJECTS | |
array< string > | getLinkedObjects (string objectIDList, string resultDomains="all", string objectLookupDomains="all") |
OBJECT HIERARCHY | |
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) |
STATUS | |
bool | isVisible (string objId) |
bool | isSelected (string objId) |
bool | isLocked (string objId) |
bool | isWired (string objId) |
GEOMETRY | |
array< object > | getPointList (string objId) |
ALIGNMENTS / REGIONS | |
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) |
ACTIVITIES | |
int | getTaskMode (string taskID) |
string | getTaskVisualisation (string taskID) |
string | getTaskRestrictionsByTask (string taskID) |
LINKRULES | |
int | updateRuleBasedLinks (string domainName, bool visibleOnly=false) |
int | removeRuleBasedLinks (string domainName) |
Signals | |
void | geoPositionUpdated (object pos) |
|
function |
Add days to a given date.
dateStr | Date to add days to, in ISO format (yyyy-MM-dd) |
nrDays | Number of days to add |
|
function |
Calculate global Gauss-Krueger coordinates from GPS coordinates.
Example:
|
function |
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:
|
function |
Returns GPS coordinates as JSON object.
Example:
|
function |
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:
|
function |
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:
|
function |
Calculate hashcode from a given string.
|
function |
Calculate model coordinates from Gauss-Krueger coordinates.
|
function |
Calculate global Gauss-Krueger coordinates from GPS coordinates.
Example:
|
function |
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) |
|
function |
Check regular expression. Wildcards are enabled.
Examples:
|
function |
ID | - An ID is expected in the format 4F3E15A2-0000-2A06-3133-323934363838 |
Example:
|
function |
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. |
|
function |
Create a GUID.
|
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 |
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 |
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):
|
function |
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:
|
signal |
Emitted when current geo position got updated.
Location tracking has to be active, otherwise call desiteAPI.enableGeoLocation.
Example:
|
function |
Example: C:/test/myTextFile.txt -> C:/test
|
function |
|
function |
|
virtualfunction |
|
function |
Example: C:/test/myTextFile.txt -> myTextFile
|
function |
Get calendar week by date. The format of date must be as in the following example:
Example:
|
function |
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. |
|
function |
Get domain by object.
objId | Lookup this object |
Example:
|
function |
Example:
|
function |
Example: C:/test/myTextFile.txt -> myTextFile.txt
|
function |
Get list of (custom) global project properties.
|
function |
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.
|
function |
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 |
|
function |
Get ID of parent element of object with ID 'objId'. If object has no parent, an empty string will be returned.
|
function |
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 |
|
function |
Get points of object as JSON.
objId | ID of geometric element |
|
function |
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 |
|
function |
|
function |
Get project informations as JavaScript object. If no project is opened, most values will be empty.
|
function |
Get geographic location of a project.
|
function |
|
function |
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:
|
function |
If the property is a formula, return the formula. Otherwise the value is returned.
|
function |
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:
|
function |
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() :
|
function |
Get meta data of property type such as display name and unit.
pName | Name of property type |
pType | Data type of property type |
|
function |
Get unit of measurement (unit code)
|
function |
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' |
|
function |
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:
|
function |
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 ';'.
|
function |
Get properties of an object.
filterpattern | Get only property values of types which name fits filterpattern. Default = '*' (all properties) |
Example:
Return:
|
function |
Get all ranges of a regions.
alignmentID | ID of the alignment object |
regionID | ID of the region |
|
function |
Get a list with regions (represented by their IDs) of an alignment with given ID.
alignmentId | ID of the alignment object |
|
function |
Get station (distance from start) of point on alignment. If point is not part of alignment, it will be projected on alignment first!
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) |
|
function |
1 | manually scheduled |
2 | automatically scheduled |
-1 | unable to get task 'taskId' |
-2 | unable to get task mode |
|
function |
Get task restrictions assigned to a task.
taskID | ID of task |
|
function |
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 |
|
function |
|
function |
Get the value assigned to a region.
alignmentID | ID of the alignment object |
regionID | ID of the region |
|
function |
Get DESITE version information as an object.
Example:
|
function |
Get DESITE version information as a string, for example "2.2.1".
|
function |
Build a semicolon-separated string from a list of IDs.
|
function |
Check if an object is locked.
|
function |
Check if a property value is inherited.
|
function |
Check if an object is selected.
|
function |
Objects status which can be visible/hidden, selected/unselected, wireframed, blocked.
Check if an object is visible.
|
function |
Check if an object is in wireframe mode.
|
function |
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) |
|
function |
Remove rule based object links for a given domain.
domainName | Name of domain |
|
function |
Returns true if version of current application is equal or higher than required.
|
function |
|
function |
|
function |
|
function |
Turn a string of semicolon-separated IDs into a list.
|
function |
ifcGuId | - ID in IFC format (base64 encoded, 22 characters) |
|
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) |
Created: Thu Apr 20 2023 10:27:56 |