BREAKING: KCL @settings are the source of truth for units (#5808)
This commit is contained in:
@ -22,6 +22,7 @@ import { CameraProjectionType } from '@rust/kcl-lib/bindings/CameraProjectionTyp
|
||||
import { OnboardingStatus } from '@rust/kcl-lib/bindings/OnboardingStatus'
|
||||
import { NamedView } from '@rust/kcl-lib/bindings/NamedView'
|
||||
import { CameraOrbitType } from '@rust/kcl-lib/bindings/CameraOrbitType'
|
||||
import { DEFAULT_DEFAULT_LENGTH_UNIT } from 'lib/constants'
|
||||
|
||||
/**
|
||||
* A setting that can be set at the user or project level
|
||||
@ -300,8 +301,9 @@ export function createSettings() {
|
||||
* The default unit to use in modeling dimensions
|
||||
*/
|
||||
defaultUnit: new Setting<BaseUnit>({
|
||||
defaultValue: 'mm',
|
||||
description: 'The default unit to use in modeling dimensions',
|
||||
defaultValue: DEFAULT_DEFAULT_LENGTH_UNIT,
|
||||
description:
|
||||
'Set the default length unit setting value to give any new files.',
|
||||
validate: (v) => baseUnitsUnion.includes(v),
|
||||
commandConfig: {
|
||||
inputType: 'options',
|
||||
|
@ -145,7 +145,7 @@ export type SaveSettingsPayload = RecursiveSettingsPayloads<typeof settings>
|
||||
|
||||
/**
|
||||
* Annotation names for default units are defined on rust side in
|
||||
* src/wasm-lib/kcl/src/execution/annotations.rs
|
||||
* rust/kcl-lib/src/execution/annotations.rs
|
||||
*/
|
||||
export interface KclSettingsAnnotation {
|
||||
defaultLengthUnit?: UnitLength_type
|
||||
|
Reference in New Issue
Block a user