MeasurementAPI¶
Interface MeasurementAPI
changeMeasurement(
measurementID: number,
properties: MeasurementProperties,
): MeasurementProperties;
createMeasurement<T extends keyof MeasurementTypeToTargetMap>(
type: T,
targets: MeasurementTypeToTargetMap[T],
properties?: MeasurementProperties,
): number;
getMeasurements(): number[];
measureBetween(
target0: MeasurementTarget,
target1: MeasurementTarget,
): Promise<BetweenMeasurementResult>;
measureTangent(
topology: { class: TOPOLOGY; value: TopologyHandle },
point: { class: POINT; value: [number, number, number] },
): Promise<TangentMeasurementResult>;
measureThickness(
topology: { class: TOPOLOGY; value: TopologyHandle },
point: { class: POINT; value: [number, number, number] },
): Promise<ThicknessMeasurementResult>;
removeMeasurement(measurementID: number, safe?: boolean): RemoveState;
requestMeasurementData(
measurementID: number,
): Promise<MeasurementProperties>;
}
Hierarchy (View Summary)
- MeasurementAPI
Methods
change Measurement
- changeMeasurement(
measurementID: number,
properties: MeasurementProperties,
): MeasurementProperties Changes one or more properties of a Measurement with the specified id.
Parameters
- measurementID: number
The id of the Measurement you want to change.
- properties: MeasurementProperties
The properties of the Measurement you want change.
Returns MeasurementProperties
An Object with the changed Properties.
- measurementID: number
create Measurement
- createMeasurement<T extends keyof MeasurementTypeToTargetMap>(
type: T,
targets: MeasurementTypeToTargetMap[T],
properties?: MeasurementProperties,
): number Creates a new Measurement.
Type Parameters
- T extends keyof MeasurementTypeToTargetMap
Parameters
- type: T
The type of the Measurement.
- targets: MeasurementTypeToTargetMap[T]
The targets of the Measurement.
Optional
properties: MeasurementPropertiesThe properties of the Measurement.
Returns number
The ID of the created Measurement.
get Measurements
measure Between
- measureBetween(
target0: MeasurementTarget,
target1: MeasurementTarget,
): Promise<BetweenMeasurementResult> Measures the distance and if possible the angle between two measurement targets.
Parameters
- target0: MeasurementTarget
The first measurement target.
- target1: MeasurementTarget
The second measurement target.
Returns Promise<BetweenMeasurementResult>
The result of the Measurement between the two specified targets.
- target0: MeasurementTarget
measure Tangent
- measureTangent(
topology: { class: TOPOLOGY; value: TopologyHandle },
point: { class: POINT; value: [number, number, number] },
): Promise<TangentMeasurementResult> Measures the tangent of an edge at the specified point.
Parameters
- topology: { class: TOPOLOGY; value: TopologyHandle }
The topological target.
class: TOPOLOGY
Describes the MeasurementTargetClass of the target.
value: TopologyHandle
Describes the value of the target depending on the specified class.
- point: { class: POINT; value: [number, number, number] }
The point target.
class: POINT
Describes the MeasurementTargetClass of the target.
value: [number, number, number]
Describes the value of the target depending on the specified class.
Returns Promise<TangentMeasurementResult>
The result of the tangent measurement.
- topology: { class: TOPOLOGY; value: TopologyHandle }
measure Thickness
- measureThickness(
topology: { class: TOPOLOGY; value: TopologyHandle },
point: { class: POINT; value: [number, number, number] },
): Promise<ThicknessMeasurementResult> Measures the thickness of a shape at the specified point.
Parameters
- topology: { class: TOPOLOGY; value: TopologyHandle }
The topological target.
class: TOPOLOGY
Describes the MeasurementTargetClass of the target.
value: TopologyHandle
Describes the value of the target depending on the specified class.
- point: { class: POINT; value: [number, number, number] }
The point target.
class: POINT
Describes the MeasurementTargetClass of the target.
value: [number, number, number]
Describes the value of the target depending on the specified class.
Returns Promise<ThicknessMeasurementResult>
The result of the thickness measurement.
- topology: { class: TOPOLOGY; value: TopologyHandle }
remove Measurement
- removeMeasurement(measurementID: number, safe?: boolean): RemoveState
Removes the Measurement from the scene and all related Snapshots.
Parameters
- measurementID: number
Optional
safe: booleanPerforms a safe remove which interrupt the removal process if the Measurement is part of one or more Snapshots.
Returns RemoveState
request Measurement Data
- requestMeasurementData(measurementID: number): Promise<MeasurementProperties>
Returns the MeasurementProperties for the specified Measurement id.
Parameters
- measurementID: number
The id of the Measurement you want to request the data for.
Returns Promise<MeasurementProperties>
The requested Measurement properties.
- measurementID: number
These functions allow the creation of Measurements.
Example