From 4c770cd133592ca369638c5ab62a20cefbd1e124 Mon Sep 17 00:00:00 2001 From: ChenX Date: Sun, 25 Apr 2021 09:16:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96:DXF=E8=BD=BD=E5=85=A5?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Add-on/DXFLoad.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Add-on/DXFLoad.ts b/src/Add-on/DXFLoad.ts index 56f61199d..7bdd9bb46 100644 --- a/src/Add-on/DXFLoad.ts +++ b/src/Add-on/DXFLoad.ts @@ -47,6 +47,7 @@ export class Command_DXFImport let enpl = en as EntityLWPOLYLINE; let pl = new Polyline(); + pl.ColorIndex = en.colorIndex ?? 7; pl.ApplyMatrix(this.GetMatrix4(en)); pl.LineData = enpl.vertices.map(p => @@ -76,6 +77,7 @@ export class Command_DXFImport if (!equaln(enArc.startAngle, enArc.endAngle, 1e-3)) { let arc = new Arc(AsVector3(enArc.center), enArc.radius, enArc.startAngle, enArc.endAngle, false); + arc.ColorIndex = en.colorIndex ?? 7; arc.ApplyMatrix(this.GetMatrix4(en)); app.Database.ModelSpace.Append(arc); } @@ -86,6 +88,7 @@ export class Command_DXFImport if (enCir.radius > 1e-3) { let cir = new Circle(AsVector3(enCir.center), enCir.radius); + cir.ColorIndex = en.colorIndex ?? 7; cir.ApplyMatrix(this.GetMatrix4(en)); app.Database.ModelSpace.Append(cir); } @@ -101,6 +104,7 @@ export class Command_DXFImport continue; let line = new Line(sp, ep); + line.ColorIndex = en.colorIndex ?? 7; app.Database.ModelSpace.Append(line); } else if (en.type === "TEXT") @@ -108,6 +112,7 @@ export class Command_DXFImport let enText = en as EntityTEXT; if (!enText.text) continue; let text = new Text(AsVector3(enText.startPoint)); + text.ColorIndex = en.colorIndex ?? 7; let mtx = this.GetMatrix4(enText); text.ApplyMatrix(mtx); text.TextString = enText.text; @@ -128,6 +133,7 @@ export class Command_DXFImport break; case 34: let dim = new LineAngularDimension(); + dim.ColorIndex = en.colorIndex ?? 7; let center = AsVector3(enDim.diameterOrRadiusPoint); let arcPoint = AsVector3(enDim.arcPoint); let p1 = AsVector3(enDim.linearOrAngularPoint1);