new Assembly(impl, app)
Parameters:
| Name | Type | Description |
|---|---|---|
impl |
AssemblyImpl | An object that implements assembly data storage and server requests. |
app |
Client | The |
Members
-
<readonly> associatedFiles :Array.<Object>
-
List of files from which the assembly was created.
Type:
- Array.<Object>
-
<readonly> created :string
-
Assembly creation time (UTC) in the format specified in ISO 8601.
Type:
- string
-
<readonly> data :Object
-
Raw assembly data received from the server.
Type:
- Object
-
<readonly> files :Array.<string>
-
List of file IDs from which the assembly was created.
Type:
- Array.<string>
-
<readonly> id :string
-
Unique assembly ID.
Type:
- string
-
name :string
-
Assembly name.
Type:
- string
-
<readonly> owner :Object
-
Assembly owner information.
Type:
- Object
Properties:
Name Type Description userIdstring User ID.
userNamestring User name.
namestring First name.
lastNamestring Last name.
emailstring User email.
avatarUrlstring User avatar image URL.
-
List of assembly related job IDs.
Type:
- Array.<string>
-
<readonly> status :string
-
Assembly geometry and properties extraction status. Can be
waiting,inprogress,doneorfailed.Type:
- string
-
<readonly> type :string
-
Assembly type. Returns an empty srting.
Type:
- string
Methods
-
<async> checkout()
-
Refresh assembly data.
Returns:
- Type
- Promise.<Assembly>
-
<async> delete()
-
Delete the assembly from the server.
Returns:
- Returns the raw data of a deleted assembly.
- Type
- Promise.<Object>
-
<async> downloadResource(dataId, onProgress, signal)
-
Download assembly resource data, such as geometry database or geometry data.
Parameters:
Name Type Description dataIdstring Resource ID.
onProgressProgressCallback Download progress callback.
signalAbortSignal An AbortSignal object instance. Allows to communicate with a fetch request and abort it if desired.
Returns:
- Type
- Promise.<ArrayBuffer>
-
<async> getModels()
-
Returns list of assembly models.
Returns:
- Type
- Promise.<Array.<Model>>
-
getModelTransformMatrix(handle)
-
Returns a model transformation.
Parameters:
Name Type Description handlestring Model database handle. See Model.database for more details.
Returns:
- Type
- Transform
-
<async> getProperties(handle)
-
Returns the properties for an object in the assembly.
Parameters:
Name Type Description handlestring Object original handle. Leave this parameter undefined to get properties for all objects in the assembly.
Returns:
- Type
- Promise.<Array.<Properties>> | Promise.<Properties>
-
<async> getReferences( [signal])
-
Returns a list of references to files used to extract file geometry data.
Parameters:
Name Type Argument Description signalAbortSignal <optional>
- To Do:
-
- Reserved for future use
Returns:
- Type
- Promise.<FileReferences>
-
<async> save()
-
Save assembly data changes to the server. Call this method to update assembly data on the server after any changes.
Returns:
- Type
- Promise.<Assembly>
-
<async> searchProperties(searchPattern)
-
Returns the list of original handles for an objects in the file that match the specified patterns. Search patterns may be combined using query operators.
Parameters:
Name Type Description searchPatternSearchPattern | QueryOperator Search pattern or combination of the patterns, see example below.
Returns:
- Type
- Promise.<Array.<Properties>>
Examples
Simple search pattern.
searchPattern = { key: "Category", value: "OST_Stairs", };Search patterns combination.
searchPattern = { $or: [ { $and: [ { key: "Category", value: "OST_GenericModel" }, { key: "Level", value: "03 - Floor" }, ], }, { key: "Category", value: "OST_Stairs" }, ], }; -
<async> setModelTransformMatrix(handle, transform)
-
Set or delete a model transformation.
Parameters:
Name Type Description handlestring Model database handle. See Model.database for more details.
transformTransform Transformation matrix. To delete transformation provide this to
undefined.Returns:
- Type
- Promise.<Assembly>
-
<async> update(data)
-
Updates assembly data on the server.
Parameters:
Name Type Description dataObject Raw assembly data.
Returns:
- Type
- Promise.<Assembly>
-
<async> waitForDone(params)
-
Wait until assembly is created. Assembly is created when it changes to
doneorfailedstatus.Parameters:
Name Type Description paramsAn object containing waiting parameters.
Properties
Name Type Description timeoutThe time, in milliseconds that the function should wait assembly. If assembly is not created during this time, the
TimeoutErrorexception will be thrown.intervalThe time, in milliseconds, the function should delay in between checking assembly status.
signal-An AbortController signal object instance, which can be used to abort waiting as desired.
Client.js