Exemplo n.º 1
0
        private void ChangePolygonLayer(AcTransaction trans, Polyline polygon, List <DBText> texts)
        {
            polygon.UpgradeOpen();
            string layerName = "";

            if (texts.Count < 1)
            {
                layerName = "#PolygonsWithoutTextInside";
            }
            else if (texts.Count == 1)
            {
                layerName = texts[0].TextString;
            }
            else
            {
                var textStrings = from t in texts select t.TextString.Trim();

                string prefix = "#" + textStrings.Count().ToString() + "-";
                layerName = prefix + textStrings.ToList().Join("-");
            }

            layerName       = Ac.GetValidName(layerName);
            polygon.LayerId = trans.CreateLayer(layerName);
        }