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.

New in version 1.5.0: Optional filter parameter added.

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[]

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"
}