mirror of https://gitee.com/cf-fz/WebCAD.git
parent
fb0c909497
commit
27dc66e6c4
@ -0,0 +1,28 @@
|
||||
import { app } from "../ApplicationServices/Application";
|
||||
import { Curve } from '../DatabaseServices/Curve';
|
||||
import { Command } from "../Editor/CommandMachine";
|
||||
import { PromptStatus } from "../Editor/PromptResult";
|
||||
|
||||
export class Command_Join implements Command
|
||||
{
|
||||
async exec()
|
||||
{
|
||||
let cu1Res = await app.m_Editor.GetEntity();
|
||||
if (cu1Res.Status != PromptStatus.OK) return;
|
||||
let cu2Res = await app.m_Editor.GetEntity();
|
||||
if (cu2Res.Status != PromptStatus.OK) return;
|
||||
|
||||
|
||||
if (cu1Res.Entity instanceof Curve)
|
||||
{
|
||||
if (cu2Res.Entity instanceof Curve)
|
||||
{
|
||||
let bIsOK = cu1Res.Entity.Join(cu2Res.Entity);
|
||||
if (bIsOK)
|
||||
{
|
||||
cu2Res.Entity.Erase();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue