load()
Loads an imported model (the cached STEP import in imports/) by name.
Imports are cached in mm and scaled into this document's unit
automatically, so a unit is normally unnecessary. options.unit asserts
the unit the asset's cached geometry is in, for assets without
trustworthy metadata; it overrides the import sidecar.
In an installed package's file, load() reads the package's own
imports/, which it ships. options.from: 'project' reads the
project's instead, for a name the model using the package passes in.
Returns: SceneObject
See the guide for detailed usage examples.
Signatures
load(fileName: string, options?: LoadOptions): ILoadFile
Loads an imported model (the cached STEP import in imports/) by name.
Imports are cached in mm and scaled into this document's unit
automatically, so a unit is normally unnecessary. options.unit asserts
the unit the asset's cached geometry is in, for assets without
trustworthy metadata; it overrides the import sidecar.
In an installed package's file, load() reads the package's own
imports/, which it ships. options.from: 'project' reads the
project's instead, for a name the model using the package passes in.
| Parameter | Type | Description |
|---|---|---|
fileName | string | The asset name (the STEP file name without extension) |
options | LoadOptions | Optional { unit } assertion of the asset's unit, and { from: 'project' } to read the project's imports/ from package code (optional) |