COLNEO Pro 1.0
Loading...
Searching...
No Matches
CoreAPI

Description

Core API interface.

This API bundles the core functionality.
It is accessed via the API object 'cnCoreAPI'.

Since
1.0, May 2025

Functions

OBJECTS
ApiJsonResponse getObjects (QStringList &domains=QStringList()<< "all")
 
ApiJsonResponse filterObjectsByProperties (QStringList &objectIds, QVariant &propertyFilter)
 
ApiJsonResponse filterObjectsByStatus (QStringList &objectIds, QString &statusCode, bool statusFlag=true)
 
ApiJsonResponse createObject (QString &parentId, QVariantMap &data)
 
ApiJsonResponse createCube (QString &parentId, QList< double > &center, double a)
 
ApiJsonResponse deleteObjects (QStringList &objectIds)
 
MODELS
ApiJsonResponse getModels (QStringList &domains=QStringList()<< "all")
 
ApiJsonResponse getModelMetaData (QString &modelId)
 
ApiJsonResponse createModel (QString &name, QString &domainCode, QVariantMap &settings=QVariantMap())
 
ApiJsonResponse deleteModel (QString &modelId)
 
ApiJsonResponse importModel (QString &filepath, QVariantMap &importOptions=QVariantMap())
 
ApiJsonResponse exportModels (QString &filePath, QList< QString > &modellist, QVariantMap &options)
 
HIERARCHIES / DOMAINS
ApiJsonResponse getParent (QString &objId)
 
ApiJsonResponse getChildren (QString &objId, int depth=0)
 
ApiJsonResponse getRootNodeOfTreeStructures (QString &domainCode)
 
PROPERTIES
ApiJsonResponse getPropertyValue (QStringList &objIds, QString &name, QString &xsDataType)
 
ApiJsonResponse setPropertyValue (QStringList &objIds, QString &name, QString &xsDataType, QVariant &value)
 
ApiJsonResponse getProperties (QString &objId, QVariantMap &filter=QVariantMap())
 
ApiJsonResponse setProperties (QStringList &objIds, QVariantMap &propertyMap)
 
PROPERTY TYPES
ApiJsonResponse getPropertyTypesByObject (QString &objId, QVariantMap &filter=QVariantMap())
 
ApiJsonResponse getPropertyTypeValues (QString &name, QString &xsDataType, QVariantMap &options=QVariantMap())
 
ApiJsonResponse getPropertyTypes ()
 
ApiJsonResponse createPropertyType (QVariantMap &data, bool updateExisting)
 
ApiJsonResponse deletePropertyType (QString &ptkeyAsString)
 
RELATIONS
ApiJsonResponse getLinkedObjects (QStringList &sourceIds, QVariantMap &options=QVariantMap())
 
ApiJsonResponse linkObjects (QStringList &sourceIds, QStringList &targetIds, QVariantMap &linkData=QVariantMap())
 
ApiJsonResponse unlinkObjects (QStringList &sourceIds)
 
OBJECT STATUS
ApiJsonResponse getVisible (QStringList &domains=QStringList()<< "all")
 
ApiJsonResponse setVisible (QStringList &objIds, bool flag, bool exclusively=false)
 
ApiJsonResponse setVisibleAll (bool statusFlag, QStringList &domains=QStringList()<< "all")
 
ApiJsonResponse toggleVisibility (QStringList &objIds)
 
ApiJsonResponse isVisible (QString &objId)
 
ApiJsonResponse getSelected (QStringList &domains=QStringList()<< "all")
 
ApiJsonResponse setSelected (QStringList &objIds, bool flag, bool exclusively=false)
 
ApiJsonResponse setSelectedVisible (bool flag)
 
ApiJsonResponse toggleSelection (QStringList &objIds)
 
ApiJsonResponse isSelected (QString &objId)
 
ApiJsonResponse clearSelection (QStringList &domains=QStringList()<< "all")
 
STYLES
ApiJsonResponse getStyles ()
 
ApiJsonResponse getStyleData (QString &styleId)
 
ApiJsonResponse createStyle (QVariantMap &styleData)
 
ApiJsonResponse updateStyle (QString &styleId, QVariantMap &styleData)
 
ApiJsonResponse deleteStyles (QStringList &styleIds)
 
ApiJsonResponse setStyle (QStringList &objectIds, QString &styleId)
 
ApiJsonResponse resetStyles (QStringList &objectIds=QStringList(), QVariantMap &filter=QVariantMap())
 
GEOMETRY
ApiJsonResponse getGeometry (QString &objId, QStringList &filter=QStringList())
 
ApiJsonResponse setGeometry (QString &objId, QVariantMap &geometryData)
 
SMARTSETS
ApiJsonResponse getRootNodeOfSmartSets (QString &domainCode)
 
ApiJsonResponse createSmartSet (QString &domainCode, QStringList &objIds)
 
ApiJsonResponse addObjectsToSmartSet (QString &smartSetId, QStringList &objIds)
 
ApiJsonResponse removeObjectsFromSmartSet (QString &smartSetId, QStringList &objIds)
 
ApiJsonResponse createSmartSet (QString &domainCode, QStringList &objIds, QStringList &propertyTypeKeys, QVariantMap &options=QVariantMap())
 
ApiJsonResponse updateSmartSet (QString &setId)
 
ApiJsonResponse createSmartSetBySchema (QString &domainCode, QStringList &rootObjectIds, QVariantMap &schema, QString &treeRuleId=QString())
 
ApiJsonResponse createColorSchemaFromSmartSet (QString &setId, QVariantMap &options=QVariantMap())
 
ApiJsonResponse createStyles (QString &smartSetId, QVariantMap &options=QVariantMap())
 
ApiJsonResponse activateStyles (QString &smartSetId, QStringList &objIds=QStringList())
 
TOOLS

Events

STATUS NOTIFICATIONS
 selectionStateChanged ()
 
 visibilityStateChanged ()
 
 lockedStateChanged ()
 
 wireFrameStateChanged ()
 
 statusChanged (QString &statusType)
 
MISCELLANOUS NOTIFICATIONS
 progressChanged (QVariantMap &progressObject)
 

Public Member Functions

Constructors/Destructor
Interface IApiObject
QString & getApiObjectName ()
 

Function Documentation

◆ activateStyles

ApiJsonResponse activateStyles ( QString & smartSetId,
QStringList & objIds = QStringList() )
slot

Activate...

Parameters
smartSetIdId of smartset
objIds
Returns
...
Since
1.0.0

◆ addObjectsToSmartSet

ApiJsonResponse addObjectsToSmartSet ( QString & smartSetId,
QStringList & objIds )
slot
Since
1.0, May 2025, sl

◆ clearSelection

ApiJsonResponse clearSelection ( QStringList & domains = QStringList()<< "all")
slot

Set all objects to 'unselected'.

Parameters
domainsList of domains to be taken into account. Available domains can be found here : Domains
Since
1.0, May 2025, jh

◆ createColorSchemaFromSmartSet

ApiJsonResponse createColorSchemaFromSmartSet ( QString & setId,
QVariantMap & options = QVariantMap() )
slot

...

Parameters
setIdID of smart set.
options...
Returns
Since
1.0.0

◆ createCube

ApiJsonResponse createCube ( QString & parentId,
QList< double > & center,
double a )
slot

Create a cube with the given edge length and center.

Parameters
parentIdId of parent object
centerCenter point of cube [x, y, z]
aEdge length of the cube
Remarks
Only for testing!

◆ createModel

ApiJsonResponse createModel ( QString & name,
QString & domainCode,
QVariantMap & settings = QVariantMap() )
slot

Create a model in the specified domain.

Parameters
nameName of model
domainCodeDomain short code, e.g. 'geo'
settings? (to specify)
{
...
}
Returns
ID of the newly created model
data : string
Since
1.0, Apr 2025

◆ createObject

ApiJsonResponse createObject ( QString & parentId,
QVariantMap & data )
slot

Create an object. If the parent does not fit (e.g. wrong domain), nothing happens.

Parameters
parentIdId of parent object
dataObject data given in JSON notation
{
info: {
object_type : "geo_container"
object_name : "MyObject",
//object_id : null,
},
properties: {
...
},
geometry: {
...
}
}
Returns
ID of the newly created object
data : string
Since
1.0, May 2025

◆ createPropertyType

ApiJsonResponse createPropertyType ( QVariantMap & data,
bool updateExisting )
slot

Create a new property type.
Property types are identified by their name and datatype.
Values of properties can be restricted: To a selection (list entries) or the matching of a regular expression.

Parameters
data
Example 1:
{
name: "MyLength",
datatype: "xs:double",
unit: "m"
}
Example 2:
{
name: "TrafficLight",
datatype: "xs:string",
values: ["red", "yellow", "green"]
readOnly: true
}
updateExisting
Returns
Since
1.0.0

◆ createSmartSet [1/2]

ApiJsonResponse createSmartSet ( QString & domainCode,
QStringList & objIds )
slot

Create SmartSet from object list.

Parameters
domainCodeCreate SmartSet in this domain, objects in list 'objIds' of this domain are taken into account only
objIdsObject list
Since
1.0, May 2025, jh

◆ createSmartSet [2/2]

ApiJsonResponse createSmartSet ( QString & domainCode,
QStringList & objIds,
QStringList & propertyTypeKeys,
QVariantMap & options = QVariantMap() )
slot

Create a smart set by property type keys.

Parameters
domainDomain (short code) in which the smart set should be created. Objects in list must match this domain, if not domain equals "all".
objIdsList of object IDs (only tree nodes, children will be automatically processed). If empty, all objects of the given domain will be taken into account.
propertyTypeKeysList of property type keys (name##xsdatatype)
optionsOptions
{
precision: 4,
intervalSize: null,
...
}
Returns
ID of new smart set
Since
1.0, May 2025

◆ createSmartSetBySchema

ApiJsonResponse createSmartSetBySchema ( QString & domainCode,
QStringList & rootObjectIds,
QVariantMap & schema,
QString & treeRuleId = QString() )
slot

Create a smart set by a property schema tree structure.

Parameters
domainDomain (short code) in which the smart set should be created. Objects in list must match this domain, if not domain equals "all".
rootObjectIdsList of object IDs (only tree nodes, children will be automatically processed). If empty, all objects of the given domain will be taken into account.
schemaSchema as defined in cn_properties on infohub
treeRuleIdID of tree rule which should be applied. If empty, all trees will be created.
Returns
ID of root smart set containers created
Since
1.0
Remarks
NEEDS TESTING

◆ createStyle

ApiJsonResponse createStyle ( QVariantMap & styleData)
slot

...

Parameters
styleData
{
}
Returns
Since
1.0.0

◆ createStyles

ApiJsonResponse createStyles ( QString & smartSetId,
QVariantMap & options = QVariantMap() )
slot

This method creates a distinc style (color) for each sub container of a given smart set

Parameters
smartSetId
options
Returns
Since
1.0.0

◆ deleteModel

ApiJsonResponse deleteModel ( QString & modelId)
slot

Delete a model. All objects and properties coming with this model are also deleted. Handle with care!

Parameters
modelIdID of the model
Returns
True, if model could be deleted, else false.
data : boolean
Since
1.0, Apr 2025

◆ deleteObjects

ApiJsonResponse deleteObjects ( QStringList & objectIds)
slot

Delete objects.

Parameters
objectIdsSingle object ID or list of object IDs.
Returns
Number of objects deleted
data : number
Since
1.0.0

◆ deletePropertyType

ApiJsonResponse deletePropertyType ( QString & ptkeyAsString)
slot

... Warning: if a property type is deleted, all properties with this key are removed from objects

Parameters
ptkeyAsString
Returns
Since
1.0.0

◆ deleteStyles

ApiJsonResponse deleteStyles ( QStringList & styleIds)
slot

...

Parameters
styleIdsStyle object ID or list of style object IDs.
Returns
Since
1.0.0

◆ exportModels

ApiJsonResponse exportModels ( QString & filePath,
QList< QString > & modellist,
QVariantMap & options )
slot

Write models to specified file in cnJSON-format.

Parameters
filePathFull file path, e.g "C:/MyModels/Test.cnjson"
modellistList of all model IDs that are to be exported. If the ID does not belong to a model, nothing is exported
options? (to specify)
Since
1.0, May 2025

◆ filterObjectsByProperties

ApiJsonResponse filterObjectsByProperties ( QStringList & objectIds,
QVariant & propertyFilter )
slot

Filter objects by property values

Parameters
objectIdsBase object set. Apply filter to this set of objects. Single object ID or list of object IDs.
propertyFilterList of filter conditions
[
{
ptkey: "icf:Entity##xs:string",
op: "in",
value: ["IfcWall", "IfcWallStandardCase"]
},
{
ptkey: "cnVolume##xs:double",
operand: ">=",
value: 2.5
}
]
Returns
List of IDs of objects from the base set which matches the filter criteria
data : Array<string>
Since
1.0, May 2025, sl

◆ filterObjectsByStatus

ApiJsonResponse filterObjectsByStatus ( QStringList & objectIds,
QString & statusCode,
bool statusFlag = true )
slot

Filter objects by status, e.g. "visible", or a status combination.

Parameters
objectIdsList with objects IDs or single ID as string.
statusCodeOne of [ 'selected', 'visible' , 'wired' , 'locked' ]
statusFlagtrue: status, false: inverted status
Returns
List of IDs of objects from the base set which matches the filter criteria
data : Array<string>
Since
1.0, May 2025, sl

◆ getApiObjectName()

QString & getApiObjectName ( )
Returns
'cnCoreAPI'

◆ getChildren

ApiJsonResponse getChildren ( QString & objId,
int depth = 0 )
slot
Note
Usable with script properties

Get children of object with given id recursivly up to given depth.

Parameters
objIdID of the object
depth[optional] Recursion depth, default = 0 (maximum depth).
Returns
List of IDs of child objects.
data : Array<string>
Since
1.0.0

◆ getGeometry

ApiJsonResponse getGeometry ( QString & objId,
QStringList & filter = QStringList() )
slot

Get geometry data of object.
Vertices, triangles, triangle normal are provided as plain arrays.

Parameters
objId
filterList of keys which should be returned
['vertices', 'triangles', 'edges']
Returns
Object in JSON with geometric data.
{
"vertices": [
0.0, 0.0, 0.0,
1.0, 0.0, 0.0,
1.0, 1.0, 0.0,
0.0, 1.0, 0.0
],
"triangles": [
0, 1, 2,
2, 3, 0
}
"edges": [
0, 1,
1, 2,
2, 3,
3, 0
}
}
Since
1.0.0

◆ getLinkedObjects

ApiJsonResponse getLinkedObjects ( QStringList & sourceIds,
QVariantMap & options = QVariantMap() )
slot
Note
Usable with script properties

Get all objects linked to given objects.

Parameters
sourceIds
options
{
...
}
Returns
List of Ids
{
data: string
}
Since
1.0.0

◆ getModelMetaData

ApiJsonResponse getModelMetaData ( QString & modelId)
slot
Note
Usable with script properties

Get the metadata of a model.

Parameters
modelIdID of model
Returns
Meta data as JSON
data : {
createdOn : "",
createdBy : "",
importedOn : "2022-05-24T12:00:00.000z",
importedBy : "User",
sourceFileName : "C:/User/test.cpixml";
sourceApplication : "ExternalApp";
sourceFormat : "cpixml"
sourceFormatVersion : "1.7",
sourceId : ""
}
Since
1.0, Apr 2025

◆ getModels

ApiJsonResponse getModels ( QStringList & domains = QStringList() << "all")
slot
Note
Usable with script properties

Get list of models, filtered by domains.

Parameters
domainsDomain short code or combination as array, e.g. 'all' or [ 'geo', 'act' ]
Returns
Array with IDs of all models that matches the given options
data : Array<string>
Since
1.0, Apr 2025

◆ getObjects

ApiJsonResponse getObjects ( QStringList & domains = QStringList() << "all")
slot
Note
Usable with script properties

Get objects.

Parameters
domainsDomain short code or combination as array, e.g. 'all' or [ 'geo', 'act' ].
See a list of domains here: Domains
Returns
List of object IDs.
data : Array<string>
Since
1.0, May 2025

◆ getParent

ApiJsonResponse getParent ( QString & objId)
slot
Note
Usable with script properties

Get parent of object with given ID.

Parameters
objIdID of the object
Returns
ID of parent object, empty string if object has no parent
data : string
Since
1.0

◆ getProperties

ApiJsonResponse getProperties ( QString & objId,
QVariantMap & filter = QVariantMap() )
slot
Note
Usable with script properties

Get map of properties of a given object.

Parameters
objIdID of the object.
filter[optional] Filter specification for getting properties. If defined the filter affects the name and data type of the fetched properties.
{
name: "MyNumber",
datatype : ["xs:double", "xs:float"]
}
Returns
Object with property type keys and values in JSON, e.g.:
data : {
"MyName##xs:string": "John",
"MyAge##xs:int": 42,
"IsMale##xs:boolean": true
}
Since
1.0, May 2025

◆ getPropertyTypes

ApiJsonResponse getPropertyTypes ( )
slot

Get a list of all available property types.

!! CHECK AGAINST METHOD getPropertyTypeValues

Since
1.0.0

◆ getPropertyTypesByObject

ApiJsonResponse getPropertyTypesByObject ( QString & objId,
QVariantMap & filter = QVariantMap() )
slot
Note
Usable with script properties

Get property types of an given object.

Parameters
objIdID of object.
filter[optional] Filter settings for getting property type. The filter the listed attributes (keys) of the fetched property types.
{
name: 'numb*',
datatypes: ['xs:double', 'xs:float']
readOnly: true
}
Returns
data : [
{
name: "cnName",
displayName: "cn:Name",
datatype: "xs:string",
readonly: true,
...
}
]
Since
1.0, May 2025

◆ getPropertyTypeValues

ApiJsonResponse getPropertyTypeValues ( QString & name,
QString & xsDataType,
QVariantMap & options = QVariantMap() )
slot

Get property values of a given property type.

Parameters
nameName of property
xsDataTypeData type of property
options
{
objects: [...], // If the key is specified, only the listed objects are taken into account, otherwise all objects
precision: 0.0001, // applies only to floating point numbers
interval_size: 0, // applies only to numbers
interval_offset: 0, // applies only to numbers
date_grouping: 'week', // applies only to dates, one of ['day','week', 'month', 'year']
max_values: 0
}
Returns
List of unique property values
data : Array<any>
Since
1.0.0

◆ getPropertyValue

ApiJsonResponse getPropertyValue ( QStringList & objIds,
QString & name,
QString & xsDataType )
slot
Note
Usable with script properties

Get property value for a one or more objects and property type.

Parameters
objIdsObject ID or list of object IDs
nameName of property.
xsDataTypeDatatype of property, one of
  • 'xs:string'
  • 'xs:double'
  • 'xs:float'
  • 'xs:long'
  • 'xs:int'
  • 'xs:boolean'
  • 'xs:ID'
  • 'xs:IDREF'
  • 'xs:anyURI'
  • 'xs:dateTime'
  • 'xs:date'
  • 'xs:object'
Returns
Value of property, depending on the datatype. In case of xs:object JSON.parse() will be called internally and an javascript object returned.
data : simple datatype | object
Since
1.0.0

◆ getRootNodeOfSmartSets

ApiJsonResponse getRootNodeOfSmartSets ( QString & domainCode)
slot

Get (invisible) root object of smart set tree structure.

Parameters
domainCodeCreate SmartSet in this domain, objects in list 'objIds' of this domain are taken into account only
Since
1.0, May 2025, sl

◆ getRootNodeOfTreeStructures

ApiJsonResponse getRootNodeOfTreeStructures ( QString & domainCode)
slot

...

Parameters
domainCode
Returns
{
data: string
}
Since
1.0.0

◆ getSelected

ApiJsonResponse getSelected ( QStringList & domains = QStringList()<< "all")
slot

Get objects with status 'selected'.

Parameters
domainsDomain short code or domain combination as array, e.g. ["geo, "act"]
Returns
List of IDs of selected objects.
data: Array<string>
Since
1.0

◆ getStyleData

ApiJsonResponse getStyleData ( QString & styleId)
slot

...

Parameters
styleId
Returns
{
name: ""
color: "#AARRGGBB"
}
Since
1.0.0

◆ getStyles

ApiJsonResponse getStyles ( )
slot

...

Returns
List of IDs
Since
1.0.0

◆ getVisible

ApiJsonResponse getVisible ( QStringList & domains = QStringList()<< "all")
slot

Get objects with status 'visible'.

Parameters
domainsDomain short code or domain combination as array, e.g. ["geo, "act"]
Returns
List of IDs of the visible objects in the specified domains.
data: Array<string>
Since
1.0

◆ importModel

ApiJsonResponse importModel ( QString & filepath,
QVariantMap & importOptions = QVariantMap() )
slot

Imports a model in IFC, cpixml or cnJSON format

Parameters
filepathThe file path of the model file, e.g "C:/MyModels/Test.ifc"
importOptionsImport options
{
transformation: {
dx: 0.0,
dy: 0.0,
dz: 0.0,
}
}
Returns
ID of imported model, else empty string if an error occured.
{
data : ' ... modelID ...' // string
}
Since
1.0, May 2025

◆ isSelected

ApiJsonResponse isSelected ( QString & objId)
slot
Note
Usable with script properties

Check if an object is selected.

Parameters
objIdID of object
Returns
True, if object is selected, else false.
data: boolean
Since
1.0

◆ isVisible

ApiJsonResponse isVisible ( QString & objId)
slot
Note
Usable with script properties

Check if an object is visible.

Parameters
objIdID of object
Returns
True, if object is visible, else false.
data: boolean
Since
1.0, May 2025

◆ linkObjects

ApiJsonResponse linkObjects ( QStringList & sourceIds,
QStringList & targetIds,
QVariantMap & linkData = QVariantMap() )
slot

Link objects given in sourceIds to objects given in targetIds (link is bidirectional).

Parameters
sourceIdsID (string) or list of IDs (array)
targetIdsID (string) or list of IDs (array)
linkData...
{
}
Returns
number of linked objects
Since
1.0.0

◆ lockedStateChanged

lockedStateChanged ( )
signal

This signal is emitted when the locked state of objects has changed. Connect the signal to a javascript function after the web page is loaded.

cnCoreAPI.lockedStateChanged.connect(onLockedStateChanged);
...
function onLockedStateChanged() { // do sth... }
Since
1.0.0

◆ progressChanged

progressChanged ( QVariantMap & progressObject)
signal

...

Parameters
progressObject
{
value: 12,
message: "Reading properties...",
status: "ok"
}
Since

◆ removeObjectsFromSmartSet

ApiJsonResponse removeObjectsFromSmartSet ( QString & smartSetId,
QStringList & objIds )
slot
Since
1.0, May 2025, sl

◆ resetStyles

ApiJsonResponse resetStyles ( QStringList & objectIds = QStringList(),
QVariantMap & filter = QVariantMap() )
slot

...

Parameters
objectIdsObject ID or list of object IDs. If empty, all objects will be considered.
filter
{
???
}
Returns
Since
1.0.0

◆ selectionStateChanged

selectionStateChanged ( )
signal

This signal is emitted when the selection state of objects has changed. Connect the signal to a javascript function (e.g. function onSelectionStateChanged) after the web page is loaded.

cnCoreAPI.selectionStateChanged.connect(onSelectionStateChanged);
...
function onSelectionStateChanged() { // do sth... }
Since
1.0.0

◆ setGeometry

ApiJsonResponse setGeometry ( QString & objId,
QVariantMap & geometryData )
slot

Set geometry data to an object.

Parameters
objId
geometryData
See also
getGeometry
Returns
True, if geometry could be set, else false (check errors)
data : boolean
Since
1.0, May 2025

◆ setProperties

ApiJsonResponse setProperties ( QStringList & objIds,
QVariantMap & propertyMap )
slot

Set properties for one or more objects.

Parameters
objIdsObject ID or list of object IDs.
propertyMapMap with properties (key given in property type key notation name##xsDataType)
{
"myType##xs:string": "ABC",
"myNumber##xs:double": 1.234,
"myBoolean##xs:boolean": true
}
Returns
data : boolean
Since
1.0.0

◆ setPropertyValue

ApiJsonResponse setPropertyValue ( QStringList & objIds,
QString & name,
QString & xsDataType,
QVariant & value )
slot

Set a property value for one ore more objects.

Parameters
objIdsObject ID or list of object IDs.
nameName of property
xsDataTypeData type of property
valueProperty value (java script value). A value of null removes the property from the object.
If the data type is 'xs:date' or 'xs:dateTime', Date objects and ISO strings will be accepted as values. If the data type is 'xs:object', the array or object will be stored internally as json string.
Returns
True, if the property value could be set, else false. If false, take a look at the status code and message.
data : boolean
Since
1.0.0

◆ setSelected

ApiJsonResponse setSelected ( QStringList & objIds,
bool flag,
bool exclusively = false )
slot

Set objects selected.

Parameters
objIdsString (single ID) OR array of IDs.
flagtrue or false
exclusivelytrue or false
Returns
Number of objects affected (should be equal to number of objIds)
Since
1.0, May 2025

◆ setSelectedVisible

ApiJsonResponse setSelectedVisible ( bool flag)
slot

Select/Unselect visible objects

Parameters
flagtrue = select visible object, false = unselect visible objects
Returns
Status code
data : void

◆ setStyle

ApiJsonResponse setStyle ( QStringList & objectIds,
QString & styleId )
slot

...

Parameters
objectIds
styleId
Returns
Since
1.0.0

◆ setVisible

ApiJsonResponse setVisible ( QStringList & objIds,
bool flag,
bool exclusively = false )
slot

Set objects visible.

Parameters
objIdsString (single ID) OR array of IDs.
flagtrue or false
exclusivelytrue or false
Returns
Number of objects affected.
data : number
Since
1.0, May 2025

◆ setVisibleAll

ApiJsonResponse setVisibleAll ( bool statusFlag,
QStringList & domains = QStringList()<< "all" )
slot

Set all objects visible.
This affects not only 3d-objects since objects in all domains have a status 'visible'

Parameters
statusFlagtrue: visible, false: hidden
domainsDomain short code or domain combination as array, e.g. ["geo, "act"]
Since
1.0, May 2025

◆ statusChanged

statusChanged ( QString & statusType)
signal

Generalisation of aboves method? To discuss ...

◆ toggleSelection

ApiJsonResponse toggleSelection ( QStringList & objIds)
slot

Reverses the selection of the transferred objects regardless of their parent-child relationship. IDs not found are listed in the message of return value

Parameters
objIdsList of object IDs whose selection is to be reversed
Returns
Number of objects whose selection has been changed
data: int
Since
1.0.0, May 2025

◆ toggleVisibility

ApiJsonResponse toggleVisibility ( QStringList & objIds)
slot

Reverses the visibility of the transferred objects regardless of their parent-child relationship. IDs not found are listed in the message of return value

Parameters
objIdsList of object IDs whose visibility is to be reversed
Returns
Number of objects whose visibility has been changed
data: int
Since
1.0.0, May 2025

◆ unlinkObjects

ApiJsonResponse unlinkObjects ( QStringList & sourceIds)
slot

Remove all links form objects given by sourceIds.

Parameters
sourceIdsID (string) or list of IDs (array)
Returns
Number of links removed.
Since
1.0.0

◆ updateSmartSet

ApiJsonResponse updateSmartSet ( QString & setId)
slot

Update smart set 'setId'.

Parameters
setIdID of the smart set to be updated
Returns
ID of root smart set container created
Since
1.0
Remarks
NEEDS TESTING

◆ updateStyle

ApiJsonResponse updateStyle ( QString & styleId,
QVariantMap & styleData )
slot

...

Parameters
styleId
styleData
See also
createStyle()
Returns
Since
1.0.0

◆ visibilityStateChanged

visibilityStateChanged ( )
signal

This signal is emitted if the visibility state of objects has changed. Connect the signal to a javascript function after the web page is loaded.

cnCoreAPI.visibilityStateChanged.connect(onVisibilityStateChanged);
...
function onVisibilityStateChanged() { // do sth... }
Since
1.0.0

◆ wireFrameStateChanged

wireFrameStateChanged ( )
signal

This signal is emitted when the wire frame state of objects has changed. Connect the signal to a javascript function after the web page is loaded.

cnCoreAPI.wireFrameStateChanged.connect(onWireFrameStateChanged);
...
function onWireFrameStateChanged() { // do sth... }
Since
1.0.0