Getting C3D Vision Parameters

The command below is used to get an object with some parameters from a C3D Vision instance.

Common command example (TypeScript):

let result = view.runCommand({
    name: "GetParametersCommand",
    type: GetParametersTypes.AnnotationList
})

Available request types:

Constant name

Value

Optional parameters

Description

GetParametersTypes.AnnotationList

"AnnotationList"

uuid: string - a node UUID to get certain objects; filter: ObjectTypeFilter - filter return objects by C3DViewObjectTypes or array of it

Returns objects added to a model.

GetParametersTypes.Camera

"Camera"

Returns current camera parameters (projection, orientation and up vector for the standard projection). Details.

GetParametersTypes.SelectionList

"SelectionList"

filter: ObjectTypeFilter - filter return objects by C3DViewObjectTypes or array of it

Returns node UUIDs selected by command.

GetParametersTypes.BoundingBox

"BoundingBox"

uuids: string[] - a list of node UUIDs to get their united bounding box

Returns a bounding box.

New in version 1.5.0: Added the optional filter parameter.

New in version 1.8.0: Added the request type GetParametersTypes.BoundingBox.

Common result type of command (TypeScript):

type GetParametersCommandResult = {
    name: ResultTypes.Parameters // "Parameters"
    result: Promise<{
        name: GetParametersTypes // command run type
        <RESULT>
    }>
}

This command returns an object storing the following: a constant name which is ResultTypes.Parameters or just "Parameters" and a promise object with a command type name and <RESULT> depending on a command type.

Command type

<RESULT>

GetParametersTypes.AnnotationList

objs: C3DViewObjects[]

GetParametersTypes.Camera

params: CameraParams

GetParametersTypes.SelectionList

uuids: string[], models: (string|null)[]

GetParametersTypes.BoundingBox

min: C3DViewPoint, max: C3DViewPoint

In some cases, a command is able to fail. Then it returns another result, with the message containing an error message, for further excepting.

Error result type of command (TypeScript):

type ErrorResult = {
    name: ResultTypes.Error // "Error"
    message: string
}

Also, there might be an empty result (e.g. in case of an invalid type name) with the following type.

Empty GetParameters result type (TypeScript):

type NoneResult = {
    name: ResultTypes.None // "None"
}

Bounding Box Result

The bounding box is defined by two opposite points (minimum and maximum). Such a box includes all geometries which UUIDs are passed via the command "GetParametersCommand" with the type GetParametersTypes.BoundingBox.

Bounding box result type (TypeScript):

export type GetBoundingBoxResult = {
    name: GetParametersTypes.BoundingBox
    min: C3DViewPoint
    max: C3DViewPoint
}