Manual Reference Source

Function

Static Public Summary
public

activateComment(comment: Object, viewer: Object)

Activiate the comment in the current viewer.

public

createComment(modelId: string, subject: string, text: string, userData: string, onSuccess: function(commentId: number): void, onFail: function(errMsg: string): void, viewer: Object)

Create a comment with or without rendering information.

public

deleteComment(commentId: number, onSuccess: function(commentId: number): void, onFail: function(errMsg: string): void, viewer: Object)

Delete a comment by given ID.

public

getComments(modelId: string, onSuccess: function(comments: Comment): void, onFail: function(errMsg: string): void, viewer: Object)

Get information of the model with given id.

public

init(config: Object)

Initialize and configure Modelo API.

public

merge(name: string, modelIds: string[], onSuccess: function(modelId: string): void, onFail: function(errMsg: string): void)

Merge several models together into one model.

public

query(modelId: string, onSuccess: function(model: Model): void, onFail: function(errMsg: string): void)

Get information of the model with given id.

public

queryBIMTree(modelId: string, onSuccess: function(bimTree: BIMTree): void, onFail: function(errMsg: string): void)

Query the bim tree of the model

public

queryElementBIM(modelId: string, elementId: number, onSuccess: function(properties: BIMProperty[]), onFail: function(errMsg: string): void)

Query the bim data of element

public

remove(modelId: string, onSuccess: function(modelId: string): void, onFail: function(errMsg: string): void)

Remove a model from its project and folder.

public

signIn(applicationToken: string, onSuccess: function(): void, onFail: function(errMsg: string): void)

Sign in Modelo with applicationToken.

public

signOut(onSuccess: function(): void, onFail: function(errMsg: string): void)

Sign out Modelo and expire the session token obtained in signIn.

public

update(modelId: string, name: string, onSuccess: function(modelId: string): void, onFail: function(errMsg: string): void)

Update the information of a model including name, folder id.

public

updateComment(commentId: number, subject: string, text: string, onSuccess: function(commentId: string): void, onFail: function(errMsg: string): void)

Update the data of a comment.

public

updateElementBIM(modelId: string, elementId: number, property: {name: string, groupKey: number, strValue: ?string, numValue: ?number}, onSuccess: function(): void, onFail: function(errMsg: string): void)

Update one of the element properties with element id and model id

public

upload(file: File, onSuccess: function(modelId: string): void, onProgress: function(percentage: number): void, onFail: function(errMsg: string): void)

Upload a model.

Static Public

public activateComment(comment: Object, viewer: Object) source

import {activateComment} from 'modelo3d/doc/Model/Comment.js'

Activiate the comment in the current viewer.

Params:

NameTypeAttributeDescription
comment Object

The comment object should be retrieved from getComments().

viewer Object

The current viewer.

public createComment(modelId: string, subject: string, text: string, userData: string, onSuccess: function(commentId: number): void, onFail: function(errMsg: string): void, viewer: Object) source

import {createComment} from 'modelo3d/doc/Model/Comment.js'

Create a comment with or without rendering information.

Params:

NameTypeAttributeDescription
modelId string

The model ID.

subject string

The comment title.

text string

The comment body text.

userData string

A string about user data.

onSuccess function(commentId: number): void

Returns the comment ID.

onFail function(errMsg: string): void
viewer Object

The current viewer. If omitted, comment is not associated to any camera angle.

public deleteComment(commentId: number, onSuccess: function(commentId: number): void, onFail: function(errMsg: string): void, viewer: Object) source

import {deleteComment} from 'modelo3d/doc/Model/Comment.js'

Delete a comment by given ID.

Params:

NameTypeAttributeDescription
commentId number

The comment ID.

onSuccess function(commentId: number): void

Returns the comment ID.

onFail function(errMsg: string): void

Returns the error message.

viewer Object

The current viewer. It is optional. When existing, it will update the comment rendering related data in viewer too.

public getComments(modelId: string, onSuccess: function(comments: Comment): void, onFail: function(errMsg: string): void, viewer: Object) source

import {getComments} from 'modelo3d/doc/Model/Comment.js'

Get information of the model with given id.

Params:

NameTypeAttributeDescription
modelId string

The comments of this model will be downloaded.

onSuccess function(comments: Comment): void

Returns all comments of the specified model.

onFail function(errMsg: string): void

Returns the error string.

viewer Object

The current viewer. It is optional. When existing, it will update the comment rendering related data in viewer too.

public init(config: Object) source

import {init} from 'modelo3d/doc/Modelo.js'

Initialize and configure Modelo API.

Params:

NameTypeAttributeDescription
config Object

The configuration setting. The curent setting parameter include "endpoint" which should refer to the clould endpoint. For public cloud, it is https://build-portal.modeloapp.com.

public merge(name: string, modelIds: string[], onSuccess: function(modelId: string): void, onFail: function(errMsg: string): void) source

import {merge} from 'modelo3d/doc/Model/Model.js'

Merge several models together into one model.

Params:

NameTypeAttributeDescription
name string

target model name

modelIds string[]

array of model ids, which you want to merge

onSuccess function(modelId: string): void

the generated model id will be available in success callback

onFail function(errMsg: string): void

public query(modelId: string, onSuccess: function(model: Model): void, onFail: function(errMsg: string): void) source

import {query} from 'modelo3d/doc/Model/Model.js'

Get information of the model with given id.

Params:

NameTypeAttributeDescription
modelId string
onSuccess function(model: Model): void
onFail function(errMsg: string): void

public queryBIMTree(modelId: string, onSuccess: function(bimTree: BIMTree): void, onFail: function(errMsg: string): void) source

import {queryBIMTree} from 'modelo3d/doc/BIM/BIM.js'

Query the bim tree of the model

Params:

NameTypeAttributeDescription
modelId string

model id

onSuccess function(bimTree: BIMTree): void
onFail function(errMsg: string): void

public queryElementBIM(modelId: string, elementId: number, onSuccess: function(properties: BIMProperty[]), onFail: function(errMsg: string): void) source

import {queryElementBIM} from 'modelo3d/doc/BIM/BIM.js'

Query the bim data of element

Params:

NameTypeAttributeDescription
modelId string

model id

elementId number

element id

onSuccess function(properties: BIMProperty[])
onFail function(errMsg: string): void

public remove(modelId: string, onSuccess: function(modelId: string): void, onFail: function(errMsg: string): void) source

import {remove} from 'modelo3d/doc/Model/Model.js'

Remove a model from its project and folder.

Params:

NameTypeAttributeDescription
modelId string
onSuccess function(modelId: string): void
onFail function(errMsg: string): void

public signIn(applicationToken: string, onSuccess: function(): void, onFail: function(errMsg: string): void) source

import {signIn} from 'modelo3d/doc/Auth/Auth.js'

Sign in Modelo with applicationToken.

Params:

NameTypeAttributeDescription
applicationToken string

The application token is obtained by admin page. Check the programming guide.

onSuccess function(): void

The callback when succeed. Login state will be stored internally.

onFail function(errMsg: string): void

The callback when fail. The errmsg records the failure error message.

public signOut(onSuccess: function(): void, onFail: function(errMsg: string): void) source

import {signOut} from 'modelo3d/doc/Auth/Auth.js'

Sign out Modelo and expire the session token obtained in signIn.

Params:

NameTypeAttributeDescription
onSuccess function(): void
onFail function(errMsg: string): void

public update(modelId: string, name: string, onSuccess: function(modelId: string): void, onFail: function(errMsg: string): void) source

import {update} from 'modelo3d/doc/Model/Model.js'

Update the information of a model including name, folder id.

Params:

NameTypeAttributeDescription
modelId string

model id

name string
  • optional

model name

onSuccess function(modelId: string): void
onFail function(errMsg: string): void

public updateComment(commentId: number, subject: string, text: string, onSuccess: function(commentId: string): void, onFail: function(errMsg: string): void) source

import {updateComment} from 'modelo3d/doc/Model/Comment.js'

Update the data of a comment.

Params:

NameTypeAttributeDescription
commentId number

The comment id

subject string

The subject of this comment.

text string

The body text of the comment.

onSuccess function(commentId: string): void

Returns the changed comment ID.

onFail function(errMsg: string): void

public updateElementBIM(modelId: string, elementId: number, property: {name: string, groupKey: number, strValue: ?string, numValue: ?number}, onSuccess: function(): void, onFail: function(errMsg: string): void) source

import {updateElementBIM} from 'modelo3d/doc/BIM/BIM.js'

Update one of the element properties with element id and model id

Params:

NameTypeAttributeDescription
modelId string

model id

elementId number

element id

property {name: string, groupKey: number, strValue: ?string, numValue: ?number}

property to be updated, strValue and numValue could be empty, but you must provide at least one of them

onSuccess function(): void
onFail function(errMsg: string): void

Example:

Modelo.BIM.updateElementBIM(
  "yourModelId",
  "yourElementId",
  { name: "propertyName", groupKey: 3, strValue: 'someValue' },
  () => {
    // success callback
  },
  err => {
    // error callback
  }
)

public upload(file: File, onSuccess: function(modelId: string): void, onProgress: function(percentage: number): void, onFail: function(errMsg: string): void) source

import {upload} from 'modelo3d/doc/Model/Model.js'

Upload a model.

Params:

NameTypeAttributeDescription
file File

file object of model

onSuccess function(modelId: string): void
onProgress function(percentage: number): void
onFail function(errMsg: string): void