Beispiel #1
0
        public static void SpTop(Entity ent)
        {
            Autocad.Init();

            var sset  = SSGet();
            var table = new Specification();

            Action <BlockReference> ProcessBref = null;

            ProcessBref = (bref) => {
                List <BlockReference> innerBlocks = new List <BlockReference>();
                Record r = GetContent(bref, innerBlocks);
                if (r["block_name"].StringValue.StartsWith("__"))
                {
                    table.Add(r);
                    return;
                }
                if (!r["block_name"].StringValue.StartsWith("_"))
                {
                    table.Add(r);
                }
                foreach (BlockReference b in innerBlocks)
                {
                    ProcessBref(b);
                }
            };

            SSForeach <BlockReference>(sset, ProcessBref);

            var report = new DwgTableReport(table);

            report.Save();
            Ed.WriteMessage("OK");
        }
Beispiel #2
0
        public static void SpAll(Entity ent)
        {
            Autocad.Init();

            var sset = SSGet();
            var spec = new Specification();

            Action <BlockReference> ProcessBref = null;

            ProcessBref = (bref) => {
                List <BlockReference> innerBlocks = new List <BlockReference>();
                Record r = GetContent(bref, innerBlocks);
                if (!r["block_name"].StringValue.StartsWith("_") && !r["art"].StringValue.StartsWith("REF"))
                {
                    spec.Add(r);
                }
                foreach (BlockReference b in innerBlocks)
                {
                    ProcessBref(b);
                }
            };

            SSForeach <BlockReference>(sset, ProcessBref);

            //foreach (var rec in spec) {
            //    Ed.WriteMessage(rec.ToString());
            //}

            var report = new DwgTableReport(spec);

            report.Save();
            Ed.WriteMessage("OK");
        }