ModelSpec

class cee.ug.ModelSpec()

Specification of what to show in the 3D viewer.

The ModelSpec controls what to show in the 3D Viewer. You specify which state(s)/time step(s) to show and which results to show. You can also specify a mode-shape animation.

The ModelDirectory contains the list of available results and states that can be set in the ModelSpec. When calling changing state or result properties in this class it is checked against the ModelDirectory and an exception is thrown if any of the ids are invalid.

Example: Show the last state with a scalar result as filled contours.

// Get the model and the model directory from the RemoteModel
var modelDir = myModel.modelDirectory;
var modelSpec = myModel.modelSpec;

// Show the last state in the analysis
modelSpec.stateIdArray = [modelDir.stateInfoArray[modelDir.stateInfoArray.length - 1].id];

// Show the first scalar as filled contours (if any)
if (modelDir.scalarResultArray.length > 0) {
    modelSpec.fringesResultId = modelDir.scalarResultArray[0].id;
}

Accessors

cee.ug.ModelSpec.displacementResultId()
get displacementResultId(): number

The id of the displacement result to use. A displacement result is a per node result that displaces the nodes in the model in every time step without redefining the elements.

Use the DisplacementSettings object to control the scaling of the displacements.

Set to -1 to show no displacements in the model.

Returns: number

set displacementResultId(resultId: number): void

Parameters

resultId: number

Returns: void

cee.ug.ModelSpec.fringesResultId()
get fringesResultId(): number

The id of the scalar result to show as textured fringes (filled contours) on the model. Use the ScalarSettings object to control how the scalar will be shown (range, color scheme, number of levels)

Set to -1 (default) to show no scalars on the model.

Note: The scalar fringes result Id can be overridden per part with the setOverridePartFringesResultId method.

Returns: number

set fringesResultId(resultId: number): void

Parameters

resultId: number

Returns: void

cee.ug.ModelSpec.modeShapeAnimationType()
get modeShapeAnimationType(): ModeShapeAnimationType

The type of mode shape animation to create: Quarter, Half or Full (default).

Returns: ModeShapeAnimationType

set modeShapeAnimationType(animType: ModeShapeAnimationType): void

Parameters

Returns: void

cee.ug.ModelSpec.modeShapeFrameCount()
get modeShapeFrameCount(): number

The number of frames to use for a mode shape animation.

A mode shape animation is an animation where the displacements of each node is interpolated between the undisplaced and the displaced positions. To setup a mode shape animation we recommend to have a displacement result specified in displacementResultId and exactly one state specified in stateIdArray.

Set to 0 (default) to not use mode shape animation.

Note: Although we support switching results in the middle of a mode shape animation, we recommend to setup the desired (scalar, vector, displacement) results first and then setting the modeShapeFrameCount.

Returns: number

set modeShapeFrameCount(frameCount: number): void

Parameters

frameCount: number

Returns: void

cee.ug.ModelSpec.modeShapeInterpolateScalars()
get modeShapeInterpolateScalars(): boolean

Specifies if the scalars should be interpolated during a mode-shape animation or not.

Returns: boolean

set modeShapeInterpolateScalars(interpolate: boolean): void

Parameters

interpolate: boolean

Returns: void

cee.ug.ModelSpec.showComplementOfVisibleSets()
get showComplementOfVisibleSets(): boolean

Specifies that the complement of the current visible sets will be shown.

If this option is enabled, only the elements that are NOT present in any of the visible sets will be shown.

Returns: boolean

set showComplementOfVisibleSets(showComplement: boolean): void

Parameters

showComplement: boolean

Returns: void

cee.ug.ModelSpec.stateIdArray()
get stateIdArray(): readonly  number[]

The Ids of the states to show. An animation will be created if there is more than one item in the array.

At least one state id must be specified in order to show the model.

Returns: readonly  number[]

set stateIdArray(stateIdsArr: readonly  number[]): void

Parameters

stateIdsArr: readonly  number[]

Returns: void

cee.ug.ModelSpec.useTransformationResult()
get useTransformationResult(): boolean

Whether the rigid body transformation result should be used (if present).

Default is true.

Returns: boolean

set useTransformationResult(useTransformationResult: boolean): void

Parameters

useTransformationResult: boolean

Returns: void

cee.ug.ModelSpec.vectorResultIdArray()
get vectorResultIdArray(): readonly  number[]

The array of vector result ids to show as vector arrows on the model surface. Use the VectorSettings object to control how the vectors will be shown (color, scaling, filtering, clamping)

Set to [] (default) to show no vectors on the model. [-1] is interpreted as [] for convenience.

Returns: readonly  number[]

set vectorResultIdArray(resultIdArray: readonly  number[]): void

Parameters

resultIdArray: readonly  number[]

Returns: void

cee.ug.ModelSpec.visibleSetIdArray()
get visibleSetIdArray(): readonly  number[]

If the array is not empty, the given set ids will be used to define which elements are visible. The union of the elements in the specified visible sets will be considered visible.

You can show the complement of the visible set by setting the showComplementOfVisibleSets property to true.

Set to [] (default) to disable set filtering on the model. [-1] is interpreted as [] for convenience.

Returns: readonly  number[]

set visibleSetIdArray(setIdArray: readonly  number[]): void

Parameters

setIdArray: readonly  number[]

Returns: void

Methods

cee.ug.ModelSpec.getAsProperties()
getAsProperties(): ModelSpecProperties

Gets the settings for this model spec as a Plain Old JavaScript Object (POJO).

Returns: ModelSpecProperties

cee.ug.ModelSpec.getEffectiveFringesResultId()
getEffectiveFringesResultId(geometryIndex: number, partId: number): number

Returns the id of the scalar result shown on the given part. Will return fringesResultId if no override result was specified for the given part.

Parameters

geometryIndex: number

partId: number

Returns: number

cee.ug.ModelSpec.getOverridePartFringesResultId()
getOverridePartFringesResultId(geometryIndex: number, partId: number): number

Returns the result id that is specified to override any global setting on the given part. If no override is provided, it will return -1.

Parameters

geometryIndex: number

partId: number

Returns: number

cee.ug.ModelSpec.removeAllOverridePartFringesResultIds()
removeAllOverridePartFringesResultIds(): void

Remove any overridden scalar fringes result ids for any parts.

All parts will after this follow the global setting (ModelSpec.fringesResultId)

Returns: void

cee.ug.ModelSpec.setFromProperties()
setFromProperties(props: Partial): void

Applies the settings in the given properties object to this model spec.

Parameters

props: Partial

Returns: void

cee.ug.ModelSpec.setOverridePartFringesResultId()
setOverridePartFringesResultId(geometryIndex: number, partId: number, fringesId: number): void

Specify to show the given scalar result on the given part as scalar fringes.

This overrides any global fringes setting for the given part.

Parameters

geometryIndex: number

partId: number

fringesId: number

Returns: void