feat: wire Part Design task parameters
This commit is contained in:
@@ -303,12 +303,14 @@ export function createMockFacade(): BitBybitWebCadFacade {
|
||||
tree.push(item)
|
||||
}
|
||||
const objectSnapshot = createObjectSnapshot(item)
|
||||
if (commandId === 'primitive') {
|
||||
objectSnapshot.properties = objectSnapshot.properties.map((property) => {
|
||||
const candidate = draft[property.name.toLowerCase()]
|
||||
return typeof candidate === 'number' && Number.isFinite(candidate) ? { ...property, value: candidate } : property
|
||||
})
|
||||
}
|
||||
objectSnapshot.properties = objectSnapshot.properties.map((property) => {
|
||||
if (!property.recompute || property.type === 'App::PropertyLink') return property
|
||||
const candidate = draft[property.name.toLowerCase()]
|
||||
if (property.type === 'App::PropertyBool' && typeof candidate === 'boolean') return { ...property, value: candidate }
|
||||
if ((property.type === 'App::PropertyLength' || property.type === 'App::PropertyAngle' || property.type === 'App::PropertyPercent' || property.type === 'App::PropertyFloat') && typeof candidate === 'number' && Number.isFinite(candidate)) return { ...property, value: candidate }
|
||||
if (property.type === 'App::PropertyEnumeration' && typeof candidate === 'string' && property.options?.includes(candidate)) return { ...property, value: candidate }
|
||||
return property
|
||||
})
|
||||
if (isPartObject && commandId !== 'primitive') {
|
||||
objectSnapshot.properties = objectSnapshot.properties.map((property) => property.name === 'Base' && state.selectedObjectId ? { ...property, value: state.selectedObjectId } : property)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user