Skip to main content

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

tip

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.

ParameterTypeDescription
fileNamestringThe asset name (the STEP file name without extension)
optionsLoadOptionsOptional { unit } assertion of the asset's unit, and { from: 'project' } to read the project's imports/ from package code (optional)