!2855 优化:Copy时保持绘制顺序一致(保证复制后的板排钻一致)

pull/2853/MERGE
ChenX 3 months ago
parent 1f2546fd6c
commit 92e7343834

@ -107,6 +107,9 @@ export class Command_Copy implements Command
export function GetCopyEntsParam(originalEnts: Entity[]): { copyEnts: Entity[]; dbEnts: Entity[]; idMapRev: IdMaping; idMap: IdMaping; oldEntsSet: Set<Entity>; }
{
//因为排钻根据id顺序排,所以拷贝时保持顺序,保证拷贝后的排钻结果一致
originalEnts.sort((e1, e2) => e1.objectId.Index - e2.objectId.Index);
originalEnts = RemoveRoomAutoGenEntity(originalEnts);
let oldEntsSet = new Set(originalEnts);
let copyEnts = originalEnts.map(e => JigUtils.Draw(e));

@ -33,13 +33,19 @@ export class Entsel implements Command
vcs.add(new Vector3(0, -20, 0));
dyn.SetPostion(vcs);
let msg = "";
if (res.Entity instanceof Entity)
{
msg = `id:${res.Entity.objectId?.Index}`;
if (res.Entity.Template?.Object)
dyn.UpdatePrompt(`模版:${res.Entity.Template.Index},${(<TemplateRecord>(res.Entity.Template.Object)).Objects.length}`);
else if (res.Entity instanceof EntityRef || res.Entity instanceof EntityFbx)
dyn.UpdatePrompt(res.Entity.Url);
else
dyn.UpdatePrompt(res.Entity.ColorIndex.toString());
msg += ` 模板:${res.Entity.Template.Index},${(<TemplateRecord>(res.Entity.Template.Object)).Objects.length}`;
if (res.Entity instanceof EntityRef || res.Entity instanceof EntityFbx)
msg += ` URL:${res.Entity.Url}`;
msg += ` 颜色:${res.Entity.ColorIndex.toString()}`;
}
if (msg)
dyn.UpdatePrompt(msg);
if (res.Entity.Id)
{

@ -510,6 +510,9 @@ export class Database
{
Entity.__ReadFileIng__ = true;
for (let obj of objects)
filer.cloned.add(obj.objectId.Index);
for (let obj of objects)
if (obj instanceof Light)
this.WblockCloneObject(obj, this.Lights, idMap, drc, filer);

Loading…
Cancel
Save