Exemple #1
0
 public static Color EntColor(DXFEntity E, DXFInsert Ins)
 {
     DXFInsert vIns = Ins;
     DXFEntity Ent = E;
     Color Result = DXFConst.clNone;
     if (Ent is DXFVisibleEntity) Result = E.FColor;
     /*if(Ent is Polyline)
         Result = ((Polyline)Ent).Pen.Pen.Color;*/
     if (E.layer == null) return Result;
     if ((Result == clByLayer) || (Result == clByBlock))
     {
         if ((vIns == null) || ((Result == clByLayer) && (Ent.layer.name != "0")))
         {
             if (Result == clByLayer)
             {
                 if (Ent.layer.color != clNone)
                     Result = Ent.layer.color;
                 else Result = Color.Black;
             }
         }
         else
         {
             while (vIns != null)
             {
                 Result = vIns.color;
                 if ((Result != clByBlock) && !((Result == clByLayer) &&
                     (vIns.layer.name == "0")))
                 {
                     if (Result == clByLayer)
                         Result = vIns.layer.color;
                     break;
                 }
                 if ((vIns.owner == null) && (Result == clByLayer))
                     Result = vIns.layer.color;
                 vIns = vIns.owner;
             }
         }
     }
     if ((Result == clByLayer) || (Result == clByBlock))
         Result = clNone;
     return Result;
 }
Exemple #2
0
 public override void Invoke(CADEntityProc Proc, CADIterate Params)
 {
     if (Params.matrix == null) Params.matrix = new DXFMatrix();
     if (FBlock == null) return;
     CADIterate Iter;
     Iter = Params;
     Params.matrix = matrix;
     Params.Scale = Scale;
     Params.Insert = this;
     Converter.FParams = Params;
     FBlock.Iterate(Proc, Params);
     Converter.FParams = Iter;
     Params = Iter;
     owner = Params.Insert;
 }
Exemple #3
0
 public DXFEntity CreateEntity()
 {
     DXFEntity E;
     switch (FValue)
     {
         case "ENDSEC":
             return null;
         case "ENDBLK":
             return null;
         case "ENDTAB":
             return null;
         case "LINE":
             E = new DXFLine();
             break;
         case "SECTION":
             E = new DXFSection();
             break;
         case "BLOCK":
             E = new DXFBlock();
             break;
         case "INSERT":
             E = new DXFInsert();
             break;
         case "TABLE":
             E = new DXFTable();
             break;
         case "CIRCLE":
             E = new DXFCircle();
             break;
         case "LAYER":
             E = new DXFLayer();
             break;
         case "TEXT":
             E = new DXFText();
             break;
         case "MTEXT":
             E = new DXFMText();
             break;
         case "ARC":
             E = new DXFArc();
             break;
         case "ELLIPSE":
             E = new DXFEllipse();
             break;
         default:
             E = new DXFEntity();
             break;
     }
     E.Converter = this;
     return E;
 }