mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 08:25:19 +01:00
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import {roundValueForPresentation as r} from 'cad/craft/operationHelper';
|
|
import {ApplicationContext} from "cad/context";
|
|
import {EntityKind} from "cad/model/entities";
|
|
import {OperationDescriptor} from "cad/craft/operationBundle";
|
|
import {MShell} from "cad/model/mshell";
|
|
|
|
interface DeleteBodyParams {
|
|
tools: MShell[];
|
|
}
|
|
|
|
export const DeleteBodyOperation: OperationDescriptor<DeleteBodyParams> = {
|
|
id: 'DELETE_BODY',
|
|
label: 'DeleteBody',
|
|
icon: 'img/cad/deleteBody',
|
|
info: 'Delete Bodies',
|
|
path:__dirname,
|
|
paramsInfo: ({ tools }) => `(${r(tools)})`,
|
|
run: (params: DeleteBodyParams, ctx: ApplicationContext) => {
|
|
let occ = ctx.occService;
|
|
const oci = occ.commandInterface;
|
|
|
|
let returnObject = {
|
|
created: [],
|
|
consumed: params.tools
|
|
}
|
|
return returnObject;
|
|
|
|
},
|
|
form: [
|
|
{
|
|
type: 'selection',
|
|
name: 'tools',
|
|
capture: [EntityKind.SHELL],
|
|
label: 'Tools',
|
|
optional: false,
|
|
multi: true,
|
|
defaultValue: {
|
|
usePreselection: true,
|
|
preselectionIndex: 0
|
|
},
|
|
},
|
|
],
|
|
path: __dirname,
|
|
}
|