private void LoadStepFile(string fileName)
        {
            var aReader = new STEPControlReader();

            aReader.ReadFile(fileName);
            aReader.WS().MapReader().TraceLevel = (2); // increase default trace level

            aReader.PrintCheckLoad(false, IFSelectPrintCount.IFSelect_ItemsByEntity);

            // Root transfers
            var nbr = aReader.NbRootsForTransfer;

            aReader.PrintCheckTransfer(false, IFSelectPrintCount.IFSelect_ItemsByEntity);

            for (var n = 1; n <= nbr; n++)
            {
                aReader.TransferRoot(n);
            } // Collecting resulting entities

            var nbs = aReader.NbShapes;

            var aSequence = new TopToolsHSequenceOfShape();

            for (var i = 1; i <= nbs; i++)
            {
                aSequence.Append(aReader.Shape(i));
            }
            Shape = aSequence.Value(1);
        }
        public static void LoadStepFile(string fileName, Document document)
        {
            try
            {
                document.Transact();
                var aReader = new STEPControlReader();

                aReader.ReadFile(fileName);

                aReader.WS().MapReader().TraceLevel = 2; // increase default trace level

                aReader.PrintCheckLoad(false, IFSelectPrintCount.IFSelect_ItemsByEntity);

                // Root transfers
                var nbr = aReader.NbRootsForTransfer;
                aReader.PrintCheckTransfer(false, IFSelectPrintCount.IFSelect_ItemsByEntity);

                for (var n = 1; n <= nbr; n++)
                {
                    aReader.TransferRoot(n);
                }

                var nbs = aReader.NbShapes;

                var aSequence = new TopToolsHSequenceOfShape();
                for (var i = 1; i <= nbs; i++)
                {
                    aSequence.Append(aReader.Shape(i));
                }

                for (var i = 1; i <= aSequence.Length; i++)
                {
                    var aisShape = aSequence.Value(i);
                    var builder  = new NodeBuilder(document, FunctionNames.Mesh);
                    builder[0].Shape = aisShape;
                    builder.ExecuteFunction();
                }
                document.Commit("Added to scene filename: " + fileName);
            }
            catch
            {
                document.Revert();
                NaroMessage.Show("Exception on loading file: " + fileName);
            }
        }