Пример #1
0
        /// <summary>
        /// Exports the geometries of the block to the outside file.
        /// This is similar to AutoCAD's wblock operation.
        /// </summary>
        /// <param name="filePath">The outside file path</param>
        /// <returns>Returns true if the export operation is successful</returns>
        public bool ExportGeometry(string filePath)
        {
            filePath = DSGeometry.GetFullPath(filePath);

            string kMethodName = "DSBlock.ExportGeometry";

            if (string.IsNullOrEmpty(filePath))
            {
                throw new ArgumentException(string.Format(Properties.Resources.InvalidInput, filePath, kMethodName), "filePath");
            }

            if (string.IsNullOrEmpty(Name))
            {
                throw new ArgumentException(string.Format(Properties.Resources.InvalidInput, Name, kMethodName), "sourceBlockName");
            }

            IBlockHelper helper = HostFactory.Factory.GetBlockHelper();

            if (null == helper)
            {
                throw new InvalidOperationException(string.Format(Properties.Resources.OperationFailed, kMethodName));
            }

            return(helper.ExportBlock(filePath, Name));
        }