Beispiel #1
0
 private void AutoClose(MudObject Player, Hatch Hatch)
 {
     if (Hatch.GetBooleanProperty("open?"))
     {
         Hatch.SetProperty("open?", false);
         var otherSide = Portal.FindOppositeSide(Hatch);
         if (otherSide != null) otherSide.SetProperty("open?", false);
         MudObject.SendMessage(Player, "^<the0> closes.", Hatch);
     }
 }
Beispiel #2
0
 public static Hatch CreateHatch(this List<Point2d> pts)
 {
     pts = pts.DistinctPoints();
     var ptCol = new Point2dCollection(pts.ToArray());
     ptCol.Add(pts[0]);
     var dCol = new DoubleCollection(new double[pts.Count]);
     var h = new Hatch();
     h.SetHatchPattern(HatchPatternType.PreDefined, "SOLID");
     h.AppendLoop(HatchLoopTypes.Default, ptCol, dCol);
     h.EvaluateHatch(false);
     return h;
 }
Beispiel #3
0
 public HatchInfo(Hatch h)
 {
     Id = h.Id;
      if (h.Associative)
      {
     IdsAssociate = h.GetAssociatedObjectIds();
      }
      PatternName = h.PatternName;
      PatternScale = h.PatternScale;
      PatternAngle = h.PatternAngle;
      PatternType = h.PatternType;
      Layer = h.Layer;
      Color = h.Color;
      Lineweight = h.LineWeight;
 }
Beispiel #4
0
        public void Create(Point2d ptCell, BlockTableRecord cs, Transaction t)
        {
            var cellWidth = ColorBookHelper.CellWidth;
            var cellHeight = ColorBookHelper.CellHeight;
            var margin = ColorBookHelper.Margin;
            var marginHalf = margin * 0.5;

            Point3d ptText = new Point3d(ptCell.X + cellWidth * 0.5, ptCell.Y - ColorBookHelper.TextHeight-margin, 0);

            Polyline pl = new Polyline(4);
            pl.AddVertexAt(0, new Point2d(ptCell.X+margin, ptText.Y- marginHalf), 0, 0, 0);
            pl.AddVertexAt(1, new Point2d(ptCell.X+cellWidth- margin, ptText.Y- marginHalf), 0, 0, 0);
            pl.AddVertexAt(2, new Point2d(ptCell.X + cellWidth-margin, ptCell.Y-cellHeight+margin), 0, 0, 0);
            pl.AddVertexAt(3, new Point2d(ptCell.X+margin, ptCell.Y - cellHeight+margin), 0, 0, 0);
            pl.Closed = true;
            pl.SetDatabaseDefaults();
            pl.Color = Color;

            cs.AppendEntity(pl);
            t.AddNewlyCreatedDBObject(pl, true);

            Hatch h = new Hatch();
            h.SetDatabaseDefaults();
            h.SetHatchPattern(HatchPatternType.PreDefined, "Solid");
            h.Annotative = AnnotativeStates.False;

            cs.AppendEntity(h);
            t.AddNewlyCreatedDBObject(h, true);

            h.Associative = true;
            h.AppendLoop(HatchLoopTypes.Default, new ObjectIdCollection(new[] { pl.Id }));
            h.Color = Color;
            h.EvaluateHatch(true);

            DBText text = new DBText();
            text.SetDatabaseDefaults();
            text.HorizontalMode = TextHorizontalMode.TextCenter;
            text.Annotative = AnnotativeStates.False;
            text.Height = ColorBookHelper.TextHeight;
            text.AlignmentPoint = ptText;
            text.AdjustAlignment(cs.Database);
            text.TextStyleId = ColorBookHelper.IdTextStylePik;
            text.TextString = Name;

            cs.AppendEntity(text);
            t.AddNewlyCreatedDBObject(text, true);
        }
Beispiel #5
0
        /// <summary>
        /// Создание ассоциативной штриховки по полилинии
        /// Полилиния должна быть в базе чертежа
        /// </summary>        
        public static Hatch CreateAssociativeHatch(Curve loop, BlockTableRecord cs, Transaction t,
            string pattern = "SOLID", string layer = null, LineWeight lw = LineWeight.LineWeight015)
        {
            var h = new Hatch();
            h.SetDatabaseDefaults();
            if (layer != null)
            {
                Layers.LayerExt.CheckLayerState(layer);
                h.Layer = layer;
            }
            h.LineWeight = lw;
            h.Linetype = SymbolUtilityServices.LinetypeContinuousName;
            h.SetHatchPattern(HatchPatternType.PreDefined, pattern);
            cs.AppendEntity(h);
            t.AddNewlyCreatedDBObject(h, true);
            h.Associative = true;
            h.HatchStyle = HatchStyle.Normal;

            // добавление контура полилинии в гштриховку
            var ids = new ObjectIdCollection();
            ids.Add(loop.Id);
            try
            {
                h.AppendLoop(HatchLoopTypes.Default, ids);
            }
            catch (Exception ex)
            {
                Logger.Log.Error(ex, $"CreateAssociativeHatch");
                h.Erase();
                return null;
            }
            h.EvaluateHatch(true);

            var orders = cs.DrawOrderTableId.GetObject(OpenMode.ForWrite) as DrawOrderTable;
            orders.MoveToBottom(new ObjectIdCollection(new[] { h.Id }));

            return h;
        }
Beispiel #6
0
        public void CreateNewHatch(BlockTableRecord btr)
        {
            var h = new Hatch();

             h.Annotative = AnnotativeStates.False;
             h.Layer = Layer;
             h.Color = Color;
             h.LineWeight = Lineweight;
             h.SetHatchPattern(PatternType, PatternName);
             h.PatternAngle = PatternAngle;
             h.PatternScale = PatternScale;
             h.SetHatchPattern(PatternType, PatternName);

             Id = btr.AppendEntity(h);
             btr.Database.TransactionManager.TopTransaction.AddNewlyCreatedDBObject(h, true);

             if (IdsAssociate != null && IdsAssociate.Count > 0)
             {
            h.Associative = true;
            h.AppendLoop(HatchLoopTypes.Default, IdsAssociate);
            h.EvaluateHatch(false);
             }
        }
        private void сreateHatch(Extents3d extText, BlockTableRecord btr)
        {
            if (extText.Diagonal() < 100)
            {
                return;
            }
            // Отступ контура штриховки от границ текста
            Extents3d ext = new Extents3d(new Point3d(extText.MinPoint.X - 10, extText.MinPoint.Y - 10, 0),
                                          new Point3d(extText.MaxPoint.X + 10, extText.MaxPoint.Y + 10, 0));
            var h = new Hatch();
            h.SetDatabaseDefaults(btr.Database);
            if (!panelBtr.CaptionLayerId.IsNull)
                h.LayerId = panelBtr.CaptionLayerId;
            h.LineWeight = LineWeight.LineWeight015;
            h.Linetype = SymbolUtilityServices.LinetypeContinuousName;
            h.Color = Color.FromRgb(250, 250, 250);
            h.Transparency = new Transparency(80);
            h.SetHatchPattern(HatchPatternType.PreDefined, "ANGLE");
            h.PatternScale = 25.0;
            btr.AppendEntity(h);
            var t = btr.Database.TransactionManager.TopTransaction;
            t.AddNewlyCreatedDBObject(h, true);
            h.Associative = true;
            h.HatchStyle = HatchStyle.Normal;

            // Полилиния по контуру текста
            Polyline pl = new Polyline();
            pl.SetDatabaseDefaults(btr.Database);
            pl.LineWeight = LineWeight.LineWeight015;
            pl.Linetype = SymbolUtilityServices.LinetypeContinuousName;
            pl.ColorIndex = 256; // ПоСлою
            if (!panelBtr.CaptionLayerId.IsNull)
                pl.LayerId = panelBtr.CaptionLayerId;
            pl.AddVertexAt(0, ext.MinPoint.Convert2d(), 0, 0, 0);
            pl.AddVertexAt(0, new Point2d(ext.MaxPoint.X, ext.MinPoint.Y), 0, 0, 0);
            pl.AddVertexAt(0, ext.MaxPoint.Convert2d(), 0, 0, 0);
            pl.AddVertexAt(0, new Point2d(ext.MinPoint.X, ext.MaxPoint.Y), 0, 0, 0);
            pl.Closed = true;

            ObjectId idPl = btr.AppendEntity(pl);
            t.AddNewlyCreatedDBObject(pl, true);

            // добавление контура полилинии в гштриховку
            var ids = new ObjectIdCollection();
            ids.Add(idPl);
            h.AppendLoop(HatchLoopTypes.Default, ids);
            h.EvaluateHatch(true);

            // Замена текстов - чтобы они стали поверх штриховки.
            panelBtr.IdCaptionMarkSb = replaceText(panelBtr.IdCaptionMarkSb, btr);
            panelBtr.IdCaptionPaint = replaceText(panelBtr.IdCaptionPaint, btr);
        }
Beispiel #8
0
        private Hatch ParseHatch(ConfigNode node)
        {
            Vector3 position = Vector3.zero;
            Vector3 scale = Vector3.one;
            if (!node.HasValue("attachNodeId"))
            {
                Debug.LogWarning("[FreeIVA] Hatch attachNodeId not found: Skipping hatch.");
                return null;
            }
            Hatch hatch = new Hatch();

            hatch.AttachNodeId = node.GetValue("attachNodeId");

            if (node.HasValue("position"))
            {
                string posString = node.GetValue("position");
                string[] p = posString.Split(_splitChars, StringSplitOptions.RemoveEmptyEntries);
                if (p.Length != 3)
                {
                    Debug.LogWarning("[FreeIVA] Invalid hatch position definition \"" + posString + "\": Must be in the form x, y, z.");
                    return null;
                }
                else
                    hatch.LocalPosition = new Vector3(float.Parse(p[0]), float.Parse(p[1]), float.Parse(p[2]));
            }
            else
            {
                Debug.LogWarning("[FreeIVA] Hatch position not found: Skipping hatch.");
                return null;
            }

            if (node.HasValue("scale"))
            {
                string scaleString = node.GetValue("scale");
                string[] s = scaleString.Split(_splitChars, StringSplitOptions.RemoveEmptyEntries);
                if (s.Length != 3)
                {
                    Debug.LogWarning("[FreeIVA] Invalid hatch scale definition \"" + scaleString + "\": Must be in the form x, y, z.");
                    return null;
                }
                else
                    hatch.Scale = new Vector3(float.Parse(s[0]), float.Parse(s[1]), float.Parse(s[2]));
            }
            else
            {
                Debug.LogWarning("[FreeIVA] Hatch scale not found: Skipping hatch.");
                return null;
            }

            if (node.HasValue("rotation"))
            {
                string rotationString = node.GetValue("rotation");
                string[] s = rotationString.Split(_splitChars, StringSplitOptions.RemoveEmptyEntries);
                if (s.Length != 3)
                {
                    Debug.LogWarning("[FreeIVA] Invalid hatch rotation definition \"" + rotationString + "\": Must be in the form x, y, z.");
                    return null;
                }
                else
                    hatch.Rotation = Quaternion.Euler(float.Parse(s[0]), float.Parse(s[1]), float.Parse(s[2]));
            }
            else
            {
                Debug.LogWarning("[FreeIVA] Hatch rotation not found: Skipping hatch.");
                return null;
            }

            if (node.HasNode("HideWhenOpen"))
            {
                ConfigNode[] hideNodes = node.GetNodes("HideWhenOpen");
                foreach (var hideNode in hideNodes)
                {
                    if (!hideNode.HasValue("name"))
                    {
                        Debug.LogWarning("[FreeIVA] HideWhenOpen name not found.");
                        continue;
                    }
                    string propName = hideNode.GetValue("name");
                    Vector3 propPos;

                    if (hideNode.HasValue("position"))
                    {
                        string posString = hideNode.GetValue("position");
                        string[] p = posString.Split(_splitChars, StringSplitOptions.RemoveEmptyEntries);
                        if (p.Length != 3)
                        {
                            Debug.LogWarning("[FreeIVA] Invalid HideWhenOpen position definition \"" + posString + "\": Must be in the form x, y, z.");
                            continue;
                        }
                        else
                        {
                            propPos = new Vector3(float.Parse(p[0]), float.Parse(p[1]), float.Parse(p[2]));
                        }
                    }
                    else
                    {
                        Debug.LogWarning("[FreeIVA] Hatch position not found: Skipping hatch.");
                        continue;
                    }

                    hatch.HideWhenOpen.Add(new KeyValuePair<Vector3, string>(propPos, propName));
                }
            }

            if (node.HasNode("InternalCollider"))
            {
                ConfigNode hatchColliderNode = node.GetNode("InternalCollider");
                if (hatchColliderNode != null)
                    hatch.Collider = ParseInternalCollider(hatchColliderNode);
            }
            return hatch;
        }
Beispiel #9
0
        /// <summary>
        /// Generates and adds a series of <see cref="Hatch"/> objects to the supplied <see cref="BlockTableRecord"/>
        /// </summary>
        /// <returns>The selected color as a<see cref="Autodesk.AutoCAD.Colors.Color"/></returns>
        private static void CreateHatchesForConcentricCircles(BlockTableRecord blockTableRecord, ObjectIdCollection objectIdCollection, Transaction transaction)
        {
            var rand = new Random();
            var previousPattern = string.Empty;

            for (var i = 0; i < objectIdCollection.Count - 1; i++)
            {
                var r = Convert.ToByte((i + 1)*rand.Next(0, 25));
                var g = Convert.ToByte((i + 1)*rand.Next(0, 25));
                var b = Convert.ToByte((i + 1)*rand.Next(0, 25));

                using (var hatch = new Hatch())
                {
                    blockTableRecord.AppendEntity(hatch);
                    transaction.AddNewlyCreatedDBObject(hatch, true);

                    var pattern = GetRandomHatchPatternName();

                    //ensure pattern isn't repeated by from previous hatch
                    // in production quality code I would move this behavior to avoid violating SRP/SoC
                    while (pattern.Equals(previousPattern, StringComparison.InvariantCultureIgnoreCase))
                    {
                        pattern = GetRandomHatchPatternName();
                    }

                    previousPattern = pattern;

                    hatch.SetHatchPattern(HatchPatternType.PreDefined, pattern);
                    hatch.Color = Color.FromRgb(r, g, b);

                    // Associative must be set after the hatch object is appended to the block table record and before AppendLoop
                    hatch.Associative = true;

                    // Take the current circle and the next to create a HatchLoop
                    hatch.AppendLoop(HatchLoopTypes.Outermost, new ObjectIdCollection {objectIdCollection[i]});
                    hatch.AppendLoop(HatchLoopTypes.Default, new ObjectIdCollection {objectIdCollection[i + 1]});
                    hatch.EvaluateHatch(true);
                }
            }
        }
Beispiel #10
0
        public void Figura4()
        {
            Database db = HostApplicationServices.WorkingDatabase;
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.GetDocument(db);
            Editor ed = doc.Editor;

            PromptDoubleOptions GetSpindulys = new PromptDoubleOptions("\nĮveskite didžiausio apskritimo spindulį");
            double Spindulys;
            GetSpindulys.AllowNegative = false;
            GetSpindulys.AllowZero = false;
            GetSpindulys.AllowZero = false;
            PromptDoubleResult GetSpindulysRezultatas = ed.GetDouble(GetSpindulys);
            Spindulys = GetSpindulysRezultatas.Value;

            PromptDoubleOptions GetPlotis = new PromptDoubleOptions("\nĮveskite apskirtimo spindulio mažėjimą");
            double Plotis;
            GetPlotis.AllowNegative = false;
            GetPlotis.AllowZero = false;
            GetPlotis.AllowZero = false;
            PromptDoubleResult GetPlotisRezultatas = ed.GetDouble(GetPlotis);
            Plotis = GetPlotisRezultatas.Value;

            PromptPointOptions GetTaskas = new PromptPointOptions("\nPasirinkite centro tašką");
            Point3d Taskas;
            GetTaskas.AllowNone = false;
            PromptPointResult GetTaskasRezultatas = ed.GetPoint(GetTaskas);
            Taskas = GetTaskasRezultatas.Value;

            Transaction tr = db.TransactionManager.StartTransaction();
            using (tr)
            {
                BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead, false);
                BlockTableRecord btr = (BlockTableRecord)tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite, false);
                int i = 1;
                while(Spindulys > 0)
                {
                    Circle Apskritimas = new Circle(Taskas, new Vector3d(0, 0, 1), Spindulys);
                    btr.AppendEntity(Apskritimas);
                    tr.AddNewlyCreatedDBObject(Apskritimas, true);

                    Hatch hatch = new Hatch();
                    btr.AppendEntity(hatch);
                    tr.AddNewlyCreatedDBObject(hatch, true);

                    ObjectIdCollection ID = new ObjectIdCollection();
                    ID.Add(Apskritimas.ObjectId);
                    hatch.HatchStyle = HatchStyle.Ignore;
                    hatch.SetHatchPattern(HatchPatternType.PreDefined, "SOLID");
                    hatch.Associative = true;
                    hatch.AppendLoop(HatchLoopTypes.Outermost, ID);
                    hatch.EvaluateHatch(true);
                    hatch.ColorIndex = i++;

                    Spindulys -= Plotis;
                }
                tr.Commit();
            }
        }
Beispiel #11
0
        public void Figura2()
        {
            Database db = HostApplicationServices.WorkingDatabase;
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.GetDocument(db);
            Editor ed = doc.Editor;

            PromptDoubleOptions GetSpindulys = new PromptDoubleOptions("\nĮveskite detalės spindulį");
            double Spindulys;
            GetSpindulys.AllowNegative = false;
            GetSpindulys.AllowZero = false;
            GetSpindulys.AllowNone = false;
            PromptDoubleResult GetSpindulysRezultatas = ed.GetDouble(GetSpindulys);
            Spindulys = GetSpindulysRezultatas.Value;

            PromptPointOptions GetTaskas = new PromptPointOptions("\nPasirinkite centro tašką");
            Point3d Taskas;
            GetTaskas.AllowNone = false;
            PromptPointResult GetTaskasRezultatas = ed.GetPoint(GetTaskas);
            Taskas = GetTaskasRezultatas.Value;

            Transaction tr = db.TransactionManager.StartTransaction();
            using (tr)
            {
                BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead, false);
                BlockTableRecord btr = (BlockTableRecord)tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite, false);

                //Apskritimas
                Circle Apskritimas = new Circle(Taskas, new Vector3d(0, 0, 1), Spindulys);
                btr.AppendEntity(Apskritimas);
                tr.AddNewlyCreatedDBObject(Apskritimas, true);

                //Linijos
                Polyline3d polyline = new Polyline3d();
                btr.AppendEntity(polyline);
                tr.AddNewlyCreatedDBObject(polyline, true);
                PolylineVertex3d vex3d = new PolylineVertex3d();

                // Linija NR1 (centrine)
                vex3d = new PolylineVertex3d(new Point3d(Taskas.X - Spindulys / 4, Taskas.Y + Spindulys / 6, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X - Spindulys / 4, Taskas.Y - Spindulys / 6, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X - Spindulys / 4, Taskas.Y, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X + Spindulys / 2, Taskas.Y, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X + Spindulys / 2, Taskas.Y - Spindulys / 2, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X - Spindulys / 4, Taskas.Y - Spindulys / 2, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X - Spindulys / 4, Taskas.Y - Spindulys / 2 + Spindulys / 6, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X - Spindulys / 4, Taskas.Y - Spindulys / 2 - Spindulys / 6, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X - Spindulys / 4, Taskas.Y - Spindulys / 2, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X + Spindulys / 2, Taskas.Y - Spindulys / 2, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X + Spindulys / 2, Taskas.Y - Spindulys / 2 - Spindulys / 1.5, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                polyline = new Polyline3d();
                btr.AppendEntity(polyline);
                tr.AddNewlyCreatedDBObject(polyline, true);

                // Linija NR2 (virsutine)
                vex3d = new PolylineVertex3d(new Point3d(Taskas.X - Spindulys / 4, Taskas.Y + Spindulys / 2 + Spindulys / 5, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X - Spindulys / 4, Taskas.Y + Spindulys / 2 - Spindulys / 5, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X - Spindulys / 4, Taskas.Y + Spindulys / 2, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X + Spindulys / 2, Taskas.Y + Spindulys / 2, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X + Spindulys / 2, Taskas.Y + Spindulys / 2 + Spindulys / 1.5, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                polyline = new Polyline3d();
                btr.AppendEntity(polyline);
                tr.AddNewlyCreatedDBObject(polyline, true);

                // Linija NR3 (kaire)
                vex3d = new PolylineVertex3d(new Point3d(Taskas.X - Spindulys / 2, Taskas.Y + Spindulys / 2, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X - Spindulys / 2, Taskas.Y - Spindulys / 2, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                vex3d = new PolylineVertex3d(new Point3d(Taskas.X - Spindulys / 2 - Spindulys / 2 - Spindulys / 4, Taskas.Y - Spindulys / 2, 0));
                polyline.AppendVertex(vex3d);
                tr.AddNewlyCreatedDBObject(vex3d, true);

                //Apskritimas FIll Viduryje
                Circle ApskritimasFillMIni = new Circle(new Point3d(Taskas.X + Spindulys / 2, Taskas.Y - Spindulys / 2, 0), new Vector3d(0, 0, 1), Spindulys / 8);
                btr.AppendEntity(ApskritimasFillMIni);
                tr.AddNewlyCreatedDBObject(ApskritimasFillMIni, true);

                Hatch hatch = new Hatch();
                btr.AppendEntity(hatch);
                tr.AddNewlyCreatedDBObject(hatch, true);

                ObjectIdCollection ID = new ObjectIdCollection();
                ID.Add(ApskritimasFillMIni.ObjectId);
                hatch.HatchStyle = HatchStyle.Ignore;
                hatch.SetHatchPattern(HatchPatternType.PreDefined, "SOLID");
                hatch.Associative = true;
                hatch.AppendLoop(HatchLoopTypes.Outermost, ID);
                hatch.EvaluateHatch(true);

                //Trikampis
                Solid trikampis = new Solid(new Point3d(Taskas.X - Spindulys / 4, Taskas.Y, 0), new Point3d(Taskas.X, Taskas.Y + Spindulys / 6, 0), new Point3d(Taskas.X, Taskas.Y - Spindulys / 6, 0));
                btr.AppendEntity(trikampis);
                tr.AddNewlyCreatedDBObject(trikampis, true);

                tr.Commit();
            }
        }