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 userId
string User ID.
userName
string User name.
name
string First name.
lastName
string Last name.
email
string User email.
avatarUrl
string 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
,done
orfailed
.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 dataId
string Resource ID.
onProgress
ProgressCallback Download progress callback.
signal
AbortSignal 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 handle
string 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 handle
string 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 signal
AbortSignal <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 searchPattern
SearchPattern | 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 handle
string Model database handle. See Model.database for more details.
transform
Transform 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 data
Object Raw assembly data.
Returns:
- Type
- Promise.<Assembly>
-
<async> waitForDone(params)
-
Wait until assembly is created. Assembly is created when it changes to
done
orfailed
status.Parameters:
Name Type Description params
An object containing waiting parameters.
Properties
Name Type Description timeout
The time, in milliseconds that the function should wait assembly. If assembly is not created during this time, the
TimeoutError
exception will be thrown.interval
The 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.